Commit b4c4ad94 authored by tangwei's avatar tangwei

修改稳压泵状态趋势

parent 023df4f1
......@@ -422,11 +422,12 @@ public class EmergencyServiceImpl implements IEmergencyService {
Object iotCode = x.get("iotCode");
if (x.get("iotCode") != null) {
List<Map<String, String>> dataList = dataListMap.get(iotCode.toString());
String flag = null;
if (!CollectionUtils.isEmpty(dataList)) {
Collections.reverse(dataList);
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey(PressurePumpRelateEnum.CREATED_TIME.getValue())).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
List<Map<String, String>> yDataList = null;
String flag = null;
for (String t : timeList) {
List<Map<String, String>> data = dataMap.get(t);
if (!CollectionUtils.isEmpty(data)) {
......@@ -438,7 +439,17 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
}
} else {
timeList.forEach(t -> yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
// timeList.forEach(t -> yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
String prefix = iotCode.toString().substring(0, 8);
String suffix = iotCode.toString().substring(8);
List<Map<String, String>> iotDataList = pressurePumpService.getIotTopSingleField("1", prefix, suffix, PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue(), pressurePumpStart);
if (!CollectionUtils.isEmpty(iotDataList)) {
flag = iotDataList.get(0).get(pressurePumpStart);
}
String finalFlag = flag;
timeList.forEach(t -> yList.add(StringUtils.isNotBlank(finalFlag) && PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(finalFlag) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
}
yMap.put("data", yList);
yData.add(yMap);
......
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