Commit a35b4bb4 authored by chenzhao's avatar chenzhao

修改代码

parent c26914d1
......@@ -61,7 +61,7 @@ public class CommonServiceImpl {
String gkzxzjskey2;
//----------------健康指数值计算相关请求属性配置------------------------
@Value("${gkzxzjs.url:8804dc58-508b-4e73-8346-5aa8d808746f}")
@Value("${jkzsjs.url:d6c175af-50e2-4ea9-9006-f091cdfe203e}")
String jkzsjsurl;
......@@ -663,7 +663,7 @@ public class CommonServiceImpl {
return dateFormat.format(timeStr);
}
@Scheduled(cron = "0/10 * * * * ?")
@Scheduled(cron = "0 0/10 * * * ?")
private void healthWarningMinute() {
List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData();
Map<String, List<IdxBizFanPointProcessVariableClassificationDto>> maps = data.stream().collect(Collectors.groupingBy(IdxBizFanPointProcessVariableClassificationDto::getGatewayId));
......@@ -707,49 +707,47 @@ public class CommonServiceImpl {
LambdaQueryWrapper<IdxBizFanPointVarCentralValue> wrapper = new LambdaQueryWrapper<>();
List<IdxBizFanPointVarCentralValue> idxBizUhefs = idxBizFanPointVarCentralValueMapper.selectList(wrapper);
List< Map<String, Object>> datas = new ArrayList<>();
Map<String, Map<String, Object>> resultMap = new HashMap<>();
for (IdxBizFanPointVarCentralValue idxBizUhef : idxBizUhefs) {
double value1 = 0.00;
double value2 = 0.00;
double value3 = 0.00;
double value4 = 0.00;
for (IdxBizFanPointProcessVariableClassificationDto datum : data) {
if (idxBizUhef.getProcessPoint1Id().equals(datum.getSequenceNbr())){
value1 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint2Id().equals(datum.getSequenceNbr())) {
value2 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint3Id().equals(datum.getSequenceNbr())) {
value3 = datum.getCurrentValue();
}
if (idxBizUhef.getAnalysisPointId().equals(datum.getSequenceNbr())) {
value4 = datum.getCurrentValue();
}
}
if (idxBizUhef.getProcess1Min() < value1 && value1 < idxBizUhef.getProcess1Max() &&
idxBizUhef.getProcess2Min() < value2 && value2 < idxBizUhef.getPorcess2Max() &&
idxBizUhef.getProcess3Min() < value3 && value3 < idxBizUhef.getProcess3Max()){
Map<String, Object> map = new HashMap<>();
for (IdxBizFanPointProcessVariableClassificationDto datum : data) {
if (idxBizUhef.getProcessPoint1Id().equals(datum.getSequenceNbr())){
value1 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint2Id().equals(datum.getSequenceNbr())) {
value2 = datum.getCurrentValue();
}
if (idxBizUhef.getProcessPoint3Id().equals(datum.getSequenceNbr())) {
value3 = datum.getCurrentValue();
}
if (idxBizUhef.getAnalysisPointId().equals(datum.getSequenceNbr())) {
value4 = datum.getCurrentValue();
}
}
Map<String, Object> map = new HashMap<>();
if (idxBizUhef.getProcess1Min() <= value1 && value1 <= idxBizUhef.getProcess1Max() &&
idxBizUhef.getProcess2Min() <= value2 && value2 <= idxBizUhef.getPorcess2Max() &&
idxBizUhef.getProcess3Min() <= value3 && value3 <= idxBizUhef.getProcess3Max()){
map.put("analysVariable",value4);
map.put("stdDev",idxBizUhef.getAnalysisStdDev());
map.put("centerValue",idxBizUhef.getAnalysisCenterValue());
map.put("analysVariableId",idxBizUhef.getAnalysisPointId());
datas.add(map);
resultMap.put(idxBizUhef.getAnalysisPointId(),map);
}
}
if (!datas.isEmpty()) {
Collection<Map<String, Object>> values = resultMap.values();
if (!values.isEmpty()) {
logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------");
HashMap<String, Object> realParams = new HashMap<>();
realParams.put(gkzxzjskey1, datas);
realParams.put(gkzxzjskey1, values);
String response = HttpUtil.createPost(baseUrl + jkzsjsurl).body(JSON.toJSONString(realParams)).execute().body();
try {
logger.info("--------------------repsonse: "+response);
TimeUnit.SECONDS.sleep(sleepTime);
logger.info("------------------------------------------调用健康指数计算算法结束----------------------------------------");
} catch (InterruptedException e) {
} catch (Exception e) {
throw new RuntimeException(e);
}
}
......
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