diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index a1c62ff8..8d87b7c9 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -1295,6 +1295,12 @@ public class SocketDevResponseService { if (targetTestMap.containsKey(sourceIssue.getType())) { List devLineTestResultList = targetTestMap.get(sourceIssue.getType()); + devListRes.forEach(it1 -> { + devLineTestResultList.stream().filter(it2 -> it2.getDeviceId().equals(it1.getDeviceId())).findFirst().ifPresent(it2 -> { + setNewChnResult(it2.getChnResult(), it1.getChnResult()); + }); + }); + devLineTestResultList.addAll(devListRes); } else { targetTestMap.put(sourceIssue.getType(), devListRes); @@ -1307,6 +1313,26 @@ public class SocketDevResponseService { WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO)); } + private void setNewChnResult(Integer[] oldChnResult, Integer[] newChnResult) { + for (int i = 0; i < oldChnResult.length; i++) { + if (newChnResult[i] == 2) { + oldChnResult[i] = 2; + continue; + } + if (newChnResult[i] == 3 && oldChnResult[i] != 2) { + oldChnResult[i] = 3; + continue; + } + if (newChnResult[i] == 4 && oldChnResult[i] != 2) { + oldChnResult[i] = 4; + continue; + } + if (newChnResult[i] == 5 && oldChnResult[i] != 2 && oldChnResult[i] != 3 && oldChnResult[i] != 4) { + oldChnResult[i] = 5; + } + } + } + /** * 返回大项检测结果,默认遇到 4,5时认为不参与计算 */