From 9dc8ecd873529dd32143250511075177be9f05c2 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 25 May 2026 18:41:39 +0800 Subject: [PATCH] =?UTF-8?q?Reapply=20"=E7=BB=9F=E4=B8=80sourceId"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7c6c103f17165b1fe0e68f9e8dcc6dffcbca9242. --- .../handler/SocketDevResponseService.java | 17 +++++++---------- .../detection/pojo/param/PreDetectionParam.java | 5 +++++ .../service/impl/PreDetectionServiceImpl.java | 4 ++++ .../detection/util/socket/CnSocketUtil.java | 2 +- .../service/impl/PqScriptDtlsServiceImpl.java | 4 +--- 5 files changed, 18 insertions(+), 14 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 8cc97db7..bee4e241 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 @@ -33,7 +33,6 @@ import com.njcn.gather.script.pojo.param.PqScriptIssueParam; import com.njcn.gather.script.pojo.po.SourceIssue; import com.njcn.gather.script.service.IPqScriptCheckDataService; import com.njcn.gather.script.service.IPqScriptDtlsService; -import com.njcn.gather.source.pojo.po.SourceInitialize; import com.njcn.gather.source.service.IPqSourceService; import com.njcn.gather.storage.pojo.param.StorageParam; import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult; @@ -394,8 +393,7 @@ public class SocketDevResponseService { if (param.getTestItemList().get(2)) { //如果后续做正式检测 PqScriptIssueParam issueParam = new PqScriptIssueParam(); - SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); - issueParam.setSourceId(sourceInitialize.getSourceId()); + issueParam.setSourceId(param.getSourceName()); issueParam.setPlanId(param.getPlanId()); issueParam.setSourceId(param.getSourceId()); issueParam.setDevIds(param.getDevIds()); @@ -693,7 +691,7 @@ public class SocketDevResponseService { */ private Double reduceList(List valList) { // valList.subList(0, 5).clear(); - valList.subList(valList.size() - 2, valList.size()).clear(); + valList.subList(valList.size() - 2, valList.size()).clear(); return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble(); } @@ -898,9 +896,10 @@ public class SocketDevResponseService { //开始下源控制脚本 PqScriptIssueParam issueParam = new PqScriptIssueParam(); - SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); - issueParam.setSourceId(sourceInitialize.getSourceId()); issueParam.setPlanId(param.getPlanId()); + issueParam.setSourceId(param.getSourceName()); + issueParam.setDevIds(param.getDevIds()); + issueParam.setScriptId(param.getScriptId()); socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue()); List sourceIssues; @@ -1166,8 +1165,7 @@ public class SocketDevResponseService { } else if (param.getTestItemList().get(2)) { // 后续做正式检测 PqScriptIssueParam issueParam = new PqScriptIssueParam(); - SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); - issueParam.setSourceId(sourceInitialize.getSourceId()); + issueParam.setSourceId(param.getSourceName()); issueParam.setPlanId(param.getPlanId()); issueParam.setDevIds(param.getDevIds()); issueParam.setScriptId(param.getScriptId()); @@ -1821,8 +1819,7 @@ public class SocketDevResponseService { XiNumberManager.devParameterList.add(devParameterSmall); PqScriptIssueParam issueParam = new PqScriptIssueParam(); - SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); - issueParam.setSourceId(sourceInitialize.getSourceId()); + issueParam.setSourceId(param.getSourceName()); issueParam.setPlanId(param.getPlanId()); issueParam.setDevIds(param.getDevIds()); issueParam.setScriptId(param.getScriptId()); diff --git a/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java b/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java index f6a56114..4f89bdbd 100644 --- a/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java +++ b/detection/src/main/java/com/njcn/gather/detection/pojo/param/PreDetectionParam.java @@ -46,6 +46,11 @@ public class PreDetectionParam { */ private String sourceId; + /** + * 源名称 + */ + private String sourceName; + /** * 所属误差体系 */ diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java index e0488f12..f368466d 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java @@ -135,6 +135,7 @@ public class PreDetectionServiceImpl implements PreDetectionService { ); if (ObjectUtil.isNotNull(planSource)) { SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId()); + param.setSourceName(sourceParam.getSourceId()); if (ObjectUtil.isNotNull(sourceParam)) { //开始组装socket报文请求头 socketDevResponseService.initList(param); @@ -181,6 +182,7 @@ public class PreDetectionServiceImpl implements PreDetectionService { if (ObjectUtil.isNotNull(planSource)) { //获取源初始化参数 SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId()); + param.setSourceName(sourceParam.getSourceId()); if (ObjectUtil.isNotNull(sourceParam)) { //开始组装socket报文请求头 socketDevResponseService.initList(param); @@ -243,6 +245,8 @@ public class PreDetectionServiceImpl implements PreDetectionService { FormalTestManager.stopFlag = false; socketDevResponseService.initRestart(); List sourceIssueList = SocketManager.getSourceList(); + SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); + param.setSourceName(sourceInitialize.getSourceId()); if (CollUtil.isNotEmpty(sourceIssueList)) { SourceIssue sourceIssues = SocketManager.getSourceList().get(0); SocketMsg xuMsg = new SocketMsg<>(); diff --git a/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java b/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java index 090a7da6..8a9810de 100644 --- a/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java +++ b/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java @@ -47,7 +47,7 @@ public class CnSocketUtil { socketMsg.setRequestId(SourceOperateCodeEnum.QUITE_SOURCE.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.CLOSE_GATHER.getValue()); JSONObject jsonObject = new JSONObject(); - jsonObject.put("sourceId", param.getSourceId()); + jsonObject.put("sourceId", param.getSourceName()); socketMsg.setData(jsonObject.toJSONString()); SocketManager.sendMsg(param.getUserPageId() + SOURCE_TAG, JSON.toJSONString(socketMsg)); WebServiceManager.removePreDetectionParam(param.getUserPageId()); diff --git a/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptDtlsServiceImpl.java b/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptDtlsServiceImpl.java index 68cb898a..510ad42b 100644 --- a/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptDtlsServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/script/service/impl/PqScriptDtlsServiceImpl.java @@ -34,7 +34,6 @@ import com.njcn.gather.script.service.IPqScriptCheckDataService; import com.njcn.gather.script.service.IPqScriptDtlsService; import com.njcn.gather.script.util.ScriptDtlsDesc; import com.njcn.gather.script.util.ThreePhaseUnbalance; -import com.njcn.gather.source.pojo.po.SourceInitialize; import com.njcn.gather.source.service.IPqSourceService; import com.njcn.gather.system.dictionary.pojo.po.DictTree; import com.njcn.gather.system.dictionary.service.IDictTreeService; @@ -784,8 +783,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl getScriptToIcdCheckInfo(PreDetectionParam param) { PqScriptIssueParam issueParam = new PqScriptIssueParam(); - SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); - issueParam.setSourceId(sourceInitialize.getSourceId()); + issueParam.setSourceId(param.getSourceName()); issueParam.setDevIds(param.getDevIds()); issueParam.setScriptId(param.getScriptId()); issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());