This commit is contained in:
caozehui
2025-05-20 16:26:50 +08:00
parent 95c564595f
commit 06e21711f2

View File

@@ -1295,6 +1295,12 @@ public class SocketDevResponseService {
if (targetTestMap.containsKey(sourceIssue.getType())) {
List<DevLineTestResult> 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;
}
}
}
/**
* 返回大项检测结果,默认遇到 45时认为不参与计算
*/