1.相序校验,增加相角校验
2.增加检测完成归档状态
This commit is contained in:
@@ -470,7 +470,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
|
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
|
||||||
//表示接收完成,必须保证10个数
|
//表示接收完成,必须保证10个数
|
||||||
if (deList.size() >= 10) {
|
if (deList.size() >= 10) {
|
||||||
@@ -839,6 +838,10 @@ public class SocketDevResponseService {
|
|||||||
temStr = "电压";
|
temStr = "电压";
|
||||||
} else if ("IRMS".equals(sourceCompareDev.getDesc())) {
|
} else if ("IRMS".equals(sourceCompareDev.getDesc())) {
|
||||||
temStr = "电流";
|
temStr = "电流";
|
||||||
|
}else if ("VA".equals(sourceCompareDev.getDesc())) {
|
||||||
|
temStr = "电压相角";
|
||||||
|
}else if ("IA".equals(sourceCompareDev.getDesc())) {
|
||||||
|
temStr = "电流相角";
|
||||||
}
|
}
|
||||||
dataMsg.setData(sourceCompareDev.getDevName() + splitTag + sourceCompareDev.getLineNum() + temStr + "校验结果:" + (sourceCompareDev.getIsQualified() ? "合格" : "不合格"));
|
dataMsg.setData(sourceCompareDev.getDevName() + splitTag + sourceCompareDev.getLineNum() + temStr + "校验结果:" + (sourceCompareDev.getIsQualified() ? "合格" : "不合格"));
|
||||||
webSocketHandler.sendMsgToUser(param.getUserPageId(), JSON.toJSONString(dataMsg));
|
webSocketHandler.sendMsgToUser(param.getUserPageId(), JSON.toJSONString(dataMsg));
|
||||||
@@ -1174,14 +1177,26 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
List<DevData.SqlDataDTO> sqlData = dev.getSqlData();
|
List<DevData.SqlDataDTO> sqlData = dev.getSqlData();
|
||||||
List<DevData.SqlDataDTO> dataV = sqlData.stream().filter(x -> "VRMS".equals(x.getDesc())).collect(Collectors.toList());
|
List<DevData.SqlDataDTO> dataV = sqlData.stream().filter(x -> "VRMS".equals(x.getDesc())).collect(Collectors.toList());
|
||||||
|
List<DevData.SqlDataDTO> dataVA = sqlData.stream().filter(x -> "VA".equals(x.getDesc())).collect(Collectors.toList());
|
||||||
List<DevData.SqlDataDTO> dataI = sqlData.stream().filter(x -> "IRMS".equals(x.getDesc())).collect(Collectors.toList());
|
List<DevData.SqlDataDTO> dataI = sqlData.stream().filter(x -> "IRMS".equals(x.getDesc())).collect(Collectors.toList());
|
||||||
|
List<DevData.SqlDataDTO> dataIA = sqlData.stream().filter(x -> "IA".equals(x.getDesc())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(dataV)) {
|
if (CollUtil.isNotEmpty(dataV)) {
|
||||||
SourceCompareDev compareDev = getSourceCompareDev(split, dataV, "VRMS", "U", channelList);
|
SourceCompareDev compareDev = getSourceCompareDev(split, dataV, "VRMS", "U", channelList, false);
|
||||||
|
compareDev.setDevName(devName);
|
||||||
|
info.add(compareDev);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(dataVA)) {
|
||||||
|
SourceCompareDev compareDev = getSourceCompareDev(split, dataVA, "VA", "U", channelList, true);
|
||||||
compareDev.setDevName(devName);
|
compareDev.setDevName(devName);
|
||||||
info.add(compareDev);
|
info.add(compareDev);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(dataI)) {
|
if (CollUtil.isNotEmpty(dataI)) {
|
||||||
SourceCompareDev compareDev = getSourceCompareDev(split, dataI, "IRMS", "I", channelList);
|
SourceCompareDev compareDev = getSourceCompareDev(split, dataI, "IRMS", "I", channelList, false);
|
||||||
|
compareDev.setDevName(devName);
|
||||||
|
info.add(compareDev);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(dataVA)) {
|
||||||
|
SourceCompareDev compareDev = getSourceCompareDev(split, dataVA, "IA", "I", channelList, true);
|
||||||
compareDev.setDevName(devName);
|
compareDev.setDevName(devName);
|
||||||
info.add(compareDev);
|
info.add(compareDev);
|
||||||
}
|
}
|
||||||
@@ -1203,10 +1218,10 @@ public class SocketDevResponseService {
|
|||||||
List<DevData.SqlDataDTO> data,
|
List<DevData.SqlDataDTO> data,
|
||||||
String name,
|
String name,
|
||||||
String type,
|
String type,
|
||||||
List<SourceIssue.ChannelListDTO> channelList
|
List<SourceIssue.ChannelListDTO> channelList,
|
||||||
|
Boolean isPhase
|
||||||
) {
|
) {
|
||||||
SourceCompareDev compareDev = new SourceCompareDev();
|
SourceCompareDev compareDev = new SourceCompareDev();
|
||||||
|
|
||||||
compareDev.setIp(split[0]);
|
compareDev.setIp(split[0]);
|
||||||
compareDev.setLineNum(split[1]);
|
compareDev.setLineNum(split[1]);
|
||||||
compareDev.setDesc(name);
|
compareDev.setDesc(name);
|
||||||
@@ -1218,7 +1233,7 @@ public class SocketDevResponseService {
|
|||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
Map<String, Double> sourceMap = sourceList.stream()
|
Map<String, Double> sourceMap = sourceList.stream()
|
||||||
.collect(Collectors.toMap(x -> x.getChannelType().toUpperCase().replace(type, "")
|
.collect(Collectors.toMap(x -> x.getChannelType().toUpperCase().replace(type, "")
|
||||||
, SourceIssue.ChannelListDTO::getFAmp));
|
, isPhase ? SourceIssue.ChannelListDTO::getFPhase : SourceIssue.ChannelListDTO::getFAmp));
|
||||||
Map<String, Double> devMap = new HashMap<>(3);
|
Map<String, Double> devMap = new HashMap<>(3);
|
||||||
devMap.put("A", devData.getA());
|
devMap.put("A", devData.getA());
|
||||||
devMap.put("B", devData.getB());
|
devMap.put("B", devData.getB());
|
||||||
@@ -1229,20 +1244,61 @@ public class SocketDevResponseService {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (channelListDTO.getChannelType().equals((type + "a"))) {
|
if (channelListDTO.getChannelType().equals((type + "a"))) {
|
||||||
|
if (isPhase) {
|
||||||
|
if (channelListDTO.getFPhase() == 0.0) {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getA()),
|
||||||
|
BigDecimal.valueOf(-0.05),
|
||||||
|
BigDecimal.valueOf(0.05));
|
||||||
|
} else {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getA()),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 0.95),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 1.05));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getA()),
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getA()),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (channelListDTO.getChannelType().equals((type + "b"))) {
|
if (channelListDTO.getChannelType().equals((type + "b"))) {
|
||||||
|
if (isPhase) {
|
||||||
|
if (channelListDTO.getFPhase() == 0.0) {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getB()),
|
||||||
|
BigDecimal.valueOf(-0.05),
|
||||||
|
BigDecimal.valueOf(0.05));
|
||||||
|
} else {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getB()),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 0.95),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 1.05));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getB()),
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getB()),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (channelListDTO.getChannelType().equals((type + "c"))) {
|
if (channelListDTO.getChannelType().equals((type + "c"))) {
|
||||||
|
if (isPhase) {
|
||||||
|
if (channelListDTO.getFPhase() == 0.0) {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getC()),
|
||||||
|
BigDecimal.valueOf(-0.05),
|
||||||
|
BigDecimal.valueOf(0.05));
|
||||||
|
} else {
|
||||||
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getC()),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 0.95),
|
||||||
|
BigDecimal.valueOf(channelListDTO.getFPhase() * 1.05));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getC()),
|
is = NumberUtil.isIn(BigDecimal.valueOf(devData.getC()),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 0.95),
|
||||||
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
BigDecimal.valueOf(channelListDTO.getFAmp() * 1.05));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
compareDev.setIsQualified(is);
|
compareDev.setIsQualified(is);
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ public class SocketSourceResponseService {
|
|||||||
|
|
||||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||||
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
||||||
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
|
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$VA", "real$IRMS", "real$IA"));
|
||||||
phaseSequenceParam.setReadCount(5);
|
phaseSequenceParam.setReadCount(5);
|
||||||
phaseSequenceParam.setIgnoreCount(10);
|
phaseSequenceParam.setIgnoreCount(10);
|
||||||
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
||||||
@@ -296,8 +296,8 @@ public class SocketSourceResponseService {
|
|||||||
readData = 1;
|
readData = 1;
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_03.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_03.getValue());
|
||||||
}else {
|
}else {
|
||||||
ignoreCount = 7;
|
ignoreCount = 1;
|
||||||
readData = 20;
|
readData = 1;
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_02.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_02.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -744,15 +744,16 @@ public class DetectionServiceImpl {
|
|||||||
|
|
||||||
public Map<String, Map<Double, List<Double>>> devHarmListMap(List<DevData> dev, SourceIssue sourceIssue, DictDataEnum dataRule, Integer num) {
|
public Map<String, Map<Double, List<Double>>> devHarmListMap(List<DevData> dev, SourceIssue sourceIssue, DictDataEnum dataRule, Integer num) {
|
||||||
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
Map<String, Map<Double, List<Double>>> map = new HashMap<>(3);
|
||||||
List<Double> harmNum;
|
List<Double> harmNum = new ArrayList<>();
|
||||||
|
harmNum.add(1.0);
|
||||||
if (1 == num) {
|
if (1 == num) {
|
||||||
harmNum = sourceIssue.getChannelList().stream()
|
harmNum.addAll(sourceIssue.getChannelList().stream()
|
||||||
.flatMap(x -> x.getInharmList().stream().map(f -> f.getInharm()))
|
.flatMap(x -> x.getInharmList().stream().map(f -> f.getInharm()))
|
||||||
.sorted().distinct().collect(Collectors.toList());
|
.sorted().distinct().collect(Collectors.toList()));
|
||||||
} else {
|
} else {
|
||||||
harmNum = sourceIssue.getChannelList().stream()
|
harmNum.addAll(sourceIssue.getChannelList().stream()
|
||||||
.flatMap(x -> x.getHarmList().stream().map(f -> f.getHarm()))
|
.flatMap(x -> x.getHarmList().stream().map(f -> f.getHarm()))
|
||||||
.sorted().distinct().collect(Collectors.toList());
|
.sorted().distinct().collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
for (DevData devData : dev) {
|
for (DevData devData : dev) {
|
||||||
Optional<DevData.SqlDataDTO> first = devData.getSqlData().stream().collect(Collectors.toList()).stream().findFirst();
|
Optional<DevData.SqlDataDTO> first = devData.getSqlData().stream().collect(Collectors.toList()).stream().findFirst();
|
||||||
@@ -810,6 +811,9 @@ public class DetectionServiceImpl {
|
|||||||
public DetectionData rangeComparisonList(List<Double> list, List<PqErrSysDtls> pqErrSysDtls, Double data, Double channelData, DictDataEnum dataRule) {
|
public DetectionData rangeComparisonList(List<Double> list, List<PqErrSysDtls> pqErrSysDtls, Double data, Double channelData, DictDataEnum dataRule) {
|
||||||
DetectionData detectionData = new DetectionData();
|
DetectionData detectionData = new DetectionData();
|
||||||
detectionData.setIsData(4);
|
detectionData.setIsData(4);
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
detectionData.setData(list.get(0));
|
||||||
|
}
|
||||||
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
||||||
//获得误差体系
|
//获得误差体系
|
||||||
List<PqErrSysDtls> errSysDtls = pqErrSysDtls.stream().filter(x -> rangeComparison(startRadiusEnd(x.getStartValue(), data, channelData, x.getConditionType()),
|
List<PqErrSysDtls> errSysDtls = pqErrSysDtls.stream().filter(x -> rangeComparison(startRadiusEnd(x.getStartValue(), data, channelData, x.getConditionType()),
|
||||||
@@ -994,6 +998,9 @@ public class DetectionServiceImpl {
|
|||||||
Map<Double, List<Double>> integerListMap = map.get(type);
|
Map<Double, List<Double>> integerListMap = map.get(type);
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
if (integerListMap.containsKey(i)) {
|
if (integerListMap.containsKey(i)) {
|
||||||
|
if (i.equals(1.0)) {
|
||||||
|
integerListMap.get(1.0).add(multiply(fund, fund));
|
||||||
|
}else{
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
||||||
}
|
}
|
||||||
@@ -1005,10 +1012,15 @@ public class DetectionServiceImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Map<Double, List<Double>> integerListMap = new LinkedHashMap<>(5);
|
Map<Double, List<Double>> integerListMap = new LinkedHashMap<>(5);
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
List<Double> integerList = new ArrayList<>();
|
List<Double> integerList = new ArrayList<>();
|
||||||
|
if (i.equals(1.0)) {
|
||||||
|
integerList.add(multiply(fund, fund));
|
||||||
|
integerListMap.put(1.0, integerList);
|
||||||
|
} else {
|
||||||
if (type.equals("A")) {
|
if (type.equals("A")) {
|
||||||
integerList.add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
integerList.add(multiply(harm.getList().getA().get((int) (i - num)), fund));
|
||||||
}
|
}
|
||||||
@@ -1020,6 +1032,8 @@ public class DetectionServiceImpl {
|
|||||||
}
|
}
|
||||||
integerListMap.put(i, integerList);
|
integerListMap.put(i, integerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
map.put(type, integerListMap);
|
map.put(type, integerListMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
|
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
|
||||||
|
Boolean fly = false;
|
||||||
if (evt instanceof IdleStateEvent) {
|
if (evt instanceof IdleStateEvent) {
|
||||||
if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
|
if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
|
||||||
if(!FormalTestManager.hasStopFlag) {
|
if(!FormalTestManager.hasStopFlag) {
|
||||||
@@ -114,6 +115,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
if (sourceIssue.getType().equals(DicDataEnum.F.getCode())) {
|
if (sourceIssue.getType().equals(DicDataEnum.F.getCode())) {
|
||||||
//闪变,正常抛一轮最大等待20分钟超时
|
//闪变,正常抛一轮最大等待20分钟超时
|
||||||
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 1300) {
|
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 1300) {
|
||||||
|
fly=true;
|
||||||
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
timeoutSend(sourceIssue);
|
timeoutSend(sourceIssue);
|
||||||
@@ -121,6 +123,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
} else if (sourceIssue.getType().equals(DicDataEnum.VOLTAGE.getCode()) || sourceIssue.getType().equals(DicDataEnum.HP.getCode())) {
|
} else if (sourceIssue.getType().equals(DicDataEnum.VOLTAGE.getCode()) || sourceIssue.getType().equals(DicDataEnum.HP.getCode())) {
|
||||||
//统计数据项,正常抛一轮数据,超时
|
//统计数据项,正常抛一轮数据,超时
|
||||||
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 180) {
|
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 180) {
|
||||||
|
fly=true;
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
timeoutSend(sourceIssue);
|
timeoutSend(sourceIssue);
|
||||||
@@ -129,15 +132,20 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
} else {
|
} else {
|
||||||
//实时数据
|
//实时数据
|
||||||
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 60) {
|
if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 60) {
|
||||||
|
fly=true;
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
timeoutSend(sourceIssue);
|
timeoutSend(sourceIssue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
fly=true;
|
||||||
//为空则认为是常规步骤,设定一分钟超时
|
//为空则认为是常规步骤,设定一分钟超时
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
}
|
}
|
||||||
|
if(fly){
|
||||||
|
socketResponseService.backCheckState(param);
|
||||||
|
}
|
||||||
System.out.println("已经等了一分钟了。。。。。。。。。。。。");
|
System.out.println("已经等了一分钟了。。。。。。。。。。。。");
|
||||||
}else {
|
}else {
|
||||||
//如果是暂停操作后
|
//如果是暂停操作后
|
||||||
@@ -188,9 +196,9 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
System.out.println("Unknown exception caught: " + cause.getMessage());
|
System.out.println("Unknown exception caught: " + cause.getMessage());
|
||||||
// 可以记录未知异常信息
|
// 可以记录未知异常信息
|
||||||
}
|
}
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
socketResponseService.backCheckState(param);
|
||||||
ctx.close();
|
ctx.close();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -338,11 +338,12 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
pqDevService.update(new LambdaUpdateWrapper<PqDev>()
|
pqDevService.update(new LambdaUpdateWrapper<PqDev>()
|
||||||
.set(PqDev::getCheckState, CheckStateEnum.CHECKING.getValue())
|
.set(PqDev::getCheckState, CheckStateEnum.CHECKING.getValue())
|
||||||
.in(PqDev::getId, devIds));
|
.in(PqDev::getId, devIds));
|
||||||
}
|
|
||||||
return this.update(new LambdaUpdateWrapper<AdPlan>()
|
return this.update(new LambdaUpdateWrapper<AdPlan>()
|
||||||
.set(AdPlan::getTestState, CheckStateEnum.CHECKING.getValue())
|
.set(AdPlan::getTestState, CheckStateEnum.CHECKING.getValue())
|
||||||
.eq(AdPlan::getId, planId));
|
.eq(AdPlan::getId, planId));
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateBackTestState(String planId, List<String> devIds) {
|
public boolean updateBackTestState(String planId, List<String> devIds) {
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import com.njcn.gather.device.pojo.enums.*;
|
|||||||
import com.njcn.gather.device.type.entity.DevType;
|
import com.njcn.gather.device.type.entity.DevType;
|
||||||
import com.njcn.gather.device.type.service.IDevTypeService;
|
import com.njcn.gather.device.type.service.IDevTypeService;
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
|
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||||
|
import com.njcn.gather.system.config.service.ISysTestConfigService;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
@@ -56,6 +58,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
private final IPqMonitorService pqMonitorService;
|
private final IPqMonitorService pqMonitorService;
|
||||||
private final DetectionDataDealService detectionDataDealService;
|
private final DetectionDataDealService detectionDataDealService;
|
||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -491,13 +494,20 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateResult(List<String> ids,List<String> valueType, String code) {
|
public boolean updateResult(List<String> ids,List<String> valueType, String code) {
|
||||||
if (CollUtil.isNotEmpty(ids)) {
|
if (CollUtil.isNotEmpty(ids)) {
|
||||||
|
SysTestConfig config = sysTestConfigService.getOneConfig();
|
||||||
Map<String, Integer> result = detectionDataDealService.devResult(ids,valueType, code);
|
Map<String, Integer> result = detectionDataDealService.devResult(ids,valueType, code);
|
||||||
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, ids));
|
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, ids));
|
||||||
for (PqDev pqDev : list) {
|
for (PqDev pqDev : list) {
|
||||||
if (result.containsKey(pqDev.getId())) {
|
if (result.containsKey(pqDev.getId())) {
|
||||||
|
Integer checkState;
|
||||||
|
if (pqDev.getReCheckNum() >= config.getMaxTime()) {
|
||||||
|
checkState = CheckStateEnum.DOCUMENTED.getValue();
|
||||||
|
}else{
|
||||||
|
checkState = CheckStateEnum.CHECKED.getValue();
|
||||||
|
}
|
||||||
this.update(new LambdaUpdateWrapper<PqDev>()
|
this.update(new LambdaUpdateWrapper<PqDev>()
|
||||||
.set(PqDev::getReCheckNum, pqDev.getReCheckNum() + 1)
|
.set(PqDev::getReCheckNum, pqDev.getReCheckNum() + 1)
|
||||||
.set(PqDev::getCheckState, CheckStateEnum.CHECKED.getValue())
|
.set(PqDev::getCheckState, checkState)
|
||||||
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
||||||
.set(PqDev::getCheckTime, LocalDateTime.now())
|
.set(PqDev::getCheckTime, LocalDateTime.now())
|
||||||
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
|
|
||||||
private final String V="real$V2-50";
|
private final String V="real$V2-50";
|
||||||
private final String SV="real$SV_1-49";
|
private final String SV="real$SV_1-49";
|
||||||
|
private final String I="real$I2-50";
|
||||||
|
private final String IV="real$SI_1-49";
|
||||||
|
|
||||||
private final DictTreeMapper dictTreeMapper;
|
private final DictTreeMapper dictTreeMapper;
|
||||||
|
|
||||||
@@ -52,9 +54,16 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
|||||||
if(CollUtil.isNotEmpty(pqScriptCheckData)){
|
if(CollUtil.isNotEmpty(pqScriptCheckData)){
|
||||||
if (param.getIsValueTypeName()) {
|
if (param.getIsValueTypeName()) {
|
||||||
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
||||||
|
if(!checkData.contains("real$U1")){
|
||||||
if(checkData.contains(V)||checkData.contains(SV)){
|
if(checkData.contains(V)||checkData.contains(SV)){
|
||||||
checkData.add("real$U1");
|
checkData.add("real$U1");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(!checkData.contains("real$I1")){
|
||||||
|
if(checkData.contains(I)||checkData.contains(IV)){
|
||||||
|
checkData.add("real$I1");
|
||||||
|
}
|
||||||
|
}
|
||||||
return checkData;
|
return checkData;
|
||||||
} else {
|
} else {
|
||||||
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
||||||
|
|||||||
Reference in New Issue
Block a user