比对相关代码
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@ import com.njcn.gather.detection.pojo.po.IcdCheckData;
|
|||||||
import com.njcn.gather.detection.pojo.po.SourceCompareDev;
|
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.DetectionUtil;
|
||||||
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.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.pojo.po.PqDevSub;
|
import com.njcn.gather.device.pojo.po.PqDevSub;
|
||||||
@@ -31,10 +32,10 @@ import com.njcn.gather.script.pojo.po.SourceIssue;
|
|||||||
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
||||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
|
import com.njcn.gather.storage.service.SimAndDigHarmonicService;
|
||||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
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;
|
||||||
@@ -49,10 +50,7 @@ import java.lang.reflect.Field;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.ZonedDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeParseException;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -85,7 +83,7 @@ public class SocketDevResponseService {
|
|||||||
private final ISysRegResService iSysRegResService;
|
private final ISysRegResService iSysRegResService;
|
||||||
private final IPqScriptCheckDataService iPqScriptCheckDataService;
|
private final IPqScriptCheckDataService iPqScriptCheckDataService;
|
||||||
private final ISysTestConfigService sysTestConfigService;
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
@@ -712,19 +710,18 @@ public class SocketDevResponseService {
|
|||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
String result = socketDataMsg.getData();
|
String result = socketDataMsg.getData();
|
||||||
successComm.add(result);
|
successComm.add(result);
|
||||||
//通讯校验成功
|
//单个测点通讯成功
|
||||||
if (!param.getOperateType().equals(SourceOperateCodeEnum.TEST_TEM_START.getValue())) {
|
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
||||||
}
|
|
||||||
System.out.println("设备通讯校验!" + successComm.size() + "=====" + FormalTestManager.monitorIdListComm.size());
|
System.out.println("设备通讯校验!" + successComm.size() + "=====" + FormalTestManager.monitorIdListComm.size());
|
||||||
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
||||||
if (!param.getOperateType().equals(SourceOperateCodeEnum.TEST_TEM_START.getValue())) {
|
// 通知前端整个装置通讯检测过程成功
|
||||||
SocketDataMsg temMsg = new SocketDataMsg();
|
SocketDataMsg temMsg = new SocketDataMsg();
|
||||||
temMsg.setCode(SourceResponseCodeEnum.DEV_COMM_ALL_SUCCESS.getCode());
|
temMsg.setCode(SourceResponseCodeEnum.DEV_COMM_ALL_SUCCESS.getCode());
|
||||||
temMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
temMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
||||||
temMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
temMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(temMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(temMsg));
|
||||||
}
|
|
||||||
//开始进行协议校验
|
//开始进行协议校验
|
||||||
successComm.clear();
|
successComm.clear();
|
||||||
failComm.clear();
|
failComm.clear();
|
||||||
@@ -1011,7 +1008,7 @@ public class SocketDevResponseService {
|
|||||||
* @param list
|
* @param list
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Integer getErrorType(String desc, DevData.SqlDataDTO.ListDTO list) {
|
public static Integer getErrorType(String desc, DevData.SqlDataDTO.ListDTO list) {
|
||||||
if (ObjectUtil.isNotNull(list)) {
|
if (ObjectUtil.isNotNull(list)) {
|
||||||
if (DetectionCodeEnum.MAG.getCode().equals(desc) || DetectionCodeEnum.DUR.getCode().equals(desc)) {
|
if (DetectionCodeEnum.MAG.getCode().equals(desc) || DetectionCodeEnum.DUR.getCode().equals(desc)) {
|
||||||
if (ObjectUtil.isNull(list.getA()) && ObjectUtil.isNull(list.getB()) && ObjectUtil.isNull(list.getC()) && ObjectUtil.isNull(list.getT())) {
|
if (ObjectUtil.isNull(list.getA()) && ObjectUtil.isNull(list.getB()) && ObjectUtil.isNull(list.getC()) && ObjectUtil.isNull(list.getT())) {
|
||||||
@@ -1190,7 +1187,6 @@ public class SocketDevResponseService {
|
|||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NORMAL_RESPONSE:
|
case NORMAL_RESPONSE:
|
||||||
if (devData.getResult()) {
|
if (devData.getResult()) {
|
||||||
devInfo.add(devData);
|
devInfo.add(devData);
|
||||||
@@ -1479,7 +1475,7 @@ public class SocketDevResponseService {
|
|||||||
switch (operateCodeEnum) {
|
switch (operateCodeEnum) {
|
||||||
case QUIT_INIT_01:
|
case QUIT_INIT_01:
|
||||||
SocketManager.removeUser(s);
|
SocketManager.removeUser(s);
|
||||||
CnSocketUtil.quitSendSource(param);
|
// CnSocketUtil.quitSendSource(param);
|
||||||
break;
|
break;
|
||||||
case QUIT_INIT_02:
|
case QUIT_INIT_02:
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.QUITE.getValue());
|
socketMsg.setRequestId(SourceOperateCodeEnum.QUITE.getValue());
|
||||||
@@ -1666,26 +1662,10 @@ public class SocketDevResponseService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Boolean phaseBoolean(SourceIssue.ChannelListDTO channelListDTO, Double devPhase) {
|
private Boolean phaseBoolean(SourceIssue.ChannelListDTO channelListDTO, Double devPhase) {
|
||||||
Double phase = devPhase;
|
devPhase = DetectionUtil.adjustPhase(devPhase);
|
||||||
if (devPhase < -180) {
|
|
||||||
phase = devPhase + 360;
|
|
||||||
}
|
|
||||||
if (devPhase > 180) {
|
|
||||||
phase = devPhase - 360;
|
|
||||||
}
|
|
||||||
|
|
||||||
Double fPhase = channelListDTO.getFPhase();
|
Double fPhase = channelListDTO.getFPhase();
|
||||||
if (fPhase < -180) {
|
fPhase = DetectionUtil.adjustPhase(fPhase);
|
||||||
fPhase = fPhase + 360;
|
return NumberUtil.isIn(BigDecimal.valueOf(devPhase), BigDecimal.valueOf(fPhase - 1), BigDecimal.valueOf(fPhase + 1));
|
||||||
}
|
|
||||||
if (fPhase > 180) {
|
|
||||||
fPhase = fPhase - 360;
|
|
||||||
}
|
|
||||||
return
|
|
||||||
NumberUtil.isIn(BigDecimal.valueOf(phase),
|
|
||||||
BigDecimal.valueOf(fPhase - 1),
|
|
||||||
BigDecimal.valueOf(fPhase + 1));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1811,10 +1791,10 @@ public class SocketDevResponseService {
|
|||||||
// Runnable runnable = () -> {
|
// Runnable runnable = () -> {
|
||||||
|
|
||||||
System.out.println("原始数据插入数据库开始执行=========================================");
|
System.out.println("原始数据插入数据库开始执行=========================================");
|
||||||
List<AdNonHarmonicResult> adNonHarmonicResultList = new ArrayList<>();
|
List<SimAndDigNonHarmonicResult> simAndDigNonHarmonicResultList = new ArrayList<>();
|
||||||
List<AdHarmonicResult> adHarmonicResultList = new ArrayList<>();
|
List<SimAndDigHarmonicResult> adHarmonicResultList = new ArrayList<>();
|
||||||
for (DevData data : devDataList) {
|
for (DevData data : devDataList) {
|
||||||
LocalDateTime localDateTime = timeFormat(data.getTime(), formatter);
|
LocalDateTime localDateTime = DetectionUtil.timeFormat(data.getTime(), formatter);
|
||||||
if (Objects.nonNull(localDateTime)) {
|
if (Objects.nonNull(localDateTime)) {
|
||||||
|
|
||||||
String[] splitArr = data.getId().split(CnSocketUtil.SPLIT_TAG);
|
String[] splitArr = data.getId().split(CnSocketUtil.SPLIT_TAG);
|
||||||
@@ -1823,7 +1803,7 @@ public class SocketDevResponseService {
|
|||||||
if (nonHarmonicList.contains(sourceIssue.getType())) {
|
if (nonHarmonicList.contains(sourceIssue.getType())) {
|
||||||
for (DevData.SqlDataDTO sqlDataDTO : data.getSqlData()) {
|
for (DevData.SqlDataDTO sqlDataDTO : data.getSqlData()) {
|
||||||
DevData.SqlDataDTO.ListDTO listDTO = sqlDataDTO.getList();
|
DevData.SqlDataDTO.ListDTO listDTO = sqlDataDTO.getList();
|
||||||
AdNonHarmonicResult adNonHarmonicResult = new AdNonHarmonicResult();
|
SimAndDigNonHarmonicResult adNonHarmonicResult = new SimAndDigNonHarmonicResult();
|
||||||
adNonHarmonicResult.setTimeId(localDateTime);
|
adNonHarmonicResult.setTimeId(localDateTime);
|
||||||
adNonHarmonicResult.setMonitorId(temId);
|
adNonHarmonicResult.setMonitorId(temId);
|
||||||
adNonHarmonicResult.setScriptId(param.getScriptId());
|
adNonHarmonicResult.setScriptId(param.getScriptId());
|
||||||
@@ -1848,14 +1828,14 @@ public class SocketDevResponseService {
|
|||||||
if (Objects.nonNull(d)) {
|
if (Objects.nonNull(d)) {
|
||||||
adNonHarmonicResult.setTValue(String.format("%.7f", d));
|
adNonHarmonicResult.setTValue(String.format("%.7f", d));
|
||||||
}
|
}
|
||||||
adNonHarmonicResultList.add(adNonHarmonicResult);
|
simAndDigNonHarmonicResultList.add(adNonHarmonicResult);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (int j = 0; j < data.getSqlDataHarm().size(); j++) {
|
for (int j = 0; j < data.getSqlDataHarm().size(); j++) {
|
||||||
DevData.SqlDataHarmDTO sqlDataDTO = data.getSqlDataHarm().get(j);
|
DevData.SqlDataHarmDTO sqlDataDTO = data.getSqlDataHarm().get(j);
|
||||||
String dui = harmonicRelationMap.get(sqlDataDTO.getDesc());
|
String dui = harmonicRelationMap.get(sqlDataDTO.getDesc());
|
||||||
AdHarmonicResult adHarmonicResult = new AdHarmonicResult();
|
SimAndDigHarmonicResult adHarmonicResult = new SimAndDigHarmonicResult();
|
||||||
adHarmonicResult.setTimeId(localDateTime);
|
adHarmonicResult.setTimeId(localDateTime);
|
||||||
|
|
||||||
adHarmonicResult.setMonitorId(temId);
|
adHarmonicResult.setMonitorId(temId);
|
||||||
@@ -1888,7 +1868,7 @@ public class SocketDevResponseService {
|
|||||||
List<String> b = tem.getB();
|
List<String> b = tem.getB();
|
||||||
List<String> c = tem.getC();
|
List<String> c = tem.getC();
|
||||||
|
|
||||||
Class<AdHarmonicResult> example = (Class<AdHarmonicResult>) adHarmonicResult.getClass();
|
Class<SimAndDigHarmonicResult> example = (Class<SimAndDigHarmonicResult>) adHarmonicResult.getClass();
|
||||||
if (DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) || DicDataEnum.HSI.getCode().equals(sourceIssue.getType())) {
|
if (DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) || DicDataEnum.HSI.getCode().equals(sourceIssue.getType())) {
|
||||||
for (int i = 1; i < a.size() + 1; i++) {
|
for (int i = 1; i < a.size() + 1; i++) {
|
||||||
try {
|
try {
|
||||||
@@ -1930,9 +1910,9 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(adNonHarmonicResultList)) {
|
if (CollUtil.isNotEmpty(simAndDigNonHarmonicResultList)) {
|
||||||
Map<String, List<AdNonHarmonicResult>> map = adNonHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType()));
|
Map<String, List<SimAndDigNonHarmonicResult>> map = simAndDigNonHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType()));
|
||||||
List<AdNonHarmonicResult> info = new ArrayList<>();
|
List<SimAndDigNonHarmonicResult> info = new ArrayList<>();
|
||||||
map.forEach((key, value) -> {
|
map.forEach((key, value) -> {
|
||||||
if (value.size() > 1) {
|
if (value.size() > 1) {
|
||||||
System.err.println("重复时间戳->" + key + value);
|
System.err.println("重复时间戳->" + key + value);
|
||||||
@@ -1944,8 +1924,8 @@ public class SocketDevResponseService {
|
|||||||
detectionDataDealService.acceptAdNon(info, param.getCode());
|
detectionDataDealService.acceptAdNon(info, param.getCode());
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(adHarmonicResultList)) {
|
if (CollUtil.isNotEmpty(adHarmonicResultList)) {
|
||||||
Map<String, List<AdHarmonicResult>> map = adHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType()));
|
Map<String, List<SimAndDigHarmonicResult>> map = adHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getMonitorId() + x.getTimeId() + x.getScriptId() + x.getSort() + x.getAdType() + x.getDataType()));
|
||||||
List<AdHarmonicResult> info = new ArrayList<>();
|
List<SimAndDigHarmonicResult> info = new ArrayList<>();
|
||||||
map.forEach((key, value) -> {
|
map.forEach((key, value) -> {
|
||||||
if (value.size() > 1) {
|
if (value.size() > 1) {
|
||||||
System.err.println("重复时间戳->" + key + value);
|
System.err.println("重复时间戳->" + key + value);
|
||||||
@@ -1961,18 +1941,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private LocalDateTime timeFormat(String dateTimeStr, DateTimeFormatter formatter) {
|
|
||||||
try {
|
|
||||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTimeStr, formatter.withZone(ZoneId.of("UTC")));
|
|
||||||
LocalDateTime localDateTime = zonedDateTime.toLocalDateTime();
|
|
||||||
return localDateTime;
|
|
||||||
} catch (DateTimeParseException e) {
|
|
||||||
System.err.println("日期时间字符串格式错误: " + e.getMessage());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向前端推送消息
|
* 向前端推送消息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -29,16 +29,12 @@ public enum DetectionCodeEnum {
|
|||||||
I_UNBAN("I_UNBAN", "三相电流负序不平衡度"),
|
I_UNBAN("I_UNBAN", "三相电流负序不平衡度"),
|
||||||
PST("PST", "短时间闪变"),
|
PST("PST", "短时间闪变"),
|
||||||
P_FUND("P_FUND", "功率"),
|
P_FUND("P_FUND", "功率"),
|
||||||
|
|
||||||
|
|
||||||
I1("I1", "基波电流"),
|
I1("I1", "基波电流"),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UNKNOWN_ERROR("-1", "未知异常"),
|
UNKNOWN_ERROR("-1", "未知异常"),
|
||||||
|
|
||||||
;
|
|
||||||
|
STAR("Star","星型接线"),
|
||||||
|
DELTA("Delta","角型接线");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String message;
|
private final String message;
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ public enum SourceOperateCodeEnum {
|
|||||||
YJC_SBTXJY("yjc_sbtxjy", "设备通讯检测"),
|
YJC_SBTXJY("yjc_sbtxjy", "设备通讯检测"),
|
||||||
YJC_XYJY("yjc_xyjy", "协议校验"),
|
YJC_XYJY("yjc_xyjy", "协议校验"),
|
||||||
YJC_XUJY("YJC_xujy", "相序校验"),
|
YJC_XUJY("YJC_xujy", "相序校验"),
|
||||||
|
YJC_ALIGN("YJC_align","实时数据对齐校验"),
|
||||||
|
YJC_MXYZXJY("YJC_mxyzxjy", "模型一致性校验"),
|
||||||
FORMAL_REAL("formal_real","正式检测"),
|
FORMAL_REAL("formal_real","正式检测"),
|
||||||
// SIMULATE_REAL("simulate_real","模拟检测"),
|
// SIMULATE_REAL("simulate_real","模拟检测"),
|
||||||
Coefficient_Check("Coefficient_Check","系数校验"),
|
Coefficient_Check("Coefficient_Check","系数校验"),
|
||||||
@@ -78,7 +80,6 @@ public enum SourceOperateCodeEnum {
|
|||||||
// TEST_TEM_STOP("5","临时停止"),
|
// TEST_TEM_STOP("5","临时停止"),
|
||||||
ALL_TEST("1","全部检测"),
|
ALL_TEST("1","全部检测"),
|
||||||
RE_ERROR_TEST("2","不合格项复检"),
|
RE_ERROR_TEST("2","不合格项复检"),
|
||||||
TEST_TEM_START("3","继续检测"),
|
|
||||||
SIMULATE_TEST("4","模拟检测"),
|
SIMULATE_TEST("4","模拟检测"),
|
||||||
//TEST_STOP("7","停止检测"),
|
//TEST_STOP("7","停止检测"),
|
||||||
//FAST_TEST("10","一键检测"),
|
//FAST_TEST("10","一键检测"),
|
||||||
@@ -99,10 +100,7 @@ public enum SourceOperateCodeEnum {
|
|||||||
/**
|
/**
|
||||||
* ftp文件传送指令
|
* ftp文件传送指令
|
||||||
*/
|
*/
|
||||||
FTP_SEND_01("FTP_SEND$01", "发送文件")
|
FTP_SEND_01("FTP_SEND$01", "发送文件"),;
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
private final String msg;
|
private final String msg;
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class ContrastDetectionParam {
|
|||||||
@NotEmpty(message = DetectionValidMessage.STANDARD_DEV_IDS_NOT_EMPTY)
|
@NotEmpty(message = DetectionValidMessage.STANDARD_DEV_IDS_NOT_EMPTY)
|
||||||
private List<String> standardDevIds;
|
private List<String> standardDevIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key为 标准设备ID_检测点序号、value为 被检设备ID_检测点序号
|
||||||
|
*/
|
||||||
@ApiModelProperty("配对关系")
|
@ApiModelProperty("配对关系")
|
||||||
@NotEmpty(message = DetectionValidMessage.PAIRS_NOT_EMPTY)
|
@NotEmpty(message = DetectionValidMessage.PAIRS_NOT_EMPTY)
|
||||||
private Map<String,String> pairs;
|
private Map<String,String> pairs;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.gather.detection.service.impl;
|
package com.njcn.gather.detection.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
@@ -23,8 +24,10 @@ import com.njcn.gather.detection.util.socket.FormalTestManager;
|
|||||||
import com.njcn.gather.detection.util.socket.SocketManager;
|
import com.njcn.gather.detection.util.socket.SocketManager;
|
||||||
import com.njcn.gather.detection.util.socket.WebServiceManager;
|
import com.njcn.gather.detection.util.socket.WebServiceManager;
|
||||||
import com.njcn.gather.detection.util.socket.cilent.NettyClient;
|
import com.njcn.gather.detection.util.socket.cilent.NettyClient;
|
||||||
|
import com.njcn.gather.detection.util.socket.cilent.NettyContrastClientHandler;
|
||||||
import com.njcn.gather.detection.util.socket.cilent.NettySourceClientHandler;
|
import com.njcn.gather.detection.util.socket.cilent.NettySourceClientHandler;
|
||||||
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.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.pojo.po.AdPlanSource;
|
import com.njcn.gather.plan.pojo.po.AdPlanSource;
|
||||||
@@ -45,7 +48,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -292,19 +298,35 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
private void sendContrastSocket(ContrastDetectionParam param) {
|
private void sendContrastSocket(ContrastDetectionParam param) {
|
||||||
String s = param.getUserId() + CnSocketUtil.DEV_TAG;
|
String s = param.getUserId() + CnSocketUtil.DEV_TAG;
|
||||||
|
|
||||||
// Map<String, List<PreDetection>> map = new HashMap<>(1);
|
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
||||||
// List<PreDetection> preDetections = BeanUtil.copyToList(FormalTestManager.devList, PreDetection.class);
|
List<PreDetection> preDetections = BeanUtil.copyToList(FormalTestManager.devList, PreDetection.class);
|
||||||
// preDetections.forEach(x -> {
|
preDetections.addAll(BeanUtil.copyToList(FormalTestManager.standardDevList, PreDetection.class));
|
||||||
// x.setDevType(x.getIcdType());
|
preDetections.forEach(x -> {
|
||||||
// });
|
x.setDevType(x.getIcdType());
|
||||||
// map.put("deviceList", preDetections);
|
x.getMonitorList().forEach(y -> {
|
||||||
// String jsonString = JSON.toJSONString(map);
|
|
||||||
// socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
String pt = y.getPt();
|
||||||
// socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
int i = pt.indexOf(":");
|
||||||
// socketMsg.setData(jsonString);
|
y.setPt(BigDecimal.valueOf(Double.parseDouble(pt.substring(0, i))).divide(BigDecimal.valueOf(Double.parseDouble(pt.substring(i + 1))), 5, BigDecimal.ROUND_HALF_UP) + "");
|
||||||
// String json = JSON.toJSONString(socketMsg);
|
|
||||||
// SocketManager.sendMsg(s,json);
|
String ct = y.getCt();
|
||||||
// NettyClient.socketClient(ip, port, param, json, new NettyDevClientHandler(param, socketDevResponseService));
|
i = ct.indexOf(":");
|
||||||
|
y.setCt(BigDecimal.valueOf(Double.parseDouble(ct.substring(0, i))).divide(BigDecimal.valueOf(Double.parseDouble(ct.substring(i + 1))), 5, BigDecimal.ROUND_HALF_UP) + "");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
map.put("deviceList", preDetections);
|
||||||
|
String jsonString = JSON.toJSONString(map);
|
||||||
|
|
||||||
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
||||||
|
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
||||||
|
socketMsg.setData(jsonString);
|
||||||
|
String json = JSON.toJSONString(socketMsg);
|
||||||
|
SocketManager.sendMsg(s, json);
|
||||||
|
|
||||||
|
PreDetectionParam preDetectionParam = new PreDetectionParam();
|
||||||
|
preDetectionParam.setUserPageId(param.getUserId());
|
||||||
|
NettyClient.socketClient(ip, port, preDetectionParam, json, new NettyContrastClientHandler(preDetectionParam, socketContrastResponseService));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,219 @@
|
|||||||
|
package com.njcn.gather.detection.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.DateTimeParseException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
public class DetectionUtil {
|
||||||
|
/**
|
||||||
|
* 相角矫正到统一个区间
|
||||||
|
*
|
||||||
|
* @param phase
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Double adjustPhase(Double phase) {
|
||||||
|
if (phase < -180) {
|
||||||
|
return phase + 360;
|
||||||
|
}
|
||||||
|
if (phase > 180) {
|
||||||
|
return phase - 360;
|
||||||
|
}
|
||||||
|
return phase;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断数据是否对齐
|
||||||
|
*
|
||||||
|
* @param devData 被检设备数据
|
||||||
|
* @param standardDevData 标准设备数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isAlignData(DevData devData, DevData standardDevData) {
|
||||||
|
if (ObjectUtil.isNotNull(devData) && ObjectUtil.isNotNull(standardDevData)) {
|
||||||
|
|
||||||
|
long devMillis = getMillis(devData.getTime());
|
||||||
|
long standardMillis = getMillis(standardDevData.getTime());
|
||||||
|
if (BigDecimal.valueOf(devMillis).divide(BigDecimal.valueOf(10), 0, BigDecimal.ROUND_HALF_UP).compareTo(BigDecimal.valueOf(standardMillis).divide(BigDecimal.valueOf(10), 0, BigDecimal.ROUND_HALF_UP)) == 0) {
|
||||||
|
return true;
|
||||||
|
} else if (Math.abs(devMillis - standardMillis) < 100) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将字符串日期时间转换为指定格式的LocalDateTime
|
||||||
|
*
|
||||||
|
* @param dateTimeStr
|
||||||
|
* @param formatter
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static LocalDateTime timeFormat(String dateTimeStr, DateTimeFormatter formatter) {
|
||||||
|
try {
|
||||||
|
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTimeStr, formatter.withZone(ZoneId.of("UTC")));
|
||||||
|
LocalDateTime localDateTime = zonedDateTime.toLocalDateTime();
|
||||||
|
return localDateTime;
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
System.err.println("日期时间字符串格式错误: " + e.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字符串日期时间对应的毫秒数
|
||||||
|
*
|
||||||
|
* @param dateTimeStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static long getMillis(String dateTimeStr) {
|
||||||
|
LocalDateTime localDateTime = timeFormat(dateTimeStr, DateTimeFormatter.ISO_DATE_TIME);
|
||||||
|
return getMillis(localDateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取LocalDateTime的所对应的毫秒数
|
||||||
|
*
|
||||||
|
* @param localDateTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static long getMillis(LocalDateTime localDateTime) {
|
||||||
|
return localDateTime.atZone(ZoneId.of("UTC")).toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断value是否为0
|
||||||
|
* @param value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isZero(Double value) {
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(value);
|
||||||
|
if(bd.subtract(BigDecimal.ZERO).abs().compareTo(BigDecimal.valueOf(0.001)) < 0){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取CP95值
|
||||||
|
*
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Double> getCP95Doubles(List<Double> t) {
|
||||||
|
if (CollUtil.isNotEmpty(t)) {
|
||||||
|
if (t.size() < 21) {
|
||||||
|
if (t.size() == 1) {
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
if (t.size() > 1) {
|
||||||
|
return t.subList(1, 2);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int v = (int) (t.size() * 0.5);
|
||||||
|
return t.subList(v, v + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取CP95值所在索引
|
||||||
|
*
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getCP95Idx(List<Double> t) {
|
||||||
|
if (CollUtil.isNotEmpty(t)) {
|
||||||
|
if (t.size() < 21) {
|
||||||
|
if (t.size() == 1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (t.size() > 1) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int v = (int) (t.size() * 0.5);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部分值
|
||||||
|
*
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Double> getSectionValueDoubles(List<Double> t) {
|
||||||
|
if (CollUtil.isNotEmpty(t)) {
|
||||||
|
if (t.size() > 2) {
|
||||||
|
Double max = Collections.max(t);
|
||||||
|
Double min = Collections.min(t);
|
||||||
|
t.remove(max);
|
||||||
|
t.remove(min);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取平均值
|
||||||
|
*
|
||||||
|
* @param t
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Double> getAvgDoubles(List<Double> t) {
|
||||||
|
if (CollUtil.isNotEmpty(t)) {
|
||||||
|
t = Arrays.asList(t.stream().mapToDouble(Double::doubleValue).average().orElse(0.0));
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对list进行从大到小排序,并返回排序后的索引序列
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Integer> sort(List<Double> list) {
|
||||||
|
List<Integer> indexList = Stream.iterate(0, i -> i + 1).limit(list.size()).collect(Collectors.toList());
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
int maxIdx = i;
|
||||||
|
for (int j = i + 1; j < list.size(); j++) {
|
||||||
|
if (list.get(j) > list.get(maxIdx)) {
|
||||||
|
maxIdx = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxIdx != i) {
|
||||||
|
double temp = list.get(i);
|
||||||
|
list.set(i, list.get(maxIdx));
|
||||||
|
list.set(maxIdx, temp);
|
||||||
|
|
||||||
|
int tempIdx = indexList.get(i);
|
||||||
|
indexList.set(i, indexList.get(maxIdx));
|
||||||
|
indexList.set(maxIdx, tempIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return indexList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.njcn.gather.detection.util.socket;
|
package com.njcn.gather.detection.util.socket;
|
||||||
|
|
||||||
|
import com.google.common.collect.HashBiMap;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
|
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
|
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -13,68 +16,98 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
/**
|
/**
|
||||||
* @Author: cdf
|
* @Author: cdf
|
||||||
* @CreateTime: 2025-01-08
|
* @CreateTime: 2025-01-08
|
||||||
* @Description: 正式检测对象管理
|
* @Description: 正式(预)检测对象管理
|
||||||
*/
|
*/
|
||||||
public class FormalTestManager {
|
public class FormalTestManager {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key:设备ip,value:当前设备下面的通道序号
|
* key:设备ip,value:当前设备下面的通道号
|
||||||
*/
|
*/
|
||||||
public static Map<String,List<String>> devMapMonitorNum = new ConcurrentHashMap<>();
|
public static Map<String, List<String>> devMapMonitorNum = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所有参与检测的装置
|
* 所有参与检测的被检设备
|
||||||
*/
|
*/
|
||||||
public static List<PreDetection> devList = new ArrayList<>();
|
public static List<PreDetection> devList = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有参与检测的标准设备
|
||||||
|
*/
|
||||||
|
public static List<PreDetection> standardDevList = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所有参与检测的监测点
|
* 所有参与检测的监测点
|
||||||
*/
|
*/
|
||||||
public static List<String> monitorIdListComm = new ArrayList<>();
|
public static List<String> monitorIdListComm = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有参与检测的监测点。key:监测点id(ip_通道号),value:检测点实体
|
||||||
|
*/
|
||||||
|
public static Map<String, PreDetection.MonitorListDTO> monitorMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
//用于存储所有测点的实时数据
|
* 用于存储所有测点的实时数据
|
||||||
|
*/
|
||||||
public static List<DevData> realDataXiList = new ArrayList<>();
|
public static List<DevData> realDataXiList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key:设备ip,value:装置名称
|
* key:设备ip,value:装置名称
|
||||||
*/
|
*/
|
||||||
public static Map<String, String> devNameMapComm = new HashMap<>();
|
public static Map<String, String> devNameMapComm = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key:设备ip,value:装置id
|
* key:设备ip,value:装置id
|
||||||
*/
|
*/
|
||||||
public static Map<String, String> devIdMapComm = new HashMap<>();
|
public static Map<String, String> devIdMapComm = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停止触发标识
|
* 停止触发标识
|
||||||
*/
|
*/
|
||||||
public static Boolean stopFlag = false;
|
public static Boolean stopFlag = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已经暂停后的标识
|
* 已经暂停后的标识
|
||||||
*/
|
*/
|
||||||
public static Boolean hasStopFlag = false;
|
public static Boolean hasStopFlag = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂停后的超时计时时间
|
* 暂停后的超时计时时间
|
||||||
*/
|
*/
|
||||||
public static Integer stopTime = 0;
|
public static Integer stopTime = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强行赋值关系
|
* 强行赋值关系
|
||||||
*/
|
*/
|
||||||
public static Map<String,String> harmonicRelationMap = new HashMap<>();
|
public static Map<String, String> harmonicRelationMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前正在检测的计划
|
* 当前正在检测的计划
|
||||||
*/
|
*/
|
||||||
public static AdPlan currentTestPlan;
|
public static AdPlan currentTestPlan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比对式检测-检测项。
|
||||||
|
*/
|
||||||
|
public static List<String> testItemCodeList = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据处理原则
|
||||||
|
*/
|
||||||
|
public static DictDataEnum dataRule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有参与比对式检测的被检设备、标准设备配对关系。key:标准设备id_通道号,value:被检设备id_通道号
|
||||||
|
*/
|
||||||
|
public static Map<String, String> pairsMap = HashBiMap.create();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被检设备的数据。key:设备ip_通道号,value:DevData数据集合
|
||||||
|
*/
|
||||||
|
public static Map<String, List<DevData>> devDataMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准设备的数据。key:设备ip_通道号,value:DevData数据集合
|
||||||
|
*/
|
||||||
|
public static Map<String, List<DevData>> standardDevDataMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.gather.detection.util.socket;
|
package com.njcn.gather.detection.util.socket;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
||||||
import com.njcn.gather.script.pojo.po.SourceIssue;
|
import com.njcn.gather.script.pojo.po.SourceIssue;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
@@ -94,6 +95,10 @@ public class SocketManager {
|
|||||||
*/
|
*/
|
||||||
public static volatile Map<Integer,Long> clockMap = new ConcurrentHashMap<>();
|
public static volatile Map<Integer,Long> clockMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于存储比对式测试时间。
|
||||||
|
*/
|
||||||
|
public static volatile Map<DataSourceEnum, Long> contrastClockMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,12 @@ public class NettyClient {
|
|||||||
socketDataMsg.setRequestId("connect");
|
socketDataMsg.setRequestId("connect");
|
||||||
if (handler instanceof NettySourceClientHandler) {
|
if (handler instanceof NettySourceClientHandler) {
|
||||||
socketDataMsg.setOperateCode("Source");
|
socketDataMsg.setOperateCode("Source");
|
||||||
} else {
|
} else if (handler instanceof NettyDevClientHandler) {
|
||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
socketDataMsg.setOperateCode("Dev");
|
socketDataMsg.setOperateCode("Dev");
|
||||||
|
} else {
|
||||||
|
socketDataMsg.setOperateCode("Dev");
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
}
|
}
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1,23 +1,181 @@
|
|||||||
package com.njcn.gather.detection.util.socket.cilent;
|
package com.njcn.gather.detection.util.socket.cilent;
|
||||||
|
|
||||||
import com.njcn.gather.detection.handler.SocketContrastResponseService;
|
import com.njcn.gather.detection.handler.SocketContrastResponseService;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
||||||
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
|
import com.njcn.gather.detection.util.socket.CnSocketUtil;
|
||||||
|
import com.njcn.gather.detection.util.socket.SocketManager;
|
||||||
|
import com.njcn.gather.plan.pojo.enums.DataSourceEnum;
|
||||||
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
|
import io.netty.handler.timeout.IdleState;
|
||||||
|
import io.netty.handler.timeout.IdleStateEvent;
|
||||||
|
import io.netty.handler.timeout.TimeoutException;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.ConnectException;
|
||||||
|
import java.net.ProtocolException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @data 2025-07-18
|
* @data 2025-07-25
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class NettyContrastClientHandler extends SimpleChannelInboundHandler<String> {
|
public class NettyContrastClientHandler extends SimpleChannelInboundHandler<String> {
|
||||||
|
|
||||||
|
|
||||||
|
private final PreDetectionParam param;
|
||||||
private final SocketContrastResponseService socketContrastResponseService;
|
private final SocketContrastResponseService socketContrastResponseService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext channelHandlerContext, String s) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
System.out.println("客户端通道已建立" + ctx.channel().id());
|
||||||
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + CnSocketUtil.DEV_TAG);
|
||||||
|
if (Objects.nonNull(channel)) {
|
||||||
|
try {
|
||||||
|
channel.close().sync();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SocketManager.addUser(param.getUserPageId() + CnSocketUtil.DEV_TAG, ctx.channel());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws InterruptedException {
|
||||||
|
System.out.println("contrastClientHandler接收server端数据>>>>>>" + msg);
|
||||||
|
try {
|
||||||
|
socketContrastResponseService.deal(param, msg);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
System.out.println("与通信模块端断线");
|
||||||
|
ctx.close();
|
||||||
|
SocketManager.removeUser(param.getUserPageId() + CnSocketUtil.DEV_TAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户事件的回调方法(自定义事件用于心跳机制)
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param evt
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
|
||||||
|
if (evt instanceof IdleStateEvent) { //IdleState.在一段时间内没有收到任何消息时,会触发该事件
|
||||||
|
if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
|
||||||
|
System.out.println(LocalDateTime.now() + "contrastClientHandler触发读超时函数**************************************");
|
||||||
|
SocketManager.contrastClockMap.put(DataSourceEnum.REAL_DATA, SocketManager.contrastClockMap.get(DataSourceEnum.REAL_DATA) + 60L);
|
||||||
|
|
||||||
|
//实时数据
|
||||||
|
if (SocketManager.contrastClockMap.get(DataSourceEnum.REAL_DATA) >= 60) {
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
System.out.println("超时处理-----》" + "实时数据已超时----------------关闭");
|
||||||
|
timeoutSend();
|
||||||
|
}
|
||||||
|
// if (!FormalTestManager.hasStopFlag) {
|
||||||
|
// if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
|
||||||
|
// SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
|
||||||
|
// if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
||||||
|
// SocketManager.clockMap.put(sourceIssue.getIndex(), SocketManager.clockMap.get(sourceIssue.getIndex()) + 60L);
|
||||||
|
// } else {
|
||||||
|
// SocketManager.clockMap.put(sourceIssue.getIndex(), 60L);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (sourceIssue.getType().equals(DicDataEnum.F.getCode())) {
|
||||||
|
// //闪变,正常抛一轮最大等待20分钟超时
|
||||||
|
// if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 1300) {
|
||||||
|
// fly = true;
|
||||||
|
// System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
|
// CnSocketUtil.quitSend(param);
|
||||||
|
// timeoutSend(sourceIssue);
|
||||||
|
// }
|
||||||
|
// } else if (sourceIssue.getType().equals(DicDataEnum.VOLTAGE.getCode()) || sourceIssue.getType().equals(DicDataEnum.HP.getCode())) {
|
||||||
|
// //统计数据项,正常抛一轮数据,超时
|
||||||
|
// if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 180) {
|
||||||
|
// fly = true;
|
||||||
|
// CnSocketUtil.quitSend(param);
|
||||||
|
// System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
|
// timeoutSend(sourceIssue);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// //实时数据
|
||||||
|
// if (SocketManager.clockMap.get(sourceIssue.getIndex()) > 60) {
|
||||||
|
// fly = true;
|
||||||
|
// CnSocketUtil.quitSend(param);
|
||||||
|
// System.out.println("超时处理-----》" + sourceIssue.getType() + "已超时----------------关闭");
|
||||||
|
// timeoutSend(sourceIssue);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// fly = true;
|
||||||
|
// //为空则认为是常规步骤,设定一分钟超时
|
||||||
|
// CnSocketUtil.quitSend(param);
|
||||||
|
// CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.SOCKET_TIMEOUT.getValue(), SourceOperateCodeEnum.SOCKET_TIMEOUT.getValue(), SourceOperateCodeEnum.SOCKET_TIMEOUT.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// if (fly) {
|
||||||
|
// socketContrastResponseService.backCheckState(param);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// //如果是暂停操作后
|
||||||
|
// FormalTestManager.stopTime += 60;
|
||||||
|
// System.out.println("当前进入暂停操作超时函数-----------------" + FormalTestManager.stopTime);
|
||||||
|
// if (FormalTestManager.stopTime > 600) {
|
||||||
|
// CnSocketUtil.quitSend(param);
|
||||||
|
// CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.FORMAL_REAL.getValue(), SourceOperateCodeEnum.STOP_TIMEOUT.getValue(), SourceOperateCodeEnum.STOP_TIMEOUT.getMsg(), null);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handlerAdded(ChannelHandlerContext ctx) {
|
||||||
|
System.out.println("有通道准备接入" + ctx.channel());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
|
System.out.println("捕获到通信模块服务异常。。。。。。。");
|
||||||
|
// 处理异常,例如记录日志、关闭连接等
|
||||||
|
cause.printStackTrace();
|
||||||
|
// 根据异常类型进行不同的处理
|
||||||
|
if (cause instanceof ConnectException) {
|
||||||
|
System.out.println("连接socket服务端异常");
|
||||||
|
} else if (cause instanceof IOException) {
|
||||||
|
System.out.println("IOException caught: There was an I/O error.");
|
||||||
|
CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.DEVICE_ERROR.getValue(), SourceOperateCodeEnum.DEVICE_ERROR.getValue(), SourceOperateCodeEnum.DEVICE_ERROR.getMsg(), null);
|
||||||
|
} else if (cause instanceof TimeoutException) {
|
||||||
|
System.out.println("TimeoutException caught: Operation timed out.");
|
||||||
|
} else if (cause instanceof ProtocolException) {
|
||||||
|
System.out.println("ProtocolException caught: Invalid protocol message.");
|
||||||
|
} else {
|
||||||
|
// 处理其他类型的异常
|
||||||
|
System.out.println("Unknown exception caught: " + cause.getMessage());
|
||||||
|
CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.DEVICE_ERROR.getValue(), SourceOperateCodeEnum.DEVICE_ERROR.getValue(), SourceOperateCodeEnum.DEVICE_ERROR.getMsg(), null);
|
||||||
|
}
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
// socketContrastResponseService.backCheckState(param);
|
||||||
|
ctx.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收数据超时处理
|
||||||
|
*/
|
||||||
|
private void timeoutSend() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import com.njcn.gather.detection.handler.SocketDevResponseService;
|
|||||||
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
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.vo.DevLineTestResult;
|
import com.njcn.gather.detection.pojo.vo.DevLineTestResult;
|
||||||
import com.njcn.gather.detection.pojo.vo.SocketDataMsg;
|
|
||||||
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
|
||||||
import com.njcn.gather.detection.pojo.vo.WebSocketVO;
|
import com.njcn.gather.detection.pojo.vo.WebSocketVO;
|
||||||
import com.njcn.gather.detection.util.socket.*;
|
import com.njcn.gather.detection.util.socket.CnSocketUtil;
|
||||||
|
import com.njcn.gather.detection.util.socket.FormalTestManager;
|
||||||
|
import com.njcn.gather.detection.util.socket.SocketManager;
|
||||||
|
import com.njcn.gather.detection.util.socket.WebServiceManager;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import com.njcn.gather.script.pojo.po.SourceIssue;
|
import com.njcn.gather.script.pojo.po.SourceIssue;
|
||||||
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
||||||
@@ -25,11 +26,9 @@ import java.io.IOException;
|
|||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.ProtocolException;
|
import java.net.ProtocolException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.List;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,8 +40,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
||||||
|
|
||||||
private final String dev = "_Dev";
|
|
||||||
|
|
||||||
private final PreDetectionParam param;
|
private final PreDetectionParam param;
|
||||||
|
|
||||||
private final SocketDevResponseService socketResponseService;
|
private final SocketDevResponseService socketResponseService;
|
||||||
@@ -56,7 +53,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
@Override
|
@Override
|
||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
System.out.println("客户端通道已建立" + ctx.channel().id());
|
System.out.println("客户端通道已建立" + ctx.channel().id());
|
||||||
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + dev);
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + CnSocketUtil.DEV_TAG);
|
||||||
if (Objects.nonNull(channel)) {
|
if (Objects.nonNull(channel)) {
|
||||||
try {
|
try {
|
||||||
channel.close().sync();
|
channel.close().sync();
|
||||||
@@ -64,7 +61,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SocketManager.addUser(param.getUserPageId() + dev, ctx.channel());
|
SocketManager.addUser(param.getUserPageId() + CnSocketUtil.DEV_TAG, ctx.channel());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,8 +76,6 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
CnSocketUtil.quitSend(param);
|
CnSocketUtil.quitSend(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +87,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
System.out.println("设备通讯客户端断线");
|
System.out.println("设备通讯客户端断线");
|
||||||
ctx.close();
|
ctx.close();
|
||||||
SocketManager.removeUser(param.getUserPageId() + dev);
|
SocketManager.removeUser(param.getUserPageId() + CnSocketUtil.DEV_TAG);
|
||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +238,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
devListRes.add(devLineTestResult);
|
devListRes.add(devLineTestResult);
|
||||||
});
|
});
|
||||||
WebSocketVO<List<DevLineTestResult>> socketVO = new WebSocketVO<>();
|
WebSocketVO<List<DevLineTestResult>> socketVO = new WebSocketVO<>();
|
||||||
socketVO.setRequestId(sourceIssue.getType() + "_End");
|
socketVO.setRequestId(sourceIssue.getType() + CnSocketUtil.END_TAG);
|
||||||
socketVO.setOperateCode(sourceIssue.getType());
|
socketVO.setOperateCode(sourceIssue.getType());
|
||||||
socketVO.setData(devListRes);
|
socketVO.setData(devListRes);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketVO));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketVO));
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @date 2025-07-02
|
* @date 2025-07-02
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package com.njcn.gather.device.mapper;
|
|||||||
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
||||||
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author makejava
|
* @author makejava
|
||||||
@@ -9,5 +13,6 @@ import com.njcn.gather.device.pojo.po.PqStandardDev;
|
|||||||
*/
|
*/
|
||||||
public interface PqStandardDevMapper extends MPJBaseMapper<PqStandardDev> {
|
public interface PqStandardDevMapper extends MPJBaseMapper<PqStandardDev> {
|
||||||
|
|
||||||
|
List<PreDetection> listStandardDevPreDetection(@Param("devIds") List<String> ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,47 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.gather.device.mapper.PqStandardDevMapper">
|
<mapper namespace="com.njcn.gather.device.mapper.PqStandardDevMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="standardDevResultMap" type="com.njcn.gather.device.pojo.vo.PreDetection">
|
||||||
|
<id column="Id" property="devId"/>
|
||||||
|
<id column="Name" property="devName"/>
|
||||||
|
<id column="IP" property="devIP"/>
|
||||||
|
<result column="Port" property="port"/>
|
||||||
|
<result column="Dev_Type" property="devType"/>
|
||||||
|
<result column="Series" property="devCode"/>
|
||||||
|
<result column="Dev_Key" property="devKey"/>
|
||||||
|
<result column="icdType" property="icdType"/>
|
||||||
|
<result column="Dev_Chns" property="devChns"/>
|
||||||
|
<result column="Dev_Volt" property="devVolt"/>
|
||||||
|
<result column="Dev_Curr" property="devCurr"/>
|
||||||
|
|
||||||
|
<!-- <collection-->
|
||||||
|
<!-- property="monitorList"-->
|
||||||
|
<!-- column="{ devId = Id}"-->
|
||||||
|
<!-- select="com.njcn.gather.monitor.mapper.PqMonitorMapper.selectMonitorInfo"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- </collection>-->
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="listStandardDevPreDetection" resultMap="standardDevResultMap">
|
||||||
|
select
|
||||||
|
standard_dev.Id,
|
||||||
|
standard_dev.Name,
|
||||||
|
standard_dev.IP,
|
||||||
|
standard_dev.Port,
|
||||||
|
standard_dev.Dev_Type,
|
||||||
|
standard_dev.Series,
|
||||||
|
standard_dev.Dev_Key,
|
||||||
|
dev_type.icdType,
|
||||||
|
dev_type.Dev_Chns,
|
||||||
|
dev_type.Dev_Volt,
|
||||||
|
dev_type.Dev_Curr
|
||||||
|
from pq_standard_dev standard_dev
|
||||||
|
inner join pq_dev_type dev_type on standard_dev.Dev_Type = dev_type.id
|
||||||
|
where standard_dev.Id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class PqDevParam {
|
|||||||
private String delegate;
|
private String delegate;
|
||||||
|
|
||||||
@ApiModelProperty("被检通道")
|
@ApiModelProperty("被检通道")
|
||||||
private List<String> inspectChannel;
|
private String inspectChannel;
|
||||||
|
|
||||||
@ApiModelProperty("投运日期")
|
@ApiModelProperty("投运日期")
|
||||||
@DateTimeStrValid(message = DetectionValidMessage.OPERATION_DATE_FORMAT_ERROR)
|
@DateTimeStrValid(message = DetectionValidMessage.OPERATION_DATE_FORMAT_ERROR)
|
||||||
|
|||||||
@@ -50,51 +50,51 @@ public class ContrastDevExcel implements Serializable {
|
|||||||
@NotBlank(message = DetectionValidMessage.MANUFACTURER_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.MANUFACTURER_NOT_BLANK)
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@Excel(name = "被检通道", width = 20, needMerge = true, orderNum = "8")
|
// @Excel(name = "被检通道", width = 20, needMerge = true, orderNum = "8")
|
||||||
private String inspectChannel;
|
// private String inspectChannel;
|
||||||
|
|
||||||
@Excel(name = "固件版本", width = 15, needMerge = true, orderNum = "9")
|
@Excel(name = "固件版本", width = 15, needMerge = true, orderNum = "8")
|
||||||
private String hardwareVersion;
|
private String hardwareVersion;
|
||||||
|
|
||||||
@Excel(name = "软件版本", width = 15, needMerge = true, orderNum = "10")
|
@Excel(name = "软件版本", width = 15, needMerge = true, orderNum = "9")
|
||||||
private String softwareVersion;
|
private String softwareVersion;
|
||||||
|
|
||||||
@Excel(name = "通讯协议*", width = 15, needMerge = true, orderNum = "11")
|
@Excel(name = "通讯协议*", width = 15, needMerge = true, orderNum = "10")
|
||||||
@NotBlank(message = DetectionValidMessage.PROTOCOL_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.PROTOCOL_NOT_BLANK)
|
||||||
private String protocol;
|
private String protocol;
|
||||||
|
|
||||||
@Excel(name = "是否加密*", width = 20, needMerge = true, replace = {"否_0", "是_1"}, orderNum = "12")
|
@Excel(name = "是否加密*", width = 20, needMerge = true, replace = {"否_0", "是_1"}, orderNum = "11")
|
||||||
@NotNull(message = DetectionValidMessage.ENCRYPTION_NOT_NULL)
|
@NotNull(message = DetectionValidMessage.ENCRYPTION_NOT_NULL)
|
||||||
private Integer encryptionFlag;
|
private Integer encryptionFlag;
|
||||||
|
|
||||||
@Excel(name = "识别码(当加密时必填)", width = 30, needMerge = true, orderNum = "13")
|
@Excel(name = "识别码(当加密时必填)", width = 30, needMerge = true, orderNum = "12")
|
||||||
private String series;
|
private String series;
|
||||||
|
|
||||||
@Excel(name = "秘钥(当加密时必填)", width = 30, needMerge = true, orderNum = "14")
|
@Excel(name = "秘钥(当加密时必填)", width = 30, needMerge = true, orderNum = "13")
|
||||||
private String devKey;
|
private String devKey;
|
||||||
|
|
||||||
@Excel(name = "IP地址*", width = 20, needMerge = true, orderNum = "15")
|
@Excel(name = "IP地址*", width = 20, needMerge = true, orderNum = "14")
|
||||||
@NotBlank(message = DetectionValidMessage.IP_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.IP_NOT_BLANK)
|
||||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = DetectionValidMessage.IP_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.IP_REGEX, message = DetectionValidMessage.IP_FORMAT_ERROR)
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
@Excel(name = "端口号*", width = 15, needMerge = true, orderNum = "16")
|
@Excel(name = "端口号*", width = 15, needMerge = true, orderNum = "15")
|
||||||
@NotNull(message = DetectionValidMessage.PORT_NOT_NULL)
|
@NotNull(message = DetectionValidMessage.PORT_NOT_NULL)
|
||||||
@Range(min = 1, max = 65535, message = DetectionValidMessage.PORT_RANGE_ERROR)
|
@Range(min = 1, max = 65535, message = DetectionValidMessage.PORT_RANGE_ERROR)
|
||||||
private Integer port;
|
private Integer port;
|
||||||
|
|
||||||
@Excel(name = "投运日期(yyyy-MM-dd)*", width = 30, needMerge = true, orderNum = "17", format = "yyyy-MM-dd")
|
@Excel(name = "投运日期(yyyy-MM-dd)*", width = 30, needMerge = true, orderNum = "16", format = "yyyy-MM-dd")
|
||||||
@NotNull(message = DetectionValidMessage.CREATE_DATE_NOT_NULL)
|
@NotNull(message = DetectionValidMessage.CREATE_DATE_NOT_NULL)
|
||||||
private LocalDate createDate;
|
private LocalDate createDate;
|
||||||
|
|
||||||
@Excel(name = "定检日期(yyyy-MM-dd)*", width = 30, needMerge = true, orderNum = "18", format = "yyyy-MM-dd")
|
@Excel(name = "定检日期(yyyy-MM-dd)*", width = 30, needMerge = true, orderNum = "17", format = "yyyy-MM-dd")
|
||||||
@NotNull(message = DetectionValidMessage.INSPECT_DATE_NOT_NULL)
|
@NotNull(message = DetectionValidMessage.INSPECT_DATE_NOT_NULL)
|
||||||
private LocalDate inspectDate;
|
private LocalDate inspectDate;
|
||||||
|
|
||||||
@Excel(name = "谐波系统设备id*", width = 30, needMerge = true, orderNum = "19")
|
@Excel(name = "谐波系统设备id*", width = 30, needMerge = true, orderNum = "18")
|
||||||
@NotBlank(message = DetectionValidMessage.HARM_SYS_ID_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.HARM_SYS_ID_NOT_BLANK)
|
||||||
private String harmSysId;
|
private String harmSysId;
|
||||||
|
|
||||||
@ExcelCollection(name = "监测点信息", orderNum = "22")
|
@ExcelCollection(name = "监测点信息", orderNum = "19")
|
||||||
private List<PqMonitorExcel> pqMonitorExcelList;
|
private List<PqMonitorExcel> pqMonitorExcelList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.util.List;
|
|||||||
public class PreDetection {
|
public class PreDetection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置ip
|
* 装置id
|
||||||
*/
|
*/
|
||||||
@JSONField(serialize = false)
|
@JSONField(serialize = false)
|
||||||
private String devId;
|
private String devId;
|
||||||
@@ -95,16 +95,28 @@ public class PreDetection {
|
|||||||
private Integer line;
|
private Integer line;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点线路号
|
* pt
|
||||||
*/
|
*/
|
||||||
@JSONField(name = "pt")
|
@JSONField(name = "pt")
|
||||||
private Integer pt;
|
private String pt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点线路号
|
* ct
|
||||||
*/
|
*/
|
||||||
@JSONField(name = "ct") //todo 是否改为ct
|
@JSONField(name = "ct") //todo 是否改为ct
|
||||||
private Integer ct;
|
private String ct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计间隔
|
||||||
|
*/
|
||||||
|
@JSONField(name = "statInterval")
|
||||||
|
private Integer statInterval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接线方式
|
||||||
|
*/
|
||||||
|
@JSONField(name = "connection")
|
||||||
|
private String connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDevKey() {
|
public String getDevKey() {
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ package com.njcn.gather.device.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.gather.device.pojo.param.PqDevParam;
|
|
||||||
import com.njcn.gather.device.pojo.param.PqStandardDevParam;
|
import com.njcn.gather.device.pojo.param.PqStandardDevParam;
|
||||||
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
||||||
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -84,4 +83,12 @@ public interface IPqStandardDevService extends IService<PqStandardDev> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PqStandardDev> listByPlanId(String planId);
|
List<PqStandardDev> listByPlanId(String planId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询出标准设备所需的检测信息
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PreDetection> listStandardDevPreDetection(List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -144,7 +145,6 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
if (ObjectUtil.isNotEmpty(pqDevParam.getMonitorList())) {
|
if (ObjectUtil.isNotEmpty(pqDevParam.getMonitorList())) {
|
||||||
pqMonitorService.addPqMonitorByDevId(id, pqDevParam.getMonitorList());
|
pqMonitorService.addPqMonitorByDevId(id, pqDevParam.getMonitorList());
|
||||||
}
|
}
|
||||||
pqDev.setInspectChannel(String.join(StrUtil.COMMA, pqDevParam.getInspectChannel()));
|
|
||||||
}
|
}
|
||||||
pqDev.setImportFlag(0);
|
pqDev.setImportFlag(0);
|
||||||
pqDev.setState(DataStateEnum.ENABLE.getCode());
|
pqDev.setState(DataStateEnum.ENABLE.getCode());
|
||||||
@@ -201,7 +201,6 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
// 比对式设备修改监测点
|
// 比对式设备修改监测点
|
||||||
if (PatternEnum.CONTRAST.getValue().equals(dictDataService.getDictDataById(updateParam.getPattern()).getCode())) {
|
if (PatternEnum.CONTRAST.getValue().equals(dictDataService.getDictDataById(updateParam.getPattern()).getCode())) {
|
||||||
pqMonitorService.updatePqMonitorByDevId(updateParam.getId(), updateParam.getMonitorList());
|
pqMonitorService.updatePqMonitorByDevId(updateParam.getId(), updateParam.getMonitorList());
|
||||||
pqDev.setInspectChannel(String.join(StrUtil.COMMA, updateParam.getInspectChannel()));
|
|
||||||
}
|
}
|
||||||
return this.updateById(pqDev);
|
return this.updateById(pqDev);
|
||||||
}
|
}
|
||||||
@@ -419,8 +418,8 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
monitorListDTO = new PreDetection.MonitorListDTO();
|
monitorListDTO = new PreDetection.MonitorListDTO();
|
||||||
monitorListDTO.setLineId(preDetection.getDevIP() + "_" + i);
|
monitorListDTO.setLineId(preDetection.getDevIP() + "_" + i);
|
||||||
monitorListDTO.setLine(i);
|
monitorListDTO.setLine(i);
|
||||||
monitorListDTO.setPt(1);
|
monitorListDTO.setPt("1");
|
||||||
monitorListDTO.setCt(1);
|
monitorListDTO.setCt("1");
|
||||||
monitorList.add(monitorListDTO);
|
monitorList.add(monitorListDTO);
|
||||||
}
|
}
|
||||||
preDetection.setMonitorList(monitorList);
|
preDetection.setMonitorList(monitorList);
|
||||||
@@ -1290,8 +1289,8 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
dictDataList = dictDataService.getDictDataByTypeId(dictType.getId());
|
dictDataList = dictDataService.getDictDataByTypeId(dictType.getId());
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(startCol + 10);
|
pullDown.setFirstCol(startCol + 9);
|
||||||
pullDown.setLastCol(startCol + 10);
|
pullDown.setLastCol(startCol + 9);
|
||||||
|
|
||||||
pullDown.setStrings(dictDataList.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(dictDataList.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
@@ -1299,20 +1298,19 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
|
|
||||||
// 是否加密
|
// 是否加密
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(startCol + 11);
|
pullDown.setFirstCol(startCol + 10);
|
||||||
pullDown.setLastCol(startCol + 11);
|
pullDown.setLastCol(startCol + 10);
|
||||||
|
|
||||||
pullDown.setStrings(Arrays.asList("是", "否"));
|
pullDown.setStrings(Arrays.asList("是", "否"));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
// 接线方式
|
// 接线方式
|
||||||
|
|
||||||
dictType = dictTypeService.getByCode("Dev_Connect");
|
dictType = dictTypeService.getByCode("Dev_Connect");
|
||||||
if (ObjectUtil.isNotNull(dictType)) {
|
if (ObjectUtil.isNotNull(dictType)) {
|
||||||
dictDataList = dictDataService.getDictDataByTypeId(dictType.getId());
|
dictDataList = dictDataService.getDictDataByTypeId(dictType.getId());
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(startCol + 25);
|
pullDown.setFirstCol(startCol + 24);
|
||||||
pullDown.setLastCol(startCol + 25);
|
pullDown.setLastCol(startCol + 24);
|
||||||
|
|
||||||
pullDown.setStrings(dictDataList.stream().map(DictData::getName).collect(Collectors.toList()));
|
pullDown.setStrings(dictDataList.stream().map(DictData::getName).collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.njcn.gather.device.mapper.PqStandardDevMapper;
|
|||||||
import com.njcn.gather.device.pojo.param.PqStandardDevParam;
|
import com.njcn.gather.device.pojo.param.PqStandardDevParam;
|
||||||
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
import com.njcn.gather.device.pojo.po.PqStandardDev;
|
||||||
import com.njcn.gather.device.pojo.vo.PqStandardDevExcel;
|
import com.njcn.gather.device.pojo.vo.PqStandardDevExcel;
|
||||||
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import com.njcn.gather.device.service.IPqStandardDevService;
|
import com.njcn.gather.device.service.IPqStandardDevService;
|
||||||
import com.njcn.gather.plan.mapper.AdPlanStandardDevMapper;
|
import com.njcn.gather.plan.mapper.AdPlanStandardDevMapper;
|
||||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||||
@@ -155,6 +156,14 @@ public class PqStandardDevServiceImpl extends ServiceImpl<PqStandardDevMapper, P
|
|||||||
return adPlanStandardDevMapper.listByPlanId(Collections.singletonList(planId));
|
return adPlanStandardDevMapper.listByPlanId(Collections.singletonList(planId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PreDetection> listStandardDevPreDetection(List<String> ids) {
|
||||||
|
if (CollectionUtil.isNotEmpty(ids)) {
|
||||||
|
return this.baseMapper.listStandardDevPreDetection(ids);
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入数据
|
* 导入数据
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -57,4 +57,10 @@ public interface IPqErrSysDtlsService extends IService<PqErrSysDtls> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ErrDtlsCheckDataVO> listByPqErrSysIdAndTypes(PqErrSysParam.DetectionParam param);
|
List<ErrDtlsCheckDataVO> listByPqErrSysIdAndTypes(PqErrSysParam.DetectionParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据误差体系id和脚本类型查询脚本类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PqErrSysDtls> listPqErrSysDtlsByPqErrSysIdAndScriptType(String errSysId, String scriptType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,4 +155,14 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
|||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PqErrSysDtls> listPqErrSysDtlsByPqErrSysIdAndScriptType(String errSysId, String scriptType) {
|
||||||
|
MPJLambdaWrapper<PqErrSysDtls> wrapper = new MPJLambdaWrapper<>();
|
||||||
|
wrapper.selectAll(PqErrSysDtls.class)
|
||||||
|
.leftJoin(DictTree.class, DictTree::getId, PqErrSysDtls::getScriptType)
|
||||||
|
.eq(PqErrSysDtls::getErrorSysId, errSysId)
|
||||||
|
.eq(DictTree::getId, scriptType);
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,16 @@
|
|||||||
|
|
||||||
<select id="selectMonitorInfo"
|
<select id="selectMonitorInfo"
|
||||||
resultType="com.njcn.gather.device.pojo.vo.PreDetection$MonitorListDTO">
|
resultType="com.njcn.gather.device.pojo.vo.PreDetection$MonitorListDTO">
|
||||||
SELECT
|
SELECT CONCAT(pq_dev.IP, '_', Num) as lineId,
|
||||||
Id as lineId,
|
|
||||||
Num as line,
|
Num as line,
|
||||||
pt as pt,
|
pt as pt,
|
||||||
ct as ct
|
ct as ct,
|
||||||
FROM
|
Stat_Interval,
|
||||||
pq_monitor
|
sys_dict_data.Code as `Connection`
|
||||||
WHERE
|
FROM pq_monitor
|
||||||
dev_id = #{devId}
|
inner join sys_dict_data on pq_monitor.Connection = sys_dict_data.id
|
||||||
|
inner join pq_dev on pq_monitor.Dev_Id = pq_dev.Id
|
||||||
|
WHERE Dev_Id = #{devId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ public class PqMonitorExcel {
|
|||||||
@NotNull(message = DetectionValidMessage.MONITOR_NUM_NOT_NULL)
|
@NotNull(message = DetectionValidMessage.MONITOR_NUM_NOT_NULL)
|
||||||
private Integer num;
|
private Integer num;
|
||||||
|
|
||||||
@Excel(name = "PT变比*", width = 20, orderNum = "5")
|
@Excel(name = "PT变比(pt1:pt2)*", width = 20, orderNum = "5")
|
||||||
@NotBlank(message = DetectionValidMessage.PT_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.PT_NOT_BLANK)
|
||||||
private String pt;
|
private String pt;
|
||||||
|
|
||||||
@Excel(name = "CT变比*", width = 20, orderNum = "6")
|
@Excel(name = "CT变比(ct1:ct2)*", width = 20, orderNum = "6")
|
||||||
@NotBlank(message = DetectionValidMessage.CT_NOT_BLANK)
|
@NotBlank(message = DetectionValidMessage.CT_NOT_BLANK)
|
||||||
private String ct;
|
private String ct;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import lombok.Getter;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public enum DataSourceEnum {
|
public enum DataSourceEnum {
|
||||||
THREE_SENSE_ACTUAL_TIME_DATA("real", "3s实时数据"),
|
REAL_DATA("real", "3s实时数据"),
|
||||||
|
|
||||||
MINUTE_STATISTICS_MAX("max", "分钟统计数据-最大"),
|
MINUTE_STATISTICS_MAX("max", "分钟统计数据-最大"),
|
||||||
MINUTE_STATISTICS_MIN("min", "分钟统计数据-最小"),
|
MINUTE_STATISTICS_MIN("min", "分钟统计数据-最小"),
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import com.njcn.gather.script.service.IPqScriptService;
|
|||||||
import com.njcn.gather.source.pojo.po.PqSource;
|
import com.njcn.gather.source.pojo.po.PqSource;
|
||||||
import com.njcn.gather.source.service.IPqSourceService;
|
import com.njcn.gather.source.service.IPqSourceService;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigHarmonicService;
|
||||||
import com.njcn.gather.storage.service.TableGenService;
|
import com.njcn.gather.storage.service.TableGenService;
|
||||||
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
||||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||||
@@ -110,7 +110,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
private final ISysTestConfigService sysTestConfigService;
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
private final IDictTypeService dictTypeService;
|
private final IDictTypeService dictTypeService;
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
private final PqDevMapper pqDevMapper;
|
private final PqDevMapper pqDevMapper;
|
||||||
private final IPqDevSubService pqDevSubService;
|
private final IPqDevSubService pqDevSubService;
|
||||||
private final IAdPlanStandardDevService adPlanStandardDevService;
|
private final IAdPlanStandardDevService adPlanStandardDevService;
|
||||||
@@ -192,7 +192,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
}
|
}
|
||||||
Map<String, Integer> standardDevIds = adPlanVO.getStandardDevMap();
|
Map<String, Integer> standardDevIds = adPlanVO.getStandardDevMap();
|
||||||
standardDevIds.putAll(pqStandardDevs.stream().collect(Collectors.toMap(PqStandardDev::getId, obj -> 1)));
|
standardDevIds.putAll(pqStandardDevs.stream().collect(Collectors.toMap(PqStandardDev::getId, obj -> 1)));
|
||||||
adPlanVO.setStandardDevNameStr(adPlanVO.getStandardDevNameStr() + pqStandardDevs.stream().map(PqStandardDev::getName).reduce((a, b) -> a + "," + b).orElse(""));
|
// adPlanVO.setStandardDevNameStr(adPlanVO.getStandardDevNameStr() + pqStandardDevs.stream().map(PqStandardDev::getName).reduce((a, b) -> a + "," + b).orElse(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
} else {
|
} else {
|
||||||
// 关联检测源
|
// 关联检测源
|
||||||
adPlanSourceService.addAdPlanSource(planId, param.getSourceIds());
|
adPlanSourceService.addAdPlanSource(planId, param.getSourceIds());
|
||||||
tableGenService.deleteTable(Arrays.asList(adPlan.getCode().toString()));
|
|
||||||
tableGenService.genAdNonHarmonicTable(adPlan.getCode().toString());
|
|
||||||
}
|
}
|
||||||
|
tableGenService.deleteTable(Arrays.asList(adPlan.getCode().toString()));
|
||||||
|
tableGenService.genTable(adPlan.getCode().toString(), PatternEnum.CONTRAST.getValue().equals(dictData.getCode()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -332,11 +332,11 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
|
|
||||||
List<String> devIds = pqDevVOList.stream().map(PqDevVO::getId).collect(Collectors.toList());
|
List<String> devIds = pqDevVOList.stream().map(PqDevVO::getId).collect(Collectors.toList());
|
||||||
param.getDevIds().removeAll(devIds);
|
param.getDevIds().removeAll(devIds);
|
||||||
plan2.setTestState(pqDevService.bind(param.getId(), param.getDevIds()));
|
|
||||||
} else {
|
} else {
|
||||||
// 修改检测计划、检测源关联
|
// 修改检测计划、检测源关联
|
||||||
adPlanSourceService.updateAdPlanSource(param.getId(), param.getSourceIds());
|
adPlanSourceService.updateAdPlanSource(param.getId(), param.getSourceIds());
|
||||||
}
|
}
|
||||||
|
plan2.setTestState(pqDevService.bind(param.getId(), param.getDevIds()));
|
||||||
// 若修改了名称,则修改相关子计划的来源字段
|
// 若修改了名称,则修改相关子计划的来源字段
|
||||||
if (!plan1.getName().equals(param.getName()) && CommonEnum.FATHER_ID.getValue().equals(plan1.getFatherPlanId())) {
|
if (!plan1.getName().equals(param.getName()) && CommonEnum.FATHER_ID.getValue().equals(plan1.getFatherPlanId())) {
|
||||||
this.lambdaUpdate().in(AdPlan::getFatherPlanId, plan1.getId()).eq(AdPlan::getState, DataStateEnum.ENABLE.getCode())
|
this.lambdaUpdate().in(AdPlan::getFatherPlanId, plan1.getId()).eq(AdPlan::getState, DataStateEnum.ENABLE.getCode())
|
||||||
@@ -401,6 +401,17 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
child.put("pid", adPlan.getFatherPlanId());
|
child.put("pid", adPlan.getFatherPlanId());
|
||||||
child.put("name", adPlan.getName());
|
child.put("name", adPlan.getName());
|
||||||
child.put("timeCheck", adPlan.getTimeCheck());
|
child.put("timeCheck", adPlan.getTimeCheck());
|
||||||
|
|
||||||
|
List<PqStandardDev> pqStandardDevs = adPlanStandardDevMapper.listByPlanId(Collections.singletonList(adPlan.getId()));
|
||||||
|
List<String> devTypeIdList = pqStandardDevs.stream().map(PqStandardDev::getDevType).collect(Collectors.toList());
|
||||||
|
if (devTypeIdList.size() > 0) {
|
||||||
|
List<DevType> devTypeList = devTypeService.listByIds(devTypeIdList);
|
||||||
|
pqStandardDevs.forEach(pqStandardDev -> {
|
||||||
|
DevType devType1 = devTypeList.stream().filter(devType -> devType.getId().equals(pqStandardDev.getDevType())).findFirst().get();
|
||||||
|
pqStandardDev.setDevType(devType1.getName());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
child.put("standardDevs", pqStandardDevs);
|
||||||
children.add(child);
|
children.add(child);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -463,13 +474,13 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
|
|
||||||
// 不合格项复检
|
// 不合格项复检
|
||||||
if (reCheckType == 0) {
|
if (reCheckType == 0) {
|
||||||
// List<AdBaseResult> allResultList = new ArrayList<>();
|
// List<SimAndDigBaseResult> allResultList = new ArrayList<>();
|
||||||
// allResultList.addAll(adHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
// allResultList.addAll(adHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
||||||
// allResultList.addAll(adNonHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
// allResultList.addAll(adNonHarmonicService.get(scriptId, null, devId, "-1", adPlan.getCode()));
|
||||||
//
|
//
|
||||||
// if (ObjectUtil.isNotEmpty(allResultList)) {
|
// if (ObjectUtil.isNotEmpty(allResultList)) {
|
||||||
// List<AdBaseResult> passList = allResultList.stream().filter(obj -> obj.getResultFlag() == 1).collect(Collectors.toList());
|
// List<SimAndDigBaseResult> passList = allResultList.stream().filter(obj -> obj.getResultFlag() == 1).collect(Collectors.toList());
|
||||||
// TreeSet<Integer> sortSet = passList.stream().map(AdBaseResult::getSort).collect(Collectors.toCollection(TreeSet::new));
|
// TreeSet<Integer> sortSet = passList.stream().map(SimAndDigBaseResult::getSort).collect(Collectors.toCollection(TreeSet::new));
|
||||||
//
|
//
|
||||||
// scriptDtlsList = scriptDtlsList.stream().filter(obj -> !sortSet.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
// scriptDtlsList = scriptDtlsList.stream().filter(obj -> !sortSet.contains(obj.getScriptIndex())).collect(Collectors.toList());
|
||||||
// }
|
// }
|
||||||
@@ -909,7 +920,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
pqDevService.importCNDev(cnDevExcelList, patternId, planId);
|
pqDevService.importCNDev(cnDevExcelList, patternId, planId);
|
||||||
|
|
||||||
tableGenService.deleteTable(Arrays.asList(code.toString()));
|
tableGenService.deleteTable(Arrays.asList(code.toString()));
|
||||||
tableGenService.genAdNonHarmonicTable(code.toString());
|
tableGenService.genTable(code.toString(), PatternEnum.CONTRAST.getValue().equals(patternCode));
|
||||||
}
|
}
|
||||||
// 逆向可视化
|
// 逆向可视化
|
||||||
this.reverseVisualize(adPlans);
|
this.reverseVisualize(adPlans);
|
||||||
@@ -967,7 +978,7 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
adPlans.get(i).setCode(code);
|
adPlans.get(i).setCode(code);
|
||||||
|
|
||||||
tableGenService.deleteTable(Arrays.asList(code.toString()));
|
tableGenService.deleteTable(Arrays.asList(code.toString()));
|
||||||
tableGenService.genAdNonHarmonicTable(code.toString());
|
tableGenService.genTable(code.toString(), PatternEnum.CONTRAST.getValue().equals(patternCode));
|
||||||
|
|
||||||
String source = planExcel.getSource();
|
String source = planExcel.getSource();
|
||||||
String[] sourceNames = source.split(StrUtil.COMMA);
|
String[] sourceNames = source.split(StrUtil.COMMA);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public enum DetectionResponseEnum {
|
|||||||
IMPORT_FLAG_NOT_UPDATE("A02091", "从谐波系统导入的设备不支持修改"),
|
IMPORT_FLAG_NOT_UPDATE("A02091", "从谐波系统导入的设备不支持修改"),
|
||||||
CONNECTION_NOT_EXIST("A02092", "该连接不存在,请先在\"接线方式\"字典中添加"),
|
CONNECTION_NOT_EXIST("A02092", "该连接不存在,请先在\"接线方式\"字典中添加"),
|
||||||
MONITOR_NUM_OUT_OF_RANGE("A02093", "检测点线路号超出范围,请检查线路号"),
|
MONITOR_NUM_OUT_OF_RANGE("A02093", "检测点线路号超出范围,请检查线路号"),
|
||||||
MONITOR_NUM_REPEAT("A02094", "改被检设备下存在相同线路号的监测点"),
|
MONITOR_NUM_REPEAT("A02094", "该被检设备下存在相同线路号的监测点"),
|
||||||
PLAN_HAS_CHILDREN("A02095", "该计划下存在子计划,请先删除子计划"),
|
PLAN_HAS_CHILDREN("A02095", "该计划下存在子计划,请先删除子计划"),
|
||||||
PLAN_REPEATED_IN_SAME_LEVEL("A02096", "该父计划下存在同名的子计划"),
|
PLAN_REPEATED_IN_SAME_LEVEL("A02096", "该父计划下存在同名的子计划"),
|
||||||
PLEASE_UNASSIGN_STANDARD_DEV("A02097","存在已分配给子计划的标准设备,请先解除分配" ),
|
PLEASE_UNASSIGN_STANDARD_DEV("A02097","存在已分配给子计划的标准设备,请先解除分配" ),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import cn.hutool.extra.qrcode.QrCodeUtil;
|
|||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -31,9 +32,11 @@ import com.njcn.gather.detection.util.socket.SocketManager;
|
|||||||
import com.njcn.gather.detection.util.socket.cilent.NettyClient;
|
import com.njcn.gather.detection.util.socket.cilent.NettyClient;
|
||||||
import com.njcn.gather.detection.util.socket.cilent.NettyDevClientHandler;
|
import com.njcn.gather.detection.util.socket.cilent.NettyDevClientHandler;
|
||||||
import com.njcn.gather.device.mapper.PqDevMapper;
|
import com.njcn.gather.device.mapper.PqDevMapper;
|
||||||
|
import com.njcn.gather.device.mapper.PqDevSubMapper;
|
||||||
import com.njcn.gather.device.pojo.enums.CheckStateEnum;
|
import com.njcn.gather.device.pojo.enums.CheckStateEnum;
|
||||||
import com.njcn.gather.device.pojo.enums.DevReportStateEnum;
|
import com.njcn.gather.device.pojo.enums.DevReportStateEnum;
|
||||||
import com.njcn.gather.device.pojo.param.PqDevParam;
|
import com.njcn.gather.device.pojo.param.PqDevParam;
|
||||||
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
import com.njcn.gather.device.pojo.po.PqDevSub;
|
import com.njcn.gather.device.pojo.po.PqDevSub;
|
||||||
import com.njcn.gather.device.pojo.vo.PqDevVO;
|
import com.njcn.gather.device.pojo.vo.PqDevVO;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
@@ -59,10 +62,10 @@ import com.njcn.gather.result.service.IResultService;
|
|||||||
import com.njcn.gather.script.pojo.vo.PqScriptDtlDataVO;
|
import com.njcn.gather.script.pojo.vo.PqScriptDtlDataVO;
|
||||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigHarmonicService;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigNonHarmonicService;
|
||||||
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
||||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||||
@@ -158,6 +161,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
@Value("${qr.gcDev.path}")
|
@Value("${qr.gcDev.path}")
|
||||||
private String gcDevPath;
|
private String gcDevPath;
|
||||||
|
|
||||||
|
|
||||||
private final IPqDevService iPqDevService;
|
private final IPqDevService iPqDevService;
|
||||||
private final PqDevMapper pqDevMapper;
|
private final PqDevMapper pqDevMapper;
|
||||||
private final IPqDevSubService iPqDevSubService;
|
private final IPqDevSubService iPqDevSubService;
|
||||||
@@ -168,9 +172,9 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
|
|
||||||
private final IPqScriptDtlsService pqScriptDtlsService;
|
private final IPqScriptDtlsService pqScriptDtlsService;
|
||||||
|
|
||||||
private final AdNonHarmonicService adNonHarmonicService;
|
private final SimAndDigNonHarmonicService adNonHarmonicService;
|
||||||
|
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
|
|
||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
|
|
||||||
@@ -1500,8 +1504,8 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
return obj.substring(index1, obj.indexOf("#", index1));
|
return obj.substring(index1, obj.indexOf("#", index1));
|
||||||
}, Collectors.toSet()))); //key为index,value为该index下所有测试项对应的code
|
}, Collectors.toSet()))); //key为index,value为该index下所有测试项对应的code
|
||||||
|
|
||||||
List<AdNonHarmonicResult> adNonHarmonicResultList = adNonHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
|
List<SimAndDigNonHarmonicResult> simAndDigNonHarmonicResultList = adNonHarmonicService.listSimAndDigBaseResult(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
|
||||||
List<AdHarmonicResult> adHarmonicResultList = adHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
|
List<SimAndDigHarmonicResult> adHarmonicResultList = adHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
|
||||||
|
|
||||||
// 填充数据
|
// 填充数据
|
||||||
indexKeysMap.forEach((index, keys) -> {
|
indexKeysMap.forEach((index, keys) -> {
|
||||||
@@ -1512,9 +1516,9 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
} else {
|
} else {
|
||||||
// 非谐波类
|
// 非谐波类
|
||||||
if (DetectionCodeEnum.V_UNBAN.getCode().equals(s1) || DetectionCodeEnum.FREQ.getCode().equals(s1)) {
|
if (DetectionCodeEnum.V_UNBAN.getCode().equals(s1) || DetectionCodeEnum.FREQ.getCode().equals(s1)) {
|
||||||
fillMapValueT(adNonHarmonicResultList, dataModelMap, keys, index);
|
fillMapValueT(simAndDigNonHarmonicResultList, dataModelMap, keys, index);
|
||||||
} else {
|
} else {
|
||||||
fillMapValueABC(adNonHarmonicResultList, dataModelMap, keys, index);
|
fillMapValueABC(simAndDigNonHarmonicResultList, dataModelMap, keys, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1534,11 +1538,11 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param keys
|
* @param keys
|
||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
private void fillMapValueABC(List<AdNonHarmonicResult> allNonHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
private void fillMapValueABC(List<SimAndDigNonHarmonicResult> allNonHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
||||||
keys.forEach(key -> {
|
keys.forEach(key -> {
|
||||||
List<AdNonHarmonicResult> resultList = allNonHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
List<SimAndDigNonHarmonicResult> resultList = allNonHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||||
AdNonHarmonicResult adNonHarmonicResult = resultList.get(0);
|
SimAndDigNonHarmonicResult adNonHarmonicResult = resultList.get(0);
|
||||||
if (ObjectUtil.isNotNull(adNonHarmonicResult)) {
|
if (ObjectUtil.isNotNull(adNonHarmonicResult)) {
|
||||||
dataModelMap.put("${" + index + "#" + key + "#A}", devValue(adNonHarmonicResult.getAValue(), 1, 1));
|
dataModelMap.put("${" + index + "#" + key + "#A}", devValue(adNonHarmonicResult.getAValue(), 1, 1));
|
||||||
dataModelMap.put("${" + index + "#" + key + "#B}", devValue(adNonHarmonicResult.getBValue(), 1, 1));
|
dataModelMap.put("${" + index + "#" + key + "#B}", devValue(adNonHarmonicResult.getBValue(), 1, 1));
|
||||||
@@ -1556,11 +1560,11 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param keys
|
* @param keys
|
||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
private void fillMapValueT(List<AdNonHarmonicResult> allNonHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
private void fillMapValueT(List<SimAndDigNonHarmonicResult> allNonHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
||||||
keys.forEach(key -> {
|
keys.forEach(key -> {
|
||||||
List<AdNonHarmonicResult> resultList = allNonHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
List<SimAndDigNonHarmonicResult> resultList = allNonHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||||
AdNonHarmonicResult adNonHarmonicResult = resultList.get(0);
|
SimAndDigNonHarmonicResult adNonHarmonicResult = resultList.get(0);
|
||||||
if (ObjectUtil.isNotNull(adNonHarmonicResult)) {
|
if (ObjectUtil.isNotNull(adNonHarmonicResult)) {
|
||||||
dataModelMap.put("${" + index + "#" + key + "#T}", devValue(adNonHarmonicResult.getTValue(), 1, 1));
|
dataModelMap.put("${" + index + "#" + key + "#T}", devValue(adNonHarmonicResult.getTValue(), 1, 1));
|
||||||
}
|
}
|
||||||
@@ -1576,11 +1580,11 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param keys
|
* @param keys
|
||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
private void fillMapValueHarm(List<AdHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
private void fillMapValueHarm(List<SimAndDigHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
||||||
keys.forEach(key -> {
|
keys.forEach(key -> {
|
||||||
List<AdHarmonicResult> resultList = allHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
List<SimAndDigHarmonicResult> resultList = allHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||||
AdHarmonicResult adHarmonicResult = resultList.get(0);
|
SimAndDigHarmonicResult adHarmonicResult = resultList.get(0);
|
||||||
if (Objects.nonNull(adHarmonicResult)) {
|
if (Objects.nonNull(adHarmonicResult)) {
|
||||||
if (DetectionCodeEnum.V2_50.getCode().equals(key) || DetectionCodeEnum.SV_1_49.getCode().equals(key)) {
|
if (DetectionCodeEnum.V2_50.getCode().equals(key) || DetectionCodeEnum.SV_1_49.getCode().equals(key)) {
|
||||||
fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100);
|
fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100);
|
||||||
@@ -1603,7 +1607,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
* @param baseValue
|
* @param baseValue
|
||||||
* @param percent
|
* @param percent
|
||||||
*/
|
*/
|
||||||
private void fillHarm(Map<String, String> dataModelMap, AdHarmonicResult adHarmonicResult, String index, String key, double baseValue, int percent) {
|
private void fillHarm(Map<String, String> dataModelMap, SimAndDigHarmonicResult adHarmonicResult, String index, String key, double baseValue, int percent) {
|
||||||
// 要处理 2 5 7 11 23 35 43 50
|
// 要处理 2 5 7 11 23 35 43 50
|
||||||
|
|
||||||
String aBase = devValue(adHarmonicResult.getAValue1(), 1, 1);
|
String aBase = devValue(adHarmonicResult.getAValue1(), 1, 1);
|
||||||
@@ -1753,16 +1757,14 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
public void uploadReportToCloud(List<String> deviceIds) {
|
public void uploadReportToCloud(List<String> deviceIds) {
|
||||||
log.info("开始批量上传检测报告到云端,设备ID列表:{}", deviceIds);
|
log.info("开始批量上传检测报告到云端,设备ID列表:{}", deviceIds);
|
||||||
|
|
||||||
// 查询条件:报告状态为已生成(1)的设备
|
|
||||||
LambdaQueryWrapper<PqDev> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(PqDev::getReportState, DevReportStateEnum.GENERATED.getValue());
|
|
||||||
|
|
||||||
// 如果指定了设备ID列表,则只查询这些设备
|
List<PqDevSub> deviceSubs = iPqDevSubService.lambdaQuery()
|
||||||
if (CollUtil.isNotEmpty(deviceIds)) {
|
.eq(PqDevSub::getReportState, DevReportStateEnum.GENERATED.getValue())
|
||||||
wrapper.in(PqDev::getId, deviceIds);
|
.in(CollUtil.isNotEmpty(deviceIds),PqDevSub::getDevId, deviceIds).list();
|
||||||
}
|
List<String> devIds = deviceSubs.stream().map(PqDevSub::getDevId).collect(Collectors.toList());
|
||||||
|
|
||||||
List<PqDev> devices = iPqDevService.list(wrapper);
|
List<PqDev> devices = iPqDevService.lambdaQuery()
|
||||||
|
.in(CollUtil.isNotEmpty(devIds), PqDev::getId, devIds).list();
|
||||||
|
|
||||||
if (CollUtil.isEmpty(devices)) {
|
if (CollUtil.isEmpty(devices)) {
|
||||||
log.warn("未找到符合条件的设备,无需上传");
|
log.warn("未找到符合条件的设备,无需上传");
|
||||||
|
|||||||
@@ -48,12 +48,12 @@ import com.njcn.gather.script.util.ScriptDtlsDesc;
|
|||||||
import com.njcn.gather.storage.mapper.TableGenMapper;
|
import com.njcn.gather.storage.mapper.TableGenMapper;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigBaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
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.SimAndDigHarmonicService;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigNonHarmonicService;
|
||||||
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;
|
||||||
@@ -82,8 +82,8 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
|
|
||||||
private final IAdPlanService adPlanService;
|
private final IAdPlanService adPlanService;
|
||||||
private final IPqDevService pqDevService;
|
private final IPqDevService pqDevService;
|
||||||
private final AdNonHarmonicService adNonHarmonicService;
|
private final SimAndDigNonHarmonicService adNonHarmonicService;
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final SimAndDigHarmonicService adHarmonicService;
|
||||||
private final IPqScriptDtlsService pqScriptDtlsService;
|
private final IPqScriptDtlsService pqScriptDtlsService;
|
||||||
private final PqScriptMapper scriptMapper;
|
private final PqScriptMapper scriptMapper;
|
||||||
private final IDictTreeService dictTreeService;
|
private final IDictTreeService dictTreeService;
|
||||||
@@ -116,7 +116,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
|
|
||||||
List<Map<String, String>> chnList = new ArrayList<>();
|
List<Map<String, String>> chnList = new ArrayList<>();
|
||||||
|
|
||||||
List<AdBaseResult> allResultList = new ArrayList<>();
|
List<SimAndDigBaseResult> allResultList = new ArrayList<>();
|
||||||
//只查询指定的脚本类型
|
//只查询指定的脚本类型
|
||||||
if (ObjectUtil.isNotNull(queryParam.getScriptType())) {
|
if (ObjectUtil.isNotNull(queryParam.getScriptType())) {
|
||||||
List<Integer> indexList = pqScriptDtlsService.getIndexList(queryParam.getScriptType(), scriptId);
|
List<Integer> indexList = pqScriptDtlsService.getIndexList(queryParam.getScriptType(), scriptId);
|
||||||
@@ -125,22 +125,22 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (HARMONIC_TYPE_CODE.contains(dictTree.getCode())) {
|
if (HARMONIC_TYPE_CODE.contains(dictTree.getCode())) {
|
||||||
allResultList.addAll(adHarmonicService.get(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
allResultList.addAll(adHarmonicService.get(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
||||||
} else {
|
} else {
|
||||||
allResultList.addAll(adNonHarmonicService.get(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
allResultList.addAll(adNonHarmonicService.listSimAndDigBaseResult(scriptId, indexList, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
||||||
}
|
}
|
||||||
} else { //查询所有的脚本类型
|
} else { //查询所有的脚本类型
|
||||||
allResultList.addAll(adHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
allResultList.addAll(adHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
||||||
allResultList.addAll(adNonHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
allResultList.addAll(adNonHarmonicService.listSimAndDigBaseResult(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode() + ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(allResultList)) {
|
if (ObjectUtil.isNotEmpty(allResultList)) {
|
||||||
Map<String, List<AdBaseResult>> chnMap = allResultList.stream().collect(
|
Map<String, List<SimAndDigBaseResult>> chnMap = allResultList.stream().collect(
|
||||||
Collectors.groupingBy(obj -> obj.getMonitorId().substring(obj.getMonitorId().lastIndexOf("_") + 1))
|
Collectors.groupingBy(obj -> obj.getMonitorId().substring(obj.getMonitorId().lastIndexOf("_") + 1))
|
||||||
);
|
);
|
||||||
chnMap.forEach((chn, list) -> {
|
chnMap.forEach((chn, list) -> {
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("value", chn);
|
map.put("value", chn);
|
||||||
Set<Integer> collect = list.stream().filter(obj -> obj.getResultFlag() != 4).map(AdBaseResult::getResultFlag).collect(Collectors.toSet());
|
Set<Integer> collect = list.stream().filter(obj -> obj.getResultFlag() != 4).map(SimAndDigBaseResult::getResultFlag).collect(Collectors.toSet());
|
||||||
map.put("label", conform(collect) + "");
|
map.put("label", conform(collect) + "");
|
||||||
|
|
||||||
chnList.add(map);
|
chnList.add(map);
|
||||||
@@ -164,15 +164,15 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
);
|
);
|
||||||
Map<Integer, Set<Integer>> resultMap = new HashMap<>(5);
|
Map<Integer, Set<Integer>> resultMap = new HashMap<>(5);
|
||||||
if (StrUtil.isNotBlank(param.getDevId())) {
|
if (StrUtil.isNotBlank(param.getDevId())) {
|
||||||
List<AdBaseResult> allResultList = new ArrayList<>();
|
List<SimAndDigBaseResult> allResultList = new ArrayList<>();
|
||||||
List<Integer> indexList = new ArrayList<>();
|
List<Integer> indexList = new ArrayList<>();
|
||||||
if (StrUtil.isNotBlank(param.getScriptType())) {
|
if (StrUtil.isNotBlank(param.getScriptType())) {
|
||||||
indexList = pqScriptDtlsService.getIndexList(param.getScriptType(), param.getScriptId());
|
indexList = pqScriptDtlsService.getIndexList(param.getScriptType(), param.getScriptId());
|
||||||
}
|
}
|
||||||
allResultList.addAll(adNonHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
|
allResultList.addAll(adNonHarmonicService.listSimAndDigBaseResult(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
|
||||||
allResultList.addAll(adHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
|
allResultList.addAll(adHarmonicService.get(param.getScriptId(), indexList, param.getDevId(), param.getDevNum(), param.getCode()));
|
||||||
if (CollUtil.isNotEmpty(allResultList)) {
|
if (CollUtil.isNotEmpty(allResultList)) {
|
||||||
resultMap = allResultList.stream().collect(Collectors.groupingBy(AdBaseResult::getSort, Collectors.mapping(AdBaseResult::getResultFlag, Collectors.toSet())));
|
resultMap = allResultList.stream().collect(Collectors.groupingBy(SimAndDigBaseResult::getSort, Collectors.mapping(SimAndDigBaseResult::getResultFlag, Collectors.toSet())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -971,7 +971,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
||||||
for (Integer sort : indexList) {
|
for (Integer sort : indexList) {
|
||||||
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueTypeList, Collections.singletonList(sort));
|
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueTypeList, Collections.singletonList(sort));
|
||||||
List<AdNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
List<SimAndDigNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
||||||
if (CollUtil.isNotEmpty(nonHarmList)) {
|
if (CollUtil.isNotEmpty(nonHarmList)) {
|
||||||
Map<String, String> keyFillMap = new HashMap<>(16);
|
Map<String, String> keyFillMap = new HashMap<>(16);
|
||||||
fillVoltagePhaseData(nonHarmList, keyFillMap, tableKeys);
|
fillVoltagePhaseData(nonHarmList, keyFillMap, tableKeys);
|
||||||
@@ -996,7 +996,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (indexList.size() == 1) {
|
if (indexList.size() == 1) {
|
||||||
// 获取谐波数据
|
// 获取谐波数据
|
||||||
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueType, indexList.get(0));
|
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, valueType, indexList.get(0));
|
||||||
AdHarmonicResult singleResult = adHarmonicService.getSingleResult(param);
|
SimAndDigHarmonicResult singleResult = adHarmonicService.getSingleResult(param);
|
||||||
// 注:如果ABC的标准值一致,则同步到standard中
|
// 注:如果ABC的标准值一致,则同步到standard中
|
||||||
Map<Double, List<PqScriptCheckData>> checkDataHarmNumMap = scriptCheckDataList.stream().collect(Collectors.groupingBy(PqScriptCheckData::getHarmNum));
|
Map<Double, List<PqScriptCheckData>> checkDataHarmNumMap = scriptCheckDataList.stream().collect(Collectors.groupingBy(PqScriptCheckData::getHarmNum));
|
||||||
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
||||||
@@ -1039,12 +1039,12 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (PowerConstant.THREE_PHASE.contains(scriptCode)) {
|
if (PowerConstant.THREE_PHASE.contains(scriptCode)) {
|
||||||
// 获取该三相的数据
|
// 获取该三相的数据
|
||||||
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList);
|
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList);
|
||||||
List<AdNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
List<SimAndDigNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
||||||
if (CollUtil.isNotEmpty(nonHarmList)) {
|
if (CollUtil.isNotEmpty(nonHarmList)) {
|
||||||
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
||||||
for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) {
|
for (SimAndDigNonHarmonicResult SimAndDigNonHarmonicResult : nonHarmList) {
|
||||||
Map<String, String> keyFillMap = new HashMap<>(16);
|
Map<String, String> keyFillMap = new HashMap<>(16);
|
||||||
fillThreePhaseData(adNonHarmonicResult, null, keyFillMap, scriptCode);
|
fillThreePhaseData(SimAndDigNonHarmonicResult, null, keyFillMap, scriptCode);
|
||||||
keyFillMapList.add(keyFillMap);
|
keyFillMapList.add(keyFillMap);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(keyFillMapList)) {
|
if (CollUtil.isNotEmpty(keyFillMapList)) {
|
||||||
@@ -1067,11 +1067,11 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
// 非三相且非暂态,通常只有一个数据,所以直接赋值即可
|
// 非三相且非暂态,通常只有一个数据,所以直接赋值即可
|
||||||
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
List<Map<String, String>> keyFillMapList = new ArrayList<>();
|
||||||
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList);
|
SingleNonHarmParam param = new SingleNonHarmParam(planCode, devId, lineNo, Collections.singletonList(valueType), indexList);
|
||||||
List<AdNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
List<SimAndDigNonHarmonicResult> nonHarmList = adNonHarmonicService.queryByCondition(param);
|
||||||
if (CollUtil.isNotEmpty(nonHarmList)) {
|
if (CollUtil.isNotEmpty(nonHarmList)) {
|
||||||
for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) {
|
for (SimAndDigNonHarmonicResult simAndDigNonHarmonicResult : nonHarmList) {
|
||||||
Map<String, String> keyFillMap = new HashMap<>(8);
|
Map<String, String> keyFillMap = new HashMap<>(8);
|
||||||
fillTPhaseData(adNonHarmonicResult, null, keyFillMap);
|
fillTPhaseData(simAndDigNonHarmonicResult, null, keyFillMap);
|
||||||
keyFillMapList.add(keyFillMap);
|
keyFillMapList.add(keyFillMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1286,14 +1286,14 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
* @param keyFillMap 待填充的集合Map
|
* @param keyFillMap 待填充的集合Map
|
||||||
* @param tableKeys 模板表格中的key
|
* @param tableKeys 模板表格中的key
|
||||||
*/
|
*/
|
||||||
private void fillVoltagePhaseData(List<AdNonHarmonicResult> nonHarmList, Map<String, String> keyFillMap, List<String> tableKeys) {
|
private void fillVoltagePhaseData(List<SimAndDigNonHarmonicResult> nonHarmList, Map<String, String> keyFillMap, List<String> tableKeys) {
|
||||||
String standardMag = "/", standardDur = "/",
|
String standardMag = "/", standardDur = "/",
|
||||||
testMag = "/", testDur = "/",
|
testMag = "/", testDur = "/",
|
||||||
errorMag = "/", errorDur = "/",
|
errorMag = "/", errorDur = "/",
|
||||||
resultMag = "/", resultDur = "/", result,
|
resultMag = "/", resultDur = "/", result,
|
||||||
errorScope, errorScopeMag = "/", errorScopeDur = "/",
|
errorScope, errorScopeMag = "/", errorScopeDur = "/",
|
||||||
unitMag = "", unitDur = "";
|
unitMag = "", unitDur = "";
|
||||||
for (AdNonHarmonicResult adNonHarmonicResult : nonHarmList) {
|
for (SimAndDigNonHarmonicResult adNonHarmonicResult : nonHarmList) {
|
||||||
DetectionData tempT = getResultData(adNonHarmonicResult, null, PowerConstant.PHASE_T);
|
DetectionData tempT = getResultData(adNonHarmonicResult, null, PowerConstant.PHASE_T);
|
||||||
// 需要判断adNonHarmonicResult是特征幅值还是持续时间
|
// 需要判断adNonHarmonicResult是特征幅值还是持续时间
|
||||||
String adType = adNonHarmonicResult.getAdType();
|
String adType = adNonHarmonicResult.getAdType();
|
||||||
@@ -1520,7 +1520,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
private void createTempResultTable(String code) {
|
private void createTempResultTable(String code) {
|
||||||
this.dropTempResultTable(code);
|
this.dropTempResultTable(code);
|
||||||
String oldCode = code.replace("_temp", "");
|
String oldCode = code.replace("_temp", "");
|
||||||
tableGenMapper.genAdNonHarmonicResultTable(code);
|
tableGenMapper.genNonHarmonicResultTable(code, false);
|
||||||
StringBuilder A = new StringBuilder();
|
StringBuilder A = new StringBuilder();
|
||||||
StringBuilder B = new StringBuilder();
|
StringBuilder B = new StringBuilder();
|
||||||
StringBuilder C = new StringBuilder();
|
StringBuilder C = new StringBuilder();
|
||||||
@@ -1596,12 +1596,12 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
dataRule = DictDataEnum.SECTION_VALUE;
|
dataRule = DictDataEnum.SECTION_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<AdNonHarmonicResult> allNonHarmonicRawData = adNonHarmonicService.listAllRawData(scriptId, oldCode, devId);
|
List<SimAndDigNonHarmonicResult> allNonHarmonicRawData = adNonHarmonicService.listAllSimAndDigRawData(scriptId, oldCode, devId);
|
||||||
LinkedHashMap<Integer, List<AdNonHarmonicResult>> nonHarmonicMap = allNonHarmonicRawData.stream().sorted(Comparator.comparing(AdNonHarmonicResult::getSort))
|
LinkedHashMap<Integer, List<SimAndDigNonHarmonicResult>> nonHarmonicMap = allNonHarmonicRawData.stream().sorted(Comparator.comparing(SimAndDigNonHarmonicResult::getSort))
|
||||||
.collect(Collectors.groupingBy(AdNonHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(SimAndDigNonHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
|
||||||
List<AdHarmonicResult> allHarmonicRawData = adHarmonicService.listAllRawData(scriptId, oldCode, devId);
|
List<SimAndDigHarmonicResult> allHarmonicRawData = adHarmonicService.listAllRawData(scriptId, oldCode, devId);
|
||||||
LinkedHashMap<Integer, List<AdHarmonicResult>> harmonicMap = allHarmonicRawData.stream().sorted(Comparator.comparing(AdHarmonicResult::getSort))
|
LinkedHashMap<Integer, List<SimAndDigHarmonicResult>> harmonicMap = allHarmonicRawData.stream().sorted(Comparator.comparing(SimAndDigHarmonicResult::getSort))
|
||||||
.collect(Collectors.groupingBy(AdHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(SimAndDigHarmonicResult::getSort, LinkedHashMap::new, Collectors.toList()));
|
||||||
|
|
||||||
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
issueParam.setPlanId(planId);
|
issueParam.setPlanId(planId);
|
||||||
@@ -1615,8 +1615,8 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
|
||||||
sourceIssues.forEach(sourceIssue -> {
|
sourceIssues.forEach(sourceIssue -> {
|
||||||
List<AdNonHarmonicResult> nonHarmonicResults = nonHarmonicMap.get(sourceIssue.getIndex());
|
List<SimAndDigNonHarmonicResult> nonHarmonicResults = nonHarmonicMap.get(sourceIssue.getIndex());
|
||||||
List<AdHarmonicResult> harmonicResults = harmonicMap.get(sourceIssue.getIndex());
|
List<SimAndDigHarmonicResult> harmonicResults = harmonicMap.get(sourceIssue.getIndex());
|
||||||
List<DevData> realDataXiList = new ArrayList<>();
|
List<DevData> realDataXiList = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(nonHarmonicResults)) {
|
if (CollUtil.isNotEmpty(nonHarmonicResults)) {
|
||||||
realDataXiList.addAll(this.toList(nonHarmonicResults, null, true));
|
realDataXiList.addAll(this.toList(nonHarmonicResults, null, true));
|
||||||
@@ -1640,11 +1640,11 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), null, param.getTemperature(), param.getHumidity());
|
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), null, param.getTemperature(), param.getHumidity());
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DevData> toList(List<AdNonHarmonicResult> nonHarm, List<AdHarmonicResult> harm, boolean containBaseHarm) {
|
private List<DevData> toList(List<SimAndDigNonHarmonicResult> nonHarm, List<SimAndDigHarmonicResult> harm, boolean containBaseHarm) {
|
||||||
List<DevData> info = new ArrayList<>();
|
List<DevData> info = new ArrayList<>();
|
||||||
// if (CollUtil.isNotEmpty(nonHarm)) {
|
// if (CollUtil.isNotEmpty(nonHarm)) {
|
||||||
if (CollUtil.isNotEmpty(nonHarm)) {
|
if (CollUtil.isNotEmpty(nonHarm)) {
|
||||||
Map<String, List<AdNonHarmonicResult>> noHarmMap = nonHarm.stream()
|
Map<String, List<SimAndDigNonHarmonicResult>> noHarmMap = nonHarm.stream()
|
||||||
.collect(Collectors.groupingBy(x -> x.getMonitorId() + "_" + x.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.UTC_SIMPLE_MS_PATTERN)) + "_" + x.getSort()));
|
.collect(Collectors.groupingBy(x -> x.getMonitorId() + "_" + x.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.UTC_SIMPLE_MS_PATTERN)) + "_" + x.getSort()));
|
||||||
noHarmMap.forEach((key, value) -> {
|
noHarmMap.forEach((key, value) -> {
|
||||||
String[] split = key.split("_");
|
String[] split = key.split("_");
|
||||||
@@ -1653,7 +1653,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
data.setId(split[0] + "_" + split[1]);
|
data.setId(split[0] + "_" + split[1]);
|
||||||
List<DevData.SqlDataDTO> sqlDataDTOS = new ArrayList<>();
|
List<DevData.SqlDataDTO> sqlDataDTOS = new ArrayList<>();
|
||||||
DevData.SqlDataDTO sqlDataDTO;
|
DevData.SqlDataDTO sqlDataDTO;
|
||||||
for (AdNonHarmonicResult result : value) {
|
for (SimAndDigNonHarmonicResult result : value) {
|
||||||
sqlDataDTO = new DevData.SqlDataDTO();
|
sqlDataDTO = new DevData.SqlDataDTO();
|
||||||
sqlDataDTO.setType(result.getDataType());
|
sqlDataDTO.setType(result.getDataType());
|
||||||
sqlDataDTO.setDesc(result.getAdType());
|
sqlDataDTO.setDesc(result.getAdType());
|
||||||
@@ -1670,7 +1670,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(harm)) {
|
if (CollUtil.isNotEmpty(harm)) {
|
||||||
Map<String, List<AdHarmonicResult>> harmMap = harm.stream()
|
Map<String, List<SimAndDigHarmonicResult>> harmMap = harm.stream()
|
||||||
.collect(Collectors.groupingBy(x -> x.getMonitorId() + "_" + x.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.UTC_SIMPLE_MS_PATTERN))));
|
.collect(Collectors.groupingBy(x -> x.getMonitorId() + "_" + x.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.UTC_SIMPLE_MS_PATTERN))));
|
||||||
harmMap.forEach((key, value) -> {
|
harmMap.forEach((key, value) -> {
|
||||||
List<DevData> collect = info.stream().filter(x -> key.equals(x.getId() + "_" + x.getTime())).collect(Collectors.toList());
|
List<DevData> collect = info.stream().filter(x -> key.equals(x.getId() + "_" + x.getTime())).collect(Collectors.toList());
|
||||||
@@ -1678,7 +1678,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
DevData.SqlDataDTO sqlDataDTO;
|
DevData.SqlDataDTO sqlDataDTO;
|
||||||
List<DevData.SqlDataHarmDTO> sqlDataHarmDTOS = new ArrayList<>();
|
List<DevData.SqlDataHarmDTO> sqlDataHarmDTOS = new ArrayList<>();
|
||||||
DevData.SqlDataHarmDTO dataHarmDTO;
|
DevData.SqlDataHarmDTO dataHarmDTO;
|
||||||
for (AdHarmonicResult harmonicResult : value) {
|
for (SimAndDigHarmonicResult harmonicResult : value) {
|
||||||
if (containBaseHarm) {
|
if (containBaseHarm) {
|
||||||
sqlDataDTO = new DevData.SqlDataDTO();
|
sqlDataDTO = new DevData.SqlDataDTO();
|
||||||
sqlDataDTO.setType(harmonicResult.getDataType());
|
sqlDataDTO.setType(harmonicResult.getDataType());
|
||||||
@@ -1725,12 +1725,12 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> reflectHarmonicValue(String phase, AdHarmonicResult adHarmonicResult, boolean notContainBaseHarm) {
|
private List<String> reflectHarmonicValue(String phase, SimAndDigHarmonicResult adHarmonicResult, boolean notContainBaseHarm) {
|
||||||
List<String> info = new ArrayList<>();
|
List<String> info = new ArrayList<>();
|
||||||
for (int i = notContainBaseHarm ? 2 : 1; i <= 50; i++) {
|
for (int i = notContainBaseHarm ? 2 : 1; i <= 50; i++) {
|
||||||
String fieldName = phase + "Value" + i;
|
String fieldName = phase + "Value" + i;
|
||||||
try {
|
try {
|
||||||
Field idField = AdHarmonicResult.class.getDeclaredField(fieldName);
|
Field idField = SimAndDigHarmonicResult.class.getDeclaredField(fieldName);
|
||||||
idField.setAccessible(true);
|
idField.setAccessible(true);
|
||||||
String value = idField.get(adHarmonicResult) + "";
|
String value = idField.get(adHarmonicResult) + "";
|
||||||
info.add(value);
|
info.add(value);
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ spring:
|
|||||||
url: jdbc:mysql://192.168.1.24:13306/pqs9100?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://192.168.1.24:13306/pqs9100?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: njcnpqs
|
password: njcnpqs
|
||||||
# url: jdbc:mysql://localhost:3306/pqs91001?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT
|
# url: jdbc:mysql://localhost:3306/pqs91001?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
#初始化建立物理连接的个数、最小、最大连接数
|
#初始化建立物理连接的个数、最小、最大连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
min-idle: 5
|
min-idle: 5
|
||||||
@@ -38,7 +38,7 @@ mybatis-plus:
|
|||||||
#配置sql日志输出
|
#配置sql日志输出
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
#关闭日志输出
|
#关闭日志输出
|
||||||
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
global-config:
|
global-config:
|
||||||
db-config:
|
db-config:
|
||||||
#指定主键生成策略
|
#指定主键生成策略
|
||||||
@@ -103,3 +103,8 @@ qr:
|
|||||||
|
|
||||||
db:
|
db:
|
||||||
type: mysql
|
type: mysql
|
||||||
|
|
||||||
|
detection:
|
||||||
|
xujy:
|
||||||
|
volOrCur: 6
|
||||||
|
phase: 3
|
||||||
@@ -3,8 +3,8 @@ package com.njcn.gather.storage.controller;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.utils.HttpResultUtil;
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
@@ -33,24 +33,24 @@ public class DataDealController extends BaseController {
|
|||||||
public HttpResult<Object> dataDealAndInsert(){
|
public HttpResult<Object> dataDealAndInsert(){
|
||||||
String methodDescribe = getMethodDescribe("dataDealAndInsert");
|
String methodDescribe = getMethodDescribe("dataDealAndInsert");
|
||||||
|
|
||||||
List<AdHarmonicResult> list2 = new ArrayList<>();
|
List<SimAndDigHarmonicResult> list2 = new ArrayList<>();
|
||||||
AdHarmonicResult adHarmonicResult = new AdHarmonicResult();
|
SimAndDigHarmonicResult SimAndDigHarmonicResult = new SimAndDigHarmonicResult();
|
||||||
adHarmonicResult.setDataType("aa");
|
SimAndDigHarmonicResult.setDataType("aa");
|
||||||
adHarmonicResult.setAdType("aaaa");
|
SimAndDigHarmonicResult.setAdType("aaaa");
|
||||||
|
|
||||||
adHarmonicResult.setMonitorId("ss");
|
SimAndDigHarmonicResult.setMonitorId("ss");
|
||||||
adHarmonicResult.setScriptId("ddd");
|
SimAndDigHarmonicResult.setScriptId("ddd");
|
||||||
adHarmonicResult.setTimeId(LocalDateTime.now());
|
SimAndDigHarmonicResult.setTimeId(LocalDateTime.now());
|
||||||
|
|
||||||
list2.add(adHarmonicResult);
|
list2.add(SimAndDigHarmonicResult);
|
||||||
AdHarmonicResult adHarmonicResult2 = new AdHarmonicResult();
|
SimAndDigHarmonicResult SimAndDigHarmonicResult2 = new SimAndDigHarmonicResult();
|
||||||
adHarmonicResult2.setDataType("aabb");
|
SimAndDigHarmonicResult2.setDataType("aabb");
|
||||||
adHarmonicResult2.setAdType("aaaabb");
|
SimAndDigHarmonicResult2.setAdType("aaaabb");
|
||||||
|
|
||||||
adHarmonicResult2.setMonitorId("ssbb");
|
SimAndDigHarmonicResult2.setMonitorId("ssbb");
|
||||||
adHarmonicResult2.setScriptId("dddbb");
|
SimAndDigHarmonicResult2.setScriptId("dddbb");
|
||||||
adHarmonicResult2.setTimeId(LocalDateTime.now());
|
SimAndDigHarmonicResult2.setTimeId(LocalDateTime.now());
|
||||||
list2.add(adHarmonicResult2);
|
list2.add(SimAndDigHarmonicResult2);
|
||||||
|
|
||||||
detectionDataDealService.acceptAd(list2,"1");
|
detectionDataDealService.acceptAd(list2,"1");
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ public class TableGenController extends BaseController {
|
|||||||
@GetMapping("genAdHarmonicTable")
|
@GetMapping("genAdHarmonicTable")
|
||||||
@ApiOperation("生成表")
|
@ApiOperation("生成表")
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
public HttpResult<Object> genAdHarmonicTable(@RequestParam("code") String code){
|
public HttpResult<Object> genAdHarmonicTable(@RequestParam("code") String code, @RequestParam("isContrast") boolean isContrast) {
|
||||||
String methodDescribe = getMethodDescribe("genAdHarmonicTable");
|
String methodDescribe = getMethodDescribe("genAdHarmonicTable");
|
||||||
tableGenService.genAdNonHarmonicTable(code);
|
tableGenService.genTable(code, isContrast);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.njcn.gather.storage.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface AdNonHarmonicMapper extends MPJBaseMapper<AdNonHarmonicResult> {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastHarmonicResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-08-06
|
||||||
|
*/
|
||||||
|
public interface ContrastHarmonicMappper extends MPJBaseMapper<ContrastHarmonicResult> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastNonHarmonicResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
public interface ContrastNonHarmonicMappper extends MPJBaseMapper<ContrastNonHarmonicResult> {
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.njcn.gather.storage.mapper;
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
import com.njcn.db.mybatisplus.mapper.BatchBaseMapper;
|
import com.njcn.db.mybatisplus.mapper.BatchBaseMapper;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface DetectionDataDealMapper extends BatchBaseMapper<AdHarmonicResult> {
|
public interface DetectionDataDealMapper extends BatchBaseMapper<SimAndDigHarmonicResult> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备ID查询禁用的脚本详情索引
|
* 根据设备ID查询禁用的脚本详情索引
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.njcn.gather.storage.mapper;
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,5 +9,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* @data 2024-12-30
|
* @data 2024-12-30
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface AdHarmonicMappper extends MPJBaseMapper<AdHarmonicResult> {
|
public interface SimAndDigHarmonicMappper extends MPJBaseMapper<SimAndDigHarmonicResult> {
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SimAndDigNonHarmonicMapper extends MPJBaseMapper<SimAndDigNonHarmonicResult> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
package com.njcn.gather.storage.mapper;
|
package com.njcn.gather.storage.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Update;
|
|
||||||
|
|
||||||
public interface TableGenMapper {
|
public interface TableGenMapper {
|
||||||
|
|
||||||
|
|
||||||
void genAdNonHarmonicTable(@Param("code")String code);
|
void genNonHarmonicTable(@Param("code") String code, @Param("isContrast") boolean isContrast);
|
||||||
|
|
||||||
|
|
||||||
void genAdHarmonicTable(@Param("tableSql")String tableSql);
|
void genAdHarmonicTable(@Param("tableSql") String tableSql);
|
||||||
|
|
||||||
|
|
||||||
void genAdNonHarmonicResultTable(@Param("code")String code);
|
void genNonHarmonicResultTable(@Param("code") String code, @Param("isContrast") boolean isContrast);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.gather.storage.mapper.AdNonHarmonicMapper">
|
<mapper namespace="com.njcn.gather.storage.mapper.SimAndDigNonHarmonicMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.gather.storage.mapper.TableGenMapper">
|
<mapper namespace="com.njcn.gather.storage.mapper.TableGenMapper">
|
||||||
|
<update id="genNonHarmonicTable">
|
||||||
<update id="genAdNonHarmonicTable" parameterType="string">
|
CREATE TABLE ad_non_harmonic_${code}
|
||||||
CREATE TABLE ad_non_harmonic_${code} (
|
(
|
||||||
Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',
|
Monitor_Id CHAR(34) NOT NULL COMMENT '监测点Id',
|
||||||
Time_Id DATETIME(3) NOT NULL COMMENT '时间',
|
Time_Id DATETIME(3) NOT NULL COMMENT '时间',
|
||||||
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
|
||||||
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
|
||||||
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
||||||
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
||||||
A_Value float DEFAULT NULL COMMENT 'A相值',
|
A_Value float DEFAULT NULL COMMENT 'A相值',
|
||||||
@@ -15,31 +13,53 @@
|
|||||||
C_Value float DEFAULT NULL COMMENT 'C相值',
|
C_Value float DEFAULT NULL COMMENT 'C相值',
|
||||||
T_Value float DEFAULT NULL COMMENT 'T相值(没有相别的则存这里)',
|
T_Value float DEFAULT NULL COMMENT 'T相值(没有相别的则存这里)',
|
||||||
Result_Flag int(1) NULL COMMENT '1合格 2不合格 4无法处理',
|
Result_Flag int(1) NULL COMMENT '1合格 2不合格 4无法处理',
|
||||||
|
<choose>
|
||||||
|
<when test="isContrast">
|
||||||
|
Error_Id CHAR(32) NOT NULL COMMENT '误差体系表ID',
|
||||||
|
Num tinyint(1) unsigned DEFAULT 0 COMMENT '第几次检测',
|
||||||
|
PRIMARY KEY (Monitor_Id, Time_Id, Error_Id, AD_Type)
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',
|
||||||
|
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
||||||
PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, Sort, AD_Type)
|
PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, Sort, AD_Type)
|
||||||
) COMMENT='监测数据表';
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
) COMMENT='非谐波类原始数据表';
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<update id="genAdHarmonicTable" parameterType="string">
|
<update id="genAdHarmonicTable" parameterType="string">
|
||||||
${tableSql}
|
${tableSql}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="genNonHarmonicResultTable">
|
||||||
<update id="genAdNonHarmonicResultTable" parameterType="string">
|
|
||||||
CREATE TABLE if not exists ad_non_harmonic_result_${code} (
|
CREATE TABLE if not exists ad_non_harmonic_result_${code} (
|
||||||
Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',
|
Monitor_Id CHAR(34) NOT NULL COMMENT '监测点Id',
|
||||||
Time_Id DATETIME(3) NULL COMMENT '时间',
|
Time_Id DATETIME NULL COMMENT '时间',
|
||||||
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
|
||||||
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
|
||||||
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
||||||
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
||||||
Result_Flag int(1) NOT NULL COMMENT '1合格 2不合格 4无法处理',
|
|
||||||
A_Value json NULL COMMENT 'A相值',
|
A_Value json NULL COMMENT 'A相值',
|
||||||
B_Value json NULL COMMENT 'B相值',
|
B_Value json NULL COMMENT 'B相值',
|
||||||
C_Value json NULL COMMENT 'C相值',
|
C_Value json NULL COMMENT 'C相值',
|
||||||
T_Value json NULL COMMENT 'T相值(没有相别的则存这里)',
|
T_Value json NULL COMMENT 'T相值(没有相别的则存这里)',
|
||||||
PRIMARY KEY (Monitor_Id, Script_Id, Sort, AD_Type,Data_Type)
|
Result_Flag int(1) NOT NULL COMMENT '1合格 2不合格 4无法处理',
|
||||||
) COMMENT='监测数据表';
|
<choose>
|
||||||
|
<when test="isContrast">
|
||||||
|
Error_Id CHAR(32) NOT NULL COMMENT '误差体系表ID',
|
||||||
|
Num tinyint(1) unsigned DEFAULT 0 COMMENT '第几次检测',
|
||||||
|
PRIMARY KEY (Monitor_Id, Error_Id, Num, AD_Type)
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',
|
||||||
|
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
||||||
|
PRIMARY KEY (Monitor_Id, Script_Id, Sort, AD_Type)
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
) COMMENT='非谐波类检测结果表';
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
package com.njcn.gather.storage.pojo.po;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* 监测数据表
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author cdf
|
|
||||||
* @since 2024-12-24
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@TableName(value = "ad_harmonic_xx")
|
|
||||||
public class AdNonHarmonicResult {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 监测点Id
|
|
||||||
*/
|
|
||||||
private String monitorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime timeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测脚本子表Id,字典表
|
|
||||||
*/
|
|
||||||
private String scriptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总检测脚本中的测试项序号
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测指标,字典表
|
|
||||||
*/
|
|
||||||
private String adType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表
|
|
||||||
*/
|
|
||||||
private String dataType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1.合格 2.不合格 4.无法处理
|
|
||||||
*/
|
|
||||||
private Integer resultFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A相值
|
|
||||||
*/
|
|
||||||
private String aValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* B相值
|
|
||||||
*/
|
|
||||||
private String bValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* C相值
|
|
||||||
*/
|
|
||||||
private String cValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* T相值(没有相别的则存这里)
|
|
||||||
*/
|
|
||||||
private String tValue;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BaseResult {
|
||||||
|
/**
|
||||||
|
* 监测点Id
|
||||||
|
*/
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime timeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.不合格 1.合格 4.无法处理
|
||||||
|
*/
|
||||||
|
private Integer resultFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测指标,字典表
|
||||||
|
*/
|
||||||
|
private String adType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表
|
||||||
|
*/
|
||||||
|
private String dataType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ContrastBaseResult extends BaseResult {
|
||||||
|
/**
|
||||||
|
* 误差体系Id
|
||||||
|
*/
|
||||||
|
private String errorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第几次检测
|
||||||
|
*/
|
||||||
|
private Integer num;
|
||||||
|
}
|
||||||
@@ -0,0 +1,917 @@
|
|||||||
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-08-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ad_harmonic_xx")
|
||||||
|
public class ContrastHarmonicResult extends ContrastBaseResult {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A相基波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_1")
|
||||||
|
private String aValue1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_2")
|
||||||
|
private String aValue2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_3")
|
||||||
|
private String aValue3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_4")
|
||||||
|
private String aValue4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_5")
|
||||||
|
private String aValue5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_6")
|
||||||
|
private String aValue6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_7")
|
||||||
|
private String aValue7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_8")
|
||||||
|
private String aValue8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_9")
|
||||||
|
private String aValue9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_10")
|
||||||
|
private String aValue10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_11")
|
||||||
|
private String aValue11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_12")
|
||||||
|
private String aValue12;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_13")
|
||||||
|
private String aValue13;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_14")
|
||||||
|
private String aValue14;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_15")
|
||||||
|
private String aValue15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_16")
|
||||||
|
private String aValue16;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_17")
|
||||||
|
private String aValue17;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_18")
|
||||||
|
private String aValue18;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_19")
|
||||||
|
private String aValue19;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_20")
|
||||||
|
private String aValue20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_21")
|
||||||
|
private String aValue21;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_22")
|
||||||
|
private String aValue22;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_23")
|
||||||
|
private String aValue23;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_24")
|
||||||
|
private String aValue24;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_25")
|
||||||
|
private String aValue25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 26次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_26")
|
||||||
|
private String aValue26;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 27次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_27")
|
||||||
|
private String aValue27;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 28次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_28")
|
||||||
|
private String aValue28;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 29次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_29")
|
||||||
|
private String aValue29;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_30")
|
||||||
|
private String aValue30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 31次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_31")
|
||||||
|
private String aValue31;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 32次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_32")
|
||||||
|
private String aValue32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 33次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_33")
|
||||||
|
private String aValue33;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 34次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_34")
|
||||||
|
private String aValue34;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 35次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_35")
|
||||||
|
private String aValue35;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 36次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_36")
|
||||||
|
private String aValue36;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 37次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_37")
|
||||||
|
private String aValue37;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 38次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_38")
|
||||||
|
private String aValue38;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 39次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_39")
|
||||||
|
private String aValue39;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 40次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_40")
|
||||||
|
private String aValue40;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 41次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_41")
|
||||||
|
private String aValue41;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 42次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_42")
|
||||||
|
private String aValue42;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 43次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_43")
|
||||||
|
private String aValue43;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 44次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_44")
|
||||||
|
private String aValue44;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 45次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_45")
|
||||||
|
private String aValue45;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 46次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_46")
|
||||||
|
private String aValue46;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 47次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_47")
|
||||||
|
private String aValue47;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 48次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_48")
|
||||||
|
private String aValue48;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 49次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_49")
|
||||||
|
private String aValue49;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 50次A相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "A_Value_50")
|
||||||
|
private String aValue50;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* B相基波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_1")
|
||||||
|
private String bValue1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_2")
|
||||||
|
private String bValue2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_3")
|
||||||
|
private String bValue3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_4")
|
||||||
|
private String bValue4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_5")
|
||||||
|
private String bValue5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_6")
|
||||||
|
private String bValue6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_7")
|
||||||
|
private String bValue7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_8")
|
||||||
|
private String bValue8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_9")
|
||||||
|
private String bValue9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_10")
|
||||||
|
private String bValue10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_11")
|
||||||
|
private String bValue11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_12")
|
||||||
|
private String bValue12;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_13")
|
||||||
|
private String bValue13;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_14")
|
||||||
|
private String bValue14;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_15")
|
||||||
|
private String bValue15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_16")
|
||||||
|
private String bValue16;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_17")
|
||||||
|
private String bValue17;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_18")
|
||||||
|
private String bValue18;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_19")
|
||||||
|
private String bValue19;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_20")
|
||||||
|
private String bValue20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_21")
|
||||||
|
private String bValue21;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_22")
|
||||||
|
private String bValue22;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_23")
|
||||||
|
private String bValue23;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_24")
|
||||||
|
private String bValue24;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_25")
|
||||||
|
private String bValue25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 26次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_26")
|
||||||
|
private String bValue26;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 27次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_27")
|
||||||
|
private String bValue27;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 28次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_28")
|
||||||
|
private String bValue28;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 29次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_29")
|
||||||
|
private String bValue29;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_30")
|
||||||
|
private String bValue30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 31次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_31")
|
||||||
|
private String bValue31;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 32次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_32")
|
||||||
|
private String bValue32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 33次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_33")
|
||||||
|
private String bValue33;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 34次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_34")
|
||||||
|
private String bValue34;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 35次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_35")
|
||||||
|
private String bValue35;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 36次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_36")
|
||||||
|
private String bValue36;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 37次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_37")
|
||||||
|
private String bValue37;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 38次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_38")
|
||||||
|
private String bValue38;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 39次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_39")
|
||||||
|
private String bValue39;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 40次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_40")
|
||||||
|
private String bValue40;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 41次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_41")
|
||||||
|
private String bValue41;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 42次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_42")
|
||||||
|
private String bValue42;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 43次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_43")
|
||||||
|
private String bValue43;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 44次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_44")
|
||||||
|
private String bValue44;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 45次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_45")
|
||||||
|
private String bValue45;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 46次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_46")
|
||||||
|
private String bValue46;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 47次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_47")
|
||||||
|
private String bValue47;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 48次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_48")
|
||||||
|
private String bValue48;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 49次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_49")
|
||||||
|
private String bValue49;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 50次B相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "B_Value_50")
|
||||||
|
private String bValue50;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C相基波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_1")
|
||||||
|
private String cValue1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_2")
|
||||||
|
private String cValue2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_3")
|
||||||
|
private String cValue3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_4")
|
||||||
|
private String cValue4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_5")
|
||||||
|
private String cValue5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_6")
|
||||||
|
private String cValue6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_7")
|
||||||
|
private String cValue7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_8")
|
||||||
|
private String cValue8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_9")
|
||||||
|
private String cValue9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_10")
|
||||||
|
private String cValue10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_11")
|
||||||
|
private String cValue11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_12")
|
||||||
|
private String cValue12;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_13")
|
||||||
|
private String cValue13;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_14")
|
||||||
|
private String cValue14;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_15")
|
||||||
|
private String cValue15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_16")
|
||||||
|
private String cValue16;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_17")
|
||||||
|
private String cValue17;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_18")
|
||||||
|
private String cValue18;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_19")
|
||||||
|
private String cValue19;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_20")
|
||||||
|
private String cValue20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_21")
|
||||||
|
private String cValue21;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_22")
|
||||||
|
private String cValue22;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_23")
|
||||||
|
private String cValue23;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_24")
|
||||||
|
private String cValue24;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_25")
|
||||||
|
private String cValue25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 26次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_26")
|
||||||
|
private String cValue26;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 27次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_27")
|
||||||
|
private String cValue27;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 28次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_28")
|
||||||
|
private String cValue28;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 29次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_29")
|
||||||
|
private String cValue29;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 30次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_30")
|
||||||
|
private String cValue30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 31次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_31")
|
||||||
|
private String cValue31;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 32次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_32")
|
||||||
|
private String cValue32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 33次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_33")
|
||||||
|
private String cValue33;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 34次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_34")
|
||||||
|
private String cValue34;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 35次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_35")
|
||||||
|
private String cValue35;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 36次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_36")
|
||||||
|
private String cValue36;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 37次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_37")
|
||||||
|
private String cValue37;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 38次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_38")
|
||||||
|
private String cValue38;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 39次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_39")
|
||||||
|
private String cValue39;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 40次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_40")
|
||||||
|
private String cValue40;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 41次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_41")
|
||||||
|
private String cValue41;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 42次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_42")
|
||||||
|
private String cValue42;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 43次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_43")
|
||||||
|
private String cValue43;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 44次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_44")
|
||||||
|
private String cValue44;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 45次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_45")
|
||||||
|
private String cValue45;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 46次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_46")
|
||||||
|
private String cValue46;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 47次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_47")
|
||||||
|
private String cValue47;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 48次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_48")
|
||||||
|
private String cValue48;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 49次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_49")
|
||||||
|
private String cValue49;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 50次C相谐波
|
||||||
|
*/
|
||||||
|
@TableField(value = "C_Value_50")
|
||||||
|
private String cValue50;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-08-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "ad_harmonic_xx")
|
||||||
|
public class ContrastNonHarmonicResult extends ContrastBaseResult {
|
||||||
|
/**
|
||||||
|
* A相值
|
||||||
|
*/
|
||||||
|
private String aValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* B相值
|
||||||
|
*/
|
||||||
|
private String bValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C相值
|
||||||
|
*/
|
||||||
|
private String cValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* T相值(没有相别的则存这里)
|
||||||
|
*/
|
||||||
|
private String tValue;
|
||||||
|
}
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
package com.njcn.gather.storage.pojo.po;
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @data 2024-12-30
|
* @data 2024-12-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class AdBaseResult {
|
@EqualsAndHashCode(callSuper = true)
|
||||||
/**
|
public class SimAndDigBaseResult extends BaseResult {
|
||||||
* 监测点Id
|
|
||||||
*/
|
|
||||||
private String monitorId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测脚本Id
|
* 检测脚本Id
|
||||||
@@ -22,14 +20,4 @@ public class AdBaseResult {
|
|||||||
* 总检测脚本中的测试项序号
|
* 总检测脚本中的测试项序号
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
|
||||||
* 0.不合格 1.合格
|
|
||||||
*/
|
|
||||||
private Integer resultFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测指标,字典表
|
|
||||||
*/
|
|
||||||
private String adType;
|
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -16,49 +18,13 @@ import lombok.Setter;
|
|||||||
* @author cdf
|
* @author cdf
|
||||||
* @since 2024-12-24
|
* @since 2024-12-24
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Data
|
||||||
@Setter
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("ad_harmonic_xx")
|
@TableName("ad_harmonic_xx")
|
||||||
public class AdHarmonicResult {
|
public class SimAndDigHarmonicResult extends SimAndDigBaseResult {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 监测点Id
|
|
||||||
*/
|
|
||||||
private String monitorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime timeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测脚本子表Id,字典表
|
|
||||||
*/
|
|
||||||
private String scriptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总检测脚本中的测试项序号
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测指标,字典表
|
|
||||||
*/
|
|
||||||
private String adType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表
|
|
||||||
*/
|
|
||||||
private String dataType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1.合格 2.不合格 4.无法处理
|
|
||||||
*/
|
|
||||||
private Integer resultFlag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A相基波
|
* A相基波
|
||||||
*/
|
*/
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 监测数据表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2024-12-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "ad_harmonic_xx")
|
||||||
|
public class SimAndDigNonHarmonicResult extends SimAndDigBaseResult {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A相值
|
||||||
|
*/
|
||||||
|
private String aValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* B相值
|
||||||
|
*/
|
||||||
|
private String bValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C相值
|
||||||
|
*/
|
||||||
|
private String cValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* T相值(没有相别的则存这里)
|
||||||
|
*/
|
||||||
|
private String tValue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.njcn.gather.storage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastHarmonicResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
public interface ContrastHarmonicService extends IService<ContrastHarmonicResult> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.gather.storage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastNonHarmonicResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
public interface ContrastNonHarmonicService extends IService<ContrastNonHarmonicResult> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
package com.njcn.gather.storage.service;
|
package com.njcn.gather.storage.service;
|
||||||
|
|
||||||
import com.njcn.db.mybatisplus.service.IReplenishMybatisService;
|
import com.njcn.db.mybatisplus.service.IReplenishMybatisService;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.BaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.ContrastNonHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface DetectionDataDealService extends IReplenishMybatisService<AdHarmonicResult> {
|
public interface DetectionDataDealService extends IReplenishMybatisService<SimAndDigHarmonicResult> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Boolean acceptAdNon(List<AdNonHarmonicResult> adNonHarmonicResultList,String code);
|
Boolean acceptAdNon(List<SimAndDigNonHarmonicResult> SimAndDigNonHarmonicResultList,String code);
|
||||||
|
|
||||||
Boolean acceptAd(List<AdHarmonicResult> adHarmonicResultList,String code);
|
Boolean acceptAd(List<SimAndDigHarmonicResult> SimAndDigHarmonicResultList,String code);
|
||||||
|
|
||||||
|
Boolean acceptNonHarmonicResult(List<? extends BaseResult> nonHarmonicResultList, String code);
|
||||||
|
|
||||||
Boolean acceptAdNonResult(List<AdNonHarmonicResult> adNonHarmonicResultList,String code);
|
Boolean acceptAdResult(List<SimAndDigHarmonicResult> SimAndDigHarmonicResultList,String code);
|
||||||
|
|
||||||
Boolean acceptAdResult(List<AdHarmonicResult> adHarmonicResultList,String code);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据终端id查询终端所有监测项目是否合格
|
* 根据终端id查询终端所有监测项目是否合格
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.njcn.gather.storage.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigBaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ import java.util.Map;
|
|||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @data 2024-12-30
|
* @data 2024-12-30
|
||||||
*/
|
*/
|
||||||
public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
public interface SimAndDigHarmonicService extends IService<SimAndDigHarmonicResult> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备ID和通道号获取谐波结果
|
* 根据设备ID和通道号获取谐波结果
|
||||||
@@ -26,7 +26,7 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
* @param code 计划code
|
* @param code 计划code
|
||||||
* @return 谐波结果
|
* @return 谐波结果
|
||||||
*/
|
*/
|
||||||
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum, String code);
|
List<SimAndDigBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum, String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询原始数据
|
* 查询原始数据
|
||||||
@@ -52,7 +52,7 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
*/
|
*/
|
||||||
List<Integer> getIndex(StorageParam param);
|
List<Integer> getIndex(StorageParam param);
|
||||||
|
|
||||||
AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
SimAndDigHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有谐波结果数据
|
* 获取所有谐波结果数据
|
||||||
@@ -62,7 +62,7 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
* @param devId 设备ID
|
* @param devId 设备ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AdHarmonicResult> listAllResultData(String scriptId, String code, String devId);
|
List<SimAndDigHarmonicResult> listAllResultData(String scriptId, String code, String devId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有原始数据
|
* 获取所有原始数据
|
||||||
@@ -72,5 +72,5 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
|||||||
* @param devId
|
* @param devId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AdHarmonicResult> listAllRawData(String scriptId, String code, String devId);
|
List<SimAndDigHarmonicResult> listAllRawData(String scriptId, String code, String devId);
|
||||||
}
|
}
|
||||||
@@ -3,15 +3,15 @@ package com.njcn.gather.storage.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigBaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
public interface SimAndDigNonHarmonicService extends IService<SimAndDigNonHarmonicResult> {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,7 +23,7 @@ public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
|||||||
* @param chnNum 通道号,从1开始
|
* @param chnNum 通道号,从1开始
|
||||||
* @return 非谐波结果
|
* @return 非谐波结果
|
||||||
*/
|
*/
|
||||||
List<AdBaseResult> get(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code);
|
List<SimAndDigBaseResult> listSimAndDigBaseResult(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 非谐波原始数据展示
|
* 非谐波原始数据展示
|
||||||
@@ -45,7 +45,7 @@ public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
|||||||
* 根据参数查询指定非谐波结果
|
* 根据参数查询指定非谐波结果
|
||||||
* @param singleNonHarmParam 查询参数
|
* @param singleNonHarmParam 查询参数
|
||||||
*/
|
*/
|
||||||
AdNonHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam);
|
SimAndDigNonHarmonicResult getSingleSimAndDigBaseResult(SingleNonHarmParam singleNonHarmParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有结果数据
|
* 获取所有结果数据
|
||||||
@@ -54,13 +54,13 @@ public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
|||||||
* @param devId
|
* @param devId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AdNonHarmonicResult> listAllResultData(String scriptId,String code,String devId);
|
List<SimAndDigNonHarmonicResult> listSimAndDigBaseResult(String scriptId,String code,String devId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据查询条件查找结果
|
* 根据查询条件查找结果
|
||||||
* @param param 查询条件
|
* @param param 查询条件
|
||||||
*/
|
*/
|
||||||
List<AdNonHarmonicResult> queryByCondition(SingleNonHarmParam param);
|
List<SimAndDigNonHarmonicResult> queryByCondition(SingleNonHarmParam param);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,5 +72,5 @@ public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
|||||||
* @param devId
|
* @param devId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AdNonHarmonicResult> listAllRawData(String scriptId, String code, String devId);
|
List<SimAndDigNonHarmonicResult> listAllSimAndDigRawData(String scriptId, String code, String devId);
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ import java.util.List;
|
|||||||
public interface TableGenService {
|
public interface TableGenService {
|
||||||
|
|
||||||
|
|
||||||
void genAdNonHarmonicTable(String code);
|
void genTable(String code, boolean isContrast);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除表 (包括谐波表、谐波结果表、非谐波表、非谐波结果表)
|
* 批量删除表 (包括谐波表、谐波结果表、非谐波表、非谐波结果表)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.gather.storage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.storage.mapper.ContrastHarmonicMappper;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.service.ContrastHarmonicService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ContrastHarmonicServiceImpl extends ServiceImpl<ContrastHarmonicMappper, ContrastHarmonicResult> implements ContrastHarmonicService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.gather.storage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.storage.mapper.ContrastNonHarmonicMappper;
|
||||||
|
import com.njcn.gather.storage.pojo.po.ContrastNonHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.service.ContrastNonHarmonicService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author caozehui
|
||||||
|
* @data 2025-07-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ContrastNonHarmonicServiceImpl extends ServiceImpl<ContrastNonHarmonicMappper, ContrastNonHarmonicResult> implements ContrastNonHarmonicService {
|
||||||
|
}
|
||||||
@@ -1,19 +1,26 @@
|
|||||||
package com.njcn.gather.storage.service.impl;
|
package com.njcn.gather.storage.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||||
import com.njcn.db.mybatisplus.service.impl.ReplenishMybatisServiceImpl;
|
import com.njcn.db.mybatisplus.service.impl.ReplenishMybatisServiceImpl;
|
||||||
import com.njcn.gather.storage.mapper.DetectionDataDealMapper;
|
import com.njcn.gather.storage.mapper.DetectionDataDealMapper;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.BaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.ContrastNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
|
import com.njcn.gather.storage.service.ContrastNonHarmonicService;
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
|
import com.njcn.gather.storage.service.SimAndDigNonHarmonicService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,23 +30,24 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<DetectionDataDealMapper, AdHarmonicResult> implements DetectionDataDealService {
|
public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<DetectionDataDealMapper, SimAndDigHarmonicResult> implements DetectionDataDealService {
|
||||||
|
|
||||||
private final AdNonHarmonicService adNonHarmonicService;
|
private final SimAndDigNonHarmonicService adNonHarmonicService;
|
||||||
|
private final ContrastNonHarmonicService contrastNonHarmonicService;
|
||||||
private final DetectionDataDealMapper detectionDataDealMapper;
|
private final DetectionDataDealMapper detectionDataDealMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean acceptAdNon(List<AdNonHarmonicResult> adNonHarmonicResultList, String code) {
|
public Boolean acceptAdNon(List<SimAndDigNonHarmonicResult> SimAndDigNonHarmonicResultList, String code) {
|
||||||
String adNonTable = "ad_non_harmonic_";
|
String adNonTable = "ad_non_harmonic_";
|
||||||
DynamicTableNameHandler.setTableName(adNonTable + code);
|
DynamicTableNameHandler.setTableName(adNonTable + code);
|
||||||
List<String> monitorIds = adNonHarmonicResultList.stream().map(AdNonHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
List<String> monitorIds = SimAndDigNonHarmonicResultList.stream().map(SimAndDigNonHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
adNonHarmonicService.remove(new LambdaQueryWrapper<AdNonHarmonicResult>().in(AdNonHarmonicResult::getMonitorId, monitorIds)
|
adNonHarmonicService.remove(new LambdaQueryWrapper<SimAndDigNonHarmonicResult>().in(SimAndDigNonHarmonicResult::getMonitorId, monitorIds)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, adNonHarmonicResultList.get(0).getScriptId())
|
.eq(SimAndDigNonHarmonicResult::getScriptId, SimAndDigNonHarmonicResultList.get(0).getScriptId())
|
||||||
.eq(AdNonHarmonicResult::getSort, adNonHarmonicResultList.get(0).getSort()));
|
.eq(SimAndDigNonHarmonicResult::getSort, SimAndDigNonHarmonicResultList.get(0).getSort()));
|
||||||
adNonHarmonicService.saveBatch(adNonHarmonicResultList, 100);
|
adNonHarmonicService.saveBatch(SimAndDigNonHarmonicResultList, 100);
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return true;
|
return true;
|
||||||
@@ -47,15 +55,15 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean acceptAd(List<AdHarmonicResult> adHarmonicResultList, String code) {
|
public Boolean acceptAd(List<SimAndDigHarmonicResult> SimAndDigHarmonicResultList, String code) {
|
||||||
String adTable = "ad_harmonic_";
|
String adTable = "ad_harmonic_";
|
||||||
DynamicTableNameHandler.setTableName(adTable + code);
|
DynamicTableNameHandler.setTableName(adTable + code);
|
||||||
List<String> monitorIds = adHarmonicResultList.stream().map(AdHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
List<String> monitorIds = SimAndDigHarmonicResultList.stream().map(SimAndDigHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
this.remove(new LambdaQueryWrapper<AdHarmonicResult>().in(AdHarmonicResult::getMonitorId, monitorIds)
|
this.remove(new LambdaQueryWrapper<SimAndDigHarmonicResult>().in(SimAndDigHarmonicResult::getMonitorId, monitorIds)
|
||||||
.eq(AdHarmonicResult::getScriptId, adHarmonicResultList.get(0).getScriptId())
|
.eq(SimAndDigHarmonicResult::getScriptId, SimAndDigHarmonicResultList.get(0).getScriptId())
|
||||||
.eq(AdHarmonicResult::getSort, adHarmonicResultList.get(0).getSort()));
|
.eq(SimAndDigHarmonicResult::getSort, SimAndDigHarmonicResultList.get(0).getSort()));
|
||||||
this.saveBatch(adHarmonicResultList, 100);
|
this.saveBatch(SimAndDigHarmonicResultList, 100);
|
||||||
|
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
@@ -64,31 +72,46 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean acceptAdNonResult(List<AdNonHarmonicResult> adNonHarmonicResultList, String code) {
|
public Boolean acceptNonHarmonicResult(List<? extends BaseResult> nonHarmonicResultList, String code) {
|
||||||
|
if (CollUtil.isNotEmpty(nonHarmonicResultList)) {
|
||||||
String adNonTableResult = "ad_non_harmonic_result_";
|
String adNonTableResult = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(adNonTableResult + code);
|
DynamicTableNameHandler.setTableName(adNonTableResult + code);
|
||||||
List<String> monitorIds = adNonHarmonicResultList.stream().map(AdNonHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
if (nonHarmonicResultList.get(0) instanceof SimAndDigNonHarmonicResult) {
|
||||||
|
List<SimAndDigNonHarmonicResult> simAndDigNonHarmonicResultList = BeanUtil.copyToList(nonHarmonicResultList, SimAndDigNonHarmonicResult.class);
|
||||||
|
List<String> monitorIds = simAndDigNonHarmonicResultList.stream().map(SimAndDigNonHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
adNonHarmonicService.remove(new LambdaQueryWrapper<AdNonHarmonicResult>().in(AdNonHarmonicResult::getMonitorId, monitorIds)
|
adNonHarmonicService.remove(new LambdaQueryWrapper<SimAndDigNonHarmonicResult>().in(SimAndDigNonHarmonicResult::getMonitorId, monitorIds)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, adNonHarmonicResultList.get(0).getScriptId())
|
.eq(SimAndDigNonHarmonicResult::getScriptId, simAndDigNonHarmonicResultList.get(0).getScriptId())
|
||||||
.eq(AdNonHarmonicResult::getSort, adNonHarmonicResultList.get(0).getSort()));
|
.eq(SimAndDigNonHarmonicResult::getSort, simAndDigNonHarmonicResultList.get(0).getSort()));
|
||||||
adNonHarmonicService.saveBatch(adNonHarmonicResultList, 100);
|
adNonHarmonicService.saveBatch(simAndDigNonHarmonicResultList, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nonHarmonicResultList.get(0) instanceof ContrastNonHarmonicResult) {
|
||||||
|
List<ContrastNonHarmonicResult> contrastNonHarmonicResultList = BeanUtil.copyToList(nonHarmonicResultList, ContrastNonHarmonicResult.class);
|
||||||
|
List<String> monitorIds = contrastNonHarmonicResultList.stream().map(ContrastNonHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
|
contrastNonHarmonicService.remove(new LambdaQueryWrapper<ContrastNonHarmonicResult>().in(ContrastNonHarmonicResult::getMonitorId, monitorIds)
|
||||||
|
.eq(ContrastNonHarmonicResult::getErrorId, contrastNonHarmonicResultList.get(0).getErrorId())
|
||||||
|
.eq(ContrastNonHarmonicResult::getNum, contrastNonHarmonicResultList.get(0).getNum()));
|
||||||
|
contrastNonHarmonicService.saveBatch(contrastNonHarmonicResultList, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean acceptAdResult(List<AdHarmonicResult> adHarmonicResultList, String code) {
|
public Boolean acceptAdResult(List<SimAndDigHarmonicResult> simAndDigHarmonicResultList, String code) {
|
||||||
String adTableResult = "ad_harmonic_result_";
|
String adTableResult = "ad_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(adTableResult + code);
|
DynamicTableNameHandler.setTableName(adTableResult + code);
|
||||||
List<String> monitorIds = adHarmonicResultList.stream().map(AdHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
List<String> monitorIds = simAndDigHarmonicResultList.stream().map(SimAndDigHarmonicResult::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
this.remove(new LambdaQueryWrapper<AdHarmonicResult>().in(AdHarmonicResult::getMonitorId, monitorIds)
|
this.remove(new LambdaQueryWrapper<SimAndDigHarmonicResult>().in(SimAndDigHarmonicResult::getMonitorId, monitorIds)
|
||||||
.eq(AdHarmonicResult::getScriptId, adHarmonicResultList.get(0).getScriptId())
|
.eq(SimAndDigHarmonicResult::getScriptId, simAndDigHarmonicResultList.get(0).getScriptId())
|
||||||
.eq(AdHarmonicResult::getSort, adHarmonicResultList.get(0).getSort()));
|
.eq(SimAndDigHarmonicResult::getSort, simAndDigHarmonicResultList.get(0).getSort()));
|
||||||
this.saveBatch(adHarmonicResultList, 100);
|
this.saveBatch(simAndDigHarmonicResultList, 100);
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return true;
|
return true;
|
||||||
@@ -97,30 +120,30 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Integer> devResult(List<String> ids, List<String> valueType, String code) {
|
public Map<String, Integer> devResult(List<String> ids, List<String> valueType, String code) {
|
||||||
List<Integer> disabledScriptDtlIndexs = detectionDataDealMapper.listDisabledScriptDtlIndexs(ids.get(0));
|
List<Integer> disabledScriptDtlIndexs = detectionDataDealMapper.listDisabledScriptDtlIndexs(ids.get(0));
|
||||||
List<AdNonHarmonicResult> noHarm = new ArrayList<>();
|
List<SimAndDigNonHarmonicResult> noHarm = new ArrayList<>();
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
DynamicTableNameHandler.setTableName("ad_non_harmonic_result_" + code);
|
DynamicTableNameHandler.setTableName("ad_non_harmonic_result_" + code);
|
||||||
noHarm.addAll(adNonHarmonicService.list(new LambdaQueryWrapper<AdNonHarmonicResult>()
|
noHarm.addAll(adNonHarmonicService.list(new LambdaQueryWrapper<SimAndDigNonHarmonicResult>()
|
||||||
.like(AdNonHarmonicResult::getMonitorId, id)
|
.like(SimAndDigNonHarmonicResult::getMonitorId, id)
|
||||||
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), AdNonHarmonicResult::getSort, disabledScriptDtlIndexs)
|
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), SimAndDigNonHarmonicResult::getSort, disabledScriptDtlIndexs)
|
||||||
.in(CollUtil.isNotEmpty(valueType), AdNonHarmonicResult::getAdType, valueType)
|
.in(CollUtil.isNotEmpty(valueType), SimAndDigNonHarmonicResult::getAdType, valueType)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
List<AdHarmonicResult> harm = new ArrayList<>();
|
List<SimAndDigHarmonicResult> harm = new ArrayList<>();
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
DynamicTableNameHandler.setTableName("ad_harmonic_result_" + code);
|
DynamicTableNameHandler.setTableName("ad_harmonic_result_" + code);
|
||||||
harm.addAll(this.list(new LambdaQueryWrapper<AdHarmonicResult>()
|
harm.addAll(this.list(new LambdaQueryWrapper<SimAndDigHarmonicResult>()
|
||||||
.like(AdHarmonicResult::getMonitorId, id)
|
.like(SimAndDigHarmonicResult::getMonitorId, id)
|
||||||
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), AdHarmonicResult::getSort, disabledScriptDtlIndexs)
|
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), SimAndDigHarmonicResult::getSort, disabledScriptDtlIndexs)
|
||||||
.in(CollUtil.isNotEmpty(valueType), AdHarmonicResult::getAdType, valueType)
|
.in(CollUtil.isNotEmpty(valueType), SimAndDigHarmonicResult::getAdType, valueType)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
Map<String, List<Integer>> noHarmMap = noHarm.stream().collect(Collectors.groupingBy(x -> x.getMonitorId().split("_")[0],
|
Map<String, List<Integer>> noHarmMap = noHarm.stream().collect(Collectors.groupingBy(x -> x.getMonitorId().split("_")[0],
|
||||||
Collectors.mapping(AdNonHarmonicResult::getResultFlag, Collectors.toList())));
|
Collectors.mapping(SimAndDigNonHarmonicResult::getResultFlag, Collectors.toList())));
|
||||||
Map<String, List<Integer>> harmMap = harm.stream().collect(Collectors.groupingBy(x -> x.getMonitorId().split("_")[0],
|
Map<String, List<Integer>> harmMap = harm.stream().collect(Collectors.groupingBy(x -> x.getMonitorId().split("_")[0],
|
||||||
Collectors.mapping(AdHarmonicResult::getResultFlag, Collectors.toList())));
|
Collectors.mapping(SimAndDigHarmonicResult::getResultFlag, Collectors.toList())));
|
||||||
Map<String, Integer> map = new HashMap<>(2);
|
Map<String, Integer> map = new HashMap<>(2);
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
List<Integer> resultFlags = new ArrayList<>();
|
List<Integer> resultFlags = new ArrayList<>();
|
||||||
|
|||||||
@@ -11,16 +11,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||||
import com.njcn.gather.storage.mapper.AdHarmonicMappper;
|
import com.njcn.gather.storage.mapper.SimAndDigHarmonicMappper;
|
||||||
import com.njcn.gather.storage.mapper.AdNonHarmonicMapper;
|
import com.njcn.gather.storage.mapper.SimAndDigNonHarmonicMapper;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigBaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigHarmonicService;
|
||||||
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
||||||
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.DictTree;
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
@@ -42,42 +42,42 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarmonicResult> implements AdHarmonicService {
|
public class SimAndDigHarmonicServiceImpl extends ServiceImpl<SimAndDigHarmonicMappper, SimAndDigHarmonicResult> implements SimAndDigHarmonicService {
|
||||||
|
|
||||||
private final AdNonHarmonicMapper adNonHarmonicMapper;
|
private final SimAndDigNonHarmonicMapper adNonHarmonicMapper;
|
||||||
private final DictTreeMapper dictTreeMapper;
|
private final DictTreeMapper dictTreeMapper;
|
||||||
private final IDictTreeService dictTreeService;
|
private final IDictTreeService dictTreeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdBaseResult> get(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code) {
|
public List<SimAndDigBaseResult> get(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code) {
|
||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + code);
|
DynamicTableNameHandler.setTableName(prefix + code);
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
String monitorId = deviceId + "_" + chnNum;
|
String monitorId = deviceId + "_" + chnNum;
|
||||||
if ("-1".equals(chnNum)) {
|
if ("-1".equals(chnNum)) {
|
||||||
monitorId = deviceId;
|
monitorId = deviceId;
|
||||||
}
|
}
|
||||||
wrapper.like(AdHarmonicResult::getMonitorId, monitorId)
|
wrapper.like(SimAndDigHarmonicResult::getMonitorId, monitorId)
|
||||||
.eq(ObjectUtil.isNotNull(scriptId), AdHarmonicResult::getScriptId, scriptId)
|
.eq(ObjectUtil.isNotNull(scriptId), SimAndDigHarmonicResult::getScriptId, scriptId)
|
||||||
.in(CollUtil.isNotEmpty(sort), AdHarmonicResult::getSort, sort);
|
.in(CollUtil.isNotEmpty(sort), SimAndDigHarmonicResult::getSort, sort);
|
||||||
List<AdHarmonicResult> list = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> list = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
return BeanUtil.copyToList(list, SimAndDigBaseResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<RawDataVO>> listHarmData(StorageParam param) {
|
public Map<String, List<RawDataVO>> listHarmData(StorageParam param) {
|
||||||
String prefix = "ad_harmonic_";
|
String prefix = "ad_harmonic_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
wrapper.like(SimAndDigHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
||||||
.eq(ObjectUtil.isNotNull(param.getScriptId()), AdHarmonicResult::getScriptId, param.getScriptId())
|
.eq(ObjectUtil.isNotNull(param.getScriptId()), SimAndDigHarmonicResult::getScriptId, param.getScriptId())
|
||||||
.in(ObjectUtil.isNotEmpty(param.getIndex()), AdHarmonicResult::getSort, param.getIndex())
|
.in(ObjectUtil.isNotEmpty(param.getIndex()), SimAndDigHarmonicResult::getSort, param.getIndex())
|
||||||
.orderByAsc(AdHarmonicResult::getTimeId)
|
.orderByAsc(SimAndDigHarmonicResult::getTimeId)
|
||||||
;
|
;
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> simAndDigHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
LinkedHashMap<String, List<AdHarmonicResult>> adMap =
|
LinkedHashMap<String, List<SimAndDigHarmonicResult>> adMap =
|
||||||
adHarmonicResults.stream().collect(Collectors.groupingBy(AdHarmonicResult::getAdType, LinkedHashMap::new, Collectors.toList()));
|
simAndDigHarmonicResults.stream().collect(Collectors.groupingBy(SimAndDigHarmonicResult::getAdType, LinkedHashMap::new, Collectors.toList()));
|
||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
||||||
@@ -95,13 +95,13 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
} else {
|
} else {
|
||||||
unit = "%";
|
unit = "%";
|
||||||
}
|
}
|
||||||
for (AdHarmonicResult harmonicResult : value) {
|
for (SimAndDigHarmonicResult harmonicResult : value) {
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
dataVO = new RawDataVO();
|
dataVO = new RawDataVO();
|
||||||
dataVO.setHarmNum(i);
|
dataVO.setHarmNum(i);
|
||||||
dataVO.setUnit(unit);
|
dataVO.setUnit(unit);
|
||||||
try {
|
try {
|
||||||
Field timeId = harmonicResult.getClass().getDeclaredField("timeId");
|
Field timeId = harmonicResult.getClass().getSuperclass().getSuperclass().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.ISO8601_PATTERN)));
|
dataVO.setTime(localDateTime.format(DateTimeFormatter.ofPattern(DatePattern.ISO8601_PATTERN)));
|
||||||
@@ -136,14 +136,14 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
public Map<String, List<RawResultDataVO>> listHarmResultData(StorageParam param) {
|
public Map<String, List<RawResultDataVO>> listHarmResultData(StorageParam param) {
|
||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
wrapper.like(SimAndDigHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
||||||
.eq(ObjectUtil.isNotNull(param.getScriptId()), AdHarmonicResult::getScriptId, param.getScriptId())
|
.eq(ObjectUtil.isNotNull(param.getScriptId()), SimAndDigHarmonicResult::getScriptId, param.getScriptId())
|
||||||
.in(ObjectUtil.isNotEmpty(param.getIndex()), AdHarmonicResult::getSort, param.getIndex())
|
.in(ObjectUtil.isNotEmpty(param.getIndex()), SimAndDigHarmonicResult::getSort, param.getIndex())
|
||||||
.orderByAsc(AdHarmonicResult::getTimeId);
|
.orderByAsc(SimAndDigHarmonicResult::getTimeId);
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
LinkedHashMap<String, List<AdHarmonicResult>> adMap =
|
LinkedHashMap<String, List<SimAndDigHarmonicResult>> adMap =
|
||||||
adHarmonicResults.stream().collect(Collectors.groupingBy(AdHarmonicResult::getAdType, LinkedHashMap::new, Collectors.toList()));
|
adHarmonicResults.stream().collect(Collectors.groupingBy(SimAndDigHarmonicResult::getAdType, LinkedHashMap::new, Collectors.toList()));
|
||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(3);
|
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(3);
|
||||||
@@ -161,7 +161,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
} else {
|
} else {
|
||||||
unit = "%";
|
unit = "%";
|
||||||
}
|
}
|
||||||
for (AdHarmonicResult harmonicResult : value) {
|
for (SimAndDigHarmonicResult harmonicResult : value) {
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
dataVO = new RawResultDataVO();
|
dataVO = new RawResultDataVO();
|
||||||
dataVO.setHarmNum(i);
|
dataVO.setHarmNum(i);
|
||||||
@@ -205,40 +205,40 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
String prefixNon = "ad_non_harmonic_result_";
|
String prefixNon = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
LambdaQueryWrapper<AdHarmonicResult> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SimAndDigHarmonicResult> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.select(AdHarmonicResult::getSort)
|
lambdaQueryWrapper.select(SimAndDigHarmonicResult::getSort)
|
||||||
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdHarmonicResult::getMonitorId, param.getDevId())
|
.likeRight(StrUtil.isNotBlank(param.getDevId()), SimAndDigHarmonicResult::getMonitorId, param.getDevId())
|
||||||
.ne(AdHarmonicResult::getResultFlag, 1)
|
.ne(SimAndDigHarmonicResult::getResultFlag, 1)
|
||||||
.ne(AdHarmonicResult::getResultFlag, 4)
|
.ne(SimAndDigHarmonicResult::getResultFlag, 4)
|
||||||
.ne(AdHarmonicResult::getResultFlag, 5)
|
.ne(SimAndDigHarmonicResult::getResultFlag, 5)
|
||||||
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
.eq(SimAndDigHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
List<SimAndDigHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
||||||
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(AdHarmonicResult::getSort).distinct().collect(Collectors.toList()));
|
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(SimAndDigHarmonicResult::getSort).distinct().collect(Collectors.toList()));
|
||||||
|
|
||||||
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
||||||
LambdaQueryWrapper<AdNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SimAndDigNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
resultLambdaQueryWrapper.select(AdNonHarmonicResult::getSort)
|
resultLambdaQueryWrapper.select(SimAndDigNonHarmonicResult::getSort)
|
||||||
.likeRight(StrUtil.isNotBlank(param.getDevId()), AdNonHarmonicResult::getMonitorId, param.getDevId())
|
.likeRight(StrUtil.isNotBlank(param.getDevId()), SimAndDigNonHarmonicResult::getMonitorId, param.getDevId())
|
||||||
.ne(AdNonHarmonicResult::getResultFlag, 1)
|
.ne(SimAndDigNonHarmonicResult::getResultFlag, 1)
|
||||||
.ne(AdNonHarmonicResult::getResultFlag, 4)
|
.ne(SimAndDigNonHarmonicResult::getResultFlag, 4)
|
||||||
.ne(AdNonHarmonicResult::getResultFlag, 5)
|
.ne(SimAndDigNonHarmonicResult::getResultFlag, 5)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
.eq(SimAndDigNonHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
List<SimAndDigNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
||||||
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).distinct().collect(Collectors.toList()));
|
indexes.addAll(nonHarmonicResults.stream().map(SimAndDigNonHarmonicResult::getSort).distinct().collect(Collectors.toList()));
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return indexes;
|
return indexes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam) {
|
public SimAndDigHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam) {
|
||||||
if (ObjectUtil.isNotNull(singleNonHarmParam)) {
|
if (ObjectUtil.isNotNull(singleNonHarmParam)) {
|
||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdHarmonicResult::getMonitorId, singleNonHarmParam.getDevId() + "_" + singleNonHarmParam.getChannelNo())
|
wrapper.like(SimAndDigHarmonicResult::getMonitorId, singleNonHarmParam.getDevId() + "_" + singleNonHarmParam.getChannelNo())
|
||||||
.eq(AdHarmonicResult::getSort, singleNonHarmParam.getSort())
|
.eq(SimAndDigHarmonicResult::getSort, singleNonHarmParam.getSort())
|
||||||
.eq(AdHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
.eq(SimAndDigHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
||||||
return adHarmonicResults.get(0);
|
return adHarmonicResults.get(0);
|
||||||
@@ -248,29 +248,29 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdHarmonicResult> listAllResultData(String scriptId, String code, String devId) {
|
public List<SimAndDigHarmonicResult> listAllResultData(String scriptId, String code, String devId) {
|
||||||
String prefix = "ad_harmonic_result_" + code;
|
String prefix = "ad_harmonic_result_" + code;
|
||||||
DynamicTableNameHandler.setTableName(prefix);
|
DynamicTableNameHandler.setTableName(prefix);
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(AdHarmonicResult.class)
|
wrapper.selectAll(SimAndDigHarmonicResult.class)
|
||||||
.selectAs(DictTree::getCode, AdHarmonicResult::getAdType)
|
.selectAs(DictTree::getCode, SimAndDigHarmonicResult::getAdType)
|
||||||
.leftJoin(DictTree.class, DictTree::getId, AdHarmonicResult::getAdType).eq(AdHarmonicResult::getScriptId, scriptId)
|
.leftJoin(DictTree.class, DictTree::getId, SimAndDigHarmonicResult::getAdType).eq(SimAndDigHarmonicResult::getScriptId, scriptId)
|
||||||
.likeRight(AdHarmonicResult::getMonitorId, devId);
|
.likeRight(SimAndDigHarmonicResult::getMonitorId, devId);
|
||||||
List<AdHarmonicResult> results = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> results = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdHarmonicResult> listAllRawData(String scriptId, String code, String devId) {
|
public List<SimAndDigHarmonicResult> listAllRawData(String scriptId, String code, String devId) {
|
||||||
String prefix = "ad_harmonic_" + code;
|
String prefix = "ad_harmonic_" + code;
|
||||||
DynamicTableNameHandler.setTableName(prefix);
|
DynamicTableNameHandler.setTableName(prefix);
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(AdHarmonicResult.class)
|
wrapper.selectAll(SimAndDigHarmonicResult.class)
|
||||||
.selectAs(DictTree::getCode, AdHarmonicResult::getAdType)
|
.selectAs(DictTree::getCode, SimAndDigHarmonicResult::getAdType)
|
||||||
.leftJoin(DictTree.class, DictTree::getId, AdHarmonicResult::getAdType).eq(AdHarmonicResult::getScriptId, scriptId)
|
.leftJoin(DictTree.class, DictTree::getId, SimAndDigHarmonicResult::getAdType).eq(SimAndDigHarmonicResult::getScriptId, scriptId)
|
||||||
.likeRight(AdHarmonicResult::getMonitorId, devId);
|
.likeRight(SimAndDigHarmonicResult::getMonitorId, devId);
|
||||||
List<AdHarmonicResult> results = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<SimAndDigHarmonicResult> results = this.getBaseMapper().selectJoinList(SimAndDigHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
@@ -10,14 +10,14 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||||
import com.njcn.gather.storage.mapper.AdNonHarmonicMapper;
|
import com.njcn.gather.storage.mapper.SimAndDigNonHarmonicMapper;
|
||||||
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
import com.njcn.gather.storage.pojo.param.SingleNonHarmParam;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigBaseResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.SimAndDigNonHarmonicService;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -34,46 +34,46 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, AdNonHarmonicResult> implements AdNonHarmonicService {
|
public class SimAndDigNonHarmonicServiceImpl extends ServiceImpl<SimAndDigNonHarmonicMapper, SimAndDigNonHarmonicResult> implements SimAndDigNonHarmonicService {
|
||||||
|
|
||||||
private final IDictTreeService dictTreeService;
|
private final IDictTreeService dictTreeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdBaseResult> get(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code) {
|
public List<SimAndDigBaseResult> listSimAndDigBaseResult(String scriptId, List<Integer> sort, String deviceId, String chnNum, String code) {
|
||||||
String prefix = "ad_non_harmonic_result_";
|
String prefix = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + code);
|
DynamicTableNameHandler.setTableName(prefix + code);
|
||||||
|
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
String monitorId = deviceId + "_" + chnNum;
|
String monitorId = deviceId + "_" + chnNum;
|
||||||
if ("-1".equals(chnNum)) {
|
if ("-1".equals(chnNum)) {
|
||||||
monitorId = deviceId;
|
monitorId = deviceId;
|
||||||
}
|
}
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, monitorId)
|
wrapper.like(SimAndDigNonHarmonicResult::getMonitorId, monitorId)
|
||||||
.eq(ObjectUtil.isNotNull(scriptId), AdNonHarmonicResult::getScriptId, scriptId)
|
.eq(ObjectUtil.isNotNull(scriptId), SimAndDigNonHarmonicResult::getScriptId, scriptId)
|
||||||
.in(CollUtil.isNotEmpty(sort), AdNonHarmonicResult::getSort, sort);
|
.in(CollUtil.isNotEmpty(sort), SimAndDigNonHarmonicResult::getSort, sort);
|
||||||
List<AdNonHarmonicResult> list = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> list = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
return BeanUtil.copyToList(list, SimAndDigBaseResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<RawDataVO>> listNonHarmData(StorageParam param) {
|
public Map<String, List<RawDataVO>> listNonHarmData(StorageParam param) {
|
||||||
String prefix = "ad_non_harmonic_";
|
String prefix = "ad_non_harmonic_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
wrapper.like(SimAndDigNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
||||||
.eq(ObjectUtil.isNotNull(param.getScriptId()), AdNonHarmonicResult::getScriptId, param.getScriptId())
|
.eq(ObjectUtil.isNotNull(param.getScriptId()), SimAndDigNonHarmonicResult::getScriptId, param.getScriptId())
|
||||||
.in(ObjectUtil.isNotEmpty(param.getIndex()), AdNonHarmonicResult::getSort, param.getIndex());
|
.in(ObjectUtil.isNotEmpty(param.getIndex()), SimAndDigNonHarmonicResult::getSort, param.getIndex());
|
||||||
List<AdNonHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> SimAndDigHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(2);
|
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(2);
|
||||||
Map<String, List<AdNonHarmonicResult>> adTypeMap = adHarmonicResults.stream().collect(Collectors.groupingBy(AdNonHarmonicResult::getAdType));
|
Map<String, List<SimAndDigNonHarmonicResult>> adTypeMap = SimAndDigHarmonicResults.stream().collect(Collectors.groupingBy(SimAndDigNonHarmonicResult::getAdType));
|
||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adTypeMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adTypeMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
adTypeMap.forEach((key, value) -> {
|
adTypeMap.forEach((key, value) -> {
|
||||||
if (dictTreeByName.containsKey(key)) {
|
if (dictTreeByName.containsKey(key)) {
|
||||||
DictTree dictTree = dictTreeByName.get(key);
|
DictTree dictTree = dictTreeByName.get(key);
|
||||||
List<RawDataVO> rawDataVOS = new ArrayList<>();
|
List<RawDataVO> rawDataVOS = new ArrayList<>();
|
||||||
for (AdNonHarmonicResult result : value) {
|
for (SimAndDigNonHarmonicResult 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.ISO8601_PATTERN)));
|
dataVO.setTime(result.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.ISO8601_PATTERN)));
|
||||||
@@ -94,17 +94,17 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
|||||||
public Map<String, List<RawResultDataVO>> listNonHarmResultData(StorageParam param) {
|
public Map<String, List<RawResultDataVO>> listNonHarmResultData(StorageParam param) {
|
||||||
String prefix = "ad_non_harmonic_result_";
|
String prefix = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getCode());
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
wrapper.like(SimAndDigNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getDevNum())
|
||||||
.eq(ObjectUtil.isNotNull(param.getScriptId()), AdNonHarmonicResult::getScriptId, param.getScriptId())
|
.eq(ObjectUtil.isNotNull(param.getScriptId()), SimAndDigNonHarmonicResult::getScriptId, param.getScriptId())
|
||||||
.in(ObjectUtil.isNotEmpty(param.getIndex()), AdNonHarmonicResult::getSort, param.getIndex());
|
.in(ObjectUtil.isNotEmpty(param.getIndex()), SimAndDigNonHarmonicResult::getSort, param.getIndex());
|
||||||
|
|
||||||
List<AdNonHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> SimAndDigHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
|
|
||||||
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(2);
|
Map<String, List<RawResultDataVO>> info = new LinkedHashMap<>(2);
|
||||||
Map<String, AdNonHarmonicResult> adTypeMap = adHarmonicResults.stream()
|
Map<String, SimAndDigNonHarmonicResult> adTypeMap = SimAndDigHarmonicResults.stream()
|
||||||
.sorted(Comparator.comparing(AdNonHarmonicResult::getResultFlag))
|
.sorted(Comparator.comparing(SimAndDigNonHarmonicResult::getResultFlag))
|
||||||
.collect(Collectors.toMap(AdNonHarmonicResult::getAdType, Function.identity(), (a, b) -> a, LinkedHashMap::new));
|
.collect(Collectors.toMap(SimAndDigNonHarmonicResult::getAdType, Function.identity(), (a, b) -> a, LinkedHashMap::new));
|
||||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adTypeMap.keySet()));
|
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(adTypeMap.keySet()));
|
||||||
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
Map<String, DictTree> dictTreeByName = dictTreeById.stream().collect(Collectors.toMap(DictTree::getId, Function.identity()));
|
||||||
adTypeMap.forEach((key, result) -> {
|
adTypeMap.forEach((key, result) -> {
|
||||||
@@ -136,62 +136,62 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdNonHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam) {
|
public SimAndDigNonHarmonicResult getSingleSimAndDigBaseResult(SingleNonHarmParam singleNonHarmParam) {
|
||||||
if (ObjectUtil.isNotNull(singleNonHarmParam)) {
|
if (ObjectUtil.isNotNull(singleNonHarmParam)) {
|
||||||
String prefix = "ad_non_harmonic_result_";
|
String prefix = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, singleNonHarmParam.getDevId() + "_" + singleNonHarmParam.getChannelNo())
|
wrapper.like(SimAndDigNonHarmonicResult::getMonitorId, singleNonHarmParam.getDevId() + "_" + singleNonHarmParam.getChannelNo())
|
||||||
.eq(AdNonHarmonicResult::getSort, singleNonHarmParam.getSort())
|
.eq(SimAndDigNonHarmonicResult::getSort, singleNonHarmParam.getSort())
|
||||||
.eq(AdNonHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
.eq(SimAndDigNonHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
||||||
List<AdNonHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> SimAndDigHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
if (CollectionUtil.isNotEmpty(SimAndDigHarmonicResults)) {
|
||||||
return adHarmonicResults.get(0);
|
return SimAndDigHarmonicResults.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdNonHarmonicResult> listAllResultData(String scriptId, String code, String devId) {
|
public List<SimAndDigNonHarmonicResult> listSimAndDigBaseResult(String scriptId, String code, String devId) {
|
||||||
String prefix = "ad_non_harmonic_result_" + code;
|
String prefix = "ad_non_harmonic_result_" + code;
|
||||||
DynamicTableNameHandler.setTableName(prefix);
|
DynamicTableNameHandler.setTableName(prefix);
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(AdNonHarmonicResult.class)
|
wrapper.selectAll(SimAndDigNonHarmonicResult.class)
|
||||||
.selectAs(DictTree::getCode, AdNonHarmonicResult::getAdType)
|
.selectAs(DictTree::getCode, SimAndDigNonHarmonicResult::getAdType)
|
||||||
.leftJoin(DictTree.class, DictTree::getId, AdNonHarmonicResult::getAdType)
|
.leftJoin(DictTree.class, DictTree::getId, SimAndDigNonHarmonicResult::getAdType)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, scriptId)
|
.eq(SimAndDigNonHarmonicResult::getScriptId, scriptId)
|
||||||
.likeRight(AdNonHarmonicResult::getMonitorId, devId);
|
.likeRight(SimAndDigNonHarmonicResult::getMonitorId, devId);
|
||||||
List<AdNonHarmonicResult> results = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> results = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdNonHarmonicResult> queryByCondition(SingleNonHarmParam param) {
|
public List<SimAndDigNonHarmonicResult> queryByCondition(SingleNonHarmParam param) {
|
||||||
String prefix = "ad_non_harmonic_result_";
|
String prefix = "ad_non_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + param.getPlanCode());
|
DynamicTableNameHandler.setTableName(prefix + param.getPlanCode());
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getChannelNo())
|
wrapper.like(SimAndDigNonHarmonicResult::getMonitorId, param.getDevId() + "_" + param.getChannelNo())
|
||||||
.in(AdNonHarmonicResult::getSort, param.getSortList())
|
.in(SimAndDigNonHarmonicResult::getSort, param.getSortList())
|
||||||
.in(AdNonHarmonicResult::getAdType, param.getValueTypeList());
|
.in(SimAndDigNonHarmonicResult::getAdType, param.getValueTypeList());
|
||||||
List<AdNonHarmonicResult> adNonHarmonicResults = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> adNonHarmonicResults = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return adNonHarmonicResults;
|
return adNonHarmonicResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdNonHarmonicResult> listAllRawData(String scriptId, String code, String devId) {
|
public List<SimAndDigNonHarmonicResult> listAllSimAndDigRawData(String scriptId, String code, String devId) {
|
||||||
String prefix = "ad_non_harmonic_" + code;
|
String prefix = "ad_non_harmonic_" + code;
|
||||||
DynamicTableNameHandler.setTableName(prefix);
|
DynamicTableNameHandler.setTableName(prefix);
|
||||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<SimAndDigNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(AdNonHarmonicResult.class)
|
wrapper.selectAll(SimAndDigNonHarmonicResult.class)
|
||||||
.selectAs(DictTree::getCode, AdNonHarmonicResult::getAdType)
|
.selectAs(DictTree::getCode, SimAndDigNonHarmonicResult::getAdType)
|
||||||
.leftJoin(DictTree.class, DictTree::getId, AdNonHarmonicResult::getAdType)
|
.leftJoin(DictTree.class, DictTree::getId, SimAndDigNonHarmonicResult::getAdType)
|
||||||
.eq(AdNonHarmonicResult::getScriptId, scriptId)
|
.eq(SimAndDigNonHarmonicResult::getScriptId, scriptId)
|
||||||
.likeRight(AdNonHarmonicResult::getMonitorId, devId);
|
.likeRight(SimAndDigNonHarmonicResult::getMonitorId, devId);
|
||||||
List<AdNonHarmonicResult> results = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<SimAndDigNonHarmonicResult> results = this.getBaseMapper().selectJoinList(SimAndDigNonHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ import com.njcn.gather.storage.mapper.TableGenMapper;
|
|||||||
import com.njcn.gather.storage.service.TableGenService;
|
import com.njcn.gather.storage.service.TableGenService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -16,9 +15,9 @@ public class TableGenServiceImpl implements TableGenService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void genAdNonHarmonicTable(String code) {
|
public void genTable(String code, boolean isContrast) {
|
||||||
tableGenMapper.genAdNonHarmonicTable(code);
|
tableGenMapper.genNonHarmonicTable(code, isContrast);
|
||||||
tableGenMapper.genAdNonHarmonicResultTable(code);
|
tableGenMapper.genNonHarmonicResultTable(code, isContrast);
|
||||||
|
|
||||||
StringBuilder A = new StringBuilder();
|
StringBuilder A = new StringBuilder();
|
||||||
StringBuilder B = new StringBuilder();
|
StringBuilder B = new StringBuilder();
|
||||||
@@ -36,32 +35,42 @@ public class TableGenServiceImpl implements TableGenService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String sql = "CREATE TABLE AD_Harmonic_" + code + " (\n" +
|
String sql = "CREATE TABLE AD_Harmonic_" + code + " (\n" +
|
||||||
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
" Monitor_Id CHAR(34) NOT NULL COMMENT '监测点Id',\n" +
|
||||||
" Time_Id DATETIME(3) NOT NULL COMMENT '时间',\n" +
|
" Time_Id DATETIME(3) NOT NULL COMMENT '时间',\n" +
|
||||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
|
||||||
" Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',\n" +
|
|
||||||
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
||||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||||
" Result_Flag int(1) NULL COMMENT '0不合格 1合格 4无法处理',\n" +
|
|
||||||
A + B + C +
|
A + B + C +
|
||||||
" PRIMARY KEY (Monitor_Id,Time_Id,Script_Id, Sort, AD_Type)\n" +
|
" Result_Flag int(1) NULL COMMENT '0不合格 1合格 4无法处理',\n" +
|
||||||
") COMMENT='监测数据表';";
|
(isContrast ?
|
||||||
|
" Error_Id CHAR(32) NOT NULL COMMENT '误差体系表Id',\n" +
|
||||||
|
" Num tinyint(1) unsigned DEFAULT 0 COMMENT '第几次检测',\n" +
|
||||||
|
" PRIMARY KEY (Monitor_Id,Time_Id,Error_Id, AD_Type)\n"
|
||||||
|
:
|
||||||
|
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',\n" +
|
||||||
|
" Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',\n"+
|
||||||
|
" PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, Sort, AD_Type)\n"
|
||||||
|
) + ") COMMENT='谐波类原始数据表';";
|
||||||
tableGenMapper.genAdHarmonicTable(sql);
|
tableGenMapper.genAdHarmonicTable(sql);
|
||||||
|
|
||||||
String a = A.toString().replaceAll("float", "json");
|
String a = A.toString().replaceAll("float", "json");
|
||||||
String b = B.toString().replaceAll("float", "json");
|
String b = B.toString().replaceAll("float", "json");
|
||||||
String c = C.toString().replaceAll("float", "json");
|
String c = C.toString().replaceAll("float", "json");
|
||||||
String sql2 = "CREATE TABLE AD_Harmonic_Result_" + code + " (\n" +
|
String sql2 = "CREATE TABLE AD_Harmonic_Result_" + code + " (\n" +
|
||||||
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
" Monitor_Id CHAR(34) NOT NULL COMMENT '监测点Id',\n" +
|
||||||
" Time_Id DATETIME(3) NULL COMMENT '时间',\n" +
|
" Time_Id DATETIME(3) NULL COMMENT '时间',\n" +
|
||||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
|
||||||
" Sort int(5) NOT NULL COMMENT '总检测脚本中的测试项序号',\n" +
|
|
||||||
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
||||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||||
" Result_Flag int(1) NOT NULL COMMENT '1合格 2不合格 4无法处理',\n" +
|
|
||||||
a + b + c +
|
a + b + c +
|
||||||
" PRIMARY KEY (Monitor_Id,Script_Id, Sort, AD_Type)\n" +
|
" Result_Flag int(1) NOT NULL COMMENT '1合格 2不合格 4无法处理',\n" +
|
||||||
") COMMENT='监测数据表';";
|
(isContrast ?
|
||||||
|
" Error_Id CHAR(32) NOT NULL COMMENT '误差体系表Id',\n" +
|
||||||
|
" Num tinyint(1) unsigned DEFAULT 0 COMMENT '第几次检测',\n" +
|
||||||
|
" PRIMARY KEY (Monitor_Id, Error_Id, Num, AD_Type)\n"
|
||||||
|
:
|
||||||
|
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',\n" +
|
||||||
|
" Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',\n"+
|
||||||
|
" PRIMARY KEY (Monitor_Id,Script_Id, Sort, AD_Type)\n"
|
||||||
|
) + ") COMMENT='谐波类检测结果表';";
|
||||||
tableGenMapper.genAdHarmonicTable(sql2);
|
tableGenMapper.genAdHarmonicTable(sql2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user