1.bug调整
This commit is contained in:
@@ -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("暂降事件不可为空");
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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.*
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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/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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1505,8 +1505,8 @@
|
|||||||
<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,
|
CONCAT(CONCAT(CONCAT(sub.NAME, '_'), vo.NAME), CONCAT('_', line.NAME)) AS lineName,
|
||||||
CONCAT(CONCAT(COALESCE(detail.pt1, 'N/A'), ':'), COALESCE(detail.pt2, 'N/A')) AS pt,
|
CONCAT(detail.pt1, ':', detail.pt2) AS pt,
|
||||||
CONCAT(CONCAT(COALESCE(detail.ct1, 'N/A'), ':'), COALESCE(detail.ct2, 'N/A')) AS ct,
|
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,
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getCustomReport(ReportSearchParam reportSearchParam, Map<String, String> newMap, DeviceUnitCommDTO deviceUnitCommDTO, HttpServletResponse response) {
|
public void getCustomReport(ReportSearchParam reportSearchParam, Map<String, String> ledgerMap, DeviceUnitCommDTO deviceUnitCommDTO, HttpServletResponse response) {
|
||||||
TimeInterval timeInterval = new TimeInterval();
|
TimeInterval timeInterval = new TimeInterval();
|
||||||
ExcelRptTemp excelRptTemp = excelRptTempMapper.selectById(reportSearchParam.getTempId());
|
ExcelRptTemp excelRptTemp = excelRptTempMapper.selectById(reportSearchParam.getTempId());
|
||||||
if (Objects.isNull(excelRptTemp)) {
|
if (Objects.isNull(excelRptTemp)) {
|
||||||
@@ -100,7 +100,7 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
}
|
}
|
||||||
if (Objects.isNull(reportSearchParam.getCustomType())) {
|
if (Objects.isNull(reportSearchParam.getCustomType())) {
|
||||||
//通用报表
|
//通用报表
|
||||||
analyzeReport(reportSearchParam, excelRptTemp, newMap, deviceUnitCommDTO, response);
|
analyzeReport(reportSearchParam, excelRptTemp, ledgerMap, deviceUnitCommDTO, response);
|
||||||
|
|
||||||
log.info("报表执行时间{}秒", timeInterval.intervalSecond());
|
log.info("报表执行时间{}秒", timeInterval.intervalSecond());
|
||||||
}
|
}
|
||||||
@@ -565,7 +565,7 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
* @date 2023/10/8
|
* @date 2023/10/8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void analyzeReport(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp, Map<String, String> newMap, DeviceUnitCommDTO deviceUnitCommDTO, HttpServletResponse response) {
|
private void analyzeReport(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp, Map<String, String> ledgerMap, DeviceUnitCommDTO deviceUnitCommDTO, HttpServletResponse response) {
|
||||||
//定义一个线程集合
|
//定义一个线程集合
|
||||||
List<Future<?>> futures = new ArrayList<>();
|
List<Future<?>> futures = new ArrayList<>();
|
||||||
//指标
|
//指标
|
||||||
@@ -651,13 +651,13 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
phaseMap.forEach((phaseKey, phaseVal) -> {
|
phaseMap.forEach((phaseKey, phaseVal) -> {
|
||||||
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
|
||||||
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
|
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
|
||||||
assembleSqlAndQuery(tMap, newMap.get("LEVEL"), newMap.get("PT"), newMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList, tableMap);
|
assembleSqlAndQuery(tMap, ledgerMap.get("LEVEL"), ledgerMap.get("PT"), ledgerMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList, tableMap);
|
||||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
|
||||||
assembleSqlAndQuery(tMap, newMap.get("LEVEL"), newMap.get("PT"), newMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList, tableMap);
|
assembleSqlAndQuery(tMap, ledgerMap.get("LEVEL"), ledgerMap.get("PT"), ledgerMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList, tableMap);
|
||||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
|
||||||
assembleSqlAndQuery(tMap, newMap.get("LEVEL"), newMap.get("PT"), newMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList,tableMap);
|
assembleSqlAndQuery(tMap, ledgerMap.get("LEVEL"), ledgerMap.get("PT"), ledgerMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.AVG_WEB, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList,tableMap);
|
||||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
|
||||||
assembleSqlAndQuery(tMap, newMap.get("LEVEL"), newMap.get("PT"), newMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList,tableMap);
|
assembleSqlAndQuery(tMap, ledgerMap.get("LEVEL"), ledgerMap.get("PT"), ledgerMap.get("CT"), phaseVal, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, noPhaseList,tableMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -681,7 +681,7 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
//处理指标最终判定合格还是不合格
|
//处理指标最终判定合格还是不合格
|
||||||
dealTargetResult(assNoPassMap, limitTargetMapX, endList);
|
dealTargetResult(assNoPassMap, limitTargetMapX, endList);
|
||||||
}
|
}
|
||||||
resultAssemble(endList, reportSearchParam, newMap, deviceUnitCommDTO, jsonArray);
|
resultAssemble(endList, reportSearchParam, ledgerMap, deviceUnitCommDTO, jsonArray);
|
||||||
//导出自定义报表
|
//导出自定义报表
|
||||||
downReport(jsonArray, response);
|
downReport(jsonArray, response);
|
||||||
}
|
}
|
||||||
@@ -1305,68 +1305,70 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
data = data.stream().peek(item -> item.setValue("/")).collect(Collectors.toList());
|
data = data.stream().peek(item -> item.setValue("/")).collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
// 兼容达梦数据库方法
|
// 兼容达梦数据库方法
|
||||||
Map<String, Object> map = convertKeysToUpperCase(mapList.get(0));
|
if(Objects.nonNull(mapList.get(0))) {
|
||||||
for (ReportTemplateDTO item : data) {
|
Map<String, Object> map = convertKeysToUpperCase(mapList.get(0));
|
||||||
if (map.containsKey(item.getItemName())) {
|
for (ReportTemplateDTO item : data) {
|
||||||
double v = Double.parseDouble(map.get(item.getItemName()).toString());
|
if (map.containsKey(item.getItemName())) {
|
||||||
item.setValue(String.format("%.3f", v));
|
double v = Double.parseDouble(map.get(item.getItemName()).toString());
|
||||||
|
item.setValue(String.format("%.3f", v));
|
||||||
|
|
||||||
// 处理overLimitMap越限判断
|
// 处理overLimitMap越限判断
|
||||||
if (overLimitMap != null && overLimitMap.containsKey(item.getLimitName())) {
|
if (overLimitMap != null && overLimitMap.containsKey(item.getLimitName())) {
|
||||||
Float tagVal = overLimitMap.get(item.getLimitName());
|
Float tagVal = overLimitMap.get(item.getLimitName());
|
||||||
|
|
||||||
if (item.getLimitName() != null && item.getLimitName().equalsIgnoreCase(UVOLTAGE_DEV)) {
|
if (item.getLimitName() != null && item.getLimitName().equalsIgnoreCase(UVOLTAGE_DEV)) {
|
||||||
// 对电压偏差特殊处理
|
// 对电压偏差特殊处理
|
||||||
Float tagVal_U = overLimitMap.get(UVOLTAGE_DEV);
|
Float tagVal_U = overLimitMap.get(UVOLTAGE_DEV);
|
||||||
if (v > tagVal || v < tagVal_U) {
|
if (v > tagVal || v < tagVal_U) {
|
||||||
item.setOverLimitFlag(1);
|
item.setOverLimitFlag(1);
|
||||||
} else {
|
} else {
|
||||||
item.setOverLimitFlag(0);
|
item.setOverLimitFlag(0);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (v > tagVal) {
|
|
||||||
item.setOverLimitFlag(1);
|
|
||||||
} else {
|
|
||||||
item.setOverLimitFlag(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断是否越限(limitMap处理)
|
|
||||||
if (limitMap != null && !limitMap.isEmpty()) {
|
|
||||||
String key = item.getLimitName() + STR_ONE + item.getStatMethod() + "#PQ_OVERLIMIT";
|
|
||||||
if (limitMap.containsKey(key)) {
|
|
||||||
ReportTemplateDTO tem = limitMap.get(key);
|
|
||||||
double limitVal = Double.parseDouble(tem.getValue());
|
|
||||||
|
|
||||||
if (VOLTAGE_DEV.equalsIgnoreCase(tem.getLimitName())) {
|
|
||||||
// 针对电压偏差特殊处理
|
|
||||||
double limitLowVal = Double.parseDouble(tem.getLowValue());
|
|
||||||
if (v > limitVal || v < limitLowVal) {
|
|
||||||
tem.setOverLimitFlag(1);
|
|
||||||
if (assNoPassMap != null) {
|
|
||||||
assNoPassMap.put(key, tem);
|
|
||||||
}
|
|
||||||
} else if (assNoPassMap != null && !assNoPassMap.containsKey(key)) {
|
|
||||||
tem.setOverLimitFlag(0);
|
|
||||||
assNoPassMap.put(key, tem);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 其他指标
|
if (v > tagVal) {
|
||||||
if (v > limitVal) {
|
item.setOverLimitFlag(1);
|
||||||
tem.setOverLimitFlag(1);
|
} else {
|
||||||
if (assNoPassMap != null) {
|
item.setOverLimitFlag(0);
|
||||||
assNoPassMap.put(key, tem);
|
|
||||||
}
|
|
||||||
} else if (assNoPassMap != null && !assNoPassMap.containsKey(key)) {
|
|
||||||
tem.setOverLimitFlag(0);
|
|
||||||
assNoPassMap.put(key, tem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断是否越限(limitMap处理)
|
||||||
|
if (limitMap != null && !limitMap.isEmpty()) {
|
||||||
|
String key = item.getLimitName() + STR_ONE + item.getStatMethod() + "#PQ_OVERLIMIT";
|
||||||
|
if (limitMap.containsKey(key)) {
|
||||||
|
ReportTemplateDTO tem = limitMap.get(key);
|
||||||
|
double limitVal = Double.parseDouble(tem.getValue());
|
||||||
|
|
||||||
|
if (VOLTAGE_DEV.equalsIgnoreCase(tem.getLimitName())) {
|
||||||
|
// 针对电压偏差特殊处理
|
||||||
|
double limitLowVal = Double.parseDouble(tem.getLowValue());
|
||||||
|
if (v > limitVal || v < limitLowVal) {
|
||||||
|
tem.setOverLimitFlag(1);
|
||||||
|
if (assNoPassMap != null) {
|
||||||
|
assNoPassMap.put(key, tem);
|
||||||
|
}
|
||||||
|
} else if (assNoPassMap != null && !assNoPassMap.containsKey(key)) {
|
||||||
|
tem.setOverLimitFlag(0);
|
||||||
|
assNoPassMap.put(key, tem);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他指标
|
||||||
|
if (v > limitVal) {
|
||||||
|
tem.setOverLimitFlag(1);
|
||||||
|
if (assNoPassMap != null) {
|
||||||
|
assNoPassMap.put(key, tem);
|
||||||
|
}
|
||||||
|
} else if (assNoPassMap != null && !assNoPassMap.containsKey(key)) {
|
||||||
|
tem.setOverLimitFlag(0);
|
||||||
|
assNoPassMap.put(key, tem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item.setValue("/");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
item.setValue("/");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1486,7 +1488,7 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
|
|||||||
} else if (v.charAt(0) == '&') {
|
} else if (v.charAt(0) == '&') {
|
||||||
//结论
|
//结论
|
||||||
String tem = v.replace(STR_THREE, "").toUpperCase();
|
String tem = v.replace(STR_THREE, "").toUpperCase();
|
||||||
if (finalTerminalMap.size() > 0) {
|
if (!finalTerminalMap.isEmpty()) {
|
||||||
if ("STATIS_TIME".equals(tem)) {
|
if ("STATIS_TIME".equals(tem)) {
|
||||||
//如何时间是大于当前时间则用当前时间
|
//如何时间是大于当前时间则用当前时间
|
||||||
String localTime = InfluxDbSqlConstant.END_TIME;
|
String localTime = InfluxDbSqlConstant.END_TIME;
|
||||||
|
|||||||
Reference in New Issue
Block a user