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 bee4e241..8cc97db7 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,6 +33,7 @@ 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; @@ -393,7 +394,8 @@ public class SocketDevResponseService { if (param.getTestItemList().get(2)) { //如果后续做正式检测 PqScriptIssueParam issueParam = new PqScriptIssueParam(); - issueParam.setSourceId(param.getSourceName()); + SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); + issueParam.setSourceId(sourceInitialize.getSourceId()); issueParam.setPlanId(param.getPlanId()); issueParam.setSourceId(param.getSourceId()); issueParam.setDevIds(param.getDevIds()); @@ -691,7 +693,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(); } @@ -896,10 +898,9 @@ 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; @@ -1165,7 +1166,8 @@ public class SocketDevResponseService { } else if (param.getTestItemList().get(2)) { // 后续做正式检测 PqScriptIssueParam issueParam = new PqScriptIssueParam(); - issueParam.setSourceId(param.getSourceName()); + SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); + issueParam.setSourceId(sourceInitialize.getSourceId()); issueParam.setPlanId(param.getPlanId()); issueParam.setDevIds(param.getDevIds()); issueParam.setScriptId(param.getScriptId()); @@ -1819,7 +1821,8 @@ public class SocketDevResponseService { XiNumberManager.devParameterList.add(devParameterSmall); PqScriptIssueParam issueParam = new PqScriptIssueParam(); - issueParam.setSourceId(param.getSourceName()); + SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); + issueParam.setSourceId(sourceInitialize.getSourceId()); 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 4f89bdbd..f6a56114 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,11 +46,6 @@ 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 f368466d..e0488f12 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,7 +135,6 @@ 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); @@ -182,7 +181,6 @@ 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); @@ -245,8 +243,6 @@ 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 8a9810de..090a7da6 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.getSourceName()); + jsonObject.put("sourceId", param.getSourceId()); 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 510ad42b..68cb898a 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,6 +34,7 @@ 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; @@ -783,7 +784,8 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl getScriptToIcdCheckInfo(PreDetectionParam param) { PqScriptIssueParam issueParam = new PqScriptIssueParam(); - issueParam.setSourceId(param.getSourceName()); + SourceInitialize sourceInitialize = pqSourceService.getSourceInitializeParam(param.getSourceId()); + issueParam.setSourceId(sourceInitialize.getSourceId()); issueParam.setDevIds(param.getDevIds()); issueParam.setScriptId(param.getScriptId()); issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());