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 94352381..c472d237 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 @@ -290,8 +290,8 @@ public class SocketDevResponseService { if (successComm.size() == FormalTestManager.monitorIdListComm.size()) { processData(param, xiSocket); } - }else { - System.out.println("系数校准抛除数据"+devData); + } else { + System.out.println("系数校准抛除数据" + devData); } break; case UNPROCESSED_BUSINESS: @@ -300,8 +300,8 @@ public class SocketDevResponseService { case NORMAL_RESPONSE: if (devData.getResult()) { FormalTestManager.realDataXiList.add(devData); - }else { - System.out.println("系数校准抛除数据"+devData); + } else { + System.out.println("系数校准抛除数据" + devData); } break; default: @@ -402,6 +402,9 @@ public class SocketDevResponseService { } private void handleFinalStep(PreDetectionParam param) { + FormalTestManager.realDataXiList.clear(); + successComm.clear(); + XiNumberManager.devXiList.clear(); sendWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.small_comp_end.getValue(), XiNumberManager.devParameterList.get(1)); System.out.println("-------------------------已经全部结束----------------------"); @@ -685,8 +688,8 @@ public class SocketDevResponseService { * 删除集合中前五个数以及最后两个数 */ private Double reduceList(List valList) { - // valList.subList(0, 5).clear(); - // valList.subList(valList.size() - 3, valList.size() - 1).clear(); + // valList.subList(0, 5).clear(); + // valList.subList(valList.size() - 3, valList.size() - 1).clear(); return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble(); } @@ -930,7 +933,7 @@ public class SocketDevResponseService { WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO)); - } else if (SourceOperateCodeEnum.PRE_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.COEFFICIENT_TEST.getValue().equals(param.getOperateType())||SourceOperateCodeEnum.FAST_TEST.getValue().equals(param.getOperateType())) { + } else if (SourceOperateCodeEnum.PRE_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.COEFFICIENT_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.FAST_TEST.getValue().equals(param.getOperateType())) { //预检测的相序检测 以及系数校验、一键检测 都需要进行相序检测 issueParam.setIsPhaseSequence(SourceOperateCodeEnum.PHASE_TEST.getValue()); sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam); @@ -1121,7 +1124,7 @@ public class SocketDevResponseService { } } else { - System.out.println("被抛除的数据:" + data); + System.out.println("相序校验被抛除的数据:" + data); } break; case UNPROCESSED_BUSINESS: @@ -1132,7 +1135,7 @@ public class SocketDevResponseService { if (devData.getResult()) { devInfo.add(devData); } else { - System.out.println("被抛除的数据:" + data); + System.out.println("相序校验被抛除的数据:" + data); } break; case DEV_ERROR: diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java index 6ab5f773..c436b120 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java @@ -18,6 +18,7 @@ import com.njcn.gather.device.service.IPqDevService; import com.njcn.gather.script.pojo.po.SourceIssue; import com.njcn.gather.system.pojo.enums.DicDataEnum; import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -197,7 +198,7 @@ public class SocketSourceResponseService { phaseSequenceParam.setMoniterIdList(monitorIdList); phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS")); phaseSequenceParam.setReadCount(3); - phaseSequenceParam.setIgnoreCount(5); + phaseSequenceParam.setIgnoreCount(4); socketMsg.setData(JSON.toJSONString(phaseSequenceParam)); SocketManager.sendMsg(s, JSON.toJSONString(socketMsg)); @@ -219,7 +220,7 @@ public class SocketSourceResponseService { /** * 装置检测(当源初始化成功后,直接向装置通道向装置服务器发送,装置检测) * - * @param param 参数 + * @param param 参数 * @param socketDataMsg 消息 */ private void detectionDev(PreDetectionParam param, SocketDataMsg socketDataMsg) { @@ -375,9 +376,11 @@ public class SocketSourceResponseService { socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_01.getValue()); } } - List moniterIdList = devList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList()); + System.out.println("devList is empty:" + CollectionUtils.isEmpty(devList)); + + //List moniterIdList = devList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList()); DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam(); - phaseSequenceParam.setMoniterIdList(moniterIdList); + phaseSequenceParam.setMoniterIdList(monitorIdList); phaseSequenceParam.setDataType(comm); phaseSequenceParam.setReadCount(readData); phaseSequenceParam.setIgnoreCount(ignoreCount);