河北两级贯通文档修改
冀北台账管理接口开发
This commit is contained in:
@@ -0,0 +1,281 @@
|
|||||||
|
//package com.njcn.advance.handler;
|
||||||
|
//
|
||||||
|
//import cn.hutool.core.collection.CollUtil;
|
||||||
|
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
//import com.njcn.advance.mapper.RmpEventAdvanceMapper;
|
||||||
|
//import com.njcn.advance.pojo.dto.waveAnalysis.AnalyWave;
|
||||||
|
//import com.njcn.advance.pojo.dto.waveAnalysis.AnalyWaveModel;
|
||||||
|
//import com.njcn.advance.pojo.dto.waveAnalysis.CauseStruct;
|
||||||
|
//import com.njcn.advance.pojo.dto.waveAnalysis.Rect;
|
||||||
|
//import com.njcn.advance.utils.JnaCallBalance;
|
||||||
|
//import com.njcn.advance.utils.JnaCallDllOrSo;
|
||||||
|
//import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
//import com.njcn.event.api.RmpEventDetailFeignClient;
|
||||||
|
//import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
|
//import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
//import com.njcn.middle.rocket.handler.EnhanceConsumerMessageHandler;
|
||||||
|
//import com.njcn.mq.constant.BusinessTopic;
|
||||||
|
//import com.njcn.mq.message.AppEventMessage;
|
||||||
|
//import com.njcn.mq.message.RmpEventDetailMessage;
|
||||||
|
//import com.njcn.mq.template.RmpEventDetailMessageTemplate;
|
||||||
|
//import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
//import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
//import com.njcn.system.pojo.po.DictData;
|
||||||
|
//import lombok.RequiredArgsConstructor;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
|
//import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
|
//import org.springframework.messaging.Message;
|
||||||
|
//import org.springframework.stereotype.Component;
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//import java.time.ZoneId;
|
||||||
|
//import java.util.*;
|
||||||
|
//import java.util.function.Function;
|
||||||
|
//import java.util.stream.Collectors;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * pqs
|
||||||
|
// *
|
||||||
|
// * @author cdf
|
||||||
|
// * @date 2023/8/24
|
||||||
|
// */
|
||||||
|
//@RocketMQMessageListener(topic = BusinessTopic.RMP_EVENT_DETAIL_TOPIC,
|
||||||
|
// consumerGroup = BusinessTopic.RMP_EVENT_DETAIL_TOPIC,
|
||||||
|
// enableMsgTrace = true)
|
||||||
|
//@Slf4j
|
||||||
|
//@Service
|
||||||
|
//@RequiredArgsConstructor
|
||||||
|
//public class RmpEventDetailConsumer extends EnhanceConsumerMessageHandler<RmpEventDetailMessage> implements RocketMQListener<RmpEventDetailMessage> {
|
||||||
|
// //波形最大值计算
|
||||||
|
// private final int MAXLENGTH = 128 * 3000;
|
||||||
|
//
|
||||||
|
// private final RmpEventAdvanceMapper rmpEventAdvanceMapper;
|
||||||
|
//
|
||||||
|
// private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void handleMessage(RmpEventDetailMessage rmpEventDetailMessage) throws Exception {
|
||||||
|
// System.out.println("6666666666666666");
|
||||||
|
// /* if(Objects.nonNull(rmpEventDetailMessage)){
|
||||||
|
// List<String> eventIds = rmpEventDetailMessage.getEventIds();
|
||||||
|
// if(CollUtil.isNotEmpty(eventIds)){
|
||||||
|
// LambdaQueryWrapper<RmpEventDetailPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// queryWrapper.in(RmpEventDetailPO::getEventId,eventIds);
|
||||||
|
// List<RmpEventDetailPO> rmpEventDetailPOList = rmpEventAdvanceMapper.selectList(queryWrapper);
|
||||||
|
//
|
||||||
|
// for(RmpEventDetailPO rmpEventDetailPO : rmpEventDetailPOList){
|
||||||
|
// if(rmpEventDetailPO.getDealFlag() != 1){
|
||||||
|
// //调用算法文件计算暂降特征值
|
||||||
|
//
|
||||||
|
// if(rmpEventDetailPO.getFileFlag() == 1){
|
||||||
|
// //存在录波
|
||||||
|
// JnaCallDllOrSo jnaCallDllOrSo = new JnaCallBalance("qvvr_dll");
|
||||||
|
// jnaCallDllOrSo.setPath();
|
||||||
|
// // 计算暂降类
|
||||||
|
// Rect rect = new Rect();
|
||||||
|
// CauseStruct causeStruct = new CauseStruct();
|
||||||
|
//
|
||||||
|
// JnaCallBalance.Eventlibrary INSTANTCE = JnaCallBalance.Eventlibrary.INSTANTCE;
|
||||||
|
// INSTANTCE.qvvr_fun(rect);
|
||||||
|
//
|
||||||
|
// byte[] arr = new byte[1024];
|
||||||
|
// AnalyWave analyWave = new AnalyWave();
|
||||||
|
// List<List<Float>> pitchList = analyWave.AnalyseComtradeDat(arr,1);
|
||||||
|
// for (int i = 0; i < pitchList.size(); i++) {
|
||||||
|
// rect.smp_va[i] = pitchList.get(i).get(1);
|
||||||
|
// causeStruct.smp_va[i] = pitchList.get(i).get(1);
|
||||||
|
//
|
||||||
|
// rect.smp_vb[i] = pitchList.get(i).get(2);
|
||||||
|
// causeStruct.smp_vb[i] = pitchList.get(i).get(2);
|
||||||
|
//
|
||||||
|
// rect.smp_vc[i] = pitchList.get(i).get(3);
|
||||||
|
// causeStruct.smp_vc[i] = pitchList.get(i).get(3);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// rect.smp_len = pitchList.size();
|
||||||
|
// //超过60s的波形直接抛异常给上面处理
|
||||||
|
// if (rect.smp_len >= MAXLENGTH) {
|
||||||
|
// throw new BusinessException("波形超过60S");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// rect.smp_rate = 32;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// *//**
|
||||||
|
// * @判断是否调用成功
|
||||||
|
// * @成功执行更新pqs_eventdetail操作:更新dq持续时间、暂降类型、暂降原因、总分段数目
|
||||||
|
// *//*
|
||||||
|
// if (rect.evt_num > 0) {
|
||||||
|
// RmpEventDetailPO detail = new RmpEventDetailPO();
|
||||||
|
// detail.setEventId("rmpEventDetailPOQuery.getEventId()");
|
||||||
|
// detail.setNum(rect.evt_num);
|
||||||
|
// detail.setDqTime((double) rect.evt_buf[0].hold_time_dq);
|
||||||
|
// detail.setFirstType((Integer.toString(rect.evt_buf[0].qvvr_cata_type[0])));
|
||||||
|
// //detail.setFirstTime(waveData.getFirstTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||||
|
// //detail.setFirstMs((double)waveData.getFirstMs());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // 排序并获取多段中最小的数据
|
||||||
|
// float[] f = new float[rect.evt_num];
|
||||||
|
//
|
||||||
|
// for (int i = 0; i < rect.evt_num; i++) {
|
||||||
|
// Arrays.parallelSort(rect.evt_buf[i].u3_min, 0, Math.max(rect.evt_buf[i].u_min_num - 1, 0));
|
||||||
|
// f[i] = rect.evt_buf[i].u3_min[0];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// float min = f[0];
|
||||||
|
// int index = 0;
|
||||||
|
//
|
||||||
|
// for (int len = 1; len < f.length; len++) {
|
||||||
|
// if (min - f[len] > 0) {
|
||||||
|
// index = len;
|
||||||
|
// min = f[len];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// *//********************************************************************
|
||||||
|
// * add by sw 返回的分段位置需根据采样率进行恢复
|
||||||
|
// ********************************************************************//*
|
||||||
|
// List<AnalyWaveModel.tagOneRate> list = waveData.getRatesCfg().OneRate;
|
||||||
|
// int rate = (int) waveData.getnOneWaveNum();
|
||||||
|
// int k = 0;
|
||||||
|
// int l = 0;
|
||||||
|
//
|
||||||
|
// for (int i = 0; i < list.size(); i++) {
|
||||||
|
// if (i == 0) {
|
||||||
|
// for (int j = 0; j < rect.evt_buf[0].SEG_T_num; j++) {
|
||||||
|
// if (list.get(i).nOneSample >= rate && rect.evt_buf[0].SEG_T_idx[j] < list.get(i).nSampleNum
|
||||||
|
// / (list.get(i).nOneSample / rate)) {
|
||||||
|
// rect.evt_buf[0].SEG_T_idx[j] = (int) (rect.evt_buf[0].SEG_T_idx[j]
|
||||||
|
// * (list.get(i).nOneSample / rate));
|
||||||
|
// k++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (int j = 0; j < rect.evt_buf[0].u_min_num; j++) {
|
||||||
|
// if (list.get(i).nOneSample >= rate && rect.evt_buf[0].order_min_idx[j] < list.get(i).nSampleNum
|
||||||
|
// / (list.get(i).nOneSample / rate)) {
|
||||||
|
// rect.evt_buf[0].order_min_idx[j] = (int) (rect.evt_buf[0].order_min_idx[j]
|
||||||
|
// * (list.get(i).nOneSample / rate));
|
||||||
|
// l++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// for (int j = k; j < rect.evt_buf[0].SEG_T_num; j++) {
|
||||||
|
// int posb = 0;
|
||||||
|
// int pose = 0;
|
||||||
|
// int pos = 0;
|
||||||
|
//
|
||||||
|
// for (int kk = 0; kk <= i; kk++) {
|
||||||
|
// pose += list.get(kk).nSampleNum / list.get(kk).nOneSample * rate;
|
||||||
|
//
|
||||||
|
// if (kk < i) {
|
||||||
|
// posb += list.get(kk).nSampleNum / list.get(kk).nOneSample * rate;
|
||||||
|
// pos += list.get(kk).nSampleNum;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (list.get(i).nOneSample >= rate
|
||||||
|
// && rect.evt_buf[0].SEG_T_idx[j] > posb
|
||||||
|
// && rect.evt_buf[0].SEG_T_idx[j] < pose) {
|
||||||
|
// rect.evt_buf[0].SEG_T_idx[j] = (int) ((rect.evt_buf[0].SEG_T_idx[j] - posb) * list.get(i).nOneSample / rate) + pos;
|
||||||
|
// k++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (int j = l; j < rect.evt_buf[0].u_min_num; j++) {
|
||||||
|
// int posb = 0;
|
||||||
|
// int pose = 0;
|
||||||
|
// int pos = 0;
|
||||||
|
//
|
||||||
|
// for (int kk = 0; kk <= i; kk++) {
|
||||||
|
// pose += list.get(kk).nSampleNum / list.get(kk).nOneSample * rate;
|
||||||
|
//
|
||||||
|
// if (kk < i) {
|
||||||
|
// posb += list.get(kk).nSampleNum / list.get(kk).nOneSample * rate;
|
||||||
|
// pos += list.get(kk).nSampleNum;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (list.get(i).nOneSample >= rate
|
||||||
|
// && rect.evt_buf[0].order_min_idx[j] > posb
|
||||||
|
// && rect.evt_buf[0].order_min_idx[j] < pose) {
|
||||||
|
// rect.evt_buf[0].order_min_idx[j] = (int) ((rect.evt_buf[0].order_min_idx[j] - posb) * list.get(i).nSampleNum / rate) + pos;
|
||||||
|
// l++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<DictData> dicDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData();
|
||||||
|
// Map<Integer, DictData> eventTypeMap = dicDataList.stream().collect(Collectors.toMap(DictData::getAlgoDescribe, Function.identity()));
|
||||||
|
//
|
||||||
|
// Integer tem = rect.evt_buf[index].qvvr_cata_type[0];
|
||||||
|
// if(eventTypeMap.containsKey(tem)) {
|
||||||
|
// rmpEventDetailPO.setAdvanceType(eventTypeMap.get(tem).getId());
|
||||||
|
// }
|
||||||
|
// rmpEventDetailPO.setDealFlag(1);
|
||||||
|
// //rmpEventAdvanceMapper.updateById(rmpEventDetailPO);
|
||||||
|
// //setEntityAdvanceData();
|
||||||
|
// //WriteData2File();
|
||||||
|
// //eventDetailMapper.updateDealFlag(1, eventIndex); //计算有结果
|
||||||
|
// } else if (rect.evt_num == 0) {
|
||||||
|
// //eventDetailMapper.updateDealFlag(2, eventIndex);//已计算无结果
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //TODO 如果不存在录波文件情况
|
||||||
|
// //如果不存在录波文件情况
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }*/
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void handleMaxRetriesExceeded(RmpEventDetailMessage rmpEventDetailMessage) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected boolean isRetry() {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected boolean throwException() {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onMessage(RmpEventDetailMessage rmpEventDetailMessage) {
|
||||||
|
// super.dispatchMessage(rmpEventDetailMessage);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*********************************
|
||||||
|
// * 获取最小采样率方法
|
||||||
|
// * @param OneRate cfg中关于采样率参数
|
||||||
|
// * @return 返回最小采样率
|
||||||
|
// **********************************/
|
||||||
|
// private long MinWaveSample(List<AnalyWaveModel.tagOneRate> OneRate) {
|
||||||
|
// long nMinOneSample = OneRate.get(0).nOneSample;
|
||||||
|
// for (int i = 0; i < OneRate.size(); i++) {
|
||||||
|
// if (OneRate.get(i).nOneSample >= 32) {
|
||||||
|
// if (nMinOneSample > OneRate.get(i).nOneSample) {
|
||||||
|
// nMinOneSample = OneRate.get(i).nOneSample;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return nMinOneSample;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@@ -90,8 +90,8 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
|
|||||||
|
|
||||||
if (rmpEventDetailPO.getFileFlag() == 1) {
|
if (rmpEventDetailPO.getFileFlag() == 1) {
|
||||||
//获取所有暂态原因
|
//获取所有暂态原因
|
||||||
List<DictData> dicDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_REASON.getCode()).getData();
|
List<DictData> dicDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_TYPE.getCode()).getData();
|
||||||
Map<Integer, DictData> eventReasonMap = dicDataList.stream().collect(Collectors.toMap(DictData::getAlgoDescribe, Function.identity()));
|
Map<Integer, DictData> eventTypeMap = dicDataList.stream().collect(Collectors.toMap(DictData::getAlgoDescribe, Function.identity()));
|
||||||
|
|
||||||
InputStream inputStreamCfg = null;
|
InputStream inputStreamCfg = null;
|
||||||
InputStream inputStreamDat = null;
|
InputStream inputStreamDat = null;
|
||||||
@@ -197,7 +197,7 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
|
|||||||
****************************************************************/
|
****************************************************************/
|
||||||
if (entityAdvancedData.backNumber > 0) {
|
if (entityAdvancedData.backNumber > 0) {
|
||||||
for (int i = 0; i < entityAdvancedData.backNumber; i++) {
|
for (int i = 0; i < entityAdvancedData.backNumber; i++) {
|
||||||
entityAdvancedData.sagType[i] = eventReasonMap.get(entityAdvancedData.evt_buf[i].qvvr_cata_type[0]).getName();
|
entityAdvancedData.sagType[i] = eventTypeMap.get(entityAdvancedData.evt_buf[i].qvvr_cata_type[0]).getName();
|
||||||
|
|
||||||
switch (entityAdvancedData.evt_buf[i].qvvr_phasetype[0]) {
|
switch (entityAdvancedData.evt_buf[i].qvvr_phasetype[0]) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ public class JnaCallBalance extends JnaCallDllOrSo{
|
|||||||
@Override
|
@Override
|
||||||
public void setPath() {
|
public void setPath() {
|
||||||
JnaCallBalance.strpath = super.getStrpath();
|
JnaCallBalance.strpath = super.getStrpath();
|
||||||
System.out.println("真实路径-----"+super.getStrpath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Balancelibrary extends Library {
|
public interface Balancelibrary extends Library {
|
||||||
@@ -33,10 +32,10 @@ public class JnaCallBalance extends JnaCallDllOrSo{
|
|||||||
Balancelibrary INSTANTCE = (Balancelibrary) Native.loadLibrary(JnaCallBalance.strpath, Balancelibrary.class);
|
Balancelibrary INSTANTCE = (Balancelibrary) Native.loadLibrary(JnaCallBalance.strpath, Balancelibrary.class);
|
||||||
|
|
||||||
|
|
||||||
// 定义方法--->与C方法相对应
|
// 定义方法--->与C方法相对应(暂降综合评估)
|
||||||
void qvvr_fun_cause(QvvrDataStruct data);
|
void qvvr_fun_cause(QvvrDataStruct data);
|
||||||
|
|
||||||
// 定义方法--->与C方法相对应
|
// 定义方法--->与C方法相对应(暂降原因)
|
||||||
void qvvr_fun_cause(CauseStruct data);
|
void qvvr_fun_cause(CauseStruct data);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ import java.net.URLDecoder;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class JnaCallDllOrSo {
|
public class JnaCallDllOrSo {
|
||||||
private String path = "";
|
private String path = "";
|
||||||
private String nameDll;
|
|
||||||
|
|
||||||
public static String jarPath = "";
|
|
||||||
|
|
||||||
public JnaCallDllOrSo(String name) {
|
public JnaCallDllOrSo(String name) {
|
||||||
super();
|
super();
|
||||||
@@ -27,15 +25,16 @@ public class JnaCallDllOrSo {
|
|||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
// windows操作系统为1 否则为0
|
// windows操作系统为1 否则为0
|
||||||
int beginIndex = os != null && os.startsWith("Windows") ? 1 : 0;
|
int beginIndex = os != null && os.startsWith("Windows") ? 1 : 0;
|
||||||
|
String nameDll;
|
||||||
if (beginIndex == 0) {
|
if (beginIndex == 0) {
|
||||||
//linux操作系统
|
//linux操作系统
|
||||||
this.nameDll = "lib" + name + "_dll";
|
nameDll = "lib" + name + "_dll";
|
||||||
suffix = ".so";
|
suffix = ".so";
|
||||||
} else {
|
} else {
|
||||||
this.nameDll = name;
|
nameDll = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
String tem = "/usr/local/dllFile/"+this.nameDll.concat(suffix);
|
String tem = "/usr/local/dllFile/"+ nameDll.concat(suffix);
|
||||||
File dockerFile = new File(tem);
|
File dockerFile = new File(tem);
|
||||||
if(!dockerFile.exists()){
|
if(!dockerFile.exists()){
|
||||||
boolean f = dockerFile.getParentFile().mkdirs();
|
boolean f = dockerFile.getParentFile().mkdirs();
|
||||||
@@ -43,7 +42,7 @@ public class JnaCallDllOrSo {
|
|||||||
System.out.println("文件夹创建:"+f);
|
System.out.println("文件夹创建:"+f);
|
||||||
System.out.println("文件创建:"+d);
|
System.out.println("文件创建:"+d);
|
||||||
|
|
||||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(this.nameDll.concat(suffix))) {
|
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream(nameDll.concat(suffix))) {
|
||||||
try (FileOutputStream outputStream = new FileOutputStream(dockerFile)) {
|
try (FileOutputStream outputStream = new FileOutputStream(dockerFile)) {
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
int bytesRead;
|
int bytesRead;
|
||||||
@@ -55,6 +54,7 @@ public class JnaCallDllOrSo {
|
|||||||
}
|
}
|
||||||
this.path = dockerFile.getAbsolutePath();
|
this.path = dockerFile.getAbsolutePath();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("调用高级算法文件异常,异常信息如下:");
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.device.pq.controller;
|
package com.njcn.device.pq.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
@@ -61,6 +62,17 @@ public class RunManageController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getDeviceLedger")
|
||||||
|
@ApiOperation("获取基本的终端台账信息")
|
||||||
|
@ApiImplicitParam(name = "runManageParam", value = "终端台账参数", required = true)
|
||||||
|
public HttpResult<Page<RunTimeVO>> getDeviceLedger(@RequestBody @Validated RunManageParam runManageParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getRuntimeData");
|
||||||
|
Page<RunTimeVO> result = runManageService.getDeviceLedger(runManageParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getTerminalLedger")
|
@PostMapping("/getTerminalLedger")
|
||||||
@ApiOperation("终端台账统计")
|
@ApiOperation("终端台账统计")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.mapper;
|
|||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pq.pojo.po.Device;
|
import com.njcn.device.pq.pojo.po.Device;
|
||||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||||
@@ -61,6 +62,14 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
|||||||
@Param("searchValue") String searchValue);
|
@Param("searchValue") String searchValue);
|
||||||
|
|
||||||
|
|
||||||
|
Page<RunTimeVO> getDeviceLedger(@Param("page")Page<RunTimeVO> page,
|
||||||
|
@Param("list") List<String> list,
|
||||||
|
@Param("comFlag") List<Integer> comFlag,
|
||||||
|
@Param("runFlag") List<Integer> runFlag,
|
||||||
|
@Param("manufacturers") List<String> manufacturer,
|
||||||
|
@Param("searchValue") String searchValue);
|
||||||
|
|
||||||
|
|
||||||
List<LineInfluxDbOnlineVO> getOnlineEvaluate(@Param("list") List<String> devIndexes,
|
List<LineInfluxDbOnlineVO> getOnlineEvaluate(@Param("list") List<String> devIndexes,
|
||||||
@Param("begin") String searchBeginTime,
|
@Param("begin") String searchBeginTime,
|
||||||
@Param("end") String searchEndTime);
|
@Param("end") String searchEndTime);
|
||||||
|
|||||||
@@ -190,7 +190,7 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
gdName,
|
gdName,
|
||||||
bdName,
|
bdName,
|
||||||
devName;
|
devName
|
||||||
</select>
|
</select>
|
||||||
<select id="getOnlineEvaluate" resultType="com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO">
|
<select id="getOnlineEvaluate" resultType="com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO">
|
||||||
SELECT
|
SELECT
|
||||||
@@ -253,4 +253,78 @@
|
|||||||
set run_flag = #{runFlag}
|
set run_flag = #{runFlag}
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getDeviceLedger" resultType="com.njcn.device.pq.pojo.vo.RunTimeVO">
|
||||||
|
SELECT
|
||||||
|
dev.Id AS id,
|
||||||
|
area.NAME AS areaName,
|
||||||
|
gd.NAME AS gdName,
|
||||||
|
sub.NAME AS bdName,
|
||||||
|
manufacturerId.NAME AS manufacturer,
|
||||||
|
dev.NAME AS devName,
|
||||||
|
device.IP AS ip,
|
||||||
|
device.Login_Time AS loginTime,
|
||||||
|
devT.Name AS devType,
|
||||||
|
device.PORT AS PORT,
|
||||||
|
CASE
|
||||||
|
device.Run_Flag
|
||||||
|
WHEN 0 THEN
|
||||||
|
"投运"
|
||||||
|
WHEN 1 THEN
|
||||||
|
"热备用"
|
||||||
|
WHEN 2 THEN
|
||||||
|
"停运"
|
||||||
|
END AS runFlag,
|
||||||
|
CASE
|
||||||
|
device.Com_Flag
|
||||||
|
WHEN 0 THEN
|
||||||
|
"中断"
|
||||||
|
WHEN 1 THEN
|
||||||
|
"正常"
|
||||||
|
END AS comFlag,
|
||||||
|
device.Update_Time AS updateTime
|
||||||
|
FROM
|
||||||
|
pq_line dev
|
||||||
|
INNER JOIN pq_line sub ON sub.Id = dev.Pid
|
||||||
|
INNER JOIN pq_line gd ON gd.Id = sub.Pid
|
||||||
|
INNER JOIN pq_line areaId ON areaId.Id = gd.Pid
|
||||||
|
INNER JOIN sys_area area ON area.Id = areaId.NAME
|
||||||
|
INNER JOIN pq_device device ON device.Id = dev.Id
|
||||||
|
INNER JOIN sys_dict_data manufacturerId ON manufacturerId.Id = device.Manufacturer
|
||||||
|
INNER JOIN sys_dict_data devT ON devT.Id = device.Dev_Type
|
||||||
|
WHERE dev.Id in
|
||||||
|
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
<if test="runFlag.size()!=0">
|
||||||
|
and device.Run_Flag in
|
||||||
|
<foreach item="item1" collection="runFlag" separator="," open="(" close=")">
|
||||||
|
#{item1}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="comFlag.size()!=0">
|
||||||
|
and device.Com_Flag in
|
||||||
|
<foreach item="item2" collection="comFlag" separator="," open="(" close=")">
|
||||||
|
#{item2}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="manufacturers.size() != 0">
|
||||||
|
and device.Manufacturer in
|
||||||
|
<foreach collection="manufacturers" item="item3" separator="," open="(" close=")">
|
||||||
|
#{item3}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="searchValue != '' and searchValue != null ">
|
||||||
|
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||||
|
AND sub.NAME LIKE #{searchValueLike}
|
||||||
|
OR dev.NAME LIKE #{searchValueLike}
|
||||||
|
OR devT.Name LIKE #{searchValueLike}
|
||||||
|
OR device.IP LIKE #{searchValueLike}
|
||||||
|
</if>
|
||||||
|
ORDER BY
|
||||||
|
gdName,
|
||||||
|
bdName,
|
||||||
|
devName
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.device.pq.service;
|
package com.njcn.device.pq.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||||
import com.njcn.device.pq.pojo.param.RunManageParam;
|
import com.njcn.device.pq.pojo.param.RunManageParam;
|
||||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||||
@@ -29,6 +30,10 @@ public interface RunManageService {
|
|||||||
List<RunTimeVO> getRuntimeDetail(RunManageParam runManageParam);
|
List<RunTimeVO> getRuntimeDetail(RunManageParam runManageParam);
|
||||||
|
|
||||||
|
|
||||||
|
Page<RunTimeVO> getDeviceLedger(RunManageParam runManageParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端台账统计
|
* 终端台账统计
|
||||||
* @author cdf
|
* @author cdf
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -27,6 +28,7 @@ import com.njcn.system.api.DicDataFeignClient;
|
|||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -70,9 +72,9 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||||
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
||||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
||||||
List<String> lineIndexes = generalDeviceDTOList.stream().flatMap(list->list.getLineIndexes().stream()).collect(Collectors.toList());
|
List<String> lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
|
||||||
if (!CollectionUtils.isEmpty(lineIndexes)) {
|
if (!CollectionUtils.isEmpty(lineIndexes)) {
|
||||||
return deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(),runManageParam.getSearchValue());
|
return deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(), runManageParam.getSearchValue());
|
||||||
} else {
|
} else {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
@@ -86,51 +88,65 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
if (!CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
||||||
List<String> devIndexes = generalDeviceDTOList.stream().flatMap(list->list.getDeviceIndexes().stream()).collect(Collectors.toList());
|
List<String> devIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||||
DateFormat bf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat bf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
if(StrUtil.isNotBlank(runManageParam.getSearchBeginTime()) && StrUtil.isNotBlank(runManageParam.getSearchEndTime()) ){
|
if (StrUtil.isNotBlank(runManageParam.getSearchBeginTime()) && StrUtil.isNotBlank(runManageParam.getSearchEndTime())) {
|
||||||
runManageParam.setSearchBeginTime(bf.format(DateUtil.beginOfDay(DateUtil.parse(runManageParam.getSearchBeginTime()))));
|
runManageParam.setSearchBeginTime(bf.format(DateUtil.beginOfDay(DateUtil.parse(runManageParam.getSearchBeginTime()))));
|
||||||
runManageParam.setSearchEndTime(bf.format(DateUtil.beginOfDay(DateUtil.parse(runManageParam.getSearchEndTime()))));
|
runManageParam.setSearchEndTime(bf.format(DateUtil.beginOfDay(DateUtil.parse(runManageParam.getSearchEndTime()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> manuList = runManageParam.getManufacturer().stream().map(SimpleDTO::getId).collect(Collectors.toList());
|
List<String> manuList = runManageParam.getManufacturer().stream().map(SimpleDTO::getId).collect(Collectors.toList());
|
||||||
if(CollectionUtil.isNotEmpty(devIndexes)){
|
if (CollectionUtil.isNotEmpty(devIndexes)) {
|
||||||
runManageDevList = deviceMapper.getRunManageDevList(devIndexes, runManageParam.getComFlag(), runManageParam.getRunFlag(),manuList,runManageParam.getSearchValue());
|
runManageDevList = deviceMapper.getRunManageDevList(devIndexes, runManageParam.getComFlag(), runManageParam.getRunFlag(), manuList, runManageParam.getSearchValue());
|
||||||
List<LineInfluxDbOnlineVO> lineInfluxDbOnlineVOList = deviceMapper.getOnlineEvaluate(devIndexes,runManageParam.getSearchBeginTime(),runManageParam.getSearchEndTime());
|
List<LineInfluxDbOnlineVO> lineInfluxDbOnlineVOList = deviceMapper.getOnlineEvaluate(devIndexes, runManageParam.getSearchBeginTime(), runManageParam.getSearchEndTime());
|
||||||
Map<String,LineInfluxDbOnlineVO> map = lineInfluxDbOnlineVOList.stream().collect(Collectors.toMap(LineInfluxDbOnlineVO::getDevIndex, Function.identity()));
|
Map<String, LineInfluxDbOnlineVO> map = lineInfluxDbOnlineVOList.stream().collect(Collectors.toMap(LineInfluxDbOnlineVO::getDevIndex, Function.identity()));
|
||||||
runManageDevList = runManageDevList.stream().peek(item-> item.setOnlineEvaluate(!map.containsKey(item.getId()) ? 3.14159 : NumberUtil.round(map.get(item.getId()).getOnlineRate(), 4).doubleValue())).collect(Collectors.toList());
|
runManageDevList = runManageDevList.stream().peek(item -> item.setOnlineEvaluate(!map.containsKey(item.getId()) ? 3.14159 : NumberUtil.round(map.get(item.getId()).getOnlineRate(), 4).doubleValue())).collect(Collectors.toList());
|
||||||
String evaluate = runManageParam.getEvaluate();
|
String evaluate = runManageParam.getEvaluate();
|
||||||
if(StrUtil.isNotBlank(evaluate)){
|
if (StrUtil.isNotBlank(evaluate)) {
|
||||||
runManageDevList=runManageDevList.stream().filter(x->filterOnlineEvaluate(evaluate,x.getOnlineEvaluate())).collect(Collectors.toList());
|
runManageDevList = runManageDevList.stream().filter(x -> filterOnlineEvaluate(evaluate, x.getOnlineEvaluate())).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return runManageDevList;
|
return runManageDevList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<RunTimeVO> getDeviceLedger(RunManageParam runManageParam) {
|
||||||
|
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||||
|
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
||||||
|
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0, 1, 2).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||||
|
if (CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
||||||
|
throw new BusinessException("当前部门没有装置台账");
|
||||||
|
}
|
||||||
|
List<String> devIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||||
|
//List<String> manuList = runManageParam.getManufacturer().stream().map(SimpleDTO::getId).collect(Collectors.toList());
|
||||||
|
return deviceMapper.getDeviceLedger(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)), devIndexes, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 评价筛选
|
* 评价筛选
|
||||||
|
*
|
||||||
* @param evaluate
|
* @param evaluate
|
||||||
* @param onlineEvaluate
|
* @param onlineEvaluate
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean filterOnlineEvaluate(String evaluate, Double onlineEvaluate) {
|
private boolean filterOnlineEvaluate(String evaluate, Double onlineEvaluate) {
|
||||||
if(onlineEvaluate!=null){
|
if (onlineEvaluate != null) {
|
||||||
onlineEvaluate=onlineEvaluate*100;
|
onlineEvaluate = onlineEvaluate * 100;
|
||||||
switch (evaluate){
|
switch (evaluate) {
|
||||||
case "优":
|
case "优":
|
||||||
if(onlineEvaluate>90){
|
if (onlineEvaluate > 90) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "良":
|
case "良":
|
||||||
if(60<onlineEvaluate&&onlineEvaluate<=90){
|
if (60 < onlineEvaluate && onlineEvaluate <= 90) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "差":
|
case "差":
|
||||||
if(onlineEvaluate<=60){
|
if (onlineEvaluate <= 60) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -301,9 +317,9 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
|
|
||||||
private GeneralDeviceDTO assembleDataByLine(SimpleDTO simpleDTO, List<Line> lines, List<String> keyIds, Integer level) {
|
private GeneralDeviceDTO assembleDataByLine(SimpleDTO simpleDTO, List<Line> lines, List<String> keyIds, Integer level) {
|
||||||
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
GeneralDeviceDTO generalDeviceDTO = new GeneralDeviceDTO();
|
||||||
if(LineBaseEnum.SUB_V_LEVEL.getCode().equals(level)){
|
if (LineBaseEnum.SUB_V_LEVEL.getCode().equals(level)) {
|
||||||
generalDeviceDTO.setName(simpleDTO.getValue());
|
generalDeviceDTO.setName(simpleDTO.getValue());
|
||||||
}else {
|
} else {
|
||||||
generalDeviceDTO.setName(simpleDTO.getName());
|
generalDeviceDTO.setName(simpleDTO.getName());
|
||||||
}
|
}
|
||||||
generalDeviceDTO.setIndex(simpleDTO.getId());
|
generalDeviceDTO.setIndex(simpleDTO.getId());
|
||||||
|
|||||||
@@ -76,4 +76,31 @@ public class DimBusBarVO {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DimBusBarMonitorVoltageVO{
|
||||||
|
private String actualCollectNum;
|
||||||
|
private String busId;
|
||||||
|
private String busName;
|
||||||
|
private String busVoltageLevel;
|
||||||
|
private String busVoltageLevelName;
|
||||||
|
private String cityOrg;
|
||||||
|
private String cityOrgName;
|
||||||
|
private String dataFullRate;
|
||||||
|
private String expectCollectNum;
|
||||||
|
private String id;
|
||||||
|
private String maintOrg;
|
||||||
|
private String maintOrgName;
|
||||||
|
private String monitorId;
|
||||||
|
private String monitorName;
|
||||||
|
private String statDate;
|
||||||
|
private String stationId;
|
||||||
|
private String stationName;
|
||||||
|
private String status;
|
||||||
|
private String statusName;
|
||||||
|
private String whetherOptimal;
|
||||||
|
private String whetherOptimalName;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.harmonic.pojo.vo.upload;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pqs
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/5/15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PmsPage<T> {
|
||||||
|
|
||||||
|
public List<T> list = Collections.emptyList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
*/
|
||||||
|
public long total = 0;
|
||||||
|
/**
|
||||||
|
* 每页显示条数,默认 10
|
||||||
|
*/
|
||||||
|
public long size = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前页
|
||||||
|
*/
|
||||||
|
public long current = 1;
|
||||||
|
|
||||||
|
public long pageNum;
|
||||||
|
public long pageSize;
|
||||||
|
public long pages;
|
||||||
|
public long prePage;
|
||||||
|
public long startRow;
|
||||||
|
|
||||||
|
|
||||||
|
public PmsPage(long current,long size){
|
||||||
|
this.current = current;
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PmsPage(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.PmsHttpResult;
|
import com.njcn.harmonic.pojo.vo.upload.PmsHttpResult;
|
||||||
|
import com.njcn.harmonic.pojo.vo.upload.PmsPage;
|
||||||
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -74,9 +75,19 @@ public class EvaluationDownController extends BaseController {
|
|||||||
@PostMapping("/getMonitorListByBus")
|
@PostMapping("/getMonitorListByBus")
|
||||||
@ApiOperation("国网上送-接收总部基准水平评估监测母线下有效监测点详情下穿接口")
|
@ApiOperation("国网上送-接收总部基准水平评估监测母线下有效监测点详情下穿接口")
|
||||||
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
||||||
public PmsHttpResult<Page<DimBusBarVO.DimBusBarMonitorVO>> getMonitorListByBus(@RequestBody DimBusBarParam param) {
|
public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorVO>> getMonitorListByBus(@RequestBody DimBusBarParam param) {
|
||||||
String methodDescribe = getMethodDescribe("getMonitorListByBus");
|
String methodDescribe = getMethodDescribe("getMonitorListByBus");
|
||||||
Page<DimBusBarVO.DimBusBarMonitorVO> page = evaluationDataService.getMonitorListByBus(param);
|
PmsPage<DimBusBarVO.DimBusBarMonitorVO> page = evaluationDataService.getMonitorListByBus(param);
|
||||||
|
return new PmsHttpResult<>(0, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getBaseEvaBusMonitorList")
|
||||||
|
@ApiOperation("国网上送-接收总部基准水平评估电压等级母线监测点列表详情下穿接口")
|
||||||
|
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
||||||
|
public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO>> getBaseEvaBusMonitorList(@RequestBody DimBusBarParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getBaseEvaBusMonitorList");
|
||||||
|
PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO> page = evaluationDataService.getBaseEvaBusMonitorList(param);
|
||||||
return new PmsHttpResult<>(0, page);
|
return new PmsHttpResult<>(0, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.harmonic.pojo.param.UploadParam;
|
|||||||
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
||||||
import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
|
import com.njcn.harmonic.pojo.po.upload.RUploadEvaluationDataD;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.upload.PmsPage;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +45,9 @@ public interface IEvaluationDataService extends IService<RUploadEvaluationDataD>
|
|||||||
|
|
||||||
Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param);
|
Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param);
|
||||||
|
|
||||||
Page<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param);
|
PmsPage<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param);
|
||||||
|
|
||||||
|
PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO> getBaseEvaBusMonitorList(DimBusBarParam param);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.njcn.harmonic.pojo.param.UploadParam;
|
|||||||
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
import com.njcn.harmonic.pojo.param.upload.DimBusBarParam;
|
||||||
import com.njcn.harmonic.pojo.po.upload.*;
|
import com.njcn.harmonic.pojo.po.upload.*;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
import com.njcn.harmonic.pojo.vo.upload.DimBusBarVO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.upload.PmsPage;
|
||||||
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
||||||
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
@@ -344,18 +345,21 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param) {
|
public PmsPage<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param) {
|
||||||
if(StrUtil.isBlank(param.getBusId())){
|
if(StrUtil.isBlank(param.getBusId())){
|
||||||
return new Page<>();
|
return new PmsPage<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<DimBusBarVO.DimBusBarMonitorVO> result = new Page<>(param.getPageNum(),param.getPageSize());
|
PmsPage<DimBusBarVO.DimBusBarMonitorVO> result = new PmsPage<>(param.getPageNum(),param.getPageSize());
|
||||||
|
|
||||||
List<RDimUpDTO> rDimUpDTOList = new ArrayList<>();
|
List<RDimUpDTO> rDimUpDTOList = new ArrayList<>();
|
||||||
List<String> midBusIds = this.busTargetAss(param, Stream.of(param.getBusId()).collect(Collectors.toList()), rDimUpDTOList);
|
List<String> midBusIds = this.busTargetAss(param, Stream.of(param.getBusId()).collect(Collectors.toList()), rDimUpDTOList);
|
||||||
|
if(CollectionUtil.isEmpty(midBusIds)){
|
||||||
|
return new PmsPage<>();
|
||||||
|
}
|
||||||
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerClient.getPmsMidLedgerList(midBusIds).getData();
|
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerClient.getPmsMidLedgerList(midBusIds).getData();
|
||||||
if(CollectionUtil.isEmpty(pmsMidLedgerList)){
|
if(CollectionUtil.isEmpty(pmsMidLedgerList)){
|
||||||
return new Page<>();
|
return new PmsPage<>();
|
||||||
}
|
}
|
||||||
Map<String,PmsMidLedger> midLedgerMap = pmsMidLedgerList.stream().collect(Collectors.toMap(PmsMidLedger::getId,Function.identity()));
|
Map<String,PmsMidLedger> midLedgerMap = pmsMidLedgerList.stream().collect(Collectors.toMap(PmsMidLedger::getId,Function.identity()));
|
||||||
List<String> effectIds = rDimUpDTOList.stream().map(RDimUpDTO::getEffectIds).filter(Objects::nonNull).collect(Collectors.toList());
|
List<String> effectIds = rDimUpDTOList.stream().map(RDimUpDTO::getEffectIds).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
@@ -396,10 +400,15 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
temList.add(tem);
|
temList.add(tem);
|
||||||
});
|
});
|
||||||
result.setTotal(page.getTotal());
|
result.setTotal(page.getTotal());
|
||||||
result.setRecords(temList);
|
result.setList(temList);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO> getBaseEvaBusMonitorList(DimBusBarParam param) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据稳态指标筛选符合条件的母线
|
* 根据稳态指标筛选符合条件的母线
|
||||||
|
|||||||
@@ -107,4 +107,16 @@ public class UserReportManageController extends BaseController {
|
|||||||
List<UserReportVO> out = userReportPOService.getUserReportList();
|
List<UserReportVO> out = userReportPOService.getUserReportList();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getInterferenceUserPage")
|
||||||
|
@ApiOperation("分页查询干扰源用户台账")
|
||||||
|
@ApiImplicitParam(name = "userReportQueryParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<UserReportVO>> getInterferenceUserPage(@RequestBody @Validated UserReportParam.UserReportQueryParam userReportQueryParam){
|
||||||
|
String methodDescribe = getMethodDescribe("getInterferenceUserPage");
|
||||||
|
Page<UserReportVO> out = userReportPOService.getInterferenceUserPage(userReportQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,7 @@ public interface UserReportPOService extends IService<UserReportPO> {
|
|||||||
void updateUserReportStatus(String businessKey, Integer status);
|
void updateUserReportStatus(String businessKey, Integer status);
|
||||||
|
|
||||||
List<UserReportVO> getUserReportList();
|
List<UserReportVO> getUserReportList();
|
||||||
|
|
||||||
|
|
||||||
|
Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,22 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||||
|
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
userReportVOQueryWrapper
|
||||||
|
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode()).eq("supervision_user_report.status",FlowStatusEnum.APPROVE.getCode());
|
||||||
|
//TODO
|
||||||
|
if (Objects.nonNull(userReportQueryParam)) {
|
||||||
|
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||||
|
//查询所有区域下的数据
|
||||||
|
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
|
||||||
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有字段为null的属性名
|
* 获取所有字段为null的属性名
|
||||||
|
|||||||
Reference in New Issue
Block a user