From 21dcd87be291db9144dd9c3c66d19e17f3337b9c Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Fri, 23 May 2025 10:04:35 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=88=87=E6=8D=A2=E8=AF=AF=E5=B7=AE?= =?UTF-8?q?=E4=BD=93=E7=B3=BB=E5=90=8E=E6=8A=A5=E5=91=8A=E7=94=9F=E6=88=90?= =?UTF-8?q?bug=202=E3=80=81=E6=AD=A3=E5=BC=8F=E6=A3=80=E6=B5=8B=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E5=A4=96=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/SocketDevResponseService.java | 49 +++++++++---------- .../service/impl/ResultServiceImpl.java | 8 +-- .../pojo/param/SingleNonHarmParam.java | 16 +++--- 3 files changed, 36 insertions(+), 37 deletions(-) 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 c7afed23..60802cf9 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 @@ -1299,12 +1299,11 @@ 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()); - }); - }); - +// 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); @@ -1317,25 +1316,25 @@ 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; - } - } - } +// 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时认为不参与计算 diff --git a/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java b/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java index e47b331a..07381351 100644 --- a/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java @@ -969,7 +969,7 @@ public class ResultServiceImpl implements IResultService { // 暂态的valueType通常只有2个,一个特征幅值,一个持续时间 List> keyFillMapList = new ArrayList<>(); for (Integer sort : indexList) { - SingleNonHarmParam param = new SingleNonHarmParam(Integer.parseInt(planCode), devId, lineNo, valueTypeList, Collections.singletonList(sort)); + SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueTypeList, Collections.singletonList(sort)); List nonHarmList = adNonHarmonicService.queryByCondition(param); if (CollUtil.isNotEmpty(nonHarmList)) { Map keyFillMap = new HashMap<>(16); @@ -994,7 +994,7 @@ public class ResultServiceImpl implements IResultService { // 查询结果数据,经过上层处理谐波类此处的scriptIndex确保只有一个 if (indexList.size() == 1) { // 获取谐波数据 - SingleNonHarmParam param = new SingleNonHarmParam(Integer.parseInt(planCode), devId, lineNo, valueType, indexList.get(0)); + SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueType, indexList.get(0)); AdHarmonicResult singleResult = adHarmonicService.getSingleResult(param); // 注:如果ABC的标准值一致,则同步到standard中 Map> checkDataHarmNumMap = scriptCheckDataList.stream().collect(Collectors.groupingBy(PqScriptCheckData::getHarmNum)); @@ -1039,7 +1039,7 @@ public class ResultServiceImpl implements IResultService { // 非谐波的需要区分是否为ABC相还是T相 if (PowerConstant.THREE_PHASE.contains(scriptCode)) { // 获取该三相的数据 - SingleNonHarmParam param = new SingleNonHarmParam(Integer.parseInt(planCode), devId, lineNo, Collections.singletonList(valueType), indexList); + SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList); List nonHarmList = adNonHarmonicService.queryByCondition(param); if (CollUtil.isNotEmpty(nonHarmList)) { List> keyFillMapList = new ArrayList<>(); @@ -1069,7 +1069,7 @@ public class ResultServiceImpl implements IResultService { } else { // 非三相且非暂态,通常只有一个数据,所以直接赋值即可 List> keyFillMapList = new ArrayList<>(); - SingleNonHarmParam param = new SingleNonHarmParam(Integer.parseInt(planCode), devId, lineNo, Collections.singletonList(valueType), indexList); + SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList); List nonHarmList = adNonHarmonicService.queryByCondition(param); if (CollUtil.isNotEmpty(nonHarmList)) { for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) { diff --git a/storage/src/main/java/com/njcn/gather/storage/pojo/param/SingleNonHarmParam.java b/storage/src/main/java/com/njcn/gather/storage/pojo/param/SingleNonHarmParam.java index 684940ef..ee5b8c3c 100644 --- a/storage/src/main/java/com/njcn/gather/storage/pojo/param/SingleNonHarmParam.java +++ b/storage/src/main/java/com/njcn/gather/storage/pojo/param/SingleNonHarmParam.java @@ -52,32 +52,32 @@ public class SingleNonHarmParam implements Serializable { private List sortList; - public SingleNonHarmParam(Integer planCode, String devId, Integer channelNo, String adType, Integer sort) { - this.planCode = String.valueOf(planCode); + public SingleNonHarmParam(String planCode, String devId, Integer channelNo, String adType, Integer sort) { + this.planCode = planCode; this.devId = devId; this.channelNo = channelNo; this.adType = adType; this.sort = sort; } - public SingleNonHarmParam(Integer planCode, String devId, Integer channelNo, String adType, List sortList) { - this.planCode = String.valueOf(planCode); + public SingleNonHarmParam(String planCode, String devId, Integer channelNo, String adType, List sortList) { + this.planCode = planCode; this.devId = devId; this.channelNo = channelNo; this.adType = adType; this.sortList = sortList; } - public SingleNonHarmParam(Integer planCode, String devId, Integer channelNo, List valueTypeList, Integer sort) { - this.planCode = String.valueOf(planCode); + public SingleNonHarmParam(String planCode, String devId, Integer channelNo, List valueTypeList, Integer sort) { + this.planCode = planCode; this.devId = devId; this.channelNo = channelNo; this.valueTypeList = valueTypeList; this.sort = sort; } - public SingleNonHarmParam(Integer planCode, String devId, Integer channelNo, List valueTypeList, List sortList) { - this.planCode = String.valueOf(planCode); + public SingleNonHarmParam(String planCode, String devId, Integer channelNo, List valueTypeList, List sortList) { + this.planCode = planCode; this.devId = devId; this.channelNo = channelNo; this.valueTypeList = valueTypeList;