1、手动检测根据检测内容不同动态决定是否进行初始化操作
2、检测结果原始数据时间展示毫秒值
This commit is contained in:
@@ -17,6 +17,7 @@ import com.njcn.gather.detection.pojo.po.SourceCompareDev;
|
|||||||
import com.njcn.gather.detection.pojo.vo.*;
|
import com.njcn.gather.detection.pojo.vo.*;
|
||||||
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
import com.njcn.gather.detection.util.socket.*;
|
import com.njcn.gather.detection.util.socket.*;
|
||||||
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.pojo.po.PqDev;
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
@@ -408,32 +409,29 @@ public class SocketDevResponseService {
|
|||||||
sendWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.small_comp_end.getValue(), XiNumberManager.devParameterList.get(1));
|
sendWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.small_comp_end.getValue(), XiNumberManager.devParameterList.get(1));
|
||||||
System.out.println("-------------------------已经全部结束----------------------");
|
System.out.println("-------------------------已经全部结束----------------------");
|
||||||
|
|
||||||
//如果是系数校验则终止
|
if (param.getTestItemList().get(2)) {
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue())) {
|
//如果后续做正式检测
|
||||||
CnSocketUtil.quitSend(param);
|
|
||||||
//修改设备表Factor_Check_Result字段
|
|
||||||
XiNumberManager.devXiNumDataMap.forEach((key, val) -> {
|
|
||||||
DevXiNumData small = XiNumberManager.smallDevXiNumDataMap.get(key);
|
|
||||||
LambdaUpdateWrapper<PqDev> updateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
updateWrapper.eq(PqDev::getId, FormalTestManager.devIdMapComm.get(key));
|
|
||||||
if (val.getResultFlag() == 0 || small.getResultFlag() == 0) {
|
|
||||||
updateWrapper.set(PqDev::getFactorCheckResult, 0);
|
|
||||||
} else {
|
|
||||||
updateWrapper.set(PqDev::getFactorCheckResult, 1);
|
|
||||||
}
|
|
||||||
iPqDevService.update(updateWrapper);
|
|
||||||
updateWrapper.clear();
|
|
||||||
});
|
|
||||||
} else if (param.getOperateType().equals(SourceOperateCodeEnum.FAST_TEST.getValue())) {
|
|
||||||
//如果是一键检测,执行完系数校验后继续进行正式检测
|
|
||||||
//开始下源控制脚本
|
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
issueParam.setPlanId(param.getPlanId());
|
issueParam.setPlanId(param.getPlanId());
|
||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
|
||||||
|
|
||||||
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
|
//不合格项复检
|
||||||
|
Set<Integer> indexes = new HashSet<>();
|
||||||
|
StorageParam storageParam = new StorageParam();
|
||||||
|
storageParam.setCode(param.getCode());
|
||||||
|
storageParam.setScriptId(param.getScriptId());
|
||||||
|
param.getDevIds().forEach(devId -> {
|
||||||
|
storageParam.setDevId(devId);
|
||||||
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
|
});
|
||||||
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
|
} else {
|
||||||
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
SocketMsg<String> socketMsg = new SocketMsg<>();
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
@@ -469,8 +467,23 @@ public class SocketDevResponseService {
|
|||||||
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
webSocketVO.setDesc(null);
|
webSocketVO.setDesc(null);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
||||||
|
} else {
|
||||||
|
//后续什么都不做
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
//修改设备表Factor_Check_Result字段
|
||||||
|
XiNumberManager.devXiNumDataMap.forEach((key, val) -> {
|
||||||
|
DevXiNumData small = XiNumberManager.smallDevXiNumDataMap.get(key);
|
||||||
|
LambdaUpdateWrapper<PqDev> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(PqDev::getId, FormalTestManager.devIdMapComm.get(key));
|
||||||
|
if (val.getResultFlag() == 0 || small.getResultFlag() == 0) {
|
||||||
|
updateWrapper.set(PqDev::getFactorCheckResult, 0);
|
||||||
|
} else {
|
||||||
|
updateWrapper.set(PqDev::getFactorCheckResult, 1);
|
||||||
|
}
|
||||||
|
iPqDevService.update(updateWrapper);
|
||||||
|
updateWrapper.clear();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -884,8 +897,15 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
List<SourceIssue> sourceIssues;
|
List<SourceIssue> sourceIssues;
|
||||||
if (SourceOperateCodeEnum.FORMAL_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.RE_ERROR_TEST.getValue().equals(param.getOperateType())) {
|
// 做预检测、后续做系数校准
|
||||||
|
if (param.getTestItemList().get(0) || param.getTestItemList().get(1)) {
|
||||||
|
issueParam.setIsPhaseSequence(CommonEnum.PHASE_TEST.getValue());
|
||||||
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
||||||
|
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
} else if (param.getTestItemList().get(2)) {
|
||||||
|
// 后续做正式检测
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
//不合格项复检
|
//不合格项复检
|
||||||
Set<Integer> indexes = new HashSet<>();
|
Set<Integer> indexes = new HashSet<>();
|
||||||
@@ -899,7 +919,7 @@ public class SocketDevResponseService {
|
|||||||
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
} else {
|
} else {
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
}
|
}
|
||||||
//正式检测
|
//正式检测
|
||||||
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
@@ -931,28 +951,20 @@ public class SocketDevResponseService {
|
|||||||
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
webSocketVO.setDesc(null);
|
webSocketVO.setDesc(null);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
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())) {
|
|
||||||
//预检测的相序检测 以及系数校验、一键检测 都需要进行相序检测
|
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.PHASE_TEST.getValue());
|
|
||||||
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
|
||||||
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
|
||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
|
||||||
} else if (SourceOperateCodeEnum.TEST_TEM_START.getValue().equals(param.getOperateType())) {
|
|
||||||
//暂停检测后的继续检测
|
|
||||||
System.out.println("进入暂停后的继续检测》》》》》》》》》》》》》》》》》》》》》》》》》》》" + "剩余检测小项" + SocketManager.getSourceList().size());
|
|
||||||
if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
|
|
||||||
SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
|
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssue.getType());
|
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
|
||||||
socketMsg.setData(JSON.toJSONString(sourceIssue));
|
|
||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// if (SourceOperateCodeEnum.TEST_TEM_START.getValue().equals(param.getOperateType())) {
|
||||||
|
// //暂停检测后的继续检测
|
||||||
|
// System.out.println("进入暂停后的继续检测》》》》》》》》》》》》》》》》》》》》》》》》》》》" + "剩余检测小项" + SocketManager.getSourceList().size());
|
||||||
|
// if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
|
||||||
|
// SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
|
||||||
|
// socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssue.getType());
|
||||||
|
// socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
// socketMsg.setData(JSON.toJSONString(sourceIssue));
|
||||||
|
// SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
// 发送下一个脚本与icd校验
|
// 发送下一个脚本与icd校验
|
||||||
String icdType = icdTypeList.stream().filter(it -> !icdCheckDataMap.containsKey(it)).findFirst().orElse(null);
|
String icdType = icdTypeList.stream().filter(it -> !icdCheckDataMap.containsKey(it)).findFirst().orElse(null);
|
||||||
@@ -1048,7 +1060,7 @@ public class SocketDevResponseService {
|
|||||||
PqScriptIssueParam sourceParam = new PqScriptIssueParam();
|
PqScriptIssueParam sourceParam = new PqScriptIssueParam();
|
||||||
sourceParam.setPlanId(param.getPlanId());
|
sourceParam.setPlanId(param.getPlanId());
|
||||||
sourceParam.setDevIds(param.getDevIds());
|
sourceParam.setDevIds(param.getDevIds());
|
||||||
sourceParam.setIsPhaseSequence(SourceOperateCodeEnum.PHASE_TEST.getValue());
|
sourceParam.setIsPhaseSequence(CommonEnum.PHASE_TEST.getValue());
|
||||||
sourceParam.setScriptId(param.getScriptId());
|
sourceParam.setScriptId(param.getScriptId());
|
||||||
sourceParam.setSourceId(param.getSourceId());
|
sourceParam.setSourceId(param.getSourceId());
|
||||||
List<SourceIssue> sourceIssues = scriptDtlsService.listSourceIssue(sourceParam);
|
List<SourceIssue> sourceIssues = scriptDtlsService.listSourceIssue(sourceParam);
|
||||||
@@ -1091,12 +1103,8 @@ public class SocketDevResponseService {
|
|||||||
successComm.clear();
|
successComm.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 后续做系数校准
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.PRE_TEST.getValue())) {
|
if (param.getTestItemList().get(1)) {
|
||||||
System.out.println("预检测流程结束-----------------关闭源");
|
|
||||||
//同时关闭设备三个步骤
|
|
||||||
CnSocketUtil.quitSend(param);
|
|
||||||
} else if (param.getOperateType().equals(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue()) || param.getOperateType().equals(SourceOperateCodeEnum.FAST_TEST.getValue())) {
|
|
||||||
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
webSocketVO.setRequestId(SourceOperateCodeEnum.Coefficient_Check.getValue());
|
webSocketVO.setRequestId(SourceOperateCodeEnum.Coefficient_Check.getValue());
|
||||||
webSocketVO.setOperateCode(SourceOperateCodeEnum.big_start.getValue());
|
webSocketVO.setOperateCode(SourceOperateCodeEnum.big_start.getValue());
|
||||||
@@ -1120,8 +1128,66 @@ public class SocketDevResponseService {
|
|||||||
XiNumberManager.smallDevXiNumDataMap.clear();
|
XiNumberManager.smallDevXiNumDataMap.clear();
|
||||||
|
|
||||||
System.out.println("开始系数校准》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
System.out.println("开始系数校准》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
||||||
}
|
} else if (param.getTestItemList().get(2)) {
|
||||||
|
// 后续做正式检测
|
||||||
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
issueParam.setPlanId(param.getPlanId());
|
||||||
|
issueParam.setSourceId(param.getSourceId());
|
||||||
|
issueParam.setDevIds(param.getDevIds());
|
||||||
|
issueParam.setScriptId(param.getScriptId());
|
||||||
|
|
||||||
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
|
//不合格项复检
|
||||||
|
Set<Integer> indexes = new HashSet<>();
|
||||||
|
StorageParam storageParam = new StorageParam();
|
||||||
|
storageParam.setCode(param.getCode());
|
||||||
|
storageParam.setScriptId(param.getScriptId());
|
||||||
|
param.getDevIds().forEach(devId -> {
|
||||||
|
storageParam.setDevId(devId);
|
||||||
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
|
});
|
||||||
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
|
} else {
|
||||||
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
|
}
|
||||||
|
//正式检测
|
||||||
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
sourceIssues = sourceIssues.stream().sorted(Comparator.comparing(SourceIssue::getIndex)).collect(Collectors.toList());
|
||||||
|
// 使用 LinkedHashMap 保持分组顺序
|
||||||
|
Map<String, List<SourceIssue>> groupedIssues = sourceIssues.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
SourceIssue::getType,
|
||||||
|
LinkedHashMap::new,
|
||||||
|
Collectors.toList()
|
||||||
|
));
|
||||||
|
|
||||||
|
// 将分组后的元素合并成一个新的集合,保持原有顺序
|
||||||
|
sourceIssues = groupedIssues.values().stream()
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 存放所有检测小项
|
||||||
|
SocketManager.addSourceList(sourceIssues);
|
||||||
|
// 按照大项分组。key为大项code,value为小项个数
|
||||||
|
Map<String, Long> sourceIssueMap = sourceIssues.stream().collect(Collectors.groupingBy(SourceIssue::getType, Collectors.counting()));
|
||||||
|
SocketManager.initMap(sourceIssueMap);
|
||||||
|
|
||||||
|
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssues.get(0).getType());
|
||||||
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
|
||||||
|
//告诉前端当前项开始了
|
||||||
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
|
webSocketVO.setDesc(null);
|
||||||
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
||||||
|
} else {
|
||||||
|
//后续什么都不做
|
||||||
|
System.out.println("预检测流程结束-----------------关闭源");
|
||||||
|
//同时关闭设备三个步骤
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("相序校验被抛除的数据:" + data);
|
System.out.println("相序校验被抛除的数据:" + data);
|
||||||
@@ -1679,7 +1745,7 @@ public class SocketDevResponseService {
|
|||||||
//字典树
|
//字典树
|
||||||
SocketManager.valueTypeMap = iPqScriptCheckDataService.getValueTypeMap(param.getScriptId());
|
SocketManager.valueTypeMap = iPqScriptCheckDataService.getValueTypeMap(param.getScriptId());
|
||||||
|
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue()) || param.getOperateType().equals(SourceOperateCodeEnum.FAST_TEST.getValue())) {
|
if (param.getTestItemList().get(1)) {
|
||||||
initXiManager(param);
|
initXiManager(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1710,7 +1776,7 @@ public class SocketDevResponseService {
|
|||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.COEFFICIENT_TEST.getValue());
|
||||||
issueParam.setIndexList(Stream.of(-2, -3).collect(Collectors.toList()));
|
issueParam.setIndexList(Stream.of(-2, -3).collect(Collectors.toList()));
|
||||||
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
for (int j = 0; j < sourceIssues.size(); j++) {
|
for (int j = 0; j < sourceIssues.size(); j++) {
|
||||||
|
|||||||
@@ -70,17 +70,18 @@ public enum SourceOperateCodeEnum {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
COEFFICIENT_TEST("0","系数校验"),
|
// COEFFICIENT_TEST("0","系数校验"),
|
||||||
PRE_TEST("1","预检测"),
|
// PRE_TEST("1","预检测"),
|
||||||
FORMAL_TEST("2","正式检测"),
|
// FORMAL_TEST("2","正式检测"),
|
||||||
TIME_TEST("3","守时检测"),
|
// TIME_TEST("3","守时检测"),
|
||||||
PHASE_TEST("4","相序检测"),
|
// PHASE_TEST("4","相序检测"),
|
||||||
TEST_TEM_STOP("5","临时停止"),
|
// TEST_TEM_STOP("5","临时停止"),
|
||||||
TEST_TEM_START("6","继续检测"),
|
ALL_TEST("1","全部检测"),
|
||||||
TEST_STOP("7","停止检测"),
|
RE_ERROR_TEST("2","不合格项复检"),
|
||||||
RE_ERROR_TEST("8","不合格项复检"),
|
TEST_TEM_START("3","继续检测"),
|
||||||
SIMULATE_TEST("9","模拟检测"),
|
SIMULATE_TEST("4","模拟检测"),
|
||||||
FAST_TEST("10","一键检测"),
|
//TEST_STOP("7","停止检测"),
|
||||||
|
//FAST_TEST("10","一键检测"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系数校验步骤
|
* 系数校验步骤
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class PreDetectionParam {
|
public class PreDetectionParam {
|
||||||
|
|
||||||
/**
|
private String operateType;
|
||||||
* 操作类型 0.预检测 1.正式检测 2.系数校验
|
|
||||||
*/
|
|
||||||
private String operateType = "0";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测计划id
|
* 检测计划id
|
||||||
@@ -75,4 +72,9 @@ public class PreDetectionParam {
|
|||||||
* 相对湿度
|
* 相对湿度
|
||||||
*/
|
*/
|
||||||
private Float humidity;
|
private Float humidity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测项列表。第一个元素为预检测、第二个元素为系数校准、第三个元素为正式检测
|
||||||
|
*/
|
||||||
|
private List<Boolean> testItemList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
||||||
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
import com.njcn.gather.plan.service.IAdPlanService;
|
import com.njcn.gather.plan.service.IAdPlanService;
|
||||||
@@ -54,7 +54,6 @@ import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
|||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
||||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
|
||||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
@@ -1612,7 +1611,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
|
|
||||||
issueParam.setDevIds(Arrays.asList(devId));
|
issueParam.setDevIds(Arrays.asList(devId));
|
||||||
issueParam.setScriptId(scriptId);
|
issueParam.setScriptId(scriptId);
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
|
||||||
sourceIssues.forEach(sourceIssue -> {
|
sourceIssues.forEach(sourceIssue -> {
|
||||||
|
|||||||
@@ -706,7 +706,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam);
|
||||||
|
|
||||||
Set<String> dataTypeSet = new HashSet<>();
|
Set<String> dataTypeSet = new HashSet<>();
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
Field timeId = harmonicResult.getClass().getDeclaredField("timeId");
|
Field timeId = harmonicResult.getClass().getDeclaredField("timeId");
|
||||||
timeId.setAccessible(true);
|
timeId.setAccessible(true);
|
||||||
LocalDateTime localDateTime = (LocalDateTime) timeId.get(harmonicResult);
|
LocalDateTime localDateTime = (LocalDateTime) timeId.get(harmonicResult);
|
||||||
dataVO.setTime(localDateTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
dataVO.setTime(localDateTime.format(DateTimeFormatter.ofPattern(DatePattern.ISO8601_PATTERN)));
|
||||||
|
|
||||||
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldA.setAccessible(true);
|
fieldA.setAccessible(true);
|
||||||
@@ -209,6 +209,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
lambdaQueryWrapper.select(AdHarmonicResult::getSort)
|
lambdaQueryWrapper.select(AdHarmonicResult::getSort)
|
||||||
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdHarmonicResult::getMonitorId, param.getDevId())
|
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdHarmonicResult::getMonitorId, param.getDevId())
|
||||||
.ne(AdHarmonicResult::getResultFlag, 1)
|
.ne(AdHarmonicResult::getResultFlag, 1)
|
||||||
|
.ne(AdHarmonicResult::getResultFlag, 4)
|
||||||
.ne(AdHarmonicResult::getResultFlag, 5)
|
.ne(AdHarmonicResult::getResultFlag, 5)
|
||||||
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
||||||
@@ -219,6 +220,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
resultLambdaQueryWrapper.select(AdNonHarmonicResult::getSort)
|
resultLambdaQueryWrapper.select(AdNonHarmonicResult::getSort)
|
||||||
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdNonHarmonicResult::getMonitorId, param.getDevId())
|
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdNonHarmonicResult::getMonitorId, param.getDevId())
|
||||||
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
||||||
|
.ne(AdNonHarmonicResult::getResultFlag, 4)
|
||||||
.ne(AdNonHarmonicResult::getResultFlag, 5)
|
.ne(AdNonHarmonicResult::getResultFlag, 5)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
|||||||
for (AdNonHarmonicResult result : value) {
|
for (AdNonHarmonicResult result : value) {
|
||||||
RawDataVO dataVO = new RawDataVO();
|
RawDataVO dataVO = new RawDataVO();
|
||||||
dataVO.setUnit(dictTree.getCode().equals("MAG")?"%":unit(dictTree.getCode()));
|
dataVO.setUnit(dictTree.getCode().equals("MAG")?"%":unit(dictTree.getCode()));
|
||||||
dataVO.setTime(result.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
dataVO.setTime(result.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.ISO8601_PATTERN)));
|
||||||
dataVO.setDataA(StrUtil.isNotBlank(result.getAValue()) ? new BigDecimal(result.getAValue()).toPlainString() : null);
|
dataVO.setDataA(StrUtil.isNotBlank(result.getAValue()) ? new BigDecimal(result.getAValue()).toPlainString() : null);
|
||||||
dataVO.setDataB(StrUtil.isNotBlank(result.getBValue()) ? new BigDecimal(result.getBValue()).toPlainString() : null);
|
dataVO.setDataB(StrUtil.isNotBlank(result.getBValue()) ? new BigDecimal(result.getBValue()).toPlainString() : null);
|
||||||
dataVO.setDataC(StrUtil.isNotBlank(result.getCValue()) ? new BigDecimal(result.getCValue()).toPlainString() : null);
|
dataVO.setDataC(StrUtil.isNotBlank(result.getCValue()) ? new BigDecimal(result.getCValue()).toPlainString() : null);
|
||||||
|
|||||||
Reference in New Issue
Block a user