|
@@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: interlock_count_day
|
|
@@ -68,7 +69,34 @@ public class InterlockCountDayServiceImpl extends ServiceImpl<InterlockCountDayM
|
|
|
|
|
|
@Override
|
|
|
public List<LoopHealthLevel> getCurrentLoopHealthLevels(String deviceId, String systemId) {
|
|
|
- return mapper.getCurrentLoopHealthLevels(deviceId, systemId);
|
|
|
+ List<LoopHealthLevel> loopHealthLevelList = mapper.getCurrentLoopHealthLevels(deviceId, systemId);
|
|
|
+
|
|
|
+
|
|
|
+ ArrayList<LoopHealthLevel> loopHealthLevelResultList = new ArrayList<>();
|
|
|
+ ArrayList<String> djList = new ArrayList<>();
|
|
|
+ djList.add("A");
|
|
|
+ djList.add("B");
|
|
|
+ djList.add("C");
|
|
|
+ djList.add("D");
|
|
|
+
|
|
|
+ if (loopHealthLevelList.size() != 4){
|
|
|
+ ArrayList<String> jkdjList = new ArrayList<>();
|
|
|
+ for (LoopHealthLevel son : loopHealthLevelList) {
|
|
|
+ jkdjList.add(son.getLevel());
|
|
|
+ }
|
|
|
+ List<String> difference = djList.stream()
|
|
|
+ .filter(item -> !jkdjList.contains(item))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ for (String d:difference) {
|
|
|
+ LoopHealthLevel loopHealthLevel = new LoopHealthLevel();
|
|
|
+ loopHealthLevel.setLevel(d);
|
|
|
+ loopHealthLevel.setNumber("0");
|
|
|
+ loopHealthLevel.setTime(loopHealthLevelList.get(0).getTime());
|
|
|
+ loopHealthLevelList.add(loopHealthLevel);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return loopHealthLevelList;
|
|
|
}
|
|
|
|
|
|
@Override
|