Compare commits
40 Commits
368103cad5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e26cc2f24 | |||
| 321e4bace8 | |||
| dd7b691993 | |||
| ae6d5453e6 | |||
| 55354130c6 | |||
| b51119daa0 | |||
| 00839668d8 | |||
| bdd555e408 | |||
| 412e97c4f1 | |||
|
|
60a519d996 | ||
|
|
16c95aa2f6 | ||
| e313894417 | |||
| a4e3a2f904 | |||
| 840263d53b | |||
| 4a04c8f764 | |||
|
|
def4c066fe | ||
|
|
5269496f24 | ||
| f594915363 | |||
| 29ca1e4a5f | |||
| 2b0c5e82fa | |||
| 6ddbdbb5be | |||
| 0d3dd0748c | |||
| 1cd3283ba5 | |||
| ce9b2b62d9 | |||
|
|
687f878b5f | ||
| 764a7b1953 | |||
| 26fa401acb | |||
| 88a99dbe9c | |||
| ae14d9a820 | |||
| 709262c2b4 | |||
| e2e7669d47 | |||
| 83907cd3ee | |||
| 5a0e990f90 | |||
| f00af22b33 | |||
| 7f13d3576d | |||
| c4f5d1b543 | |||
| 6451cfeb88 | |||
| 6eedee7783 | |||
|
|
21fe98db49 | ||
|
|
bf9779c06e |
@@ -129,10 +129,10 @@ public class EventRelevantAnalysisController extends BaseController {
|
|||||||
@PostMapping("/updateEventToAss")
|
@PostMapping("/updateEventToAss")
|
||||||
@ApiOperation("把暂降事件添加到指定事件中去")
|
@ApiOperation("把暂降事件添加到指定事件中去")
|
||||||
public HttpResult<Page<AdvanceEventDetailVO>> updateEventToAss(@RequestBody Map<String,Object> map){
|
public HttpResult<Page<AdvanceEventDetailVO>> updateEventToAss(@RequestBody Map<String,Object> map){
|
||||||
if(!map.containsKey("eventId") || !map.containsKey("assId")){
|
|
||||||
throw new BusinessException("参数异常");
|
|
||||||
}
|
|
||||||
String methodDescribe = getMethodDescribe("updateEventToAss");
|
String methodDescribe = getMethodDescribe("updateEventToAss");
|
||||||
|
if(!map.containsKey("eventId") || !map.containsKey("assId")){
|
||||||
|
throw new BusinessException("参数异常");
|
||||||
|
}
|
||||||
List<String> eventIds = (List<String>) map.get("eventId");
|
List<String> eventIds = (List<String>) map.get("eventId");
|
||||||
if(CollectionUtil.isEmpty(eventIds)){
|
if(CollectionUtil.isEmpty(eventIds)){
|
||||||
throw new BusinessException("暂降事件不可为空");
|
throw new BusinessException("暂降事件不可为空");
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import java.io.File;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.locks.Lock;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -42,10 +44,14 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
|||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
private final Lock lock = new ReentrantLock();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventAnalysisDTO analysisCauseAndType(EventAnalysisDTO eventAnalysis) {
|
public EventAnalysisDTO analysisCauseAndType(EventAnalysisDTO eventAnalysis) {
|
||||||
WaveDataDTO waveDataDTO;
|
//由于计算原因是异步操作,这里需要加锁不然JNI调用ddl文件会存在内存Invalid memory access
|
||||||
|
lock.lock();
|
||||||
|
try {
|
||||||
|
WaveDataDTO waveDataDTO;
|
||||||
String waveName = eventAnalysis.getWaveName();
|
String waveName = eventAnalysis.getWaveName();
|
||||||
String wlFilePath = eventAnalysis.getWlFilePath();
|
String wlFilePath = eventAnalysis.getWlFilePath();
|
||||||
String cfgPath, datPath, cfgPath2, datPath2;
|
String cfgPath, datPath, cfgPath2, datPath2;
|
||||||
@@ -181,6 +187,9 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
|||||||
}
|
}
|
||||||
System.out.println("暂降原因分析完毕===============");
|
System.out.println("暂降原因分析完毕===============");
|
||||||
System.out.println("cause:" + eventAnalysis);
|
System.out.println("cause:" + eventAnalysis);
|
||||||
|
} finally {
|
||||||
|
lock.unlock(); // 释放锁
|
||||||
|
}
|
||||||
return eventAnalysis;
|
return eventAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
||||||
i * FinalData.MAX_EVT_NUM, to);
|
i * FinalData.MAX_EVT_NUM, to);
|
||||||
EntityMtrans entityMtrans = mEntry.getValue();
|
EntityMtrans entityMtrans = mEntry.getValue();
|
||||||
EntityGroupData entityGroupData = handleEvent.translate(arrayObj,entityMtrans);
|
EntityGroupData entityGroupData = handleEvent.translate(arrayObj, entityMtrans);
|
||||||
// 处理分析结果
|
// 处理分析结果
|
||||||
handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
||||||
}
|
}
|
||||||
@@ -177,51 +177,44 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
||||||
|
|
||||||
|
|
||||||
|
int listSize = listEventAssObj.size();
|
||||||
|
int toIndex = 1000;
|
||||||
|
for (int i = 0; i < listSize; i += 1000) {
|
||||||
|
//作用为toIndex最后没有toIndex条数据则剩余几条newList中就装几条
|
||||||
disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
if (i + 1000 > listSize) {
|
||||||
|
toIndex = listSize - i;
|
||||||
|
|
||||||
int listSize = listEventAssObj.size();
|
|
||||||
int toIndex = 1000;
|
|
||||||
for (int i = 0; i < listSize; i += 1000) {
|
|
||||||
//作用为toIndex最后没有toIndex条数据则剩余几条newList中就装几条
|
|
||||||
if (i + 1000 > listSize) {
|
|
||||||
toIndex = listSize - i;
|
|
||||||
}
|
|
||||||
//分割lst
|
|
||||||
List<EventAssObj> newList = listEventAssObj.subList(i, i + toIndex);
|
|
||||||
//写入添加方法,需要写你的新增方法,把newList分切后的数据新增进入数据库。
|
|
||||||
rmpEventDetailAssMapper.insertEventAssData(newList);
|
|
||||||
}
|
}
|
||||||
|
//分割lst
|
||||||
|
List<EventAssObj> newList = listEventAssObj.subList(i, i + toIndex);
|
||||||
|
//写入添加方法,需要写你的新增方法,把newList分切后的数据新增进入数据库。
|
||||||
|
rmpEventDetailAssMapper.insertEventAssData(newList);
|
||||||
|
}
|
||||||
|
|
||||||
List<RmpEventDetailPO> eventUpdateList = new ArrayList<>();
|
List<RmpEventDetailPO> eventUpdateList = new ArrayList<>();
|
||||||
for (int i = 0; i < listSagEvent.size(); i++) {
|
for (int i = 0; i < listSagEvent.size(); i++) {
|
||||||
RmpEventDetailPO rmp = new RmpEventDetailPO();
|
RmpEventDetailPO rmp = new RmpEventDetailPO();
|
||||||
rmp.setEventId(listSagEvent.get(i).getIndexEventDetail());
|
rmp.setEventId(listSagEvent.get(i).getIndexEventDetail());
|
||||||
rmp.setEventassIndex(listSagEvent.get(i).getIndexEventAss());
|
rmp.setEventassIndex(listSagEvent.get(i).getIndexEventAss());
|
||||||
rmp.setDealTime(listSagEvent.get(i).getDealTime());
|
rmp.setDealTime(listSagEvent.get(i).getDealTime());
|
||||||
eventUpdateList.add(rmp);
|
eventUpdateList.add(rmp);
|
||||||
if ((i + 1) % 1000 == 0) {
|
if ((i + 1) % 1000 == 0) {
|
||||||
this.updateBatchById(eventUpdateList);
|
this.updateBatchById(eventUpdateList);
|
||||||
eventUpdateList.clear();
|
eventUpdateList.clear();
|
||||||
} else if (i == listSagEvent.size() - 1) {
|
} else if (i == listSagEvent.size() - 1) {
|
||||||
this.updateBatchById(eventUpdateList);
|
this.updateBatchById(eventUpdateList);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 增加策略记录
|
// 增加策略记录
|
||||||
String describe = "用户" + RequestUtil.getUserNickname() + "进行了关联分析";
|
String describe = "用户" + RequestUtil.getUserNickname() + "进行了关联分析";
|
||||||
PqsRelevanceLog entityPqsRelevance = new PqsRelevanceLog();
|
PqsRelevanceLog entityPqsRelevance = new PqsRelevanceLog();
|
||||||
entityPqsRelevance.setContentDes(describe);
|
entityPqsRelevance.setContentDes(describe);
|
||||||
entityPqsRelevance.setState(DataStateEnum.ENABLE.getCode());
|
entityPqsRelevance.setState(DataStateEnum.ENABLE.getCode());
|
||||||
entityPqsRelevance.setTimeId(date);
|
entityPqsRelevance.setTimeId(date);
|
||||||
relevantLogMapper.insert(entityPqsRelevance);
|
relevantLogMapper.insert(entityPqsRelevance);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
||||||
@@ -230,224 +223,6 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
|
||||||
// public void processEvents(LocalDateTime startTime, LocalDateTime endTime) {
|
|
||||||
//
|
|
||||||
// TimeInterval timeInterval = new TimeInterval();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Map<String, Map<String, Integer>> nodeSort = new HashMap<>();
|
|
||||||
// Map<String, EntityMtrans> entityMtransMap = getNodeInfo();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// for (Map.Entry<String, Map<String, Integer>> m : nodeSort) {
|
|
||||||
// List<EntityGroupEvtData> list = new ArrayList<EntityGroupEvtData>();
|
|
||||||
// Set<Map.Entry<String, Integer>> mapValue = m.getValue().entrySet();
|
|
||||||
// FinalData.NODE_NUM = m.getValue().size();
|
|
||||||
//
|
|
||||||
// for (Map.Entry<String, Integer> mm : mapValue) {
|
|
||||||
// for (int i = 0; i < entityGroupEvtDatas.length; i++) {
|
|
||||||
// if (entityGroupEvtDatas[i].getNodePhysics() == mm.getKey().intValue() && "短路故障".equals(entityGroupEvtDatas[i].getSagReason())) {
|
|
||||||
// entityGroupEvtDatas[i].setNode(mm.getValue());
|
|
||||||
// list.add(entityGroupEvtDatas[i]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 筛选不在矩阵中的事件id
|
|
||||||
// Iterator<EntityGroupEvtData> iterator = list3.iterator();
|
|
||||||
// while (iterator.hasNext()) {
|
|
||||||
// EntityGroupEvtData entityGroupEvtData = iterator.next();
|
|
||||||
//
|
|
||||||
// if (entityGroupEvtData.getNodePhysics() == mm.getKey().intValue() && "短路故障".equals(entityGroupEvtData.getSagReason())) {
|
|
||||||
// iterator.remove();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
|
||||||
// Collections.sort(list);
|
|
||||||
// list.toArray(entityGroupEvtData);
|
|
||||||
//
|
|
||||||
// for (Map.Entry<String, JSONObject> mEntry : setMtrans) {
|
|
||||||
// if (mEntry.getKey().equals(m.getKey())) {
|
|
||||||
// *//**//********************************************************************
|
|
||||||
// * 算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
|
||||||
// *********************************************************************//**//*
|
|
||||||
// int circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
|
||||||
// ? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
|
||||||
// : entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 1;
|
|
||||||
//
|
|
||||||
// for (int i = 0; i < circulation; i++) {
|
|
||||||
// int to = 0;
|
|
||||||
//
|
|
||||||
// if (i == circulation - 1) {
|
|
||||||
// to = entityGroupEvtData.length % FinalData.MAX_EVT_NUM > 0
|
|
||||||
// ? entityGroupEvtData.length
|
|
||||||
// : (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
|
||||||
// } else {
|
|
||||||
// to = (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
|
||||||
// i * FinalData.MAX_EVT_NUM, to);
|
|
||||||
// JSONObject entityMtrans = mEntry.getValue();
|
|
||||||
// EntityGroupData entityGroupData = handleEvent.translate(arrayObj, (EntityMtrans) JSONObject.toBean(entityMtrans, EntityMtrans.class));
|
|
||||||
// // 处理分析结果
|
|
||||||
// handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.EVENT_REASON.getName(), DicDataEnum.SHORT_TROUBLE.getName()).getData();
|
|
||||||
// if (Objects.isNull(dictData)) {
|
|
||||||
// throw new BusinessException(SystemResponseEnum.ADVANCE_REASON);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// LocalDateTime date = LocalDateTime.now();
|
|
||||||
// HandleEvent handleEvent = new HandleEvent();
|
|
||||||
// // 分析的事件进行处理
|
|
||||||
// List<EntityGroupEvtData> baseList = handleEvent.getData(startTime, endTime);
|
|
||||||
// if (CollectionUtil.isEmpty(baseList)) {
|
|
||||||
// throw new BusinessException("当前时间段暂无可分析事件");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 传入的处理事件根据物理隔绝进行分组
|
|
||||||
//
|
|
||||||
// List<EntityLogic> strategyList = relevantLogMapper.getLogic();
|
|
||||||
//
|
|
||||||
// if (CollectionUtil.isNotEmpty(strategyList)) {
|
|
||||||
// List<SagEvent> listSagEvent = new ArrayList<>();
|
|
||||||
// List<EventAssObj> listEventAssObj = new ArrayList<>();
|
|
||||||
//
|
|
||||||
// Map<String, List<String>> strategyToBusBarMap = new HashMap<>(32);
|
|
||||||
//
|
|
||||||
// Map<String, EntityMtrans> mapRedis = new HashMap<>(32);
|
|
||||||
//
|
|
||||||
// Map<String, List<EntityLogic>> strategyMap = strategyList.stream().collect(Collectors.groupingBy(EntityLogic::getTPIndex));
|
|
||||||
// strategyMap.forEach((key, list) -> {
|
|
||||||
// List<String> before = list.stream().map(EntityLogic::getNodeBefore).distinct().collect(Collectors.toList());
|
|
||||||
// List<String> after = list.stream().map(EntityLogic::getNodeNext).distinct().collect(Collectors.toList());
|
|
||||||
// before.addAll(after);
|
|
||||||
// before = before.stream().distinct().collect(Collectors.toList());
|
|
||||||
// strategyToBusBarMap.put(key, before);
|
|
||||||
//
|
|
||||||
// FinalData.NODE_NUM = before.size();
|
|
||||||
// EntityMtrans entityMtrans = new EntityMtrans();
|
|
||||||
// handleEvent.create_matrixcata(list, entityMtrans);
|
|
||||||
//
|
|
||||||
// mapRedis.put(key, entityMtrans);
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// strategyToBusBarMap.forEach((lastKey, lastVal) -> {
|
|
||||||
// int index = 1;
|
|
||||||
// List<EntityGroupEvtData> list = new ArrayList<>();
|
|
||||||
// for (EntityGroupEvtData entityGroupEvtData : baseList) {
|
|
||||||
// if (lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason())) {
|
|
||||||
// entityGroupEvtData.setNode(index++);
|
|
||||||
// list.add(entityGroupEvtData);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// baseList.removeIf(entityGroupEvtData -> lastVal.contains(entityGroupEvtData.getNodePhysics()) && dictData.getId().equals(entityGroupEvtData.getSagReason()));
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// EntityGroupEvtData[] entityGroupEvtData = new EntityGroupEvtData[list.size()];
|
|
||||||
// Collections.sort(list);
|
|
||||||
// list.toArray(entityGroupEvtData);
|
|
||||||
//
|
|
||||||
// mapRedis.forEach((mKey, mVal) -> {
|
|
||||||
// if (mKey.equals(lastKey)) {
|
|
||||||
// //算法最多处理1000条数据,超过限制需分批处理 先将数据根据某种方式进行升序/降序排序,然后分段处理 加入循环处理
|
|
||||||
// int circulation = entityGroupEvtData.length % FinalData.MAX_EVT_NUM == 0
|
|
||||||
// ? entityGroupEvtData.length / FinalData.MAX_EVT_NUM
|
|
||||||
// : entityGroupEvtData.length / FinalData.MAX_EVT_NUM + 1;
|
|
||||||
//
|
|
||||||
// for (int i = 0; i < circulation; i++) {
|
|
||||||
// int to;
|
|
||||||
// if (i == circulation - 1) {
|
|
||||||
// to = entityGroupEvtData.length % FinalData.MAX_EVT_NUM > 0
|
|
||||||
// ? entityGroupEvtData.length
|
|
||||||
// : (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
|
||||||
// } else {
|
|
||||||
// to = (i + 1) * FinalData.MAX_EVT_NUM - 1;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// EntityGroupEvtData[] arrayObj = Arrays.copyOfRange(entityGroupEvtData,
|
|
||||||
// i * FinalData.MAX_EVT_NUM, to);
|
|
||||||
// EntityGroupData entityGroupData = handleEvent.translate(arrayObj, mVal);
|
|
||||||
// // 处理分析结果
|
|
||||||
// handleEvent.show_group_info(entityGroupData, listSagEvent, listEventAssObj, date);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //事件ID不在矩阵中,结果集为基础以时标为标准进行归集处理 注意:三相与(单相/两相)互斥
|
|
||||||
//
|
|
||||||
// disposeNonStandardData(handleEvent, baseList, listEventAssObj, listSagEvent, date);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// int listSize = listEventAssObj.size();
|
|
||||||
// int toIndex = 1000;
|
|
||||||
// for (int i = 0; i < listSize; i += 1000) {
|
|
||||||
// //作用为toIndex最后没有toIndex条数据则剩余几条newList中就装几条
|
|
||||||
// if (i + 1000 > listSize) {
|
|
||||||
// toIndex = listSize - i;
|
|
||||||
// }
|
|
||||||
// //分割lst
|
|
||||||
// List<EventAssObj> newList = listEventAssObj.subList(i, i + toIndex);
|
|
||||||
// //写入添加方法,需要写你的新增方法,把newList分切后的数据新增进入数据库。
|
|
||||||
// rmpEventDetailAssMapper.insertEventAssData(newList);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// List<RmpEventDetailPO> eventUpdateList = new ArrayList<>();
|
|
||||||
// for (int i = 0; i < listSagEvent.size(); i++) {
|
|
||||||
// RmpEventDetailPO rmp = new RmpEventDetailPO();
|
|
||||||
// rmp.setEventId(listSagEvent.get(i).getIndexEventDetail());
|
|
||||||
// rmp.setEventassIndex(listSagEvent.get(i).getIndexEventAss());
|
|
||||||
// rmp.setDealTime(listSagEvent.get(i).getDealTime());
|
|
||||||
// eventUpdateList.add(rmp);
|
|
||||||
// if ((i + 1) % 1000 == 0) {
|
|
||||||
// this.updateBatchById(eventUpdateList);
|
|
||||||
// eventUpdateList.clear();
|
|
||||||
// } else if (i == listSagEvent.size() - 1) {
|
|
||||||
// this.updateBatchById(eventUpdateList);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 增加策略记录
|
|
||||||
// String describe = "用户" + RequestUtil.getUserNickname() + "进行了关联分析";
|
|
||||||
// PqsRelevanceLog entityPqsRelevance = new PqsRelevanceLog();
|
|
||||||
// entityPqsRelevance.setContentDes(describe);
|
|
||||||
// entityPqsRelevance.setState(DataStateEnum.ENABLE.getCode());
|
|
||||||
// entityPqsRelevance.setTimeId(date);
|
|
||||||
// relevantLogMapper.insert(entityPqsRelevance);
|
|
||||||
//
|
|
||||||
// } else {
|
|
||||||
// throw new BusinessException("当前无变压器策略,请先配置策略");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// log.info("事件关联分析用时:" + timeInterval.interval() / 1000 + "秒");
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<AdvanceEventDetailVO> querySagEventsPage(BaseParam baseParam) {
|
public Page<AdvanceEventDetailVO> querySagEventsPage(BaseParam baseParam) {
|
||||||
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
List<String> lineIds = generalDeviceInfoClient.deptGetRunLineEvent(RequestUtil.getDeptIndex()).getData();
|
||||||
@@ -473,7 +248,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||||
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude() * 100));
|
||||||
|
|
||||||
if (map.containsKey(item.getLineId())) {
|
if (map.containsKey(item.getLineId())) {
|
||||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||||
@@ -493,6 +268,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 四舍五入保留两位小数
|
* 四舍五入保留两位小数
|
||||||
*/
|
*/
|
||||||
@@ -504,6 +280,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
//保留2位小数
|
//保留2位小数
|
||||||
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||||
@@ -620,6 +397,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
.in(RmpEventDetailPO::getEventId, eventId);
|
.in(RmpEventDetailPO::getEventId, eventId);
|
||||||
RmpEventDetailPO rmpEventDetailPO = new RmpEventDetailPO();
|
RmpEventDetailPO rmpEventDetailPO = new RmpEventDetailPO();
|
||||||
rmpEventDetailPO.setEventassIndex(assId);
|
rmpEventDetailPO.setEventassIndex(assId);
|
||||||
|
rmpEventDetailPO.setDealTime(LocalDateTime.now());
|
||||||
eventAdvanceMapper.update(rmpEventDetailPO, lambdaUpdateWrapper);
|
eventAdvanceMapper.update(rmpEventDetailPO, lambdaUpdateWrapper);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -734,7 +512,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime);
|
List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime);
|
||||||
|
|
||||||
advanceEventDetailVOLsit = advanceEventDetailVOLsit.stream().filter(temp-> StringUtils.isNotEmpty(temp.getAdvanceType())).collect(Collectors.toList());
|
advanceEventDetailVOLsit = advanceEventDetailVOLsit.stream().filter(temp -> StringUtils.isNotEmpty(temp.getAdvanceType())).collect(Collectors.toList());
|
||||||
for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号
|
for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号
|
||||||
//母线id
|
//母线id
|
||||||
String nodePhysics = advanceEventDetailVO.getVoltageId();
|
String nodePhysics = advanceEventDetailVO.getVoltageId();
|
||||||
@@ -868,7 +646,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
/*************************************************************************************
|
/*************************************************************************************
|
||||||
* 获取变压器信息并生成矩阵
|
* 获取变压器信息并生成矩阵
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
public Map<String, Map<String, Integer>> getNodeBefore(){
|
public Map<String, Map<String, Integer>> getNodeBefore() {
|
||||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||||
|
|
||||||
HandleEvent handleEvent = new HandleEvent();
|
HandleEvent handleEvent = new HandleEvent();
|
||||||
@@ -883,7 +661,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, EntityMtrans> getNodeInfo( ) {
|
public Map<String, EntityMtrans> getNodeInfo() {
|
||||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||||
|
|
||||||
HandleEvent handleEvent = new HandleEvent();
|
HandleEvent handleEvent = new HandleEvent();
|
||||||
@@ -893,7 +671,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
Map<String, List<String>> map = getLogicInfo(list);
|
Map<String, List<String>> map = getLogicInfo(list);
|
||||||
Map<String, Map<String, Integer>> setNodeSort = nodeSort(map);
|
Map<String, Map<String, Integer>> setNodeSort = nodeSort(map);
|
||||||
redisUtil.saveByKeyWithExpire(redisSortKey,setNodeSort,-1L);
|
redisUtil.saveByKeyWithExpire(redisSortKey, setNodeSort, -1L);
|
||||||
|
|
||||||
setNodeSort.forEach((key, val) -> {
|
setNodeSort.forEach((key, val) -> {
|
||||||
FinalData.NODE_NUM = val.size();
|
FinalData.NODE_NUM = val.size();
|
||||||
|
|||||||
@@ -216,20 +216,18 @@ public class AuthController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.AUTHENTICATE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.AUTHENTICATE)
|
||||||
@ApiOperation("自动登录")
|
@ApiOperation("自动登录")
|
||||||
@GetMapping("/autoLogin")
|
@PostMapping("/autoLogin")
|
||||||
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query")
|
@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query")
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
public HttpResult<Object> autoLogin(@RequestParam String phone) {
|
public HttpResult<Object> autoLogin(@RequestParam String phone) {
|
||||||
String methodDescribe = getMethodDescribe("autoLogin");
|
String methodDescribe = getMethodDescribe("autoLogin");
|
||||||
String userUrl = "http://127.0.0.1:10214/oauth/token";
|
String userUrl = "http://127.0.0.1:20214/oauth/token";
|
||||||
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(userUrl)
|
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(userUrl)
|
||||||
.queryParam("grant_type", SecurityConstants.GRANT_AUTHORIZATION_CODE)
|
.queryParam("grant_type", "sms_code")
|
||||||
.queryParam("client_id", "njcn")
|
.queryParam("client_id", "njcnapp")
|
||||||
.queryParam("client_secret", "njcnpqs")
|
.queryParam("client_secret", "njcnpqs")
|
||||||
.queryParam("username", "%2FPY4%2FD07ExoKDUg6yCi2cA%3D%3D")
|
.queryParam("phone", phone)
|
||||||
.queryParam("imageCode", "verifyCode")
|
.queryParam("smsCode", "123456789");
|
||||||
.queryParam("verifyCode", "0");
|
|
||||||
|
|
||||||
URI uri = builder.build().encode().toUri();
|
URI uri = builder.build().encode().toUri();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Objects.requireNonNull(RestTemplateUtil.post(uri, HttpResult.class).getBody()).getData(), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, Objects.requireNonNull(RestTemplateUtil.post(uri, HttpResult.class).getBody()).getData(), methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,6 @@ cas:
|
|||||||
#白名单设置
|
#白名单设置
|
||||||
# /oauth/lnLogin$|/pqs-auth/oauth/lnLogin|/oauth/lnRefreshToken$|/pqs-auth/oauth/lnRefreshToken
|
# /oauth/lnLogin$|/pqs-auth/oauth/lnLogin|/oauth/lnRefreshToken$|/pqs-auth/oauth/lnRefreshToken
|
||||||
sso:
|
sso:
|
||||||
whiteList:
|
whiteList: .*/oauth/lnLogin.*|.*/pqs-auth/oauth/lnLogin.*|.*/oauth/lnRefreshToken.*|.*/pqs-auth/oauth/lnRefreshToken.*
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1720,8 +1720,8 @@ public class WaveFileComponent {
|
|||||||
s = sdf.format(d);
|
s = sdf.format(d);
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
WaveFileComponent waveFileComponent = new WaveFileComponent();
|
WaveFileComponent waveFileComponent = new WaveFileComponent();
|
||||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\无名\\Desktop\\月报\\2026\\202603\\文档\\暂态事件及波形\\新建文件夹 (3)\\Comtrade\\Comtrade\\10.95.0.201\\PQMonitor_PQM1_001183_20260320_175042_316.CFG");
|
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\Administrator\\Desktop\\wave\\PQMonitor_PQM1_000062_20260501_053729_063_WAV.cfg");
|
||||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\无名\\Desktop\\月报\\2026\\202603\\文档\\暂态事件及波形\\新建文件夹 (3)\\Comtrade\\Comtrade\\10.95.0.201\\PQMonitor_PQM1_001183_20260320_175042_316.DAT");
|
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\Administrator\\Desktop\\wave\\PQMonitor_PQM1_000062_20260501_053729_063_WAV.dat");
|
||||||
// 获取瞬时波形 //获取原始波形值
|
// 获取瞬时波形 //获取原始波形值
|
||||||
WaveDataDTO waveDataDTO = waveFileComponent.getComtradeNoAddPoints(cfgStream, datStream, 0);
|
WaveDataDTO waveDataDTO = waveFileComponent.getComtradeNoAddPoints(cfgStream, datStream, 0);
|
||||||
d = new Date();
|
d = new Date();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
|
|||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -206,6 +207,37 @@ public class WavePicComponent {
|
|||||||
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
||||||
);
|
);
|
||||||
picPath = composeImage(firstPic, secondPic);
|
picPath = composeImage(firstPic, secondPic);
|
||||||
|
} else if (waveDataDetails.size() == 4) {
|
||||||
|
WaveDataDetail waveDataDetail1 = waveDataDetails.get(0);
|
||||||
|
String pic1 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail1.getChannelName(),time), waveDataDetail1.getInstantData().getAValue(),
|
||||||
|
waveDataDetail1.getInstantData().getBValue(), waveDataDetail1.getInstantData().getCValue(),
|
||||||
|
waveDataDetail1.getUnit(), waveDataDetail1.getInstantData().getMax(), waveDataDetail1.getInstantData().getMin(),
|
||||||
|
waveDataDetail1.getA(), waveDataDetail1.getB(), waveDataDetail1.getC(),
|
||||||
|
waveDataDetail1.getColors(), waveDataDetail1.getIsOpen()
|
||||||
|
);
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail2 = waveDataDetails.get(1);
|
||||||
|
String pic2 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail2.getChannelName(),time), waveDataDetail2.getInstantData().getAValue(),
|
||||||
|
waveDataDetail2.getInstantData().getBValue(), waveDataDetail2.getInstantData().getCValue(),
|
||||||
|
waveDataDetail2.getUnit(), waveDataDetail2.getInstantData().getMax(), waveDataDetail2.getInstantData().getMin(),
|
||||||
|
waveDataDetail2.getA(), waveDataDetail2.getB(), waveDataDetail2.getC(),
|
||||||
|
waveDataDetail2.getColors(), waveDataDetail2.getIsOpen());
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail3 = waveDataDetails.get(2);
|
||||||
|
String pic3 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail3.getChannelName(),time), waveDataDetail3.getInstantData().getAValue(),
|
||||||
|
waveDataDetail3.getInstantData().getBValue(), waveDataDetail3.getInstantData().getCValue(),
|
||||||
|
waveDataDetail3.getUnit(), waveDataDetail3.getInstantData().getMax(), waveDataDetail3.getInstantData().getMin(),
|
||||||
|
waveDataDetail3.getA(), waveDataDetail3.getB(), waveDataDetail3.getC(),
|
||||||
|
waveDataDetail3.getColors(), waveDataDetail3.getIsOpen());
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail4 = waveDataDetails.get(3);
|
||||||
|
String pic4 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail4.getChannelName(),time), waveDataDetail4.getInstantData().getAValue(),
|
||||||
|
waveDataDetail4.getInstantData().getBValue(), waveDataDetail4.getInstantData().getCValue(),
|
||||||
|
waveDataDetail4.getUnit(), waveDataDetail4.getInstantData().getMax(), waveDataDetail4.getInstantData().getMin(),
|
||||||
|
waveDataDetail4.getA(), waveDataDetail4.getB(), waveDataDetail4.getC(),
|
||||||
|
waveDataDetail4.getColors(), waveDataDetail4.getIsOpen()
|
||||||
|
);
|
||||||
|
picPath = composeImageZl(pic1, pic2, pic3, pic4);
|
||||||
}
|
}
|
||||||
return picPath;
|
return picPath;
|
||||||
}
|
}
|
||||||
@@ -286,10 +318,55 @@ public class WavePicComponent {
|
|||||||
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
||||||
);
|
);
|
||||||
picPath = composeImage(firstPic, secondPic);
|
picPath = composeImage(firstPic, secondPic);
|
||||||
|
} else if (waveDataDetails.size() == 4) {
|
||||||
|
WaveDataDetail waveDataDetail1 = waveDataDetails.get(0);
|
||||||
|
String pic1 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail1.getChannelName(),time), waveDataDetail1.getRmsData().getAValue(),
|
||||||
|
waveDataDetail1.getRmsData().getBValue(), waveDataDetail1.getRmsData().getCValue(),
|
||||||
|
waveDataDetail1.getUnit(), waveDataDetail1.getRmsData().getMax(), waveDataDetail1.getRmsData().getMin(),
|
||||||
|
waveDataDetail1.getA(), waveDataDetail1.getB(), waveDataDetail1.getC(),
|
||||||
|
waveDataDetail1.getColors(), waveDataDetail1.getIsOpen()
|
||||||
|
);
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail2 = waveDataDetails.get(1);
|
||||||
|
String pic2 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail2.getChannelName(),time), waveDataDetail2.getRmsData().getAValue(),
|
||||||
|
waveDataDetail2.getRmsData().getBValue(), waveDataDetail2.getRmsData().getCValue(),
|
||||||
|
waveDataDetail2.getUnit(), waveDataDetail2.getRmsData().getMax(), waveDataDetail2.getRmsData().getMin(),
|
||||||
|
waveDataDetail2.getA(), waveDataDetail2.getB(), waveDataDetail2.getC(),
|
||||||
|
waveDataDetail2.getColors(), waveDataDetail2.getIsOpen());
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail3 = waveDataDetails.get(2);
|
||||||
|
String pic3 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail3.getChannelName(),time), waveDataDetail3.getRmsData().getAValue(),
|
||||||
|
waveDataDetail3.getRmsData().getBValue(), waveDataDetail3.getRmsData().getCValue(),
|
||||||
|
waveDataDetail3.getUnit(), waveDataDetail3.getRmsData().getMax(), waveDataDetail3.getRmsData().getMin(),
|
||||||
|
waveDataDetail3.getA(), waveDataDetail3.getB(), waveDataDetail3.getC(),
|
||||||
|
waveDataDetail3.getColors(), waveDataDetail3.getIsOpen());
|
||||||
|
|
||||||
|
WaveDataDetail waveDataDetail4 = waveDataDetails.get(3);
|
||||||
|
String pic4 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail4.getChannelName(),time), waveDataDetail4.getRmsData().getAValue(),
|
||||||
|
waveDataDetail4.getRmsData().getBValue(), waveDataDetail4.getRmsData().getCValue(),
|
||||||
|
waveDataDetail4.getUnit(), waveDataDetail4.getRmsData().getMax(), waveDataDetail4.getRmsData().getMin(),
|
||||||
|
waveDataDetail4.getA(), waveDataDetail4.getB(), waveDataDetail4.getC(),
|
||||||
|
waveDataDetail4.getColors(), waveDataDetail4.getIsOpen()
|
||||||
|
);
|
||||||
|
picPath = composeImageZl(pic1, pic2, pic3, pic4);
|
||||||
}
|
}
|
||||||
return picPath;
|
return picPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTitle2(String channelName, String time) {
|
||||||
|
String title;
|
||||||
|
if (channelName.toUpperCase().startsWith("SU")) {
|
||||||
|
title ="电压-电网侧" + " 发生时刻:" + time;
|
||||||
|
} else if (channelName.toUpperCase().startsWith("SI")) {
|
||||||
|
title ="电流-电网侧" + " 发生时刻:" + time;
|
||||||
|
} else if (channelName.toUpperCase().startsWith("LU")) {
|
||||||
|
title ="电压-负载侧" + " 发生时刻:" + time;
|
||||||
|
} else {
|
||||||
|
title ="电流-负载侧" + " 发生时刻:" + time;
|
||||||
|
}
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 绘制RMS波形图 App端用来绘制图片,会去掉部分数据,只保留开始数据 结束数据
|
* 绘制RMS波形图 App端用来绘制图片,会去掉部分数据,只保留开始数据 结束数据
|
||||||
* @author xy
|
* @author xy
|
||||||
@@ -364,6 +441,59 @@ public class WavePicComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String composeImage(String firstPic, String secondPic, String thirdPic, String forthPic) {
|
||||||
|
try {
|
||||||
|
//第一张图片 base64截取删除前缀data:image/png;base64,
|
||||||
|
BufferedImage imageOne = ImgUtil.toBufferedImage(ImgUtil.toImage(firstPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||||
|
int width = imageOne.getWidth();
|
||||||
|
int height = imageOne.getHeight();
|
||||||
|
int[] imageArrayOne = new int[width * height];
|
||||||
|
imageArrayOne = imageOne.getRGB(0, 0, width, height, imageArrayOne, 0, width);
|
||||||
|
//第二张图片 base64截取删除前缀data:image/png;base64,
|
||||||
|
BufferedImage imageTwo = ImgUtil.toBufferedImage(ImgUtil.toImage(secondPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||||
|
int width2 = imageTwo.getWidth();
|
||||||
|
int height2 = imageTwo.getHeight();
|
||||||
|
int[] ImageArrayTwo = new int[width2 * height2];
|
||||||
|
ImageArrayTwo = imageTwo.getRGB(0, 0, width, height, ImageArrayTwo, 0, width);
|
||||||
|
|
||||||
|
int[] ImageArrayThree = null;
|
||||||
|
if (Objects.equals(thirdPic, "")) {
|
||||||
|
BufferedImage imageThree = ImgUtil.toBufferedImage(ImgUtil.toImage(thirdPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||||
|
int width3 = imageThree.getWidth();
|
||||||
|
int height3 = imageThree.getHeight();
|
||||||
|
ImageArrayThree = new int[width3 * height3];
|
||||||
|
ImageArrayThree = imageThree.getRGB(0, 0, width, height, ImageArrayThree, 0, width);
|
||||||
|
}
|
||||||
|
|
||||||
|
int[] ImageArrayForth = null;
|
||||||
|
if (Objects.equals(forthPic, "")) {
|
||||||
|
BufferedImage imageForth = ImgUtil.toBufferedImage(ImgUtil.toImage(forthPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||||
|
int width4 = imageForth.getWidth();
|
||||||
|
int height4 = imageForth.getHeight();
|
||||||
|
ImageArrayForth = new int[width4 * height4];
|
||||||
|
ImageArrayForth = imageForth.getRGB(0, 0, width, height, ImageArrayForth, 0, width);
|
||||||
|
}
|
||||||
|
|
||||||
|
//新图片
|
||||||
|
BufferedImage imageNew = new BufferedImage(width, height * 2, BufferedImage.TYPE_INT_RGB);
|
||||||
|
BufferedImageGraphicsConfig config = BufferedImageGraphicsConfig.getConfig(imageNew);
|
||||||
|
imageNew = config.createCompatibleImage(width, height * 2, Transparency.TRANSLUCENT);
|
||||||
|
imageNew.setRGB(0, 0, width, height, imageArrayOne, 0, width);
|
||||||
|
imageNew.setRGB(0, height, width, height, ImageArrayTwo, 0, width);
|
||||||
|
if (!Objects.isNull(ImageArrayThree)) {
|
||||||
|
imageNew.setRGB(0, height, width, height, ImageArrayThree, 0, width);
|
||||||
|
}
|
||||||
|
if (!Objects.isNull(ImageArrayForth)) {
|
||||||
|
imageNew.setRGB(0, height, width, height, ImageArrayForth, 0, width);
|
||||||
|
}
|
||||||
|
String resultImg = ImgUtil.toBase64(imageNew, ImgUtil.IMAGE_TYPE_PNG);
|
||||||
|
byte[] bytes = Base64.getDecoder().decode(resultImg);
|
||||||
|
return fileStorageUtil.uploadStream(new ByteArrayInputStream(bytes), OssPath.EVENT_WAVE_PIC, FileUtil.generateFileName("png"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(WaveFileResponseEnum.COMPOSE_PIC_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* app越限指标图
|
* app越限指标图
|
||||||
* @param title
|
* @param title
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
|
|||||||
public void environmentPrepared(ConfigurableEnvironment environment) {
|
public void environmentPrepared(ConfigurableEnvironment environment) {
|
||||||
String active = environment.getProperty("spring.profiles.active");
|
String active = environment.getProperty("spring.profiles.active");
|
||||||
if(!"jb".equalsIgnoreCase(active)){
|
if(!"jb".equalsIgnoreCase(active)){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
||||||
String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
||||||
String projectName = environment.getProperty("microservice.ename");
|
String projectName = environment.getProperty("microservice.ename");
|
||||||
@@ -51,19 +55,23 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
|
|||||||
if (response.getStatusCode().is2xxSuccessful()) {
|
if (response.getStatusCode().is2xxSuccessful()) {
|
||||||
String logbackConfigContent = response.getBody();
|
String logbackConfigContent = response.getBody();
|
||||||
//替换项目名称
|
//替换项目名称
|
||||||
logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
//logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
||||||
logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
// logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
||||||
// 应用获取到的Logback配置
|
// 应用获取到的Logback配置
|
||||||
applyLogbackConfig(logbackConfigContent,logLevel);
|
applyLogbackConfig(logbackConfigContent,logLevel,projectName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyLogbackConfig(String logbackConfigContent,String logLevel) {
|
private void applyLogbackConfig(String logbackConfigContent,String logLevel,String projectName) {
|
||||||
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||||
JoranConfigurator configurator = new JoranConfigurator();
|
JoranConfigurator configurator = new JoranConfigurator();
|
||||||
configurator.setContext(context);
|
configurator.setContext(context);
|
||||||
context.reset();
|
context.reset();
|
||||||
|
// 注意:变量名必须与 XML 中 ${...} 内的名称完全一致
|
||||||
|
context.putProperty("log.projectName", projectName != null ? projectName : "undefined_pqs");
|
||||||
|
context.putProperty("log.commonLevel", logLevel != null ? logLevel : "INFO");
|
||||||
|
|
||||||
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(logbackConfigContent.getBytes(StandardCharsets.UTF_8))) {
|
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(logbackConfigContent.getBytes(StandardCharsets.UTF_8))) {
|
||||||
configurator.doConfigure(inputStream);
|
configurator.doConfigure(inputStream);
|
||||||
Logger root = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
|
Logger root = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.mq.message;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
* @data 2026-07-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CloudTopicMessage extends BaseMessage {
|
||||||
|
/**
|
||||||
|
* 消息请求的唯一标识
|
||||||
|
*/
|
||||||
|
@SerializedName("guid")
|
||||||
|
private String guid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备Mac
|
||||||
|
*/
|
||||||
|
@SerializedName("Dev_id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置Id
|
||||||
|
* 序列化输出 "FrontId",反序列化兼容 "frontId"
|
||||||
|
*/
|
||||||
|
@SerializedName("FrontId")
|
||||||
|
private String frontId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置进程号
|
||||||
|
* 序列化输出 "Node",反序列化兼容 "node"
|
||||||
|
*/
|
||||||
|
@SerializedName("Node")
|
||||||
|
private Integer node;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
* 序列化输出 "Detail",反序列化兼容 "detail"
|
||||||
|
*/
|
||||||
|
@SerializedName("Detail")
|
||||||
|
private Detail detail;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Detail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
* 序列化输出 "Type",反序列化兼容 "type"
|
||||||
|
*/
|
||||||
|
@SerializedName("Type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
* 序列化输出 "Msg",反序列化兼容 "msg"
|
||||||
|
*/
|
||||||
|
@SerializedName("Msg")
|
||||||
|
private Object msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.mq.template;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
|
import com.njcn.mq.constant.BusinessResource;
|
||||||
|
import com.njcn.mq.constant.BusinessTopic;
|
||||||
|
import com.njcn.mq.message.CloudTopicMessage;
|
||||||
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:读取装置版本配置信息
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2026/7/15
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class CloudTopicMessageTemplate extends RocketMQEnhanceTemplate {
|
||||||
|
|
||||||
|
public CloudTopicMessageTemplate(RocketMQTemplate template) {
|
||||||
|
super(template);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendResult sendMember(CloudTopicMessage message, String tag) {
|
||||||
|
BaseMessage baseMessage = new BaseMessage();
|
||||||
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
|
baseMessage.setMessageBody(new Gson().toJson(message));
|
||||||
|
return send(BusinessTopic.CLOUD_TOPIC,tag,baseMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ public interface AppRedisKey {
|
|||||||
/**
|
/**
|
||||||
* 设备模板前缀
|
* 设备模板前缀
|
||||||
*/
|
*/
|
||||||
String MODEL = "MODEL";
|
String MODEL = "MODEL:";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +39,7 @@ public interface AppRedisKey {
|
|||||||
/**
|
/**
|
||||||
* 监测点位置数据
|
* 监测点位置数据
|
||||||
*/
|
*/
|
||||||
String LINE_POSITION = "LINEPOSITION";
|
String LINE_POSITION = "LINEPOSITION:";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rocketMQ消费key
|
* rocketMQ消费key
|
||||||
|
|||||||
@@ -104,4 +104,9 @@ public class PollutionLineInfoDTO {
|
|||||||
* 实际安装位置
|
* 实际安装位置
|
||||||
*/
|
*/
|
||||||
private String actualArea;
|
private String actualArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点运行状态
|
||||||
|
*/
|
||||||
|
private String runFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class COverlimitUtil {
|
|||||||
uHarm(overlimit, voltageLevel);
|
uHarm(overlimit, voltageLevel);
|
||||||
threeVoltageUnbalance(overlimit);
|
threeVoltageUnbalance(overlimit);
|
||||||
interharmonicCurrent(overlimit, voltageLevel);
|
interharmonicCurrent(overlimit, voltageLevel);
|
||||||
|
negativeSequenceCurrent(overlimit, voltageLevel, shortCapacity);
|
||||||
//谐波电流限值
|
//谐波电流限值
|
||||||
int lineType;
|
int lineType;
|
||||||
if (voltageLevel >= DicDataEnum.KV220.getValue()) {
|
if (voltageLevel >= DicDataEnum.KV220.getValue()) {
|
||||||
@@ -72,7 +72,6 @@ public class COverlimitUtil {
|
|||||||
}
|
}
|
||||||
// 1. 配网 lineType = 1
|
// 1. 配网 lineType = 1
|
||||||
if (Objects.equals(lineType, RunFlagEnum.PW_FLAG.getStatus())) {
|
if (Objects.equals(lineType, RunFlagEnum.PW_FLAG.getStatus())) {
|
||||||
overlimit.setINeg(PLACEHOLDER);
|
|
||||||
Float[] iHarmTem = new Float[49];
|
Float[] iHarmTem = new Float[49];
|
||||||
|
|
||||||
// 配网-电网侧(powerFlag=0) / 配网Ⅱ类:直接基准限值,不折算
|
// 配网-电网侧(powerFlag=0) / 配网Ⅱ类:直接基准限值,不折算
|
||||||
@@ -103,8 +102,7 @@ public class COverlimitUtil {
|
|||||||
else {
|
else {
|
||||||
iHarm(overlimit, voltageLevel, pc, dc, sc);
|
iHarm(overlimit, voltageLevel, pc, dc, sc);
|
||||||
}
|
}
|
||||||
// 主网统一计算负序电流
|
|
||||||
negativeSequenceCurrent(overlimit, voltageLevel, sc);
|
|
||||||
}
|
}
|
||||||
return overlimit;
|
return overlimit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class DeviceInfo {
|
|||||||
private String ip;
|
private String ip;
|
||||||
//终端型号
|
//终端型号
|
||||||
private String devType;
|
private String devType;
|
||||||
|
//前置类型
|
||||||
|
private String comType;
|
||||||
//挂载单位
|
//挂载单位
|
||||||
private String org_name;
|
private String org_name;
|
||||||
//组织名称
|
//组织名称
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-06
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class TerminalCheckParam extends BaseParam {
|
||||||
|
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate thisCheckTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate nextCheckTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告
|
||||||
|
*/
|
||||||
|
private String checkUrl;
|
||||||
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
@@ -61,6 +64,8 @@ public class Line extends BaseEntity {
|
|||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Line> children;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ public class LineDetail{
|
|||||||
/**
|
/**
|
||||||
* 监测点序号
|
* 监测点序号
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +113,6 @@ public class LineDetail{
|
|||||||
/**
|
/**
|
||||||
* 监测点对象名称
|
* 监测点对象名称
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
private String objName;
|
private String objName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,19 +172,16 @@ public class LineDetail{
|
|||||||
/**
|
/**
|
||||||
* 监测点拥有者
|
* 监测点拥有者
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
private String owner;
|
private String owner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拥有者职务
|
* 拥有者职务
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
private String ownerDuty;
|
private String ownerDuty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拥有者联系方式
|
* 拥有者联系方式
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
private String ownerTel;
|
private String ownerTel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-07
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测对象附件
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("SUPERVISION_USER_REPORT_FILE")
|
||||||
|
public class SupervisionUserReportFile {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告
|
||||||
|
*/
|
||||||
|
private String checkUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史检测报告
|
||||||
|
*/
|
||||||
|
private String checkHistoryUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评估报告
|
||||||
|
*/
|
||||||
|
private String assessUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他附件
|
||||||
|
*/
|
||||||
|
private String otherUrl;
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//package com.njcn.device.pq.pojo.po;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
//import lombok.Data;
|
|
||||||
//import org.influxdb.annotation.Column;
|
|
||||||
//import org.influxdb.annotation.Measurement;
|
|
||||||
//
|
|
||||||
//import java.time.Instant;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @version 1.0.0
|
|
||||||
// * @author: chenchao
|
|
||||||
// * @date: 2022/06/22 19:03
|
|
||||||
// */
|
|
||||||
//@Data
|
|
||||||
//@Measurement(name = "pqs_terminal_logs")
|
|
||||||
//public class TerminalLogs {
|
|
||||||
//
|
|
||||||
// @Column(name = "time")
|
|
||||||
// private Instant timeId;
|
|
||||||
//
|
|
||||||
// @Column(name = "line_id")
|
|
||||||
// private String lineId;
|
|
||||||
//
|
|
||||||
// @Column(name = "terminal_type")
|
|
||||||
// private String terminalType;
|
|
||||||
//
|
|
||||||
// @Column(name = "update_by")
|
|
||||||
// private String updateBy;
|
|
||||||
//
|
|
||||||
// @Column(name = "terminal_describe")
|
|
||||||
// private String terminalDescribe;
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
@@ -53,4 +53,12 @@ public class DevDetail {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate nextTimeCheck;
|
private LocalDate nextTimeCheck;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DevPowerFlag{
|
||||||
|
@ApiModelProperty("终端id")
|
||||||
|
private String devIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||||
|
private String powerFlag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ public class LineDetailDataVO {
|
|||||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||||
private String devName;
|
private String devName;
|
||||||
|
|
||||||
|
@ApiModelProperty("装置型号")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@@ -26,4 +27,7 @@ public class LoadTypeVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty("干扰源暂降次数")
|
@ApiModelProperty("干扰源暂降次数")
|
||||||
private Integer count;
|
private Integer count;
|
||||||
|
|
||||||
|
|
||||||
|
private List<String> loadTypeList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class RunManageVO {
|
|||||||
private Integer runNo;
|
private Integer runNo;
|
||||||
|
|
||||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||||
private Integer id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||||
private String lineName;
|
private String lineName;
|
||||||
@@ -44,6 +44,9 @@ public class RunManageVO {
|
|||||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||||
|
private String powerFlag;
|
||||||
|
|
||||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||||
private String runFlag;
|
private String runFlag;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class RunTimeVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||||
private String devName;
|
private String devName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||||
|
private String powerFlag;
|
||||||
|
|
||||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-06
|
||||||
|
* @Description: 终端检测
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TerminalCheckVO {
|
||||||
|
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
private String bdName;
|
||||||
|
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
private String objId;
|
||||||
|
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
private LocalDate thisCheckTime;
|
||||||
|
|
||||||
|
private LocalDate nextCheckTime;
|
||||||
|
|
||||||
|
private LocalDate loginDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.未逾期
|
||||||
|
* 1.逾期
|
||||||
|
*/
|
||||||
|
private Integer checkStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逾期时间
|
||||||
|
*/
|
||||||
|
private Integer overdueDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告
|
||||||
|
*/
|
||||||
|
private String checkUrl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -48,4 +48,6 @@ public class TerminalMaintainVO implements Serializable {
|
|||||||
private Integer strategyFlag;
|
private Integer strategyFlag;
|
||||||
@ApiModelProperty(name = "子级")
|
@ApiModelProperty(name = "子级")
|
||||||
List<TerminalMaintainVO> children;
|
List<TerminalMaintainVO> children;
|
||||||
|
|
||||||
|
private String objName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public class DeviceOnlineRate {
|
|||||||
private String comFlag;
|
private String comFlag;
|
||||||
|
|
||||||
@ApiModelProperty("最新数据时间")
|
@ApiModelProperty("最新数据时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime timeID;
|
private LocalDateTime timeID;
|
||||||
|
|
||||||
@ApiModelProperty("在线率")
|
@ApiModelProperty("在线率")
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ public class LineDataExcel implements Serializable {
|
|||||||
private BigDecimal integrity;
|
private BigDecimal integrity;
|
||||||
|
|
||||||
@ExcelProperty(value = "国网ID")
|
@ExcelProperty(value = "国网ID")
|
||||||
private BigDecimal monitorId;
|
private String monitorId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
|||||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LoadTypeVO;
|
||||||
import com.njcn.device.pq.service.GridDiagramService;
|
import com.njcn.device.pq.service.GridDiagramService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -135,4 +136,13 @@ public class GridDiagramController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramOnLineRateD, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramOnLineRateD, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/loadTypeVOList")
|
||||||
|
@ApiOperation("干扰源类型统计")
|
||||||
|
public HttpResult<List<LoadTypeVO>> loadTypeVOList(@RequestBody GridDiagramParam param){
|
||||||
|
String methodDescribe = getMethodDescribe("loadTypeVOList");
|
||||||
|
List<LoadTypeVO> loadTypeVOList = gridDiagramService.loadTypeVOList(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, loadTypeVOList, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class LineIntegrityDataController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("getIntegrityByLineIds");
|
String methodDescribe = getMethodDescribe("getIntegrityByLineIds");
|
||||||
if(CollUtil.isNotEmpty(lineIds)){
|
if(CollUtil.isNotEmpty(lineIds)){
|
||||||
QueryWrapper<RStatIntegrityD> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<RStatIntegrityD> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.select("sum(real_time) as realTime,sum(due_time) as dueTime,sum(real_time)/sum(due_time) as integrityData","line_index").in("line_index",lineIds).between("time_id",startTime,endTime).groupBy("line_index");
|
queryWrapper.select("sum(real_time) as realTime,sum(due_time) as dueTime,avg(real_time*1.0/due_time) as integrityData","line_index").in("line_index",lineIds).between("time_id",startTime,endTime).groupBy("line_index");
|
||||||
List<RStatIntegrityD> rStatIntegrityDList = irStatIntegrityDService.list(queryWrapper);
|
List<RStatIntegrityD> rStatIntegrityDList = irStatIntegrityDService.list(queryWrapper);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatIntegrityDList, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rStatIntegrityDList, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
import com.njcn.device.pq.pojo.param.AlarmParam;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -87,4 +89,19 @@ public class TerminalAlarmController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端周期检测告警
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/5/23
|
||||||
|
*/
|
||||||
|
@PostMapping("/terminalCheckPage")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("终端检测告警")
|
||||||
|
@ApiImplicitParam(name = "terminalCheckParam", value = "告警类型")
|
||||||
|
public HttpResult<Page<TerminalCheckVO>> terminalCheckPage(@RequestBody @Validated TerminalCheckParam terminalCheckParam){
|
||||||
|
String methodDescribe = getMethodDescribe("terminalCheckPage");
|
||||||
|
Page<TerminalCheckVO> res = terminalAlarmService.terminalCheckPage(terminalCheckParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.njcn.device.pq.controller.file;
|
package com.njcn.device.pq.controller.file;
|
||||||
|
|
||||||
import cn.hutool.core.date.TimeInterval;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
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;
|
||||||
@@ -16,7 +15,6 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.context.request.async.DeferredResult;
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.device.pq.pojo.po.Alarm;
|
import com.njcn.device.pq.pojo.po.Alarm;
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -41,4 +43,8 @@ public interface AlarmMapper extends BaseMapper<Alarm> {
|
|||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
|
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
|
||||||
|
|
||||||
|
|
||||||
|
Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page, @Param("terminalCheckParam")TerminalCheckParam terminalCheckParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,5 +158,51 @@ ORDER BY
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="terminalCheckPage" resultType="TerminalCheckVO">
|
||||||
|
SELECT
|
||||||
|
dev.id AS devId,
|
||||||
|
dev.NAME AS devName,
|
||||||
|
users.city AS areaName,
|
||||||
|
bd.name AS bdName,
|
||||||
|
detail.obj_id AS objId,
|
||||||
|
users.project_name AS objName,
|
||||||
|
dev_detail.this_time_check AS thisCheckTime,
|
||||||
|
dev_detail.next_time_check AS nextCheckTime,
|
||||||
|
dev_detail.login_time AS loginDate,
|
||||||
|
files.CHECK_URL as checkUrl,
|
||||||
|
DATEDIFF(
|
||||||
|
day,
|
||||||
|
COALESCE(CAST(dev_detail.next_time_check AS DATE), CURRENT_DATE + INTERVAL '365' DAY),
|
||||||
|
CURRENT_DATE
|
||||||
|
) AS overdueDay,
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF(
|
||||||
|
day,
|
||||||
|
COALESCE(CAST(dev_detail.next_time_check AS DATE), CURRENT_DATE + INTERVAL '365' DAY),
|
||||||
|
CURRENT_DATE
|
||||||
|
) > 0 THEN 1
|
||||||
|
ELSE 0
|
||||||
|
END AS checkStatus
|
||||||
|
FROM
|
||||||
|
pq_line line
|
||||||
|
INNER JOIN pq_line_detail detail ON line.id = detail.id
|
||||||
|
INNER JOIN pq_line bus ON line.pid = bus.id
|
||||||
|
INNER JOIN pq_line dev ON bus.pid = dev.id
|
||||||
|
INNER JOIN pq_device dev_detail ON dev.id = dev_detail.id
|
||||||
|
INNER JOIN pq_line bd ON dev.pid = bd.id
|
||||||
|
LEFT JOIN SUPERVISION_USER_REPORT users ON users.id = detail.obj_id
|
||||||
|
LEFT JOIN SUPERVISION_USER_REPORT_FILE files on users.id = files.id
|
||||||
|
<where>
|
||||||
|
<if test="terminalCheckParam.city!=null and terminalCheckParam.city !=''">
|
||||||
|
users.city = #{terminalCheckParam.city}
|
||||||
|
</if>
|
||||||
|
<if test="terminalCheckParam.searchValue!=null and terminalCheckParam.searchValue !=''">
|
||||||
|
and users.project_name like concat('%',#{terminalCheckParam.searchValue},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by checkStatus desc,loginDate desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
|||||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LoadTypeVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -90,4 +91,12 @@ public interface GridDiagramService {
|
|||||||
* @Date: 2024/5/4 18:35
|
* @Date: 2024/5/4 18:35
|
||||||
*/
|
*/
|
||||||
List<RStatOnlinerateD> getGridDiagramOnLineRateD(StatisticsBizBaseParam param);
|
List<RStatOnlinerateD> getGridDiagramOnLineRateD(StatisticsBizBaseParam param);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 根据干扰源进行分组
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LoadTypeVO> loadTypeVOList(GridDiagramParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
import com.njcn.device.pq.pojo.param.AlarmParam;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -35,4 +37,7 @@ public interface TerminalAlarmService {
|
|||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
boolean updateAlarmInfo(String type,String devLineId);
|
boolean updateAlarmInfo(String type,String devLineId);
|
||||||
|
|
||||||
|
|
||||||
|
Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.device.biz.enums.RunFlagEnum;
|
||||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
@@ -24,9 +25,11 @@ import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
|||||||
import com.njcn.device.pq.pojo.param.GridDiagramParam;
|
import com.njcn.device.pq.pojo.param.GridDiagramParam;
|
||||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||||
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.pojo.po.*;
|
import com.njcn.device.pq.pojo.po.*;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LoadTypeVO;
|
||||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||||
import com.njcn.device.pq.service.*;
|
import com.njcn.device.pq.service.*;
|
||||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||||
@@ -45,6 +48,7 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
@@ -569,6 +573,27 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LoadTypeVO> loadTypeVOList(@NotNull GridDiagramParam param) {
|
||||||
|
List<LoadTypeVO> returnList = new ArrayList<>();
|
||||||
|
MonitorBaseParam monitorBaseParam = new MonitorBaseParam();
|
||||||
|
monitorBaseParam.setDeptId(param.getOrgId());
|
||||||
|
monitorBaseParam.setLineRunFlag(RunFlagEnum.RUNNING.getStatus());
|
||||||
|
List<String> list = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||||
|
if(CollUtil.isNotEmpty(list)) {
|
||||||
|
List<LineDetail> lineDetailList =lineDetailMapper.selectList(new LambdaQueryWrapper<LineDetail>().select(LineDetail::getLoadType, LineDetail::getId).in(LineDetail::getId, list));
|
||||||
|
Map<String,List<String>> map = lineDetailList.stream().collect(Collectors.groupingBy(LineDetail::getLoadType,Collectors.mapping(LineDetail::getId, Collectors.toList())));
|
||||||
|
map.forEach((k,v)->{
|
||||||
|
LoadTypeVO loadTypeVO = new LoadTypeVO();
|
||||||
|
loadTypeVO.setName(k);
|
||||||
|
loadTypeVO.setCount(v.size());
|
||||||
|
loadTypeVO.setLoadTypeList(v);
|
||||||
|
returnList.add(loadTypeVO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void getDevStatisticsData(List<GridDiagramVO.StatisticsData> statisticsData, List<GridDiagramVO.StatisticsData> gwStatisticsData, List<LineDevGetDTO> lineBaseList, List<String> voltageIds) {
|
private void getDevStatisticsData(List<GridDiagramVO.StatisticsData> statisticsData, List<GridDiagramVO.StatisticsData> gwStatisticsData, List<LineDevGetDTO> lineBaseList, List<String> voltageIds) {
|
||||||
GridDiagramVO.StatisticsData data;
|
GridDiagramVO.StatisticsData data;
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
lineDataExcel.setOnlineRate(onLineRate(onlineRateByDev, Arrays.asList(dto.getDeviceId())));
|
lineDataExcel.setOnlineRate(onLineRate(onlineRateByDev, Arrays.asList(dto.getDeviceId())));
|
||||||
lineDataExcel.setIntegrity(integrity(integrityList, Arrays.asList(dto.getLineId())));
|
lineDataExcel.setIntegrity(integrity(integrityList, Arrays.asList(dto.getLineId())));
|
||||||
if (num == 1) {
|
if (num == 1) {
|
||||||
lineDataExcel.setMonitorId(new BigDecimal(dto.getMonitorId()));
|
lineDataExcel.setMonitorId(dto.getMonitorId());
|
||||||
}
|
}
|
||||||
lineDataExcels1.add(lineDataExcel);
|
lineDataExcels1.add(lineDataExcel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ 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.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
import com.njcn.device.pq.pojo.vo.*;
|
||||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
|
||||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalLedgerVO;
|
|
||||||
import com.njcn.device.pq.service.RunManageService;
|
import com.njcn.device.pq.service.RunManageService;
|
||||||
import com.njcn.device.userledger.service.UserLedgerService;
|
import com.njcn.device.userledger.service.UserLedgerService;
|
||||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||||
@@ -31,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.user.pojo.dto.DeptDTO;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -39,10 +37,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -157,7 +152,28 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
if(CollUtil.isEmpty(devIndexes)){
|
if(CollUtil.isEmpty(devIndexes)){
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
}
|
}
|
||||||
return deviceMapper.getDeviceLedger(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)), devIndexes, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), runManageParam.getSearchValue());
|
Page<RunTimeVO> deviceLedger = deviceMapper.getDeviceLedger(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)), devIndexes, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), runManageParam.getSearchValue());
|
||||||
|
List<String> devID = deviceLedger.getRecords().stream().map(RunTimeVO::getId).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isNotEmpty(devID)){
|
||||||
|
//添加装置用户性质
|
||||||
|
List<DevDetail.DevPowerFlag> devPowerFlags = deviceMapper.selectDevPowerFlagByIds(devID);
|
||||||
|
Map<String, List<DevDetail.DevPowerFlag>> devPowerFlag =
|
||||||
|
devPowerFlags.stream().collect(Collectors.groupingBy(DevDetail.DevPowerFlag::getDevIndex));
|
||||||
|
deviceLedger.getRecords().stream().forEach(
|
||||||
|
vo -> {
|
||||||
|
if (devPowerFlag.containsKey(vo.getId())) {
|
||||||
|
String powerFlagStr = Optional.ofNullable(devPowerFlag.get(vo.getId()))
|
||||||
|
.orElse(Collections.emptyList())
|
||||||
|
.stream()
|
||||||
|
.map(DevDetail.DevPowerFlag::getPowerFlag)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.joining("/"));
|
||||||
|
vo.setPowerFlag(powerFlagStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return deviceLedger;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
package com.njcn.device.pq.service.impl;
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.device.pq.mapper.AlarmMapper;
|
import com.njcn.device.pq.mapper.AlarmMapper;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
import com.njcn.device.pq.pojo.param.AlarmParam;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,4 +53,11 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
|||||||
public boolean updateAlarmInfo(String type, String devLineId) {
|
public boolean updateAlarmInfo(String type, String devLineId) {
|
||||||
return alarmMapper.updateAlarmInfo(type,devLineId,LocalDateTime.now(),RequestUtil.getUserIndex());
|
return alarmMapper.updateAlarmInfo(type,devLineId,LocalDateTime.now(),RequestUtil.getUserIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam) {
|
||||||
|
Page<TerminalCheckVO> page = new Page<>(PageFactory.getPageNum(terminalCheckParam),PageFactory.getPageSize(terminalCheckParam));
|
||||||
|
Page<TerminalCheckVO> pageResult = alarmMapper.terminalCheckPage(page,terminalCheckParam);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import com.njcn.system.pojo.po.Area;
|
|||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ import java.util.stream.Stream;
|
|||||||
* @date 2021/7/19
|
* @date 2021/7/19
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TerminalTreeServiceImpl implements TerminalTreeService {
|
public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||||
|
|
||||||
private final LineMapper lineMapper;
|
private final LineMapper lineMapper;
|
||||||
@@ -67,6 +69,8 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
|
|
||||||
private final UserLedgerService userLedgerService;
|
private final UserLedgerService userLedgerService;
|
||||||
|
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
/**
|
/**
|
||||||
* 台账页面终端树
|
* 台账页面终端树
|
||||||
*
|
*
|
||||||
@@ -126,16 +130,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
||||||
projectList.forEach(project -> project.setChildren(getChildren(project, provinceList)));
|
projectList.forEach(project -> project.setChildren(getChildren(project, provinceList)));
|
||||||
|
|
||||||
/* if (CollectionUtil.isNotEmpty(allList)) {
|
|
||||||
TerminalTree terminalTree = new TerminalTree();
|
|
||||||
terminalTree.setId("9999999");
|
|
||||||
terminalTree.setLevel(0);
|
|
||||||
terminalTree.setName("台账管理");
|
|
||||||
if (CollectionUtil.isNotEmpty(projectList)) {
|
|
||||||
terminalTree.setChildren(projectList);
|
|
||||||
}
|
|
||||||
taiZhang.add(terminalTree);
|
|
||||||
}*/
|
|
||||||
return projectList;
|
return projectList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,8 +318,6 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
});
|
});
|
||||||
temMap = temList.stream().collect(Collectors.groupingBy(TerminalTree::getPid));
|
temMap = temList.stream().collect(Collectors.groupingBy(TerminalTree::getPid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//处理变电站
|
//处理变电站
|
||||||
dealChildrenData(subList, otherLineList, temMap, true);
|
dealChildrenData(subList, otherLineList, temMap, true);
|
||||||
|
|
||||||
@@ -332,11 +325,18 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
|||||||
//Integer[] arr = {1};
|
//Integer[] arr = {1};
|
||||||
//subList.forEach(item->item.getChildren().forEach(it->it.setName((arr[0]++ +"_"+it.getName()))));
|
//subList.forEach(item->item.getChildren().forEach(it->it.setName((arr[0]++ +"_"+it.getName()))));
|
||||||
//处理供电公司
|
//处理供电公司
|
||||||
dealChildrenData(gdList, subList, null, false);
|
|
||||||
|
|
||||||
|
|
||||||
if (deviceInfoParam.getStatisticalType().getCode().equalsIgnoreCase(StatisticsEnum.POWER_NETWORK.getCode())) {
|
if (deviceInfoParam.getStatisticalType().getCode().equalsIgnoreCase(StatisticsEnum.POWER_NETWORK.getCode())) {
|
||||||
terminalTree.setChildren(gdList);
|
if("liaoning".equals(versionUsed)){
|
||||||
|
terminalTree.setChildren(subList);
|
||||||
|
}else {
|
||||||
|
dealChildrenData(gdList, subList, null, false);
|
||||||
|
terminalTree.setChildren(gdList);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
dealChildrenData(gdList, subList, null, false);
|
||||||
//还需要额外处理省会
|
//还需要额外处理省会
|
||||||
dealChildrenData(proList, gdList, null, false);
|
dealChildrenData(proList, gdList, null, false);
|
||||||
terminalTree.setChildren(proList);
|
terminalTree.setChildren(proList);
|
||||||
|
|||||||
@@ -497,13 +497,13 @@ public class GeneralDeviceService {
|
|||||||
}
|
}
|
||||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||||
for (SimpleDTO simpleDTO : scales) {
|
for (SimpleDTO simpleDTO : scales) {
|
||||||
if(ObjectUtil.isNull(type)){
|
/* if(ObjectUtil.isNull(type)){
|
||||||
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
||||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
||||||
}else{
|
}else{*/
|
||||||
List<String> voltageScaleIds = terminalBaseService.getVoltageIdByScale(subVIds, simpleDTO.getId());
|
List<String> voltageScaleIds = terminalBaseService.getVoltageIdByScale(subVIds, simpleDTO.getId());
|
||||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_V_LEVEL.getCode()));
|
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_V_LEVEL.getCode()));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
return generalDeviceDTOS;
|
return generalDeviceDTOS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,31 +383,31 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
||||||
.in(Line::getName, subvNameList);
|
.in(Line::getName, subvNameList);
|
||||||
List<Line> subvRes = this.list(lineLambdaQueryWrapper);
|
List<Line> subvRes = this.list(lineLambdaQueryWrapper);
|
||||||
if (!subvRes.isEmpty()) {
|
/* if (!subvRes.isEmpty()) {
|
||||||
List<String> subvList = subvRes.stream().map(Line::getName).collect(Collectors.toList());
|
List<String> subvList = subvRes.stream().map(Line::getName).collect(Collectors.toList());
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";", subvList));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";", subvList));
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//母线
|
//母线
|
||||||
List<String> voltageName = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
List<String> voltageName = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(voltageName)) {
|
/* if (CollectionUtil.isNotEmpty(voltageName)) {
|
||||||
List<Line> voltageList = this.baseMapper.getVoltageListBySubId(subIndex, voltageName);
|
List<Line> voltageList = this.baseMapper.getVoltageListBySubId(subIndex, voltageName);
|
||||||
if (CollectionUtil.isNotEmpty(voltageList)) {
|
if (CollectionUtil.isNotEmpty(voltageList)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageList.stream().map(Line::getName).collect(Collectors.joining(";")));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageList.stream().map(Line::getName).collect(Collectors.joining(";")));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
//校验同一变电站下只能有唯一母线名称
|
//校验同一变电站下只能有唯一母线名称
|
||||||
List<String> addVoltage = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
List<String> addVoltage = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(addVoltage)) {
|
/* if (CollectionUtil.isNotEmpty(addVoltage)) {
|
||||||
List<Line> voltageListBySubId = this.baseMapper.getVoltageListBySubId(subIndex, addVoltage);
|
List<Line> voltageListBySubId = this.baseMapper.getVoltageListBySubId(subIndex, addVoltage);
|
||||||
if (CollectionUtil.isNotEmpty(voltageListBySubId)) {
|
if (CollectionUtil.isNotEmpty(voltageListBySubId)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageListBySubId.stream().map(Line::getName).collect(Collectors.joining(";")));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageListBySubId.stream().map(Line::getName).collect(Collectors.joining(";")));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
Integer subvSort = lineSortHelper.getNextSort(SUB_V_LEVEL.getCode());
|
Integer subvSort = lineSortHelper.getNextSort(SUB_V_LEVEL.getCode());
|
||||||
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
||||||
//母线id
|
//母线id
|
||||||
@@ -751,10 +751,10 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
.notIn(Line::getId, subVIndexList)
|
.notIn(Line::getId, subVIndexList)
|
||||||
.eq(Line::getPid, voltage.getPid());
|
.eq(Line::getPid, voltage.getPid());
|
||||||
List<Line> subVoltageList = this.list(lambdaQueryWrapper);
|
List<Line> subVoltageList = this.list(lambdaQueryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(subVoltageList)) {
|
/* if (CollectionUtil.isNotEmpty(subVoltageList)) {
|
||||||
List<String> repeatSubVNames = subVoltageList.stream().map(Line::getName).collect(Collectors.toList());
|
List<String> repeatSubVNames = subVoltageList.stream().map(Line::getName).collect(Collectors.toList());
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, "已存在母线名称:" + String.join(";", repeatSubVNames));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, "已存在母线名称:" + String.join(";", repeatSubVNames));
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4107,6 +4107,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.info("台账同步推送异常:" + e);
|
||||||
//出现异常,直接重启整个前置
|
//出现异常,直接重启整个前置
|
||||||
exFlag=true;
|
exFlag=true;
|
||||||
for (Node node : nodes) {
|
for (Node node : nodes) {
|
||||||
|
|||||||
@@ -102,4 +102,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
|||||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||||
|
|
||||||
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
||||||
|
|
||||||
|
List<DevDetail.DevPowerFlag> selectDevPowerFlagByIds(@Param("ids") List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
<select id="getRunManageCommList" resultType="com.njcn.device.pq.pojo.vo.RunManageVO">
|
<select id="getRunManageCommList" resultType="com.njcn.device.pq.pojo.vo.RunManageVO">
|
||||||
SELECT
|
SELECT
|
||||||
linedetail.Num AS id,
|
linedetail.id AS id,
|
||||||
|
linedetail.Num AS runNo,
|
||||||
line.NAME AS lineName,
|
line.NAME AS lineName,
|
||||||
area.NAME AS areaName,
|
area.NAME AS areaName,
|
||||||
gd.NAME AS gdName,
|
gd.NAME AS gdName,
|
||||||
@@ -28,6 +29,10 @@
|
|||||||
manufacturerId.name as manufacturer,
|
manufacturerId.name as manufacturer,
|
||||||
dev.name as devName,
|
dev.name as devName,
|
||||||
device.IP as ip,
|
device.IP as ip,
|
||||||
|
CASE linedetail.Power_Flag
|
||||||
|
WHEN 0 THEN '电网侧'
|
||||||
|
WHEN 1 THEN '非电网侧'
|
||||||
|
END AS powerFlag,
|
||||||
case linedetail.Run_Flag
|
case linedetail.Run_Flag
|
||||||
when 0 then '投运'
|
when 0 then '投运'
|
||||||
when 1 then '检修'
|
when 1 then '检修'
|
||||||
@@ -140,7 +145,8 @@
|
|||||||
|
|
||||||
<select id="getRunManageList" resultType="com.njcn.device.pq.pojo.vo.RunManageVO">
|
<select id="getRunManageList" resultType="com.njcn.device.pq.pojo.vo.RunManageVO">
|
||||||
SELECT
|
SELECT
|
||||||
linedetail.Num AS id,
|
linedetail.id AS id,
|
||||||
|
linedetail.Num AS runNo,
|
||||||
line.NAME AS lineName,
|
line.NAME AS lineName,
|
||||||
area.NAME AS areaName,
|
area.NAME AS areaName,
|
||||||
gd.NAME AS gdName,
|
gd.NAME AS gdName,
|
||||||
@@ -149,6 +155,10 @@
|
|||||||
manufacturerId.name as manufacturer,
|
manufacturerId.name as manufacturer,
|
||||||
dev.name as devName,
|
dev.name as devName,
|
||||||
device.IP as ip,
|
device.IP as ip,
|
||||||
|
CASE linedetail.Power_Flag
|
||||||
|
WHEN 0 THEN '电网侧'
|
||||||
|
WHEN 1 THEN '非电网侧'
|
||||||
|
END AS powerFlag,
|
||||||
case linedetail.Run_Flag
|
case linedetail.Run_Flag
|
||||||
when 0 then '投运'
|
when 0 then '投运'
|
||||||
when 1 then '检修'
|
when 1 then '检修'
|
||||||
@@ -506,7 +516,14 @@
|
|||||||
pv.scale lineVoltage,
|
pv.scale lineVoltage,
|
||||||
pqsub.scale subVoltage,
|
pqsub.scale subVoltage,
|
||||||
lineDetail.monitor_id monitorId,
|
lineDetail.monitor_id monitorId,
|
||||||
lineDetail.Actual_Area actualArea
|
lineDetail.Actual_Area actualArea,
|
||||||
|
CASE lineDetail.Run_Flag
|
||||||
|
WHEN 0 THEN'投运'
|
||||||
|
WHEN 1 THEN'检修'
|
||||||
|
WHEN 2 THEN'停运'
|
||||||
|
WHEN 3 THEN'调试'
|
||||||
|
WHEN 4 THEN'退运'
|
||||||
|
END AS runFlag
|
||||||
FROM
|
FROM
|
||||||
pq_line line,
|
pq_line line,
|
||||||
pq_line_detail lineDetail,
|
pq_line_detail lineDetail,
|
||||||
@@ -530,5 +547,31 @@
|
|||||||
AND substation.id = pqsub.id
|
AND substation.id = pqsub.id
|
||||||
AND subv.id = pv.id
|
AND subv.id = pv.id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDevPowerFlagByIds" resultType="com.njcn.device.pq.pojo.vo.DevDetail$DevPowerFlag">
|
||||||
|
SELECT DISTINCT
|
||||||
|
device.id as devIndex,
|
||||||
|
CASE lineDetail.Power_Flag
|
||||||
|
WHEN 0 THEN '电网侧'
|
||||||
|
WHEN 1 THEN '非电网侧'
|
||||||
|
END AS powerFlag
|
||||||
|
FROM
|
||||||
|
pq_line line,
|
||||||
|
pq_dept_line pd,
|
||||||
|
pq_line voltage,
|
||||||
|
pq_line device,
|
||||||
|
pq_line_detail lineDetail
|
||||||
|
<where>
|
||||||
|
<if test="ids!=null and ids.size()>0">
|
||||||
|
device.id IN
|
||||||
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
AND line.pid = voltage.id
|
||||||
|
AND line.id = pd.Line_Id
|
||||||
|
AND voltage.pid = device.id
|
||||||
|
AND line.id = lineDetail.id
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -209,15 +209,24 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
||||||
SELECT
|
SELECT distinct
|
||||||
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,sub.name subName,gd.name gdName
|
case when
|
||||||
|
t4.obj_id is not null and t4.obj_id !='' then t4.obj_name
|
||||||
|
else sub.name end subName,
|
||||||
|
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,gd.name gdName
|
||||||
FROM
|
FROM
|
||||||
|
pq_line t3,
|
||||||
|
pq_line_detail t4,
|
||||||
|
pq_line bus,
|
||||||
pq_line t1,
|
pq_line t1,
|
||||||
pq_device t2,
|
pq_device t2,
|
||||||
pq_line sub,
|
pq_line sub,
|
||||||
pq_line gd
|
pq_line gd
|
||||||
WHERE
|
WHERE
|
||||||
t1.id = t2.id
|
t3.id = t4.id
|
||||||
|
and t3.pid = bus.id
|
||||||
|
and bus.pid = t1.id
|
||||||
|
and t1.id = t2.id
|
||||||
and t1.pid = sub.id
|
and t1.pid = sub.id
|
||||||
and sub.pid = gd.id
|
and sub.pid = gd.id
|
||||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||||
@@ -1504,9 +1513,12 @@
|
|||||||
|
|
||||||
<select id="getCustomDetailByLineId" resultType="map">
|
<select id="getCustomDetailByLineId" resultType="map">
|
||||||
SELECT line.id AS lineId,
|
SELECT line.id AS lineId,
|
||||||
CONCAT(CONCAT(CONCAT(sub.NAME, '_'), vo.NAME), CONCAT('_', line.NAME)) AS lineName,
|
CASE
|
||||||
CONCAT(CONCAT(COALESCE(detail.pt1, 'N/A'), ':'), COALESCE(detail.pt2, 'N/A')) AS pt,
|
WHEN detail.obj_id IS NOT NULL AND detail.obj_id != '' THEN CONCAT(obj.PROJECT_NAME,'_', line.NAME)
|
||||||
CONCAT(CONCAT(COALESCE(detail.ct1, 'N/A'), ':'), COALESCE(detail.ct2, 'N/A')) AS ct,
|
ELSE CONCAT(sub.NAME, '_', vo.NAME, '_', line.NAME)
|
||||||
|
END AS lineName,
|
||||||
|
CONCAT(detail.pt1, ':', detail.pt2) AS pt,
|
||||||
|
CONCAT(detail.ct1, ':', detail.ct2) AS ct,
|
||||||
detail.Dev_Capacity AS Dev_Capacity,
|
detail.Dev_Capacity AS Dev_Capacity,
|
||||||
detail.Short_Capacity AS Short_Capacity,
|
detail.Short_Capacity AS Short_Capacity,
|
||||||
detail.Standard_Capacity AS Standard_Capacity,
|
detail.Standard_Capacity AS Standard_Capacity,
|
||||||
@@ -1521,6 +1533,7 @@
|
|||||||
JOIN pq_device pqd ON pqd.id = dev.id
|
JOIN pq_device pqd ON pqd.id = dev.id
|
||||||
JOIN sys_dict_data dic ON vg.scale = dic.id
|
JOIN sys_dict_data dic ON vg.scale = dic.id
|
||||||
JOIN pq_line sub ON sub.id = dev.pid
|
JOIN pq_line sub ON sub.id = dev.pid
|
||||||
|
LEFT JOIN SUPERVISION_USER_REPORT obj on detail.obj_id = obj.id
|
||||||
WHERE line.id = #{lineId}
|
WHERE line.id = #{lineId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -160,8 +160,10 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
lineDetailDataVO.setIp(device.getIp());
|
lineDetailDataVO.setIp(device.getIp());
|
||||||
lineDetailDataVO.setLoginTime(device.getLoginTime());
|
lineDetailDataVO.setLoginTime(device.getLoginTime());
|
||||||
lineDetailDataVO.setDevId(device.getId());
|
lineDetailDataVO.setDevId(device.getId());
|
||||||
|
lineDetailDataVO.setDevType(device.getDevType());
|
||||||
lineDetailDataVO.setBusinessType(dicDataFeignClient.getDicDataById(lineDetail.getBusinessType()).getData().getName());
|
lineDetailDataVO.setBusinessType(dicDataFeignClient.getDicDataById(lineDetail.getBusinessType()).getData().getName());
|
||||||
lineDetailDataVO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
lineDetailDataVO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
||||||
|
lineDetailDataVO.setObjId(lineDetail.getObjId());
|
||||||
lineDetailDataVO.setObjName(lineDetail.getObjName());
|
lineDetailDataVO.setObjName(lineDetail.getObjName());
|
||||||
lineDetailDataVO.setId(lineDetail.getNum());
|
lineDetailDataVO.setId(lineDetail.getNum());
|
||||||
lineDetailDataVO.setPtType(PubUtils.ptType(lineDetail.getPtType()));
|
lineDetailDataVO.setPtType(PubUtils.ptType(lineDetail.getPtType()));
|
||||||
@@ -992,6 +994,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
areaLineInfoVO.setSubName(newUserReportVO.getProjectName());
|
areaLineInfoVO.setSubName(newUserReportVO.getProjectName());
|
||||||
areaLineInfoVO.setLat(newUserReportVO.getLatitude());
|
areaLineInfoVO.setLat(newUserReportVO.getLatitude());
|
||||||
areaLineInfoVO.setLng(newUserReportVO.getLongitude());
|
areaLineInfoVO.setLng(newUserReportVO.getLongitude());
|
||||||
|
areaLineInfoVO.setObjName(newUserReportVO.getProjectName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
pq_device.Id id,
|
pq_device.Id id,
|
||||||
pq_device.IP ip,
|
pq_device.IP ip,
|
||||||
s1.Name devType,
|
s1.Name devType,
|
||||||
|
S3.Name comType,
|
||||||
pq_device.Port port,
|
pq_device.Port port,
|
||||||
pq_line.Name name,
|
pq_line.Name name,
|
||||||
sub.Name subName,
|
sub.Name subName,
|
||||||
@@ -25,15 +26,16 @@
|
|||||||
LEFT JOIN pq_line sub on pq_line.pid = sub.id
|
LEFT JOIN pq_line sub on pq_line.pid = sub.id
|
||||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||||
LEFT JOIN pq_dev_type s1 ON pq_device.Dev_Type = s1.id
|
LEFT JOIN pq_dev_type s1 ON pq_device.Dev_Type = s1.id
|
||||||
|
LEFT JOIN sys_dict_data s3 ON pq_device.Front_Type = s3.id
|
||||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||||
<where>
|
<where>
|
||||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||||
pq_node.ip=#{nodeDeviceParam.ip}
|
pq_node.ip=#{nodeDeviceParam.ip}
|
||||||
</if>
|
</if>
|
||||||
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
||||||
pq_device.id=#{nodeDeviceParam.devId}
|
pq_device.id=#{nodeDeviceParam.devId}
|
||||||
</if>
|
</if>
|
||||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||||
AND pq_device.Run_Flag in
|
AND pq_device.Run_Flag in
|
||||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
select
|
select
|
||||||
if(sum(real_time*1.0)/sum(due_time)*100>100,
|
if(sum(real_time*1.0)/sum(due_time)*100>100,
|
||||||
100,
|
100,
|
||||||
IFNULL(ROUND( sum(real_time)/sum(due_time)*100,2),0))
|
IFNULL(ROUND( sum(real_time*1.0)/sum(due_time)*100,2),0))
|
||||||
as integrityRate
|
as integrityRate
|
||||||
from
|
from
|
||||||
r_stat_integrity_d
|
r_stat_integrity_d
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ public interface TerminalMaintainMapper {
|
|||||||
*/
|
*/
|
||||||
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||||
|
|
||||||
|
|
||||||
|
List<TerminalMaintainVO> terminalConfig(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取区域
|
* 获取区域
|
||||||
* @author cdf
|
* @author cdf
|
||||||
|
|||||||
@@ -38,6 +38,35 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="terminalConfig" resultType="TerminalMaintainVO">
|
||||||
|
SELECT distinct
|
||||||
|
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||||
|
a.id,
|
||||||
|
a.pid,
|
||||||
|
a.level,
|
||||||
|
b.run_flag,
|
||||||
|
b.ip,
|
||||||
|
b.com_flag,
|
||||||
|
b.dev_type devType
|
||||||
|
FROM
|
||||||
|
pq_line line
|
||||||
|
inner join pq_line_detail detail on line.id = detail.id
|
||||||
|
inner join pq_line bus on line.pid = bus.id
|
||||||
|
inner join pq_line a on bus.pid = a.id
|
||||||
|
INNER JOIN pq_device b ON a.id = b.id
|
||||||
|
where a.id in
|
||||||
|
<foreach collection="devIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
<if test="comFlag != null">
|
||||||
|
AND b.Com_Flag=#{comFlag}
|
||||||
|
</if>
|
||||||
|
<if test="devType !=null and devType != ''">
|
||||||
|
AND b.Dev_Type =#{devType}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
|
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
|
||||||
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
||||||
</select>
|
</select>
|
||||||
@@ -77,14 +106,17 @@
|
|||||||
|
|
||||||
<select id="getRunFlagList" resultType="TerminalMaintainVO">
|
<select id="getRunFlagList" resultType="TerminalMaintainVO">
|
||||||
SELECT
|
SELECT
|
||||||
|
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||||
a.id,
|
a.id,
|
||||||
a.pid,
|
a.pid,
|
||||||
a.NAME,
|
|
||||||
b.ip,
|
b.ip,
|
||||||
a.level,
|
a.level,
|
||||||
b.run_flag
|
b.run_flag
|
||||||
FROM
|
FROM
|
||||||
pq_line a
|
pq_line line
|
||||||
|
inner join pq_line_detail detail on line.id = detail.id
|
||||||
|
inner join pq_line bus on line.pid = bus.id
|
||||||
|
inner join pq_line a on bus.pid = a.id
|
||||||
INNER JOIN pq_device b ON a.id = b.id
|
INNER JOIN pq_device b ON a.id = b.id
|
||||||
WHERE a.id in
|
WHERE a.id in
|
||||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.device.terminal.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
@@ -108,10 +109,13 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
|||||||
terminalMaintainVO.setName(generalDeviceDTO.getName());
|
terminalMaintainVO.setName(generalDeviceDTO.getName());
|
||||||
terminalMaintainVO.setId(generalDeviceDTO.getIndex());
|
terminalMaintainVO.setId(generalDeviceDTO.getIndex());
|
||||||
terminalMaintainVO.setLevel(1);
|
terminalMaintainVO.setLevel(1);
|
||||||
List<TerminalMaintainVO> devList = terminalMaintainMapper.getTerminalDevInfo(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
List<TerminalMaintainVO> devList = terminalMaintainMapper.terminalConfig(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
||||||
if (CollectionUtil.isEmpty(devList)) {
|
if (CollectionUtil.isEmpty(devList)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<String> subIndexes = devList.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
List<String> subIndexes = devList.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||||
List<TerminalMaintainVO> subList1 = terminalMaintainMapper.getPqLineGdAndSubList(subIndexes);
|
List<TerminalMaintainVO> subList1 = terminalMaintainMapper.getPqLineGdAndSubList(subIndexes);
|
||||||
List<String> gdIndexes = subList1.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
List<String> gdIndexes = subList1.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.device.userledger.service.UserLedgerService;
|
import com.njcn.device.userledger.service.UserLedgerService;
|
||||||
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
@@ -19,6 +20,7 @@ import com.njcn.web.controller.BaseController;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import jdk.nashorn.internal.ir.Terminal;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -147,4 +149,15 @@ public class UserLedgerController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportVO, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportVO, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||||
|
@PostMapping("/userCheckUpload")
|
||||||
|
@ApiOperation("周期检测")
|
||||||
|
@ApiImplicitParam(name = "terminalCheckParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<Boolean> userCheckUpload(@RequestBody @Validated TerminalCheckParam terminalCheckParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("userCheckUpload");
|
||||||
|
Boolean f = userReportPOService.userCheckUpload(terminalCheckParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, f, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.device.userledger.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-07
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SupervisionUserReportFileMapper extends BaseMapper<SupervisionUserReportFile> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.njcn.device.userledger.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||||
|
|
||||||
|
public interface SupervisionUserReportFileService extends IService<SupervisionUserReportFile> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.njcn.device.userledger.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||||
@@ -90,4 +91,7 @@ public interface UserLedgerService extends IService<UserReportPO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
UserReportVO getUserReportById(String id);
|
UserReportVO getUserReportById(String id);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean userCheckUpload(TerminalCheckParam terminalCheckParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.device.userledger.service.impl;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.device.userledger.mapper.SupervisionUserReportFileMapper;
|
||||||
|
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||||
|
import com.njcn.device.userledger.service.SupervisionUserReportFileService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-07
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SupervisionUserReportFileServiceImpl extends ServiceImpl<SupervisionUserReportFileMapper, SupervisionUserReportFile>
|
||||||
|
implements SupervisionUserReportFileService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,15 +17,19 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
|||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.device.mapper.DeviceMapper;
|
||||||
|
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||||
import com.njcn.device.line.mapper.LineMapper;
|
import com.njcn.device.line.mapper.LineMapper;
|
||||||
|
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.Device;
|
||||||
import com.njcn.device.pq.pojo.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
|
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||||
import com.njcn.device.substation.mapper.SubstationMapper;
|
import com.njcn.device.substation.mapper.SubstationMapper;
|
||||||
|
import com.njcn.device.userledger.mapper.SupervisionUserReportFileMapper;
|
||||||
import com.njcn.device.userledger.mapper.UserReportNormalMapper;
|
import com.njcn.device.userledger.mapper.UserReportNormalMapper;
|
||||||
import com.njcn.device.userledger.mapper.UserReportPOMapper;
|
import com.njcn.device.userledger.mapper.UserReportPOMapper;
|
||||||
import com.njcn.device.userledger.service.UserLedgerService;
|
import com.njcn.device.userledger.service.*;
|
||||||
import com.njcn.device.userledger.service.UserReportProjectPOService;
|
|
||||||
import com.njcn.device.userledger.service.UserReportSensitivePOService;
|
|
||||||
import com.njcn.device.userledger.service.UserReportSubstationPOService;
|
|
||||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
import com.njcn.supervision.enums.UserNatureEnum;
|
import com.njcn.supervision.enums.UserNatureEnum;
|
||||||
@@ -47,8 +51,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -71,6 +77,9 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
private final LineMapper substationMapper;
|
private final LineMapper substationMapper;
|
||||||
|
private final LineDetailMapper lineDetailMapper;
|
||||||
|
private final SupervisionUserReportFileService supervisionUserReportFileService;
|
||||||
|
private final DeviceMapper deviceMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
||||||
@@ -182,7 +191,10 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
List<Line> stationList = substationMapper.selectBatchIds(stationIds);
|
List<Line> stationList = substationMapper.selectBatchIds(stationIds);
|
||||||
stationList.forEach(line -> atationMap.put(line.getId(), line.getName()));
|
stationList.forEach(line -> atationMap.put(line.getId(), line.getName()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
List<String> ids = page.getRecords().stream().map(UserReportVO::getId).collect(Collectors.toList());
|
||||||
|
List<SupervisionUserReportFile> supervisionUserReportFiles = supervisionUserReportFileService.lambdaQuery().in(SupervisionUserReportFile::getId,ids).list();
|
||||||
|
Map<String,SupervisionUserReportFile> stringSupervisionUserReportFileMap = supervisionUserReportFiles.stream().collect(Collectors.toMap(SupervisionUserReportFile::getId, Function.identity()));
|
||||||
page.getRecords().forEach(temp -> {
|
page.getRecords().forEach(temp -> {
|
||||||
temp.setStationId(atationMap.getOrDefault(temp.getStationId(),"/"));
|
temp.setStationId(atationMap.getOrDefault(temp.getStationId(),"/"));
|
||||||
Integer needGovernance = 0;
|
Integer needGovernance = 0;
|
||||||
@@ -230,7 +242,16 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
temp.setType(type);
|
temp.setType(type);
|
||||||
|
if(stringSupervisionUserReportFileMap.containsKey(temp.getId())){
|
||||||
|
SupervisionUserReportFile supervisionUserReportFile = stringSupervisionUserReportFileMap.get(temp.getId());
|
||||||
|
temp.setCheckUrl(supervisionUserReportFile.getCheckUrl());
|
||||||
|
//temp.setCheckHistoryUrl(supervisionUserReportFile.getCheckHistoryUrl());
|
||||||
|
temp.setAssessUrl(supervisionUserReportFile.getAssessUrl());
|
||||||
|
temp.setOtherUrl(supervisionUserReportFile.getOtherUrl());
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,6 +275,13 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
userReportVO.setOrgName(dept.getName());
|
userReportVO.setOrgName(dept.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SupervisionUserReportFile supervisionUserReportFile = supervisionUserReportFileService.getOne(new LambdaQueryWrapper<SupervisionUserReportFile>().eq(SupervisionUserReportFile::getId,userReportPO.getId()));
|
||||||
|
if(Objects.nonNull(supervisionUserReportFile)){
|
||||||
|
userReportVO.setCheckUrl(supervisionUserReportFile.getCheckUrl());
|
||||||
|
userReportVO.setAssessUrl(supervisionUserReportFile.getAssessUrl());
|
||||||
|
userReportVO.setOtherUrl(supervisionUserReportFile.getOtherUrl());
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
根据用户性质获取自己特有的字段,此处需要特殊处理
|
根据用户性质获取自己特有的字段,此处需要特殊处理
|
||||||
1、每个附件需要返回文件名称以及可以预览的url
|
1、每个附件需要返回文件名称以及可以预览的url
|
||||||
@@ -300,6 +328,7 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addUserReport(UserReportParam userReportParam) {
|
public String addUserReport(UserReportParam userReportParam) {
|
||||||
UserReportPO userReportPO = new UserReportPO();
|
UserReportPO userReportPO = new UserReportPO();
|
||||||
BeanUtils.copyProperties(userReportParam, userReportPO);
|
BeanUtils.copyProperties(userReportParam, userReportPO);
|
||||||
@@ -328,6 +357,27 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
userReportPO.setDataType(0);
|
userReportPO.setDataType(0);
|
||||||
}
|
}
|
||||||
this.saveOrUpdate(userReportPO);
|
this.saveOrUpdate(userReportPO);
|
||||||
|
|
||||||
|
//需要同步更新pq_line_detail 表里的obj_name字段
|
||||||
|
if(Objects.nonNull(userReportParam.getDataType()) && userReportParam.getDataType() == 1){
|
||||||
|
if(StrUtil.isNotBlank(userReportPO.getId())){
|
||||||
|
List<LineDetail> lineDetailList = lineDetailMapper.selectList(new LambdaQueryWrapper<LineDetail>().eq(LineDetail::getId, userReportPO.getId()));
|
||||||
|
if(CollUtil.isNotEmpty(lineDetailList)){
|
||||||
|
List<String> ids = lineDetailList.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||||
|
LineDetail lineDetail = new LineDetail();
|
||||||
|
lineDetail.setObjName(userReportPO.getProjectName());
|
||||||
|
lineDetailMapper.update(lineDetail,new LambdaUpdateWrapper<LineDetail>().in(LineDetail::getId,ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//处理需要上传的附件
|
||||||
|
SupervisionUserReportFile supervisionUserReportFile = new SupervisionUserReportFile();
|
||||||
|
supervisionUserReportFile.setId(userReportPO.getId());
|
||||||
|
supervisionUserReportFile.setCheckUrl(userReportParam.getCheckUrl());
|
||||||
|
supervisionUserReportFile.setAssessUrl(userReportParam.getAssessUrl());
|
||||||
|
supervisionUserReportFile.setOtherUrl(userReportParam.getOtherUrl());
|
||||||
|
supervisionUserReportFileService.saveOrUpdate(supervisionUserReportFile);
|
||||||
|
|
||||||
userReportPO = this.getById(userReportPO.getId());
|
userReportPO = this.getById(userReportPO.getId());
|
||||||
if (
|
if (
|
||||||
CollectionUtil.newArrayList(
|
CollectionUtil.newArrayList(
|
||||||
@@ -396,6 +446,21 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
return this.baseMapper.getUserReportById(userReportVOQueryWrapper);
|
return this.baseMapper.getUserReportById(userReportVOQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean userCheckUpload(TerminalCheckParam terminalCheckParam) {
|
||||||
|
SupervisionUserReportFile supervisionUserReportFile = new SupervisionUserReportFile();
|
||||||
|
supervisionUserReportFile.setId(terminalCheckParam.getObjId());
|
||||||
|
supervisionUserReportFile.setCheckUrl(terminalCheckParam.getCheckUrl());
|
||||||
|
supervisionUserReportFileService.saveOrUpdate(supervisionUserReportFile);
|
||||||
|
Device device = new Device();
|
||||||
|
device.setId(terminalCheckParam.getDevId());
|
||||||
|
device.setThisTimeCheck(terminalCheckParam.getThisCheckTime());
|
||||||
|
device.setNextTimeCheck(terminalCheckParam.getNextCheckTime());
|
||||||
|
deviceMapper.updateById(device);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断工程名称是否重复,如果重复则提示用户XXX已经创建该工程
|
* 判断工程名称是否重复,如果重复则提示用户XXX已经创建该工程
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -636,18 +636,16 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
|||||||
}
|
}
|
||||||
}, executor);
|
}, executor);
|
||||||
|
|
||||||
CompletableFuture<List<EventEigDetail>> eigFuture = CompletableFuture.supplyAsync(() ->
|
|
||||||
waveService.eventDetailEigenvalue(index, line.getPtType()), executor
|
|
||||||
);
|
|
||||||
|
|
||||||
// 等待所有异步任务完成并获取结果(无超时,但可加)
|
// 等待所有异步任务完成并获取结果(无超时,但可加)
|
||||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf(instantFuture, rmsFuture, eigFuture);
|
CompletableFuture<Void> allFutures = CompletableFuture.allOf(instantFuture, rmsFuture);
|
||||||
allFutures.join(); // 阻塞直到三个任务都完成
|
allFutures.join(); // 阻塞直到2个任务都完成
|
||||||
|
|
||||||
// 获取结果(此时所有任务已完成,get()不会阻塞)
|
// 获取结果(此时所有任务已完成,get()不会阻塞)
|
||||||
String imageShun64 = instantFuture.get();
|
String imageShun64 = instantFuture.get();
|
||||||
String rmsShun64 = rmsFuture.get();
|
String rmsShun64 = rmsFuture.get();
|
||||||
List<EventEigDetail> eventDetailEigenvalue = eigFuture.get();
|
List<EventEigDetail> eventDetailEigenvalue = waveService.eventDetailEigenvalue(index, line.getPtType());
|
||||||
|
|
||||||
// 主线程顺序调用 WordUtil 方法(保证线程安全)
|
// 主线程顺序调用 WordUtil 方法(保证线程安全)
|
||||||
wordUtil.translateShun(index, imageShun64);
|
wordUtil.translateShun(index, imageShun64);
|
||||||
wordUtil.translateRms(index, rmsShun64);
|
wordUtil.translateRms(index, rmsShun64);
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
|||||||
}else {
|
}else {
|
||||||
rmpEventDetailPO.setFileFlag(1);
|
rmpEventDetailPO.setFileFlag(1);
|
||||||
}
|
}
|
||||||
|
//默认给0,经过高级算法在赋值
|
||||||
|
rmpEventDetailPO.setDealFlag(0);
|
||||||
rmpEventDetailPO.setEventDescribe(" ");
|
rmpEventDetailPO.setEventDescribe(" ");
|
||||||
//如果不为空,说明是二次上传波形文件了;
|
//如果不为空,说明是二次上传波形文件了;
|
||||||
|
|
||||||
@@ -387,15 +388,5 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
try{
|
|
||||||
System.out.println(1/0);
|
|
||||||
}catch (Exception e){
|
|
||||||
System.out.println(1);
|
|
||||||
}
|
|
||||||
System.out.println(1111);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class WaveServiceImpl implements WaveService {
|
|||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
try {
|
try {
|
||||||
InputStream cfgStreamLower = fileStorageUtil.getFileStream(wavePath + GeneralConstant.CFG_LOWER);
|
InputStream cfgStreamLower = fileStorageUtil.getFileStream(wavePath + GeneralConstant.CFG_LOWER);
|
||||||
@@ -70,7 +70,7 @@ public class WaveServiceImpl implements WaveService {
|
|||||||
if (Objects.isNull(cfgStreamLower) || Objects.isNull(datStreamLower)) {
|
if (Objects.isNull(cfgStreamLower) || Objects.isNull(datStreamLower)) {
|
||||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
waveDataDTO = waveFileComponent.getComtrade(cfgStreamLower, datStreamLower, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStreamLower, datStreamLower, 2);
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ public class LinePollution implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 位置,电网侧&非电网侧
|
* 位置,电网侧&非电网侧
|
||||||
*/
|
*/
|
||||||
@Excel(name = "监测位置", width = 30)
|
@Excel(name = "用户性质", width = 30)
|
||||||
@ApiModelProperty("监测位置")
|
@ApiModelProperty("用户性质")
|
||||||
private String powerFlag;
|
private String powerFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +84,7 @@ public class LinePollution implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
* 监测点电压等级
|
* 变电站电压等级
|
||||||
*/
|
*/
|
||||||
@Excel(name = "变电站电压等级", width = 30)
|
@Excel(name = "变电站电压等级", width = 30)
|
||||||
@ApiModelProperty("变电站电压等级")
|
@ApiModelProperty("变电站电压等级")
|
||||||
@@ -112,7 +112,7 @@ public class LinePollution implements Serializable {
|
|||||||
private Integer interval;
|
private Integer interval;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
*
|
||||||
* 在线率
|
* 在线率
|
||||||
*/
|
*/
|
||||||
@Excel(name = "在线率(%)",type = 10, width = 30)
|
@Excel(name = "在线率(%)",type = 10, width = 30)
|
||||||
@@ -120,7 +120,7 @@ public class LinePollution implements Serializable {
|
|||||||
private Float onlineRate;
|
private Float onlineRate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
*
|
||||||
* 完整性
|
* 完整性
|
||||||
*/
|
*/
|
||||||
@Excel(name = "完整率(%)",type = 10, width = 30)
|
@Excel(name = "完整率(%)",type = 10, width = 30)
|
||||||
@@ -134,42 +134,47 @@ public class LinePollution implements Serializable {
|
|||||||
@ApiModelProperty("谐波污染值")
|
@ApiModelProperty("谐波污染值")
|
||||||
private Double HarmonicValue;
|
private Double HarmonicValue;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 暂升次数 1.1~1.8
|
// * 暂升次数 1.1~1.8
|
||||||
* 10ms ~ 1min
|
// * 10ms ~ 1min
|
||||||
*/
|
// */
|
||||||
@Excel(name = "暂升次数(次)",type = 10, width = 20)
|
// @Excel(name = "暂升次数(次)",type = 10, width = 20)
|
||||||
@ApiModelProperty("暂升次数(次)")
|
// @ApiModelProperty("暂升次数(次)")
|
||||||
private Integer upCounts;
|
// private Integer upCounts;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 暂降次数 0.1~0.9
|
||||||
|
// * 10ms ~ 1min
|
||||||
|
// */
|
||||||
|
// @Excel(name = "电压暂降(次)",type = 10, width = 20)
|
||||||
|
// @ApiModelProperty("电压暂降(次)")
|
||||||
|
// private Integer downCounts;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 短时中断 0~0.1
|
||||||
|
// * 10ms ~ 1min
|
||||||
|
// */
|
||||||
|
// @Excel(name = "短时中断(次)",type = 10, width = 20)
|
||||||
|
// @ApiModelProperty("短时中断(次")
|
||||||
|
// private Integer breakCounts;
|
||||||
|
|
||||||
/**
|
// @Excel(name = "是否关联敏感用户", width = 30, replace = "/_null")
|
||||||
* 暂降次数 0.1~0.9
|
// @ApiModelProperty("是否关联敏感用户")
|
||||||
* 10ms ~ 1min
|
// private String isMg;
|
||||||
*/
|
//
|
||||||
@Excel(name = "电压暂降(次)",type = 10, width = 20)
|
// @Excel(name = "敏感及重要用户", width = 30,replace = "/_null")
|
||||||
@ApiModelProperty("电压暂降(次)")
|
// @ApiModelProperty("敏感及重要用户")
|
||||||
private Integer downCounts;
|
// private String importUser;
|
||||||
|
|
||||||
/**
|
|
||||||
* 短时中断 0~0.1
|
|
||||||
* 10ms ~ 1min
|
|
||||||
*/
|
|
||||||
@Excel(name = "短时中断(次)",type = 10, width = 20)
|
|
||||||
@ApiModelProperty("短时中断(次")
|
|
||||||
private Integer breakCounts;
|
|
||||||
|
|
||||||
@Excel(name = "是否关联敏感用户", width = 30, replace = "/_null")
|
|
||||||
@ApiModelProperty("是否关联敏感用户")
|
|
||||||
private String isMg;
|
|
||||||
|
|
||||||
@Excel(name = "敏感及重要用户", width = 30,replace = "/_null")
|
|
||||||
@ApiModelProperty("敏感及重要用户")
|
|
||||||
private String importUser;
|
|
||||||
|
|
||||||
@Excel(name = "一类监测点", width = 30,replace = "/_null")
|
@Excel(name = "一类监测点", width = 30,replace = "/_null")
|
||||||
@ApiModelProperty("一类监测点")
|
@ApiModelProperty("一类监测点")
|
||||||
private String monitorId;
|
private String monitorId;
|
||||||
|
|
||||||
|
|
||||||
|
@Excel(name = "监测点运行状态", width = 30,replace = "/_null")
|
||||||
|
@ApiModelProperty("监测点运行状态")
|
||||||
|
private String runFlag;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 备注
|
// * 备注
|
||||||
// */
|
// */
|
||||||
|
|||||||
@@ -64,19 +64,7 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 多数据源切换,当数据源为oracle时需要使用 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baomidou</groupId>
|
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
|
||||||
<version>3.5.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 多数据源切换,当数据源为oracle时需要使用 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baomidou</groupId>
|
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
|
||||||
<version>${dynamic-datasource.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.oracle.database.jdbc</groupId>
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
<artifactId>ojdbc8</artifactId>
|
<artifactId>ojdbc8</artifactId>
|
||||||
@@ -122,7 +110,6 @@
|
|||||||
<groupId>com.njcn.platform</groupId>
|
<groupId>com.njcn.platform</groupId>
|
||||||
<artifactId>data-processing-api</artifactId>
|
<artifactId>data-processing-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class PowerStatisticsController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getTargetByTime")
|
@PostMapping("/getTargetByTime")
|
||||||
@ApiOperation("点击越限列表时间查询指标的详细数据")
|
@ApiOperation("点击越限列表时间查询指标的详细数据")
|
||||||
public HttpResult<List<ThdDataVO>> getTargetByTime(@RequestBody @Validated PowerStatisticsParam powerStatisticsParam) {
|
public HttpResult<List<ThdDataVO>> getTargetByTime(@RequestBody PowerStatisticsParam powerStatisticsParam) {
|
||||||
String methodDescribe = getMethodDescribe("getTargetByTime");
|
String methodDescribe = getMethodDescribe("getTargetByTime");
|
||||||
List<ThdDataVO> targetByTime = powerStatisticsService.getTargetByTimeDetail(powerStatisticsParam);
|
List<ThdDataVO> targetByTime = powerStatisticsService.getTargetByTimeDetail(powerStatisticsParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, targetByTime, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, targetByTime, methodDescribe);
|
||||||
@@ -73,14 +73,14 @@ public class PowerStatisticsController extends BaseController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("导出区间数据")
|
@ApiOperation("导出区间数据")
|
||||||
@PostMapping(value = "exportExcelRangTemplate")
|
@PostMapping(value = "exportExcelRangTemplate")
|
||||||
public void exportExcelRangTemplate(@RequestBody @Validated PowerStatisticsParam powerStatisticsParam,HttpServletResponse response) {
|
public void exportExcelRangTemplate(@RequestBody PowerStatisticsParam powerStatisticsParam,HttpServletResponse response) {
|
||||||
powerStatisticsService.exportExcelRangTemplate(powerStatisticsParam,response);
|
powerStatisticsService.exportExcelRangTemplate(powerStatisticsParam,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("导出指标越限列表数据")
|
@ApiOperation("导出指标越限列表数据")
|
||||||
@PostMapping(value = "exportExcelListTemplate")
|
@PostMapping(value = "exportExcelListTemplate")
|
||||||
public void exportExcelListTemplate(@RequestBody @Validated PowerStatisticsParam powerStatisticsParam,HttpServletResponse response) {
|
public void exportExcelListTemplate(@RequestBody PowerStatisticsParam powerStatisticsParam,HttpServletResponse response) {
|
||||||
powerStatisticsService.exportExcelListTemplate(powerStatisticsParam,response);
|
powerStatisticsService.exportExcelListTemplate(powerStatisticsParam,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataHarmrateI;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @author xy
|
||||||
|
// */
|
||||||
|
//public interface DataHarmRateIMapper extends InfluxDbBaseMapper<DataHarmrateI> {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataHarmrateV;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @author xy
|
||||||
|
// */
|
||||||
|
//public interface DataHarmRateVMapper extends InfluxDbBaseMapper<DataHarmrateV> {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataI;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @author hongawen
|
||||||
|
// * @version 1.0
|
||||||
|
// * @data 2024/11/7 18:49
|
||||||
|
// */
|
||||||
|
//public interface DataIMapper extends InfluxDbBaseMapper<DataI> {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataInharmV;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * <p>
|
||||||
|
// * Mapper 接口
|
||||||
|
// * </p>
|
||||||
|
// *
|
||||||
|
// * @author hongawen
|
||||||
|
// * @since 2023-12-28
|
||||||
|
// */
|
||||||
|
//public interface DataInharmVMapper extends InfluxDbBaseMapper<DataInharmV> {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataPlt;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * <p>
|
||||||
|
// * Mapper 接口
|
||||||
|
// * </p>
|
||||||
|
// *
|
||||||
|
// * @author hongawen
|
||||||
|
// * @since 2023-12-28
|
||||||
|
// */
|
||||||
|
//public interface DataPltMapper extends InfluxDbBaseMapper<DataPlt> {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//package com.njcn.harmonic.mapper.influxdb;
|
||||||
|
//
|
||||||
|
//import com.njcn.dataProcess.dto.LineDataVFiveItemDTO;
|
||||||
|
//import com.njcn.dataProcess.dto.MeasurementCountDTO;
|
||||||
|
//import com.njcn.dataProcess.po.influx.DataV;
|
||||||
|
//import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||||
|
//import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
//
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @author hongawen
|
||||||
|
// * @version 1.0
|
||||||
|
// * @data 2024/11/7 18:49
|
||||||
|
// */
|
||||||
|
//public interface DataVMapper extends InfluxDbBaseMapper<DataV> {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<LineDataVFiveItemDTO> queryDataValue(InfluxQueryWrapper dataVQueryWrapper);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<MeasurementCountDTO> getMeasurementCount(InfluxQueryWrapper influxQueryWrapper);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//}
|
||||||
@@ -2,6 +2,8 @@ package com.njcn.harmonic.service;
|
|||||||
|
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailTimeDto;
|
||||||
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
||||||
import com.njcn.harmonic.pojo.param.LimitExtentDayQueryParam;
|
import com.njcn.harmonic.pojo.param.LimitExtentDayQueryParam;
|
||||||
import com.njcn.harmonic.pojo.param.LimitExtentQueryParam;
|
import com.njcn.harmonic.pojo.param.LimitExtentQueryParam;
|
||||||
@@ -27,4 +29,12 @@ public interface IRStatLimitRateDetailDService extends IService<RStatLimitRateDe
|
|||||||
List<LimitProbabilityVO> limitProbabilityData(LimitProbabilityQueryParam param);
|
List<LimitProbabilityVO> limitProbabilityData(LimitProbabilityQueryParam param);
|
||||||
|
|
||||||
List<LimitTimeProbabilityVO> limitTimeProbabilityData(LimitProbabilityQueryParam param);
|
List<LimitTimeProbabilityVO> limitTimeProbabilityData(LimitProbabilityQueryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 稳态超标时间
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataLimitRateDetailTimeDto> getLimitRateDetailTime(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.alibaba.excel.EasyExcel;
|
|||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.njcn.dataProcess.api.*;
|
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.*;
|
import com.njcn.dataProcess.pojo.dto.*;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -18,11 +17,11 @@ import com.njcn.device.pq.api.OverLimitClient;
|
|||||||
import com.njcn.harmonic.constant.Param;
|
import com.njcn.harmonic.constant.Param;
|
||||||
import com.njcn.harmonic.pojo.param.PowerStatisticsParam;
|
import com.njcn.harmonic.pojo.param.PowerStatisticsParam;
|
||||||
import com.njcn.harmonic.pojo.vo.*;
|
import com.njcn.harmonic.pojo.vo.*;
|
||||||
|
import com.njcn.harmonic.service.IRStatLimitRateDetailDService;
|
||||||
import com.njcn.harmonic.service.activepowerrange.PowerStatisticsService;
|
import com.njcn.harmonic.service.activepowerrange.PowerStatisticsService;
|
||||||
import com.njcn.harmonic.service.activepowerrange.RActivePowerRangeService;
|
import com.njcn.harmonic.service.activepowerrange.RActivePowerRangeService;
|
||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.harmonic.service.influxdb.*;
|
||||||
import com.njcn.poi.util.PoiUtil;
|
import com.njcn.poi.util.PoiUtil;
|
||||||
import com.njcn.system.api.EpdFeignClient;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||||
@@ -54,14 +53,14 @@ import java.util.stream.Collectors;
|
|||||||
public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
||||||
|
|
||||||
private final RActivePowerRangeService rActivePowerRangeService;
|
private final RActivePowerRangeService rActivePowerRangeService;
|
||||||
|
private final IRStatLimitRateDetailDService irStatLimitRateDetailDService;
|
||||||
private final DecimalFormat dftwo = new DecimalFormat(Param.DECIMAL_FORMATTWOSTR);
|
private final DecimalFormat dftwo = new DecimalFormat(Param.DECIMAL_FORMATTWOSTR);
|
||||||
private final DataVFeignClient dataVFeignClient;
|
private final IDataV dataV;
|
||||||
private final DataIFeignClient dataIFeignClient;
|
private final IDataI dataI;
|
||||||
private final DataPltFeignClient dataPltFeignClient;
|
private final IDataPlt dataPlt;
|
||||||
private final DataInharmVFeignClient dataInharmVFeignClient;
|
private final IDataInHarmV dataInHarmV;
|
||||||
private final DataHarmRateVFeignClient dataHarmRateVFeignClient;
|
private final IDataHarmRateV dataHarmRateV;
|
||||||
private final OverLimitClient overLimitClient;
|
private final OverLimitClient overLimitClient;
|
||||||
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
|
||||||
|
|
||||||
private List<String> times = Arrays.asList("0~10%", "10~20%", "20~30%", "30~40%", "40~50%", "50~60%", "60~70%", "70~80%", "80~90%", "90~100%");
|
private List<String> times = Arrays.asList("0~10%", "10~20%", "20~30%", "30~40%", "40~50%", "50~60%", "60~70%", "70~80%", "80~90%", "90~100%");
|
||||||
|
|
||||||
@@ -111,7 +110,9 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
lineCountEvaluateParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
lineCountEvaluateParam.setStartTime(powerStatisticsParam.getSearchBeginTime());
|
||||||
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchEndTime());
|
lineCountEvaluateParam.setEndTime(powerStatisticsParam.getSearchEndTime());
|
||||||
//获取超标数据
|
//获取超标数据
|
||||||
List<DataLimitRateDetailTimeDto> dtoList = dataLimitRateDetailFeignClient.getLimitRateDetailTimeList(lineCountEvaluateParam).getData();
|
|
||||||
|
|
||||||
|
List<DataLimitRateDetailTimeDto> dtoList = irStatLimitRateDetailDService.getLimitRateDetailTime(lineCountEvaluateParam);
|
||||||
Map<String, DataLimitRateDetailTimeDto> timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity()));
|
Map<String, DataLimitRateDetailTimeDto> timeDateMap = dtoList.stream().collect(Collectors.toMap(x -> x.getTime(), Function.identity()));
|
||||||
List<String> timeId = rActivePowerRangePO.getTimeId();
|
List<String> timeId = rActivePowerRangePO.getTimeId();
|
||||||
String times = reflexObjValue(rActivePowerRangePO, "minsTime" + powerStatisticsParam.getField()).toString().replace("null", "");
|
String times = reflexObjValue(rActivePowerRangePO, "minsTime" + powerStatisticsParam.getField()).toString().replace("null", "");
|
||||||
@@ -155,11 +156,11 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
String time = param.getSearchBeginTime();
|
String time = param.getSearchBeginTime();
|
||||||
if ("1".equals(param.getStatisticalId())) {
|
if ("1".equals(param.getStatisticalId())) {
|
||||||
//电压数据
|
//电压数据
|
||||||
List<DataVDto> dataVAllTime = dataVFeignClient.getRawData(evaluateParam).getData();
|
List<DataVDto> dataVAllTime = dataV.getRawData(evaluateParam);
|
||||||
//闪变数据
|
//闪变数据
|
||||||
List<DataPltDto> dataFlickerAllTime = dataPltFeignClient.getRawData(evaluateParam).getData();
|
List<DataPltDto> dataFlickerAllTime = dataPlt.getRawData(evaluateParam);
|
||||||
//电流数据
|
//电流数据
|
||||||
List<DataIDto> dataIList = dataIFeignClient.getRawData(evaluateParam).getData();
|
List<DataIDto> dataIList = dataI.getRawData(evaluateParam);
|
||||||
//电压偏差
|
//电压偏差
|
||||||
if ("Dev".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
if ("Dev".equals(param.getCode()) || StrUtil.isBlank(param.getCode())) {
|
||||||
addThdData(info, overlimit.getVoltageDev(), "vuDev", dataVAllTime, "电压上偏差","%",time);
|
addThdData(info, overlimit.getVoltageDev(), "vuDev", dataVAllTime, "电压上偏差","%",time);
|
||||||
@@ -189,17 +190,17 @@ public class PowerStatisticsServiceImpl implements PowerStatisticsService {
|
|||||||
}
|
}
|
||||||
if ("2".equals(param.getStatisticalId())) {
|
if ("2".equals(param.getStatisticalId())) {
|
||||||
//谐波数据
|
//谐波数据
|
||||||
List<DataHarmDto> dataVHarmList = dataHarmRateVFeignClient.getRawData(evaluateParam).getData();
|
List<DataHarmDto> dataVHarmList = dataHarmRateV.getRawData(evaluateParam);
|
||||||
addThdData(info, overlimit, "getUharm", "v", 2, 26, dataVHarmList, "谐波电压","%",time);
|
addThdData(info, overlimit, "getUharm", "v", 2, 26, dataVHarmList, "谐波电压","%",time);
|
||||||
}
|
}
|
||||||
if ("3".equals(param.getStatisticalId())) {
|
if ("3".equals(param.getStatisticalId())) {
|
||||||
//电流数据
|
//电流数据
|
||||||
List<DataIDto> dataIList = dataIFeignClient.getRawData(evaluateParam).getData();
|
List<DataIDto> dataIList = dataI.getRawData(evaluateParam);
|
||||||
addThdData(info, overlimit, "getUharm", "i", 2, 26, dataIList, "谐波电流","A",time);
|
addThdData(info, overlimit, "getUharm", "i", 2, 26, dataIList, "谐波电流","A",time);
|
||||||
}
|
}
|
||||||
if ("4".equals(param.getStatisticalId())) {
|
if ("4".equals(param.getStatisticalId())) {
|
||||||
//间谐波数据
|
//间谐波数据
|
||||||
List<DataHarmDto> dataVInHarmList = dataInharmVFeignClient.getRawData(evaluateParam).getData();
|
List<DataHarmDto> dataVInHarmList = dataInHarmV.getRawData(evaluateParam);
|
||||||
addThdData(info, overlimit, "getInuharm", "v", 1, 17, dataVInHarmList, "间谐波电压","%",time);
|
addThdData(info, overlimit, "getInuharm", "v", 1, 17, dataVInHarmList, "间谐波电压","%",time);
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import com.njcn.harmonic.pojo.vo.MonitorOverLimitVO;
|
|||||||
import com.njcn.harmonic.pojo.vo.OverAreaLimitVO;
|
import com.njcn.harmonic.pojo.vo.OverAreaLimitVO;
|
||||||
import com.njcn.harmonic.pojo.vo.OverAreaVO;
|
import com.njcn.harmonic.pojo.vo.OverAreaVO;
|
||||||
import com.njcn.harmonic.pojo.vo.WarningSubstationVO;
|
import com.njcn.harmonic.pojo.vo.WarningSubstationVO;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.IAnalyzeService;
|
import com.njcn.harmonic.service.IAnalyzeService;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
@@ -50,7 +50,6 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|||||||
@@ -68,8 +68,6 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
|
|||||||
|
|
||||||
String systemType = commTerminalGeneralClient.isPqOrPms().getData();
|
String systemType = commTerminalGeneralClient.isPqOrPms().getData();
|
||||||
if (systemType.equals("pq")) {
|
if (systemType.equals("pq")) {
|
||||||
|
|
||||||
|
|
||||||
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
|
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
|
||||||
Map<String, UserLedgerVO> userLedgerVOMap = userLedgerVOList.stream().collect(Collectors.toMap(UserLedgerVO::getId, Function.identity()));
|
Map<String, UserLedgerVO> userLedgerVOMap = userLedgerVOList.stream().collect(Collectors.toMap(UserLedgerVO::getId, Function.identity()));
|
||||||
|
|
||||||
@@ -158,8 +156,8 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
|
|||||||
comAssessVOList.add(comAssessVO);
|
comAssessVOList.add(comAssessVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
|
// List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
|
||||||
return list;
|
return comAssessVOList;
|
||||||
} else {
|
} else {
|
||||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||||
PmsDeviceInfoParam param = new PmsDeviceInfoParam();
|
PmsDeviceInfoParam param = new PmsDeviceInfoParam();
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
|||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||||
import com.njcn.device.pq.api.LineFeignClient;
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
|
||||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
|
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.harmonic.mapper.*;
|
import com.njcn.harmonic.mapper.*;
|
||||||
import com.njcn.harmonic.pojo.param.hebeinorth.AssessParam;
|
import com.njcn.harmonic.pojo.param.hebeinorth.AssessParam;
|
||||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||||
@@ -26,11 +26,14 @@ import com.njcn.harmonic.pojo.vo.hebeinorth.EvaluationVo;
|
|||||||
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
import com.njcn.harmonic.common.mapper.RStatDataIDMapper;
|
||||||
import com.njcn.harmonic.common.mapper.RStatDataInharmVDMapper;
|
import com.njcn.harmonic.common.mapper.RStatDataInharmVDMapper;
|
||||||
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
import com.njcn.harmonic.common.mapper.RStatDataVDMapper;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.hebeinorth.IGridService;
|
import com.njcn.harmonic.service.hebeinorth.IGridService;
|
||||||
import com.njcn.harmonic.util.ComAssesUtil;
|
import com.njcn.harmonic.util.ComAssesUtil;
|
||||||
import com.njcn.harmonic.util.TimeUtil;
|
import com.njcn.harmonic.util.TimeUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -71,6 +74,7 @@ public class GridServiceImpl implements IGridService {
|
|||||||
private final RStatLimitTargetDMapper rStatLimitTargetDMapper;
|
private final RStatLimitTargetDMapper rStatLimitTargetDMapper;
|
||||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||||
private final DeptFeignClient deptFeignClient;
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AssessVo.AssessOverview getAssessOverview(AssessParam param) {
|
public AssessVo.AssessOverview getAssessOverview(AssessParam param) {
|
||||||
@@ -328,8 +332,11 @@ public class GridServiceImpl implements IGridService {
|
|||||||
deptGetLineParam.setDeptId(param.getDeptIndex());
|
deptGetLineParam.setDeptId(param.getDeptIndex());
|
||||||
deptGetLineParam.setLineRunFlag(0);
|
deptGetLineParam.setLineRunFlag(0);
|
||||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||||
|
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(param.getVoltageLevel()).getData();
|
||||||
|
DictData standVoltageDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(),dictData.getName()).getData();
|
||||||
//获取监测点集合
|
//获取监测点集合
|
||||||
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(), param.getVoltageLevel());
|
Map<String, List<String>> lineMap = this.getLineMap(list, param.getIsUpToGrid(),standVoltageDic.getId());
|
||||||
List<String> lineList = lineMap.values().stream()
|
List<String> lineList = lineMap.values().stream()
|
||||||
.flatMap(List::stream)
|
.flatMap(List::stream)
|
||||||
.distinct()
|
.distinct()
|
||||||
@@ -577,7 +584,7 @@ public class GridServiceImpl implements IGridService {
|
|||||||
//筛选出9项指标(电压偏差、频率偏差、电压总谐波畸变率、电压闪变、三相电压不平衡度、负序电流、谐波电流、间谐波电压、谐波电压)超标监测点
|
//筛选出9项指标(电压偏差、频率偏差、电压总谐波畸变率、电压闪变、三相电压不平衡度、负序电流、谐波电流、间谐波电压、谐波电压)超标监测点
|
||||||
long allNum = list2.stream().filter(o -> o.getAllOvertime() > 0 || o.getFlickerAllTime() > 0 ).count();
|
long allNum = list2.stream().filter(o -> o.getAllOvertime() > 0 || o.getFlickerAllTime() > 0 ).count();
|
||||||
detail.setOverNum((int) allNum);
|
detail.setOverNum((int) allNum);
|
||||||
detail.setOverRatio(PubUtils.doubleRound(2, detail.getOverNum() * 100.0 / detail.getOnlineNum()));
|
detail.setOverRatio(detail.getOnlineNum() == 0 ? 0 : PubUtils.doubleRound(2, detail.getOverNum() * 100.0 / detail.getOnlineNum()));
|
||||||
//筛选出电压偏差超标监测点
|
//筛选出电压偏差超标监测点
|
||||||
long num1 = list2.stream().filter(o -> o.getFreqDevOvertime() > 0).count();
|
long num1 = list2.stream().filter(o -> o.getFreqDevOvertime() > 0).count();
|
||||||
Integer day1 = list2.stream().max(Comparator.comparingInt(RStatLimitTargetVO::getFreqDevOvertime)).get().getFreqDevOvertime();
|
Integer day1 = list2.stream().max(Comparator.comparingInt(RStatLimitTargetVO::getFreqDevOvertime)).get().getFreqDevOvertime();
|
||||||
@@ -655,7 +662,7 @@ public class GridServiceImpl implements IGridService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//获取基础台账信息
|
//获取基础台账信息
|
||||||
List<BaseLineInfo> baseLineInfos = generalDeviceInfoClient.getBaseLineInfo(lineList).getData();
|
List<AreaLineInfoVO> baseLineInfos = lineFeignClient.getBaseLineAreaInfo(lineList).getData();
|
||||||
//获取越限详情
|
//获取越限详情
|
||||||
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(lineList, param.getStartTime(), param.getEndTime());
|
List<RStatLimitRateDPO> overLimitList = rStatLimitRateDMapper.getAssessTargetRate(lineList, param.getStartTime(), param.getEndTime());
|
||||||
Map<String, RStatLimitRateDPO> map = overLimitList.stream().collect(Collectors.toMap(RStatLimitRateDPO::getLineId, Function.identity()));
|
Map<String, RStatLimitRateDPO> map = overLimitList.stream().collect(Collectors.toMap(RStatLimitRateDPO::getLineId, Function.identity()));
|
||||||
@@ -664,8 +671,8 @@ public class GridServiceImpl implements IGridService {
|
|||||||
qualifiedDetail.setAreaName(item.getGdName());
|
qualifiedDetail.setAreaName(item.getGdName());
|
||||||
qualifiedDetail.setLineName(item.getLineName());
|
qualifiedDetail.setLineName(item.getLineName());
|
||||||
qualifiedDetail.setSubstationName(item.getSubName());
|
qualifiedDetail.setSubstationName(item.getSubName());
|
||||||
if (map.containsKey(item.getId())) {
|
if (map.containsKey(item.getLineId())) {
|
||||||
RStatLimitRateDPO item2 = map.get(item.getId());
|
RStatLimitRateDPO item2 = map.get(item.getLineId());
|
||||||
if (!Objects.isNull(item2) && item2.getAllTime() > 0) {
|
if (!Objects.isNull(item2) && item2.getAllTime() > 0) {
|
||||||
addQualifiedDetail(qualifiedDetail, item2);
|
addQualifiedDetail(qualifiedDetail, item2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,12 +59,13 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
|||||||
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
|
||||||
import com.njcn.harmonic.pojo.vo.PollutionVO;
|
import com.njcn.harmonic.pojo.vo.PollutionVO;
|
||||||
import com.njcn.harmonic.pojo.vo.SubstationVo;
|
import com.njcn.harmonic.pojo.vo.SubstationVo;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.PollutionSubstationService;
|
import com.njcn.harmonic.service.PollutionSubstationService;
|
||||||
import com.njcn.poi.excel.ExcelUtil;
|
import com.njcn.poi.excel.ExcelUtil;
|
||||||
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||||
|
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
@@ -340,11 +341,11 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
list.add(pollutionVO);
|
list.add(pollutionVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
/* if (!CollectionUtils.isEmpty(list)) {
|
||||||
List<PollutionVO> listSort = list.stream().filter(x -> x.getData() != 3.14159).sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList());
|
List<PollutionVO> listSort = list.stream().filter(x -> x.getData() != 3.14159).sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList());
|
||||||
listSort.addAll(list.stream().filter(x -> x.getData() == 3.14159).collect(Collectors.toList()));
|
listSort.addAll(list.stream().filter(x -> x.getData() == 3.14159).collect(Collectors.toList()));
|
||||||
return listSort;
|
return listSort;
|
||||||
}
|
}*/
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -711,11 +712,23 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
paramDTO.setLineList(monitorIds);
|
paramDTO.setLineList(monitorIds);
|
||||||
List<PollutionLineDTO> monitorList = lineFeignClient.getLineInfo(paramDTO).getData();
|
List<PollutionLineDTO> monitorList = lineFeignClient.getLineInfo(paramDTO).getData();
|
||||||
Map<String, PollutionLineDTO> monitorMap = monitorList.stream().collect(Collectors.toMap(PollutionLineDTO::getId, Function.identity()));
|
Map<String, PollutionLineDTO> monitorMap = monitorList.stream().collect(Collectors.toMap(PollutionLineDTO::getId, Function.identity()));
|
||||||
|
List<String> objIds = monitorList.stream().map(PollutionLineDTO::getObjId).distinct().collect(Collectors.toList());
|
||||||
|
Map<String, String> objMap = new HashMap<>();
|
||||||
|
if(CollUtil.isNotEmpty(objIds)){
|
||||||
|
List<NewUserReportVO> userReportVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||||
|
objMap = userReportVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getProjectName));
|
||||||
|
}
|
||||||
|
Map<String, String> finalObjMap = objMap;
|
||||||
list = result.stream().map(it -> {
|
list = result.stream().map(it -> {
|
||||||
PollutionLineDTO pollutionLineDTO = new PollutionLineDTO();
|
PollutionLineDTO pollutionLineDTO = new PollutionLineDTO();
|
||||||
pollutionLineDTO.setData(NumberUtil.round(it.getData(), 2).doubleValue());
|
pollutionLineDTO.setData(NumberUtil.round(it.getData(), 2).doubleValue());
|
||||||
PollutionLineDTO monitor = monitorMap.get(it.getId());
|
PollutionLineDTO monitor = monitorMap.get(it.getId());
|
||||||
pollutionLineDTO.setName(monitor.getSubstation() + "_" + monitor.getName());
|
if(StrUtil.isNotBlank(monitor.getObjId())){
|
||||||
|
String objName = finalObjMap.get(monitor.getObjId());
|
||||||
|
pollutionLineDTO.setName(objName + "_" + monitor.getName());
|
||||||
|
}else {
|
||||||
|
pollutionLineDTO.setName(monitor.getSubstation() + "_" + monitor.getName());
|
||||||
|
}
|
||||||
return pollutionLineDTO;
|
return pollutionLineDTO;
|
||||||
}).sorted(Comparator.comparing(PollutionLineDTO::getData, Comparator.reverseOrder())).collect(Collectors.toList());
|
}).sorted(Comparator.comparing(PollutionLineDTO::getData, Comparator.reverseOrder())).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1024,6 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
@Override
|
@Override
|
||||||
public List<LinePollution> downPollutionLineCalc(StatSubstationBizBaseParam param) {
|
public List<LinePollution> downPollutionLineCalc(StatSubstationBizBaseParam param) {
|
||||||
DeviceInfoParam deviceInfoParam=new DeviceInfoParam();
|
DeviceInfoParam deviceInfoParam=new DeviceInfoParam();
|
||||||
deviceInfoParam.setLineRunFlag(0);
|
|
||||||
deviceInfoParam.setDeptIndex(param.getId());
|
deviceInfoParam.setDeptIndex(param.getId());
|
||||||
deviceInfoParam.setStatisticalType(new SimpleDTO());
|
deviceInfoParam.setStatisticalType(new SimpleDTO());
|
||||||
List<GeneralDeviceDTO> data1 = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
|
List<GeneralDeviceDTO> data1 = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
|
||||||
|
|||||||
@@ -167,12 +167,16 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
|
|||||||
List<GridDiagramVO.StatisticsData> statisticsData = new ArrayList<>();
|
List<GridDiagramVO.StatisticsData> statisticsData = new ArrayList<>();
|
||||||
List<GridDiagramVO.StatisticsData> gwStatisticsData = new ArrayList<>();
|
List<GridDiagramVO.StatisticsData> gwStatisticsData = new ArrayList<>();
|
||||||
|
|
||||||
|
List<String> idsList = new ArrayList<>();
|
||||||
|
int allNum = 0;
|
||||||
for(String voltage:voltageIds){
|
for(String voltage:voltageIds){
|
||||||
GridDiagramVO.StatisticsData voltageItem = new GridDiagramVO.StatisticsData();
|
GridDiagramVO.StatisticsData voltageItem = new GridDiagramVO.StatisticsData();
|
||||||
voltageItem.setColumnName(voltage);
|
voltageItem.setColumnName(voltage);
|
||||||
if(voltageMonitorMap.containsKey(voltage)){
|
if(voltageMonitorMap.containsKey(voltage)){
|
||||||
List<String> ids = voltageMonitorMap.get(voltage).stream().map(LineDevGetDTO::getObjId).distinct().collect(Collectors.toList());
|
List<String> ids = voltageMonitorMap.get(voltage).stream().map(LineDevGetDTO::getObjId).distinct().collect(Collectors.toList());
|
||||||
voltageItem.setNumOne((long)ids.size());
|
voltageItem.setNumOne((long)ids.size());
|
||||||
|
allNum+=ids.size();
|
||||||
|
idsList.addAll(ids);
|
||||||
voltageItem.setNumOneList(ids);
|
voltageItem.setNumOneList(ids);
|
||||||
}else {
|
}else {
|
||||||
voltageItem.setNumOne(0L);
|
voltageItem.setNumOne(0L);
|
||||||
@@ -180,6 +184,10 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
|
|||||||
}
|
}
|
||||||
statisticsData.add(voltageItem);
|
statisticsData.add(voltageItem);
|
||||||
}
|
}
|
||||||
|
GridDiagramVO.StatisticsData dataSum = new GridDiagramVO.StatisticsData();
|
||||||
|
dataSum.setNumOneList(idsList);
|
||||||
|
dataSum.setNumOne((long)allNum);
|
||||||
|
statisticsData.add(dataSum);
|
||||||
lineStatistics.setData(statisticsData);
|
lineStatistics.setData(statisticsData);
|
||||||
gwLineStatistics.setData(gwStatisticsData);
|
gwLineStatistics.setData(gwStatisticsData);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import com.njcn.harmonic.pojo.param.TotalLimitStatisticsDetailsQueryParam;
|
|||||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsParam;
|
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.vo.*;
|
import com.njcn.harmonic.pojo.vo.*;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
import com.njcn.harmonic.service.IRStatLimitRateDService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
@@ -186,12 +186,12 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
|||||||
mainLineVO.setLineId(lineId);
|
mainLineVO.setLineId(lineId);
|
||||||
if (linePO != null) {
|
if (linePO != null) {
|
||||||
mainLineVO.setLineName(linePO.getName());
|
mainLineVO.setLineName(linePO.getName());
|
||||||
if (linePO.getGovern().equals(0)) {
|
// if (linePO.getGovern().equals(0)) {
|
||||||
mainLineVO.setGovern("未治理");
|
// mainLineVO.setGovern("未治理");
|
||||||
}
|
// }
|
||||||
if (linePO.getGovern().equals(1)) {
|
// if (linePO.getGovern().equals(1)) {
|
||||||
mainLineVO.setGovern("已治理");
|
// mainLineVO.setGovern("已治理");
|
||||||
}
|
// }
|
||||||
mainLineVO.setObjType(linePO.getMonitorObj());
|
mainLineVO.setObjType(linePO.getMonitorObj());
|
||||||
DictData dictData = dicDataFeignClient.getDicDataById(linePO.getMonitorObj()).getData();
|
DictData dictData = dicDataFeignClient.getDicDataById(linePO.getMonitorObj()).getData();
|
||||||
if (dictData != null) {
|
if (dictData != null) {
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
package com.njcn.harmonic.service.impl;
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.lang.Pair;
|
import cn.hutool.core.lang.Pair;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.AbnormalData;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailTimeDto;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.pq.api.OverLimitClient;
|
import com.njcn.device.pq.api.OverLimitClient;
|
||||||
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
||||||
@@ -30,10 +35,13 @@ import com.njcn.harmonic.service.IRStatLimitRateDetailDService;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -381,6 +389,76 @@ public class RStatLimitRateDetailDServiceImpl extends ServiceImpl<RStatLimitRate
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataLimitRateDetailTimeDto> getLimitRateDetailTime(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataLimitRateDetailTimeDto> info = new ArrayList<>();
|
||||||
|
LambdaQueryWrapper<RStatLimitRateDetailDPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()), RStatLimitRateDetailDPO::getLineId, lineParam.getLineId())
|
||||||
|
.between(RStatLimitRateDetailDPO::getTime, lineParam.getStartTime(),lineParam.getEndTime())
|
||||||
|
// .le(RStatLimitRateDetailDPO::getTime, )
|
||||||
|
// .orderByAsc(RStatLimitRateDetailDPO::getTime)
|
||||||
|
;
|
||||||
|
|
||||||
|
List<RStatLimitRateDetailDPO> list = this.list(lambdaQueryWrapper);
|
||||||
|
DataLimitRateDetailTimeDto dto;
|
||||||
|
for (RStatLimitRateDetailDPO detailD : list) {
|
||||||
|
dto = new DataLimitRateDetailTimeDto();
|
||||||
|
dto.setLineId(detailD.getLineId());
|
||||||
|
dto.setTime(detailD.getTime().format((DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN))));
|
||||||
|
dto.setFlickerOvertime(toList(detailD.getFlickerOvertime()));
|
||||||
|
dto.setFreqDevOvertime(toList(detailD.getFreqDevOvertime()));
|
||||||
|
dto.setVoltageDevOvertime(toList(detailD.getVoltageDevOvertime()));
|
||||||
|
dto.setUbalanceOvertime(toList(detailD.getUbalanceOvertime()));
|
||||||
|
dto.setUaberranceOvertime(toList(detailD.getUaberranceOvertime()));
|
||||||
|
dto.setINegOvertime(toList(detailD.getINegOvertime()));
|
||||||
|
dto.setUharmOvertime(toList(detailD,2,25,"getUharm"));
|
||||||
|
dto.setIharmOvertime(toList(detailD,2,25,"getIharm"));
|
||||||
|
dto.setInuharmOvertime(toList(detailD,1,16,"getInuharm"));
|
||||||
|
info.add(dto);
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> toList(RStatLimitRateDetailDPO detailD,Integer start, Integer end, String targetName){
|
||||||
|
List<AbnormalData.Json> json = new ArrayList<>();
|
||||||
|
for (int i = start; i <= end; i++) {
|
||||||
|
// 构造方法名
|
||||||
|
String methodName = targetName + i + "Overtime";
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getVx 方法
|
||||||
|
Method getVMethod = RStatLimitRateDetailDPO.class.getMethod(methodName);
|
||||||
|
String value = (String) getVMethod.invoke(detailD);
|
||||||
|
if(StrUtil.isNotBlank(value)){
|
||||||
|
json.addAll(JSON.parseArray(value, AbnormalData.Json.class));
|
||||||
|
}
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getString(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> toList(String json){
|
||||||
|
List<AbnormalData.Json> jsons = JSON.parseArray(json, AbnormalData.Json.class);
|
||||||
|
return getString(jsons);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> getString(List<AbnormalData.Json> jsons) {
|
||||||
|
if (CollUtil.isNotEmpty(jsons)){
|
||||||
|
List<String> times = jsons.stream().map(AbnormalData.Json::getTime).collect(Collectors.toList());
|
||||||
|
String join = String.join(",", times);
|
||||||
|
String[] split = join.split(",");
|
||||||
|
return Arrays.stream(split).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置LimitExtentVO的最大值和相关信息
|
* 设置LimitExtentVO的最大值和相关信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
|||||||
import com.njcn.harmonic.pojo.vo.MonitorOverLimitVO;
|
import com.njcn.harmonic.pojo.vo.MonitorOverLimitVO;
|
||||||
import com.njcn.harmonic.pojo.vo.SteadyExceedRateCensusVO;
|
import com.njcn.harmonic.pojo.vo.SteadyExceedRateCensusVO;
|
||||||
import com.njcn.harmonic.pojo.vo.SteadyExceedRateVO;
|
import com.njcn.harmonic.pojo.vo.SteadyExceedRateVO;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.SteadyExceedRateService;
|
import com.njcn.harmonic.service.SteadyExceedRateService;
|
||||||
import com.njcn.harmonic.utils.PubUtils;
|
import com.njcn.harmonic.utils.PubUtils;
|
||||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import com.njcn.device.pq.enums.LineBaseEnum;
|
|||||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.mapper.SteadyQualifyMapper;
|
import com.njcn.harmonic.mapper.SteadyQualifyMapper;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.vo.SteadyQualifyCensusVO;
|
import com.njcn.harmonic.pojo.vo.SteadyQualifyCensusVO;
|
||||||
@@ -24,7 +24,8 @@ import com.njcn.harmonic.service.SteadyQualifyService;
|
|||||||
import com.njcn.harmonic.utils.PubUtils;
|
import com.njcn.harmonic.utils.PubUtils;
|
||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ import java.util.stream.Collectors;
|
|||||||
* @Description: <描述>
|
* @Description: <描述>
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||||
|
|
||||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||||
@@ -51,6 +52,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
|
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SteadyQualifyVO> getSteadyQualifyData(DeviceInfoParam.BusinessParam steadyParam) {
|
public List<SteadyQualifyVO> getSteadyQualifyData(DeviceInfoParam.BusinessParam steadyParam) {
|
||||||
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
||||||
@@ -304,8 +312,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
//供电公司集合
|
//供电公司集合
|
||||||
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
|
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
|
||||||
dealChildrenData(substationList, otherLineList, temMap, true);
|
dealChildrenData(substationList, otherLineList, temMap, true);
|
||||||
dealChildrenData(powerCompanyList, substationList, temMap, false);
|
|
||||||
return powerCompanyList;
|
if("liaoning".equals(versionUsed)){
|
||||||
|
return substationList;
|
||||||
|
}else {
|
||||||
|
dealChildrenData(powerCompanyList, substationList, temMap, false);
|
||||||
|
return powerCompanyList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ import com.njcn.harmonic.utils.PubUtils;
|
|||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
* @Description: <描述>
|
* @Description: <描述>
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class THDistortionServiceImpl implements THDistortionService {
|
public class THDistortionServiceImpl implements THDistortionService {
|
||||||
|
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
@@ -53,13 +55,19 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
private final RMpVThdMapper rMpVThdMapper;
|
private final RMpVThdMapper rMpVThdMapper;
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam, Integer nodeType) {
|
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam, Integer nodeType) {
|
||||||
List<THDistortionVO> thDistortionVOS = new ArrayList<>();
|
List<THDistortionVO> thDistortionVOS = new ArrayList<>();
|
||||||
|
|
||||||
//按照条件获取实际运行终端综合信息
|
//按照条件获取实际运行终端综合信息
|
||||||
List<GeneralDeviceDTO> deviceList = generalDeviceInfoClient.getPracticalRunDeviceInfo(new DeviceInfoParam(thDistortionParam.getStatisticalType(), thDistortionParam.getDeptIndex(), generalInfo.getMicroServiceName(), thDistortionParam.getScale(), thDistortionParam.getManufacturer(), thDistortionParam.getLoadType())).getData();
|
DeviceInfoParam deviceInfoParam = new DeviceInfoParam(thDistortionParam.getStatisticalType(), thDistortionParam.getDeptIndex(), generalInfo.getMicroServiceName(), thDistortionParam.getScale(), thDistortionParam.getManufacturer(), thDistortionParam.getLoadType());
|
||||||
|
List<GeneralDeviceDTO> deviceList = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
|
||||||
Map<String, UserLedgerVO> userLedgerVOMap = new HashMap<>();
|
Map<String, UserLedgerVO> userLedgerVOMap = new HashMap<>();
|
||||||
if (thDistortionParam.isUserLedger()) {
|
if (thDistortionParam.isUserLedger()) {
|
||||||
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
|
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
|
||||||
@@ -83,15 +91,14 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
//组装父级数据树
|
//组装父级数据树
|
||||||
List<THDistortionVO> treeList = getTreeData(lineIndexes, condition, userLedgerVOMap, thDistortionParam.getPowerFlag());
|
List<THDistortionVO> treeList = getTreeData(lineIndexes, condition, userLedgerVOMap, thDistortionParam.getPowerFlag());
|
||||||
thDistortionVO.setChildren(treeList);
|
thDistortionVO.setChildren(treeList);
|
||||||
|
|
||||||
thDistortionVOS.add(thDistortionVO);
|
thDistortionVOS.add(thDistortionVO);
|
||||||
}
|
}
|
||||||
if (nodeType == 1) {
|
if (nodeType == 1) {
|
||||||
thDistortionVOS.stream().forEach(data -> {
|
thDistortionVOS.forEach(data -> {
|
||||||
if (CollUtil.isNotEmpty(data.getChildren())) {
|
if (CollUtil.isNotEmpty(data.getChildren())) {
|
||||||
//市
|
//市
|
||||||
List<THDistortionVO> sub = data.getChildren().stream().flatMap(dto -> dto.getChildren().stream()).collect(Collectors.toList());
|
List<THDistortionVO> sub = data.getChildren().stream().flatMap(dto -> dto.getChildren().stream()).collect(Collectors.toList());
|
||||||
sub.stream().forEach(x -> {
|
sub.forEach(x -> {
|
||||||
x.setChildren(new ArrayList<>());
|
x.setChildren(new ArrayList<>());
|
||||||
});
|
});
|
||||||
data.setChildren(sub);
|
data.setChildren(sub);
|
||||||
@@ -117,7 +124,7 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
||||||
type.add(thDistortionVO.getName() );
|
type.add(thDistortionVO.getName());
|
||||||
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||||
single.add(thDistortionVO.getDistortion());
|
single.add(thDistortionVO.getDistortion());
|
||||||
}
|
}
|
||||||
@@ -359,17 +366,20 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
//List<THDistortionVO> deviceList = thDistortionMapper.getLineInfoByList(busBarList.stream().map(THDistortionVO::getPid).distinct().collect(Collectors.toList()));
|
//List<THDistortionVO> deviceList = thDistortionMapper.getLineInfoByList(busBarList.stream().map(THDistortionVO::getPid).distinct().collect(Collectors.toList()));
|
||||||
//变电站集合
|
//变电站集合
|
||||||
List<THDistortionVO> substationList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.SUB_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
List<THDistortionVO> substationList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.SUB_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
||||||
//供电公司集合
|
|
||||||
List<THDistortionVO> powerCompanyList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.GD_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(monitorList)) {
|
if (!CollectionUtils.isEmpty(monitorList)) {
|
||||||
setChildesList(substationList, powerLedgerList, userTemList);
|
setChildesList(substationList, powerLedgerList, userTemList);
|
||||||
setFatherDistortion(substationList);
|
setFatherDistortion(substationList);
|
||||||
powerCompanyList = powerCompanyList.stream().peek(item -> item.setChildren(getChildCategoryList(item, substationList))).collect(Collectors.toList());
|
if ("liaoning".equals(versionUsed)) {
|
||||||
// setFatherDistortion(powerCompanyList);
|
return substationList;
|
||||||
setPowerDistortion(powerCompanyList);
|
} else {
|
||||||
|
//供电公司集合
|
||||||
|
List<THDistortionVO> powerCompanyList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.GD_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
||||||
|
powerCompanyList = powerCompanyList.stream().peek(item -> item.setChildren(getChildCategoryList(item, substationList))).collect(Collectors.toList());
|
||||||
|
setPowerDistortion(powerCompanyList);
|
||||||
|
return powerCompanyList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return powerCompanyList;
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.dto.DataHarmrateVDTO;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataHarmRateVDto;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatDataHarmRateVD;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
public interface IDataHarmRateV {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb;
|
||||||
|
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/11/18 11:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface IDataI {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataIDto> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.dto.DataInharmVDTO;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataInHarmVDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatDataInHarmVD;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/11/18 13:27【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface IDataInHarmV {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.dto.DataPltDTO;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatDataPltD;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/11/18 11:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface IDataPlt {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataPltDto> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb;
|
||||||
|
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2024/11/7 10:54
|
||||||
|
*/
|
||||||
|
public interface IDataV {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataVDto> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||||
|
import com.njcn.harmonic.service.influxdb.IDataHarmRateV;
|
||||||
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
|
import com.njcn.influx.imapper.DataHarmRateVMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataHarmRateV;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV {
|
||||||
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
private final DataHarmRateVMapper DataHarmRateVMapper;
|
||||||
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
|
put("AB", "A");
|
||||||
|
put("BC", "B");
|
||||||
|
put("CA", "C");
|
||||||
|
put("M", "T");
|
||||||
|
}};
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private static final Set<String> LINE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("AB", "BC", "CA", "T")));
|
||||||
|
private static final Set<String> PHASE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("A", "B", "C", "T")));
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataHarmDto> result = new ArrayList<>();
|
||||||
|
List<DataHarmRateV> list = getMinuteData(lineParam);
|
||||||
|
list.forEach(item->{
|
||||||
|
DataHarmDto dto = new DataHarmDto();
|
||||||
|
BeanUtils.copyProperties(item,dto);
|
||||||
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按监测点集合、时间条件获取分钟数据
|
||||||
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||||
|
* 1.无异常数据,则直接返回集合;
|
||||||
|
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||||
|
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||||
|
*/
|
||||||
|
public List<DataHarmRateV> getMinuteData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataHarmRateV> dataList;
|
||||||
|
List<DataHarmRateV> result = new ArrayList<>();
|
||||||
|
List<DataHarmRateV> data = new ArrayList<>();
|
||||||
|
//获取监测点、接线方式数据
|
||||||
|
Type type = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
|
Map<String, Integer> map = new Gson().fromJson(
|
||||||
|
String.valueOf(redisUtil.getObjectByKey("wlLineDetail")),
|
||||||
|
type
|
||||||
|
);
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class);
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
|
influxQueryWrapper.regular(DataHarmRateV::getLineId, lineParam.getLineId())
|
||||||
|
.select(DataHarmRateV::getLineId)
|
||||||
|
.select(DataHarmRateV::getPhaseType)
|
||||||
|
.select(DataHarmRateV::getValueType)
|
||||||
|
.select(DataHarmRateV::getQualityFlag)
|
||||||
|
.select(DataHarmRateV::getAbnormalFlag)
|
||||||
|
.between(DataHarmRateV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
|
.eq(DataHarmRateV::getQualityFlag,"0");
|
||||||
|
if(CollUtil.isNotEmpty(lineParam.getPhasicType())){
|
||||||
|
influxQueryWrapper.regular(DataHarmRateV::getPhaseType,lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
List<DataHarmRateV> list = DataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
//过滤掉暂态事件影响的数据 true过滤 false不过滤
|
||||||
|
if (lineParam.getDataType()) {
|
||||||
|
dataList = list.stream().filter(item -> Objects.isNull(item.getAbnormalFlag())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
dataList = list;
|
||||||
|
}
|
||||||
|
Map<String,List<DataHarmRateV>> lineMap = dataList.stream().collect(Collectors.groupingBy(DataHarmRateV::getLineId));
|
||||||
|
//有异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
||||||
|
//有异常数据,当前监测点自身的异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
List<DataHarmRateV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||||
|
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||||
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||||
|
result.addAll(filterList);
|
||||||
|
}
|
||||||
|
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||||
|
else {
|
||||||
|
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
if (!Objects.isNull(map)) {
|
||||||
|
//现根据监测点分组,然后根据接线方式排除多于数据,在修改相别
|
||||||
|
Map<String, List<DataHarmRateV>> lineMap = result.stream().collect(Collectors.groupingBy(DataHarmRateV::getLineId));
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
if (Objects.isNull(map.get(k))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Integer conType = map.get(k);
|
||||||
|
Set<String> validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES;
|
||||||
|
List<DataHarmRateV> result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList());
|
||||||
|
data.addAll(result2);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
data.addAll(result);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
|
data.forEach(item -> {
|
||||||
|
String newType = PHASE_MAPPING.get(item.getPhaseType());
|
||||||
|
if (newType != null) {
|
||||||
|
item.setPhaseType(newType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataIDto;
|
||||||
|
import com.njcn.harmonic.service.influxdb.IDataI;
|
||||||
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
|
import com.njcn.influx.imapper.DataIMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataI;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2026/7/1 10:49
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InfluxdbDataIImpl implements IDataI {
|
||||||
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
|
private final DataIMapper dataIMapper;
|
||||||
|
|
||||||
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
|
put("AB", "A");
|
||||||
|
put("BC", "B");
|
||||||
|
put("CA", "C");
|
||||||
|
put("M", "T");
|
||||||
|
}};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataIDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataIDto> result = new ArrayList<>();
|
||||||
|
List<DataI> list = getMinuteDataI(lineParam);;
|
||||||
|
list.forEach(item->{
|
||||||
|
DataIDto dto = new DataIDto();
|
||||||
|
BeanUtils.copyProperties(item,dto);
|
||||||
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按监测点集合、时间条件获取dataI分钟数据
|
||||||
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||||
|
* 1.无异常数据,则直接返回集合;
|
||||||
|
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||||
|
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||||
|
*/
|
||||||
|
public List<DataI> getMinuteDataI(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataI> dataList;
|
||||||
|
List<DataI> result = new ArrayList<>();
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
|
influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId())
|
||||||
|
.select(DataI::getLineId)
|
||||||
|
.select(DataI::getPhaseType)
|
||||||
|
.select(DataI::getValueType)
|
||||||
|
.select(DataI::getINeg)
|
||||||
|
.select(DataI::getIPos)
|
||||||
|
.select(DataI::getIThd)
|
||||||
|
.select(DataI::getIUnbalance)
|
||||||
|
.select(DataI::getIZero)
|
||||||
|
.select(DataI::getRms)
|
||||||
|
.select(DataI::getQualityFlag)
|
||||||
|
.select(DataI::getAbnormalFlag)
|
||||||
|
.between(DataI::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
|
.eq(DataI::getQualityFlag,"0");
|
||||||
|
if(CollUtil.isNotEmpty(lineParam.getPhasicType())){
|
||||||
|
influxQueryWrapper.regular(DataI::getPhaseType,lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DataI> list = dataIMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
//过滤掉暂态事件影响的数据 true过滤 false不过滤
|
||||||
|
if (lineParam.getDataType()) {
|
||||||
|
dataList = list.stream().filter(item -> Objects.isNull(item.getAbnormalFlag())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
dataList = list;
|
||||||
|
}
|
||||||
|
Map<String,List<DataI>> lineMap = dataList.stream().collect(Collectors.groupingBy(DataI::getLineId));
|
||||||
|
//有异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
||||||
|
//有异常数据,当前监测点自身的异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
List<DataI> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||||
|
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||||
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||||
|
result.addAll(filterList);
|
||||||
|
}
|
||||||
|
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||||
|
else {
|
||||||
|
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
result.forEach(item -> {
|
||||||
|
String newType = PHASE_MAPPING.get(item.getPhaseType());
|
||||||
|
if (newType != null) {
|
||||||
|
item.setPhaseType(newType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
|
||||||
|
import com.njcn.harmonic.service.influxdb.IDataInHarmV;
|
||||||
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
|
import com.njcn.influx.imapper.DataInHarmVMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataInHarmV;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/11/18 14:33【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InfluxdbDataInharmVImpl implements IDataInHarmV {
|
||||||
|
|
||||||
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
private final DataInHarmVMapper DataInHarmVMapper;
|
||||||
|
|
||||||
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
|
put("AB", "A");
|
||||||
|
put("BC", "B");
|
||||||
|
put("CA", "C");
|
||||||
|
put("M", "T");
|
||||||
|
}};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataHarmDto> result = new ArrayList<>();
|
||||||
|
List<DataInHarmV> list = getMinuteData(lineParam);
|
||||||
|
list.forEach(item->{
|
||||||
|
DataHarmDto dto = new DataHarmDto();
|
||||||
|
BeanUtils.copyProperties(item,dto);
|
||||||
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按监测点集合、时间条件获取dataI分钟数据
|
||||||
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||||
|
* 1.无异常数据,则直接返回集合;
|
||||||
|
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||||
|
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||||
|
*/
|
||||||
|
public List<DataInHarmV> getMinuteData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataInHarmV> dataList;
|
||||||
|
List<DataInHarmV> result = new ArrayList<>();
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInHarmV.class);
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
|
influxQueryWrapper.regular(DataInHarmV::getLineId, lineParam.getLineId())
|
||||||
|
.select(DataInHarmV::getLineId)
|
||||||
|
.select(DataInHarmV::getPhaseType)
|
||||||
|
.select(DataInHarmV::getValueType)
|
||||||
|
.select(DataInHarmV::getQualityFlag)
|
||||||
|
.select(DataInHarmV::getAbnormalFlag)
|
||||||
|
.between(DataInHarmV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
|
.eq(DataInHarmV::getQualityFlag,"0");
|
||||||
|
if(CollUtil.isNotEmpty(lineParam.getPhasicType())){
|
||||||
|
influxQueryWrapper.regular(DataInHarmV::getPhaseType,lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
List<DataInHarmV> list = DataInHarmVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
//过滤掉暂态事件影响的数据 true过滤 false不过滤
|
||||||
|
if (lineParam.getDataType()) {
|
||||||
|
dataList = list.stream().filter(item -> Objects.isNull(item.getAbnormalFlag())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
dataList = list;
|
||||||
|
}
|
||||||
|
Map<String,List<DataInHarmV>> lineMap = dataList.stream().collect(Collectors.groupingBy(DataInHarmV::getLineId));
|
||||||
|
//有异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
||||||
|
//有异常数据,当前监测点自身的异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
List<DataInHarmV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||||
|
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||||
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||||
|
result.addAll(filterList);
|
||||||
|
}
|
||||||
|
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||||
|
else {
|
||||||
|
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
result.forEach(item -> {
|
||||||
|
String newType = PHASE_MAPPING.get(item.getPhaseType());
|
||||||
|
if (newType != null) {
|
||||||
|
item.setPhaseType(newType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.influx.pojo.po.DataPlt;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataPltDto;
|
||||||
|
import com.njcn.harmonic.service.influxdb.IDataPlt;
|
||||||
|
import com.njcn.influx.imapper.DataPltMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataV;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/11/18 14:33【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InfluxdbDataPltImpl implements IDataPlt {
|
||||||
|
|
||||||
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
private final DataPltMapper dataPltMapper;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
|
put("AB", "A");
|
||||||
|
put("BC", "B");
|
||||||
|
put("CA", "C");
|
||||||
|
put("M", "T");
|
||||||
|
}};
|
||||||
|
private static final Set<String> LINE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("AB", "BC", "CA", "T")));
|
||||||
|
private static final Set<String> PHASE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("A", "B", "C", "T")));
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataPltDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataPltDto> result = new ArrayList<>();
|
||||||
|
List<DataPlt> list = getMinuteDataPlt(lineParam);
|
||||||
|
list.forEach(item->{
|
||||||
|
DataPltDto dto = new DataPltDto();
|
||||||
|
BeanUtils.copyProperties(item,dto);
|
||||||
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 按监测点集合、时间条件获取dataI分钟数据
|
||||||
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
* 需要进行剔除异常数据时,这里会有三种情况判断
|
||||||
|
* 1.无异常数据,则直接返回集合;
|
||||||
|
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||||
|
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||||
|
*/
|
||||||
|
public List<DataPlt> getMinuteDataPlt(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataPlt> dataList;
|
||||||
|
List<DataPlt> result = new ArrayList<>();
|
||||||
|
List<DataPlt> data = new ArrayList<>();
|
||||||
|
//获取监测点、接线方式数据
|
||||||
|
Type type = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
|
Map<String, Integer> map = new Gson().fromJson(
|
||||||
|
String.valueOf(redisUtil.getObjectByKey("wlLineDetail")),
|
||||||
|
type
|
||||||
|
);
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class);
|
||||||
|
influxQueryWrapper.regular(DataPlt::getLineId, lineParam.getLineId())
|
||||||
|
.select(DataPlt::getLineId)
|
||||||
|
.select(DataPlt::getPhaseType)
|
||||||
|
.select(DataPlt::getPlt)
|
||||||
|
.select(DataPlt::getQualityFlag)
|
||||||
|
.select(DataPlt::getAbnormalFlag)
|
||||||
|
.between(DataPlt::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
|
.eq(DataPlt::getQualityFlag,"0");
|
||||||
|
if(CollUtil.isNotEmpty(lineParam.getPhasicType())){
|
||||||
|
influxQueryWrapper.regular(DataV::getPhaseType,lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
List<DataPlt> list = dataPltMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
if(CollUtil.isNotEmpty(list)){
|
||||||
|
//过滤掉暂态事件影响的数据 true过滤 false不过滤
|
||||||
|
if (lineParam.getDataType()) {
|
||||||
|
dataList = list.stream().filter(item -> Objects.isNull(item.getAbnormalFlag())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
dataList = list;
|
||||||
|
}
|
||||||
|
Map<String,List<DataPlt>> lineMap = dataList.stream().collect(Collectors.groupingBy(DataPlt::getLineId));
|
||||||
|
//有异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
||||||
|
//有异常数据,当前监测点自身的异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
List<DataPlt> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||||
|
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||||
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||||
|
result.addAll(filterList);
|
||||||
|
}
|
||||||
|
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||||
|
else {
|
||||||
|
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
if (!Objects.isNull(map)) {
|
||||||
|
//现根据监测点分组,然后根据接线方式排除多于数据,在修改相别
|
||||||
|
Map<String, List<DataPlt>> lineMap = result.stream().collect(Collectors.groupingBy(DataPlt::getLineId));
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
if (Objects.isNull(map.get(k))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Integer conType = map.get(k);
|
||||||
|
Set<String> validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES;
|
||||||
|
List<DataPlt> result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList());
|
||||||
|
data.addAll(result2);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
data.addAll(result);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
|
data.forEach(item -> {
|
||||||
|
String newType = PHASE_MAPPING.get(item.getPhaseType());
|
||||||
|
if (newType != null) {
|
||||||
|
item.setPhaseType(newType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
package com.njcn.harmonic.service.influxdb.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataVDto;
|
||||||
|
import com.njcn.harmonic.service.influxdb.IDataV;
|
||||||
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
|
import com.njcn.influx.imapper.DataVMapper;
|
||||||
|
import com.njcn.influx.pojo.po.DataV;
|
||||||
|
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2026/7/1 10:49
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class InfluxdbDataVImpl implements IDataV {
|
||||||
|
|
||||||
|
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||||
|
private static final Map<String, String> PHASE_MAPPING = new HashMap<String, String>() {{
|
||||||
|
put("AB", "A");
|
||||||
|
put("BC", "B");
|
||||||
|
put("CA", "C");
|
||||||
|
put("M", "T");
|
||||||
|
}};
|
||||||
|
@Resource
|
||||||
|
private DataVMapper dataVMapper;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
private static final Set<String> LINE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("AB", "BC", "CA", "T")));
|
||||||
|
private static final Set<String> PHASE_VOLTAGE_TYPES =
|
||||||
|
Collections.unmodifiableSet(new HashSet<>(Arrays.asList("A", "B", "C", "T")));
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataVDto> result = new ArrayList<>();
|
||||||
|
List<DataV> list = getMinuteDataV(lineParam);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
list.forEach(item -> {
|
||||||
|
DataVDto dto = new DataVDto();
|
||||||
|
BeanUtils.copyProperties(item, dto);
|
||||||
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按监测点集合、时间条件获取dataV分钟数据
|
||||||
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
* 剔除异常数据,这里会有三种情况判断
|
||||||
|
* 1.无异常数据,则直接返回集合;
|
||||||
|
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||||
|
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||||
|
*/
|
||||||
|
public List<DataV> getMinuteDataV(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataV> result = new ArrayList<>();
|
||||||
|
List<DataV> data = new ArrayList<>();
|
||||||
|
//获取监测点、接线方式数据
|
||||||
|
Type type = new TypeToken<Map<String, Integer>>(){}.getType();
|
||||||
|
Map<String, Integer> map = new Gson().fromJson(
|
||||||
|
String.valueOf(redisUtil.getObjectByKey("wlLineDetail")),
|
||||||
|
type
|
||||||
|
);
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
|
influxQueryWrapper.regular(DataV::getLineId, lineParam.getLineId())
|
||||||
|
.select(DataV::getLineId)
|
||||||
|
.select(DataV::getPhaseType)
|
||||||
|
.select(DataV::getValueType)
|
||||||
|
.select(DataV::getFreq)
|
||||||
|
.select(DataV::getFreqDev)
|
||||||
|
.select(DataV::getRms)
|
||||||
|
.select(DataV::getRmsLvr)
|
||||||
|
.select(DataV::getVNeg)
|
||||||
|
.select(DataV::getVPos)
|
||||||
|
.select(DataV::getVThd)
|
||||||
|
.select(DataV::getVUnbalance)
|
||||||
|
.select(DataV::getVZero)
|
||||||
|
.select(DataV::getVlDev)
|
||||||
|
.select(DataV::getVuDev)
|
||||||
|
.select(DataV::getQualityFlag)
|
||||||
|
.select(DataV::getAbnormalFlag)
|
||||||
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
|
.eq(DataV::getQualityFlag, "0");
|
||||||
|
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
||||||
|
influxQueryWrapper.regular(DataV::getPhaseType, lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
quality(result, influxQueryWrapper, lineParam);
|
||||||
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
|
if (!Objects.isNull(map)) {
|
||||||
|
//现根据监测点分组,然后根据接线方式排除多于数据,在修改相别
|
||||||
|
Map<String, List<DataV>> lineMap = result.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||||
|
lineMap.forEach((k,v)->{
|
||||||
|
if (Objects.isNull(map.get(k))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//这边需要特殊处理下,将线电压数据赋值
|
||||||
|
Map<String, DataV> lineVoltageIndex = v.stream()
|
||||||
|
.filter(d -> PHASE_MAPPING.containsKey(d.getPhaseType()))
|
||||||
|
.filter(d -> d.getRmsLvr() != null)
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
d -> buildKey(d.getTime(), d.getValueType(), d.getPhaseType()),
|
||||||
|
Function.identity(),
|
||||||
|
(existing, replacement) -> existing
|
||||||
|
));
|
||||||
|
v.stream()
|
||||||
|
.filter(d -> PHASE_VOLTAGE_TYPES.contains(d.getPhaseType()))
|
||||||
|
.forEach(phaseData -> {
|
||||||
|
// 根据当前相电压反查对应的线电压相别
|
||||||
|
String targetLinePhasic = getReverseLinePhasic(phaseData.getPhaseType());
|
||||||
|
if (targetLinePhasic == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String key = buildKey(phaseData.getTime(), phaseData.getValueType(), targetLinePhasic);
|
||||||
|
DataV matchedLineData = lineVoltageIndex.get(key);
|
||||||
|
if (matchedLineData != null && matchedLineData.getRmsLvr() != null) {
|
||||||
|
phaseData.setRmsLvr(matchedLineData.getRmsLvr());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Integer conType = map.get(k);
|
||||||
|
Set<String> validPhasicTypes = (conType != 0) ? LINE_VOLTAGE_TYPES : PHASE_VOLTAGE_TYPES;
|
||||||
|
List<DataV> result2 = v.stream().filter(item -> validPhasicTypes.contains(item.getPhaseType())).collect(Collectors.toList());
|
||||||
|
data.addAll(result2);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
data.addAll(result);
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(data)) {
|
||||||
|
data.forEach(item -> {
|
||||||
|
String newType = PHASE_MAPPING.get(item.getPhaseType());
|
||||||
|
if (newType != null) {
|
||||||
|
item.setPhaseType(newType);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
private void quality(List<DataV> result, InfluxQueryWrapper influxQueryWrapper, LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataV> dataList;
|
||||||
|
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
//过滤掉暂态事件影响的数据 true过滤 false不过滤
|
||||||
|
if (lineParam.getDataType()) {
|
||||||
|
dataList = list.stream().filter(item -> Objects.isNull(item.getAbnormalFlag())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
dataList = list;
|
||||||
|
}
|
||||||
|
Map<String, List<DataV>> lineMap = dataList.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||||
|
//有异常数据
|
||||||
|
Map<String, List<String>> timeMap = lineParam.getAbnormalTime();
|
||||||
|
if (CollectionUtil.isNotEmpty(timeMap)) {
|
||||||
|
lineMap.forEach((k, v) -> {
|
||||||
|
List<String> timeList = timeMap.get(k);
|
||||||
|
//有异常数据,当前监测点自身的异常数据
|
||||||
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
List<DataV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
|
||||||
|
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
|
||||||
|
if (CollectionUtil.isNotEmpty(filterList)) {
|
||||||
|
result.addAll(filterList);
|
||||||
|
}
|
||||||
|
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
|
||||||
|
else {
|
||||||
|
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//没有异常数据,则使用原数据
|
||||||
|
else {
|
||||||
|
result.addAll(dataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildKey(Object time, Object valueType, Object phasicType) {
|
||||||
|
return time + "|" + valueType + "|" + phasicType;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getReverseLinePhasic(String phaseType) {
|
||||||
|
if (phaseType == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
switch (phaseType) {
|
||||||
|
case "A":
|
||||||
|
return "AB";
|
||||||
|
case "B":
|
||||||
|
return "BC";
|
||||||
|
case "C":
|
||||||
|
return "CA";
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
|||||||
import com.njcn.harmonic.pojo.vo.MonitorLimitRateVO;
|
import com.njcn.harmonic.pojo.vo.MonitorLimitRateVO;
|
||||||
import com.njcn.harmonic.pojo.vo.PwLimitDataVO;
|
import com.njcn.harmonic.pojo.vo.PwLimitDataVO;
|
||||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.IRStatLimitTargetDService;
|
import com.njcn.harmonic.service.IRStatLimitTargetDService;
|
||||||
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
||||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
private final String STR_FOUR = "%";
|
private final String STR_FOUR = "%";
|
||||||
private final String UVOLTAGE_DEV = "UVOLTAGE_DEV";
|
private final String UVOLTAGE_DEV = "UVOLTAGE_DEV";
|
||||||
private final String VOLTAGE_DEV = "VOLTAGE_DEV";
|
private final String VOLTAGE_DEV = "VOLTAGE_DEV";
|
||||||
|
private final String PT = "PT";
|
||||||
|
private final String CT = "CT";
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getCustomReport(ReportSearchParam reportSearchParam, HttpServletResponse response) {
|
public void getCustomReport(ReportSearchParam reportSearchParam, HttpServletResponse response) {
|
||||||
@@ -126,6 +129,8 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
DeviceUnitCommDTO deviceUnitCommDTO = BeanUtil.copyProperties(deviceUnit, DeviceUnitCommDTO.class);
|
DeviceUnitCommDTO deviceUnitCommDTO = BeanUtil.copyProperties(deviceUnit, DeviceUnitCommDTO.class);
|
||||||
|
|
||||||
Map<String,String> finalTerminalMap = convertKeysToUpperCase(commTerminalGeneralClient.getCustomDetailByLineId(reportSearchParam.getLineId()).getData());
|
Map<String,String> finalTerminalMap = convertKeysToUpperCase(commTerminalGeneralClient.getCustomDetailByLineId(reportSearchParam.getLineId()).getData());
|
||||||
|
finalTerminalMap.put(PT,formatSciNumber(finalTerminalMap.getOrDefault(PT,"N/A")));
|
||||||
|
finalTerminalMap.put(CT,formatSciNumber(finalTerminalMap.getOrDefault(CT,"N/A")));
|
||||||
customReportTableService.getCustomReport(reportSearchParam,finalTerminalMap,deviceUnitCommDTO, response);
|
customReportTableService.getCustomReport(reportSearchParam,finalTerminalMap,deviceUnitCommDTO, response);
|
||||||
} else {
|
} else {
|
||||||
//浙江无线报表
|
//浙江无线报表
|
||||||
@@ -1462,6 +1467,28 @@ public class CustomReportServiceImpl implements CustomReportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析科学计数字符串,转为完整数字文本,原有小数原样保留
|
||||||
|
* @param numStr 数据库返回字符串:123.00 / 1.234E+08 / N/A
|
||||||
|
* @return 标准数字字符串
|
||||||
|
*/
|
||||||
|
public String formatSciNumber(String numStr) {
|
||||||
|
// 空值或占位符直接返回
|
||||||
|
if (numStr == null || "N/A".equals(numStr.trim())) {
|
||||||
|
return numStr;
|
||||||
|
}
|
||||||
|
// 判断是否为科学计数格式
|
||||||
|
if (numStr.toLowerCase().contains("e")) {
|
||||||
|
// BigDecimal 可完美解析科学计数,输出完整数字,保留全部小数位
|
||||||
|
String [] split =numStr.split(":");
|
||||||
|
BigDecimal one = new BigDecimal(split[0]);
|
||||||
|
BigDecimal two = new BigDecimal(split[1]);
|
||||||
|
return (one.toPlainString().concat(":").concat(two.toPlainString()));
|
||||||
|
}
|
||||||
|
return numStr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
|||||||
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.UploadEvaluationDataVo;
|
import com.njcn.harmonic.pojo.vo.upload.UploadEvaluationDataVo;
|
||||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
import com.njcn.harmonic.common.mapper.RStatLimitRateDMapper;
|
||||||
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
import com.njcn.harmonic.service.upload.IEvaluationDataService;
|
||||||
import com.njcn.harmonic.service.upload.IRUploadDataLogService;
|
import com.njcn.harmonic.service.upload.IRUploadDataLogService;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user