Commit af3efeb4 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 8aa291c4 0b9d46d3
......@@ -102,6 +102,7 @@ public class KafkaAnalyseController {
@ApiOperation(httpMethod = "POST", value = "中心值 - 光伏 - 新", notes = "工况划分 - 光伏 - 新")
public ResponseModel<Object> getPvConditionVariablesZXZ() {
if (redisUtils.hasKey(kafkaTopicConsumerZXZPv)) {
// redisUtils.del(kafkaTopicConsumerZXZPv);
return ResponseHelper.buildResponse("计算中");
}
fanConditionVariablesMessage.getPvConditionVariablesZXZ();
......
......@@ -85,6 +85,6 @@ public class FanConditionVariablesMessage {
@Async
public void getPvConditionVariablesZXZ() {
List<IdxBizPvPointProcessVariableClassification> fenxiList = idxBizPvPointProcessVariableClassificationMapper.selectList(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().isNotNull("SEQUENCE_NBR").eq("TAG_CODE", "分析变量"));
fenxiList.forEach(item -> kafkaProducerService.sendMessageAsync(kafkaTopicConsumerZXZFan, JSON.toJSONString(item)));
fenxiList.forEach(item -> kafkaProducerService.sendMessageAsync(kafkaTopicConsumerZXZPv, JSON.toJSONString(item)));
}
}
......@@ -715,7 +715,7 @@ public class KafkaConsumerService {
if (kafkaMessage.isPresent()) {
IdxBizPvPointProcessVariableClassification pvPointProcessVariable = JSON.parseObject(kafkaMessage.get().toString(), IdxBizPvPointProcessVariableClassification.class);
List<IdxBizFanPointVarCorrelation> gongkuangList = idxBizFanPointVarCorrelationService.list(new QueryWrapper<IdxBizFanPointVarCorrelation>().eq("ANALYSIS_GATEWAY_ID", pvPointProcessVariable.getGatewayId()).eq("ANALYSIS_POINT_ID", pvPointProcessVariable.getSequenceNbr()).orderByDesc("CORRELATION_COEFFICIENT").last("limit 3"));
List<IdxBizPvPointVarCorrelation> gongkuangList = idxBizPvPointVarCorrelationService.list(new QueryWrapper<IdxBizPvPointVarCorrelation>().eq("ANALYSIS_GATEWAY_ID", pvPointProcessVariable.getGatewayId()).eq("ANALYSIS_POINT_ID", pvPointProcessVariable.getSequenceNbr()).orderByDesc("CORRELATION_COEFFICIENT").last("limit 3"));
List<String> processPointIds = gongkuangList.stream().map(idxBizFanPointVarCorrelation -> idxBizFanPointVarCorrelation.getProcessPointId().toString()).collect(Collectors.toList());
List<IdxBizPvPointProcessVariableClassification> idxBizPvPointProcessVariableClassificationList = idxBizPvPointProcessVariableClassificationService.list(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().in("SEQUENCE_NBR", processPointIds));
......@@ -736,7 +736,7 @@ public class KafkaConsumerService {
}
});
buildZXZPvExecData(consumerRecords, gatewayPoints, zxzIds, "ZXZFanConsumer");
buildZXZPvExecData(consumerRecords, gatewayPoints, zxzIds, "ZXZPvConsumer");
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -219,13 +219,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
likeMap.put("systemType", systemType);
}
List<ESEquipments> result = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
List<String> needDisplayDisplayNameFrontModule = Arrays.asList("箱变");
List<String> needDisplayDisplayNameSystemType = Arrays.asList("实时运行数据");
result.stream().forEach(e -> {
e.setValue(String.format(CommonConstans.Twodecimalplaces, e.getValueF()));
});
Collator instance = Collator.getInstance(Locale.CHINA);
if (needDisplayDisplayNameSystemType.contains(systemType) && needDisplayDisplayNameFrontModule.contains(frontModule)) {
result.sort(Comparator.comparing(ESEquipments::getTraceId,Comparator.comparingInt(Integer::parseInt)));
} else {
Collections.sort(result, (e1, e2) -> {
return instance.compare(e1.getEquipmentIndexName(), e2.getEquipmentIndexName());
});
}
List<ESEquipments> collect = result.stream()
.skip((long) (current - 1) * size)
.limit(size)
......@@ -1126,37 +1132,37 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ArrayList<Map<String, String>> resultList1 = new ArrayList<>();
List<String> nameList = new ArrayList<>();
Map<String, String> handleData = new HashMap<>();
Map<String,List<String>> originalData = new HashMap<>();
Map<String, List<String>> originalData = new HashMap<>();
if ("FDZ".equals(stationBasic.getStationType())) {
handleData = windSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, esEquipments -> String.format(CommonConstans.Threedecimalplaces, esEquipments.getValueF())));
nameList = CommonConstans.xiazaoElectricityMeter;
originalData = CommonConstans.xiazaoElectricityMeterPointSort;
} else {
handleData=windSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, esEquipments -> String.format(CommonConstans.Twodecimalplaces, esEquipments.getValueF()*0.01)));
handleData = windSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, esEquipments -> String.format(CommonConstans.Twodecimalplaces, esEquipments.getValueF() * 0.01)));
nameList = CommonConstans.taiheElectricityMeter;
originalData= CommonConstans.taiheElectricityMeterPointSort;
originalData = CommonConstans.taiheElectricityMeterPointSort;
}
for (int i = 0; i < nameList.size(); i++) {
HashMap<String, String> stringStringHashMap = new HashMap<>();
String name = nameList.get(i);
stringStringHashMap.put("name",name);
stringStringHashMap.put("name", name);
Double electricityIndicator = 1.0;
List<String> dataList = originalData.get(name);
stringStringHashMap.put("zxzyg",handleData.get(dataList.get(0)));
stringStringHashMap.put("fxzyg",handleData.get(dataList.get(1)));
stringStringHashMap.put("zxzwg",handleData.get(dataList.get(2)));
stringStringHashMap.put("fxzwg",handleData.get(dataList.get(3)));
if(name.equals("夏雩线212主表")){
stringStringHashMap.put("zxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(0)))*0.001));
stringStringHashMap.put("fxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(1)))*0.001));
stringStringHashMap.put("zxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(2)))*0.001));
stringStringHashMap.put("fxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(3)))*0.001));
}
if(name.equals("夏雩线212副表")){
stringStringHashMap.put("zxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(0)))*0.01));
stringStringHashMap.put("fxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(1)))*0.01));
stringStringHashMap.put("zxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(2)))*0.01));
stringStringHashMap.put("fxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(3)))*0.01));
stringStringHashMap.put("zxzyg", handleData.get(dataList.get(0)));
stringStringHashMap.put("fxzyg", handleData.get(dataList.get(1)));
stringStringHashMap.put("zxzwg", handleData.get(dataList.get(2)));
stringStringHashMap.put("fxzwg", handleData.get(dataList.get(3)));
if (name.equals("夏雩线212主表")) {
stringStringHashMap.put("zxzyg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(0))) * 0.001));
stringStringHashMap.put("fxzyg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(1))) * 0.001));
stringStringHashMap.put("zxzwg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(2))) * 0.001));
stringStringHashMap.put("fxzwg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(3))) * 0.001));
}
if (name.equals("夏雩线212副表")) {
stringStringHashMap.put("zxzyg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(0))) * 0.01));
stringStringHashMap.put("fxzyg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(1))) * 0.01));
stringStringHashMap.put("zxzwg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(2))) * 0.01));
stringStringHashMap.put("fxzwg", String.format(CommonConstans.Threedecimalplaces, Double.valueOf(handleData.get(dataList.get(3))) * 0.01));
}
resultList.add(stringStringHashMap);
}
......@@ -1367,12 +1373,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondition.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondition.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondition, null, ESEquipments.class);
List<String> displayName = Arrays.asList("Ua","Ub","Uc");
List<String> displayName = Arrays.asList("Ua", "Ub", "Uc");
// 10kVⅡ段母线数据
List<ESEquipments> xianData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().contains("35kVⅠ母PT")&&!displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
List<ESEquipments> xianData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().contains("35kVⅠ母PT") && !displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
HashMap<String, Object> resultMap = new HashMap<>();
xianData.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
List<ESEquipments> xianData1 = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().contains("南瑞光差保护_313")&&displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
List<ESEquipments> xianData1 = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getEquipmentIndexName().contains("南瑞光差保护_313") && displayName.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
xianData1.forEach(item -> resultMap.put(item.getDisplayName(), keepTwoDecimalPlaces(item.getValueF().toString())));
List<String> xyxDisplayNameList = Arrays.asList("Ia", "P", "Q");
List<ESEquipments> xyxSqlData = esEquipmentsList.stream().filter(esEquipments -> esEquipments.getFrontModule().equals("35kV前万线") && xyxDisplayNameList.contains(esEquipments.getDisplayName())).collect(Collectors.toList());
......@@ -1944,7 +1950,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
});
}
statusMaps.sort(Comparator.comparingInt(o->Integer.parseInt(o.get("titie").toString())));
statusMaps.sort(Comparator.comparingInt(o -> Integer.parseInt(o.get("titie").toString())));
IPage<Map<String, String>> result = new Page<>();
result.setRecords(statusMaps);
result.setCurrent(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment