Compare commits
114 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f1ae1886a | ||
|
|
af4863af65 | ||
| 2012221b73 | |||
|
|
f4df52dd1c | ||
| 41c557118c | |||
| 6596a572d6 | |||
|
|
786bd5d660 | ||
|
|
21d2c2b7a7 | ||
|
|
48fa4c2390 | ||
|
|
9d15351fba | ||
|
|
2339a006ec | ||
|
|
7fd904ab79 | ||
|
|
40cb153656 | ||
|
|
f922ee97aa | ||
|
|
26c5e933f5 | ||
|
|
c7d8fc3168 | ||
|
|
bb22857fc9 | ||
|
|
6ef908ff60 | ||
|
|
7461801657 | ||
|
|
4ecec5e6ef | ||
|
|
04a667531b | ||
|
|
a0f6846f53 | ||
|
|
a177d7991c | ||
|
|
f8fb45cf6f | ||
|
|
910069a463 | ||
| 56477157aa | |||
| a6b0509179 | |||
|
|
b5e5286411 | ||
|
|
d01c0e14c0 | ||
|
|
0cf8bbc3d5 | ||
|
|
3a239b5123 | ||
|
|
0eabe977cb | ||
|
|
f1f86ea854 | ||
|
|
e048c92ad1 | ||
|
|
65f46a22f5 | ||
| 5d4cce365e | |||
|
|
b4c9bd12c9 | ||
|
|
8a11a9e5b1 | ||
|
|
b2738e1726 | ||
|
|
5d16d6c494 | ||
|
|
2693015dab | ||
|
|
3ecffc99b8 | ||
| 9c02a7cb8e | |||
|
|
a4edf8b3f6 | ||
| 8328d6c06e | |||
|
|
2ac33e8cec | ||
|
|
bbb911c917 | ||
|
|
bef9723255 | ||
|
|
47e3e5218d | ||
|
|
72800e1e44 | ||
| f6547b02a4 | |||
|
|
8fb22017d3 | ||
|
|
6f8070c85f | ||
| c09a0f4b85 | |||
| ba22f2b796 | |||
|
|
f62aa1f7f7 | ||
|
|
f19a467300 | ||
|
|
f4550b9c76 | ||
|
|
a5791ef76b | ||
|
|
dff4b556eb | ||
|
|
c013cd2eac | ||
| dc366ae1c3 | |||
| a9d2ba8dde | |||
|
|
de138328e9 | ||
|
|
757501efa8 | ||
|
|
73028c70d2 | ||
|
|
bdb3efd81d | ||
| 20423028f7 | |||
|
|
6442219087 | ||
|
|
a0148badaf | ||
| 8745f8bbbe | |||
|
|
277b1710fa | ||
| 1115520106 | |||
|
|
c8b63a7a7a | ||
|
|
1ed27ed29f | ||
|
|
072a2b6bfc | ||
|
|
b2bb7c3901 | ||
|
|
ad2752197a | ||
| 424a81ac53 | |||
|
|
38332616fa | ||
| 118068bafe | |||
| 8103b45a61 | |||
|
|
ef4c4a0a17 | ||
|
|
31a2311698 | ||
|
|
9937c3cb5f | ||
| 482d7f6ce5 | |||
|
|
5905c0b438 | ||
| 594ac7d4d4 | |||
| 9d2aad81e4 | |||
| 6b1303d250 | |||
| c45800f6d5 | |||
|
|
74cdfaf882 | ||
|
|
34ff162db1 | ||
|
|
bd6af21b99 | ||
| f0566a5969 | |||
| 76a571921a | |||
| 512ed2a542 | |||
|
|
c2c5c9668e | ||
|
|
a0b0023def | ||
| a11189d85c | |||
| ed54f79983 | |||
|
|
f03622ac5b | ||
|
|
bf3fe9450f | ||
| b4e2727c58 | |||
| 977ab4bf1b | |||
| d26504c841 | |||
| 418e17a427 | |||
| 4e0e50a4f8 | |||
| e05403bfa7 | |||
| b1a2ccd018 | |||
| 10f39b44a2 | |||
| 9eca074ffb | |||
| 9820d0a915 | |||
|
|
525de0c24c |
@@ -94,7 +94,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.docx4j</groupId>
|
<groupId>org.docx4j</groupId>
|
||||||
<artifactId>docx4j</artifactId>
|
<artifactId>docx4j</artifactId>
|
||||||
<version>3.3.4</version>
|
<version>6.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
@@ -112,6 +112,18 @@
|
|||||||
<version>2.12.0</version>
|
<version>2.12.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>RestTemplate-plugin</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-net</groupId>
|
||||||
|
<artifactId>commons-net</artifactId>
|
||||||
|
<version>3.10.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ public class PreDetectionController extends BaseController {
|
|||||||
private final PreDetectionService preDetectionService;
|
private final PreDetectionService preDetectionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始检测
|
* 开始检测通用入口
|
||||||
|
* @param param 实体参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/startPreTest")
|
@PostMapping("/startPreTest")
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.gather.detection.handler;
|
package com.njcn.gather.detection.handler;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -17,6 +18,7 @@ import com.njcn.gather.detection.pojo.po.SourceCompareDev;
|
|||||||
import com.njcn.gather.detection.pojo.vo.*;
|
import com.njcn.gather.detection.pojo.vo.*;
|
||||||
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
import com.njcn.gather.detection.util.socket.*;
|
import com.njcn.gather.detection.util.socket.*;
|
||||||
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.pojo.po.PqDev;
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
import com.njcn.gather.device.pojo.vo.PreDetection;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
@@ -63,7 +65,6 @@ import static com.njcn.gather.detection.util.socket.FormalTestManager.harmonicRe
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class SocketDevResponseService {
|
public class SocketDevResponseService {
|
||||||
|
|
||||||
|
|
||||||
private final String handlerStr = "_Dev";
|
private final String handlerStr = "_Dev";
|
||||||
private final String handlerSourceStr = "_Source";
|
private final String handlerSourceStr = "_Source";
|
||||||
private final String stepTag = "&&";
|
private final String stepTag = "&&";
|
||||||
@@ -124,12 +125,10 @@ public class SocketDevResponseService {
|
|||||||
/**
|
/**
|
||||||
* 保存成功的协议
|
* 保存成功的协议
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DictDataEnum dataRule;
|
DictDataEnum dataRule;
|
||||||
|
|
||||||
|
|
||||||
//标识当前检测小项是否结束
|
//标识当前检测小项是否结束
|
||||||
|
|
||||||
public void deal(PreDetectionParam param, String msg) throws Exception {
|
public void deal(PreDetectionParam param, String msg) throws Exception {
|
||||||
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
||||||
String[] tem = socketDataMsg.getRequestId().split(stepTag);
|
String[] tem = socketDataMsg.getRequestId().split(stepTag);
|
||||||
@@ -156,6 +155,21 @@ public class SocketDevResponseService {
|
|||||||
case Coefficient_Check:
|
case Coefficient_Check:
|
||||||
coefficient(param, socketDataMsg);
|
coefficient(param, socketDataMsg);
|
||||||
break;
|
break;
|
||||||
|
//报告处理
|
||||||
|
case REPORT_CAT:
|
||||||
|
SourceOperateCodeEnum temOp = SourceOperateCodeEnum.getDictDataEnumByCode(socketDataMsg.getOperateCode());
|
||||||
|
SourceResponseCodeEnum dictDataEnumByCode = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
|
||||||
|
switch (Objects.requireNonNull(dictDataEnumByCode)) {
|
||||||
|
case SUCCESS:
|
||||||
|
SocketManager.removeUser(param.getUserPageId() + handlerStr);
|
||||||
|
break;
|
||||||
|
case UNPROCESSED_BUSINESS:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SocketManager.removeUser(param.getUserPageId() + handlerStr);
|
||||||
|
System.out.println(socketDataMsg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
//退出关闭
|
//退出关闭
|
||||||
case QUITE:
|
case QUITE:
|
||||||
quitDeal(socketDataMsg, param, msg);
|
quitDeal(socketDataMsg, param, msg);
|
||||||
@@ -165,7 +179,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系数校验
|
* 系数校验
|
||||||
*/
|
*/
|
||||||
@@ -194,17 +207,12 @@ public class SocketDevResponseService {
|
|||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(xiSocket));
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(xiSocket));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NORMAL_RESPONSE:
|
case NORMAL_RESPONSE:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DATA_RESOLVE:
|
case DATA_RESOLVE:
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case COMMUNICATION_ERR:
|
case COMMUNICATION_ERR:
|
||||||
break;
|
break;
|
||||||
@@ -217,7 +225,6 @@ public class SocketDevResponseService {
|
|||||||
//系数下发后的响应
|
//系数下发后的响应
|
||||||
switch (Objects.requireNonNull(dictDataEnumByCode)) {
|
switch (Objects.requireNonNull(dictDataEnumByCode)) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(XiNumberManager.devXiList)) {
|
if (CollUtil.isNotEmpty(XiNumberManager.devXiList)) {
|
||||||
//单台装置系数下发后,需要删除集合中存在的当前装置
|
//单台装置系数下发后,需要删除集合中存在的当前装置
|
||||||
String devIp = XiNumberManager.devXiList.get(0);
|
String devIp = XiNumberManager.devXiList.get(0);
|
||||||
@@ -259,13 +266,10 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NORMAL_RESPONSE:
|
case NORMAL_RESPONSE:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DATA_RESOLVE:
|
case DATA_RESOLVE:
|
||||||
|
|
||||||
//quitSend(param);
|
//quitSend(param);
|
||||||
break;
|
break;
|
||||||
case COMMUNICATION_ERR:
|
case COMMUNICATION_ERR:
|
||||||
@@ -281,19 +285,26 @@ public class SocketDevResponseService {
|
|||||||
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
||||||
switch (dictDataEnumByCode) {
|
switch (dictDataEnumByCode) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
FormalTestManager.realDataXiList.add(devData);
|
if (devData.getResult()) {
|
||||||
successComm.add(devData.getId());
|
FormalTestManager.realDataXiList.add(devData);
|
||||||
System.out.println(successComm.size() + " ==" + FormalTestManager.monitorIdListComm.size() + "FormalTestManager.realDataXiList:" + FormalTestManager.realDataXiList.size() + "当前步骤" + XiNumberManager.stepNumber);
|
successComm.add(devData.getId());
|
||||||
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
System.out.println(successComm.size() + " ==" + FormalTestManager.monitorIdListComm.size() + "FormalTestManager.realDataXiList:" + FormalTestManager.realDataXiList.size() + "当前步骤" + XiNumberManager.stepNumber);
|
||||||
processData(param, xiSocket);
|
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
||||||
|
processData(param, xiSocket);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("系数校准抛除数据" + devData);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
case NORMAL_RESPONSE:
|
case NORMAL_RESPONSE:
|
||||||
FormalTestManager.realDataXiList.add(devData);
|
if (devData.getResult()) {
|
||||||
|
FormalTestManager.realDataXiList.add(devData);
|
||||||
|
} else {
|
||||||
|
System.out.println("系数校准抛除数据" + devData);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xiSocket.setRequestId(socketDataMsg.getRequestId());
|
xiSocket.setRequestId(socketDataMsg.getRequestId());
|
||||||
@@ -393,22 +404,87 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleFinalStep(PreDetectionParam param) {
|
private void handleFinalStep(PreDetectionParam param) {
|
||||||
|
FormalTestManager.realDataXiList.clear();
|
||||||
|
successComm.clear();
|
||||||
|
XiNumberManager.devXiList.clear();
|
||||||
sendWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.small_comp_end.getValue(), XiNumberManager.devParameterList.get(1));
|
sendWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.small_comp_end.getValue(), XiNumberManager.devParameterList.get(1));
|
||||||
System.out.println("-------------------------已经全部结束----------------------");
|
System.out.println("-------------------------已经全部结束----------------------");
|
||||||
CnSocketUtil.quitSend(param);
|
|
||||||
//修改设备表Factor_Check_Result字段
|
if (param.getTestItemList().get(2)) {
|
||||||
XiNumberManager.devXiNumDataMap.forEach((key, val) -> {
|
//如果后续做正式检测
|
||||||
DevXiNumData small = XiNumberManager.smallDevXiNumDataMap.get(key);
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
LambdaUpdateWrapper<PqDev> updateWrapper = new LambdaUpdateWrapper<>();
|
issueParam.setPlanId(param.getPlanId());
|
||||||
updateWrapper.eq(PqDev::getId, FormalTestManager.devIdMapComm.get(key));
|
issueParam.setSourceId(param.getSourceId());
|
||||||
if (val.getResultFlag() == 0 || small.getResultFlag() == 0) {
|
issueParam.setDevIds(param.getDevIds());
|
||||||
updateWrapper.set(PqDev::getFactorCheckResult, 0);
|
issueParam.setScriptId(param.getScriptId());
|
||||||
|
|
||||||
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
|
//不合格项复检
|
||||||
|
Set<Integer> indexes = new HashSet<>();
|
||||||
|
StorageParam storageParam = new StorageParam();
|
||||||
|
storageParam.setCode(param.getCode());
|
||||||
|
storageParam.setScriptId(param.getScriptId());
|
||||||
|
param.getDevIds().forEach(devId -> {
|
||||||
|
storageParam.setDevId(devId);
|
||||||
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
|
});
|
||||||
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
} else {
|
} else {
|
||||||
updateWrapper.set(PqDev::getFactorCheckResult, 1);
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
}
|
}
|
||||||
iPqDevService.update(updateWrapper);
|
|
||||||
updateWrapper.clear();
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
});
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
List<SourceIssue> sourceIssues;
|
||||||
|
|
||||||
|
//正式检测
|
||||||
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
sourceIssues = sourceIssues.stream().sorted(Comparator.comparing(SourceIssue::getIndex)).collect(Collectors.toList());
|
||||||
|
// 使用 LinkedHashMap 保持分组顺序
|
||||||
|
Map<String, List<SourceIssue>> groupedIssues = sourceIssues.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
SourceIssue::getType,
|
||||||
|
LinkedHashMap::new,
|
||||||
|
Collectors.toList()
|
||||||
|
));
|
||||||
|
|
||||||
|
// 将分组后的元素合并成一个新的集合,保持原有顺序
|
||||||
|
sourceIssues = groupedIssues.values().stream()
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 存放所有检测小项
|
||||||
|
SocketManager.addSourceList(sourceIssues);
|
||||||
|
// 按照大项分组。key为大项code,value为小项个数
|
||||||
|
Map<String, Long> sourceIssueMap = sourceIssues.stream().collect(Collectors.groupingBy(SourceIssue::getType, Collectors.counting()));
|
||||||
|
SocketManager.initMap(sourceIssueMap);
|
||||||
|
|
||||||
|
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssues.get(0).getType());
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
|
||||||
|
//告诉前端当前项开始了
|
||||||
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
|
webSocketVO.setDesc(null);
|
||||||
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
||||||
|
} else {
|
||||||
|
//后续什么都不做
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
//修改设备表Factor_Check_Result字段
|
||||||
|
XiNumberManager.devXiNumDataMap.forEach((key, val) -> {
|
||||||
|
DevXiNumData small = XiNumberManager.smallDevXiNumDataMap.get(key);
|
||||||
|
LambdaUpdateWrapper<PqDev> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(PqDev::getId, FormalTestManager.devIdMapComm.get(key));
|
||||||
|
if (val.getResultFlag() == 0 || small.getResultFlag() == 0) {
|
||||||
|
updateWrapper.set(PqDev::getFactorCheckResult, 0);
|
||||||
|
} else {
|
||||||
|
updateWrapper.set(PqDev::getFactorCheckResult, 1);
|
||||||
|
}
|
||||||
|
iPqDevService.update(updateWrapper);
|
||||||
|
updateWrapper.clear();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -484,7 +560,6 @@ public class SocketDevResponseService {
|
|||||||
//表格数据
|
//表格数据
|
||||||
CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.DATA_CHNFACTOR$02.getValue(), coefficientVO, null);
|
CnSocketUtil.sendToWebSocket(param.getUserPageId(), SourceOperateCodeEnum.Coefficient_Check.getValue(), SourceOperateCodeEnum.DATA_CHNFACTOR$02.getValue(), coefficientVO, null);
|
||||||
});
|
});
|
||||||
|
|
||||||
DevXiNumData devXiNumData = createDevXiNumData(devIp, gf, xiFlag.get());
|
DevXiNumData devXiNumData = createDevXiNumData(devIp, gf, xiFlag.get());
|
||||||
saveDevXiNumData(devIp, devXiNumData);
|
saveDevXiNumData(devIp, devXiNumData);
|
||||||
}
|
}
|
||||||
@@ -531,7 +606,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 比较两个数的差值,是否再limit范围内
|
* 比较两个数的差值,是否再limit范围内
|
||||||
*/
|
*/
|
||||||
@@ -552,22 +626,20 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, DevXiNumData.GF startF, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
|
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, DevXiNumData.GF startF, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
|
||||||
//表示接收完成,必须保证10个数
|
//表示接收完成,必须保证3个数
|
||||||
if (deList.size() >= 10) {
|
if (deList.size() >= 7) {
|
||||||
|
List<Double> aList = deList.stream().map(it -> it.getSqlData().get(0).getList().getA()).collect(Collectors.toList());
|
||||||
List<Double> aList = deList.stream().map(it -> it.getSqlData().get(0).getList().getA()).sorted().collect(Collectors.toList());
|
List<Double> bList = deList.stream().map(it -> it.getSqlData().get(0).getList().getB()).collect(Collectors.toList());
|
||||||
List<Double> bList = deList.stream().map(it -> it.getSqlData().get(0).getList().getB()).sorted().collect(Collectors.toList());
|
List<Double> cList = deList.stream().map(it -> it.getSqlData().get(0).getList().getC()).collect(Collectors.toList());
|
||||||
List<Double> cList = deList.stream().map(it -> it.getSqlData().get(0).getList().getC()).sorted().collect(Collectors.toList());
|
|
||||||
|
|
||||||
Double optionalA = reduceList(aList);
|
Double optionalA = reduceList(aList);
|
||||||
Double optionalB = reduceList(bList);
|
Double optionalB = reduceList(bList);
|
||||||
Double optionalC = reduceList(cList);
|
Double optionalC = reduceList(cList);
|
||||||
|
|
||||||
List<Double> aIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getA()).sorted().collect(Collectors.toList());
|
List<Double> aIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getA()).collect(Collectors.toList());
|
||||||
List<Double> bIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getB()).sorted().collect(Collectors.toList());
|
List<Double> bIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getB()).collect(Collectors.toList());
|
||||||
List<Double> cIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getC()).sorted().collect(Collectors.toList());
|
List<Double> cIList = deList.stream().map(it -> it.getSqlData().get(1).getList().getC()).collect(Collectors.toList());
|
||||||
|
|
||||||
Double optionalIA = reduceList(aIList);
|
Double optionalIA = reduceList(aIList);
|
||||||
Double optionalIB = reduceList(bIList);
|
Double optionalIB = reduceList(bIList);
|
||||||
@@ -579,7 +651,6 @@ public class SocketDevResponseService {
|
|||||||
coefficientVO.setAIeData(String.valueOf(optionalIA));
|
coefficientVO.setAIeData(String.valueOf(optionalIA));
|
||||||
coefficientVO.setBIeData(String.valueOf(optionalIB));
|
coefficientVO.setBIeData(String.valueOf(optionalIB));
|
||||||
coefficientVO.setCIeData(String.valueOf(optionalIC));
|
coefficientVO.setCIeData(String.valueOf(optionalIC));
|
||||||
|
|
||||||
if (XiNumberManager.stepNumber == 0 || XiNumberManager.stepNumber == 1) {
|
if (XiNumberManager.stepNumber == 0 || XiNumberManager.stepNumber == 1) {
|
||||||
Integer aXi = BigDecimal.valueOf(devParameter.getDevVolt() * startF.getF().getUa_gain() / optionalA).setScale(0, RoundingMode.HALF_UP).intValue();
|
Integer aXi = BigDecimal.valueOf(devParameter.getDevVolt() * startF.getF().getUa_gain() / optionalA).setScale(0, RoundingMode.HALF_UP).intValue();
|
||||||
Integer bXi = BigDecimal.valueOf(devParameter.getDevVolt() * startF.getF().getUb_gain() / optionalB).setScale(0, RoundingMode.HALF_UP).intValue();
|
Integer bXi = BigDecimal.valueOf(devParameter.getDevVolt() * startF.getF().getUb_gain() / optionalB).setScale(0, RoundingMode.HALF_UP).intValue();
|
||||||
@@ -631,8 +702,8 @@ public class SocketDevResponseService {
|
|||||||
* 删除集合中前五个数以及最后两个数
|
* 删除集合中前五个数以及最后两个数
|
||||||
*/
|
*/
|
||||||
private Double reduceList(List<Double> valList) {
|
private Double reduceList(List<Double> valList) {
|
||||||
valList.subList(0, 5).clear();
|
// valList.subList(0, 5).clear();
|
||||||
valList.subList(valList.size() - 3, valList.size() - 1).clear();
|
valList.subList(valList.size() - 2, valList.size()).clear();
|
||||||
return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
|
return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,12 +722,8 @@ public class SocketDevResponseService {
|
|||||||
//通讯校验成功
|
//通讯校验成功
|
||||||
if (!param.getOperateType().equals(SourceOperateCodeEnum.TEST_TEM_START.getValue())) {
|
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())) {
|
if (!param.getOperateType().equals(SourceOperateCodeEnum.TEST_TEM_START.getValue())) {
|
||||||
SocketDataMsg temMsg = new SocketDataMsg();
|
SocketDataMsg temMsg = new SocketDataMsg();
|
||||||
@@ -665,7 +732,6 @@ public class SocketDevResponseService {
|
|||||||
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();
|
||||||
@@ -680,15 +746,11 @@ public class SocketDevResponseService {
|
|||||||
System.out.println("开始协议校验》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
System.out.println("开始协议校验》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
||||||
SocketManager.sendMsg(s, json);
|
SocketManager.sendMsg(s, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
completeJudgment(param);
|
completeJudgment(param);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEV_ERROR:
|
case DEV_ERROR:
|
||||||
failComm.addAll(FormalTestManager.devMapMonitorNum.get(socketDataMsg.getData()));
|
failComm.addAll(FormalTestManager.devMapMonitorNum.get(socketDataMsg.getData()));
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 0));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 0));
|
||||||
@@ -698,7 +760,6 @@ public class SocketDevResponseService {
|
|||||||
failComm.add(socketDataMsg.getData());
|
failComm.add(socketDataMsg.getData());
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
||||||
completeJudgment(param);
|
completeJudgment(param);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case RE_OPERATE:
|
case RE_OPERATE:
|
||||||
//出现已经初始化情况,发送用户用户确认是否继续检测
|
//出现已经初始化情况,发送用户用户确认是否继续检测
|
||||||
@@ -716,6 +777,7 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//检测结束判断
|
||||||
private void completeJudgment(PreDetectionParam param) {
|
private void completeJudgment(PreDetectionParam param) {
|
||||||
System.out.println("成功失败测点数量" + successComm.size() + ":" + failComm.size() + "监测点总数" + FormalTestManager.monitorIdListComm.size());
|
System.out.println("成功失败测点数量" + successComm.size() + ":" + failComm.size() + "监测点总数" + FormalTestManager.monitorIdListComm.size());
|
||||||
|
|
||||||
@@ -755,7 +817,6 @@ public class SocketDevResponseService {
|
|||||||
webSend.setData(string);
|
webSend.setData(string);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(webSend, FormalTestManager.devNameMapComm, 1));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(webSend, FormalTestManager.devNameMapComm, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
successComm.clear();
|
successComm.clear();
|
||||||
failComm.clear();
|
failComm.clear();
|
||||||
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
||||||
@@ -767,10 +828,7 @@ public class SocketDevResponseService {
|
|||||||
System.out.println("开始暂态协议校验++++++++++");
|
System.out.println("开始暂态协议校验++++++++++");
|
||||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
completeJudgment(param);
|
completeJudgment(param);
|
||||||
|
|
||||||
|
|
||||||
} else if (socketDataMsg.getOperateCode().equals(SourceOperateCodeEnum.DEV_INIT_GATHER_03.getValue())) {
|
} else if (socketDataMsg.getOperateCode().equals(SourceOperateCodeEnum.DEV_INIT_GATHER_03.getValue())) {
|
||||||
successComm.add(socketDataMsg.getData());
|
successComm.add(socketDataMsg.getData());
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
||||||
@@ -822,7 +880,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
icdCheckDataMap.put(icdCheckData.getIcdType(), icdCheckData);
|
icdCheckDataMap.put(icdCheckData.getIcdType(), icdCheckData);
|
||||||
|
|
||||||
if (isContinue) {
|
if (isContinue) {
|
||||||
//System.out.println("icdCheckDataMap.size()="+icdCheckDataMap.size()+",icdTypeList.size()="+icdTypeList.size());
|
//System.out.println("icdCheckDataMap.size()="+icdCheckDataMap.size()+",icdTypeList.size()="+icdTypeList.size());
|
||||||
if (icdCheckDataMap.size() == icdTypeList.size()) {
|
if (icdCheckDataMap.size() == icdTypeList.size()) {
|
||||||
@@ -841,8 +898,15 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
List<SourceIssue> sourceIssues;
|
List<SourceIssue> sourceIssues;
|
||||||
if (SourceOperateCodeEnum.FORMAL_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.RE_ERROR_TEST.getValue().equals(param.getOperateType())) {
|
// 做预检测、后续做系数校准
|
||||||
|
if (param.getTestItemList().get(0) || param.getTestItemList().get(1)) {
|
||||||
|
issueParam.setIsPhaseSequence(CommonEnum.PHASE_TEST.getValue());
|
||||||
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
||||||
|
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
} else if (param.getTestItemList().get(2)) {
|
||||||
|
// 后续做正式检测
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
//不合格项复检
|
//不合格项复检
|
||||||
Set<Integer> indexes = new HashSet<>();
|
Set<Integer> indexes = new HashSet<>();
|
||||||
@@ -856,7 +920,7 @@ public class SocketDevResponseService {
|
|||||||
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
} else {
|
} else {
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
}
|
}
|
||||||
//正式检测
|
//正式检测
|
||||||
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
@@ -883,34 +947,25 @@ public class SocketDevResponseService {
|
|||||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssues.get(0).getType());
|
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssues.get(0).getType());
|
||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
|
||||||
|
|
||||||
//告诉前端当前项开始了
|
//告诉前端当前项开始了
|
||||||
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
webSocketVO.setDesc(null);
|
webSocketVO.setDesc(null);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
||||||
|
|
||||||
|
|
||||||
} else if (SourceOperateCodeEnum.PRE_TEST.getValue().equals(param.getOperateType()) || SourceOperateCodeEnum.COEFFICIENT_TEST.getValue().equals(param.getOperateType())) {
|
|
||||||
//预检测的相序检测 以及系数校验都需要进行相序检测
|
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.PHASE_TEST.getValue());
|
|
||||||
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
|
||||||
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
|
||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
|
||||||
} else if (SourceOperateCodeEnum.TEST_TEM_START.getValue().equals(param.getOperateType())) {
|
|
||||||
//暂停检测后的继续检测
|
|
||||||
System.out.println("进入暂停后的继续检测》》》》》》》》》》》》》》》》》》》》》》》》》》》" + "剩余检测小项" + SocketManager.getSourceList().size());
|
|
||||||
if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
|
|
||||||
SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
|
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssue.getType());
|
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
|
||||||
socketMsg.setData(JSON.toJSONString(sourceIssue));
|
|
||||||
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// if (SourceOperateCodeEnum.TEST_TEM_START.getValue().equals(param.getOperateType())) {
|
||||||
|
// //暂停检测后的继续检测
|
||||||
|
// System.out.println("进入暂停后的继续检测》》》》》》》》》》》》》》》》》》》》》》》》》》》" + "剩余检测小项" + SocketManager.getSourceList().size());
|
||||||
|
// if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
|
||||||
|
// SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
|
||||||
|
// socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssue.getType());
|
||||||
|
// socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
// socketMsg.setData(JSON.toJSONString(sourceIssue));
|
||||||
|
// SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
// 发送下一个脚本与icd校验
|
// 发送下一个脚本与icd校验
|
||||||
String icdType = icdTypeList.stream().filter(it -> !icdCheckDataMap.containsKey(it)).findFirst().orElse(null);
|
String icdType = icdTypeList.stream().filter(it -> !icdCheckDataMap.containsKey(it)).findFirst().orElse(null);
|
||||||
@@ -941,7 +996,6 @@ public class SocketDevResponseService {
|
|||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 1));
|
||||||
completeJudgment(param);
|
completeJudgment(param);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RE_OPERATE:
|
case RE_OPERATE:
|
||||||
//出现已经初始化情况,发送用户用户确认是否继续检测
|
//出现已经初始化情况,发送用户用户确认是否继续检测
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
@@ -1007,7 +1061,7 @@ public class SocketDevResponseService {
|
|||||||
PqScriptIssueParam sourceParam = new PqScriptIssueParam();
|
PqScriptIssueParam sourceParam = new PqScriptIssueParam();
|
||||||
sourceParam.setPlanId(param.getPlanId());
|
sourceParam.setPlanId(param.getPlanId());
|
||||||
sourceParam.setDevIds(param.getDevIds());
|
sourceParam.setDevIds(param.getDevIds());
|
||||||
sourceParam.setIsPhaseSequence(SourceOperateCodeEnum.PHASE_TEST.getValue());
|
sourceParam.setIsPhaseSequence(CommonEnum.PHASE_TEST.getValue());
|
||||||
sourceParam.setScriptId(param.getScriptId());
|
sourceParam.setScriptId(param.getScriptId());
|
||||||
sourceParam.setSourceId(param.getSourceId());
|
sourceParam.setSourceId(param.getSourceId());
|
||||||
List<SourceIssue> sourceIssues = scriptDtlsService.listSourceIssue(sourceParam);
|
List<SourceIssue> sourceIssues = scriptDtlsService.listSourceIssue(sourceParam);
|
||||||
@@ -1027,6 +1081,7 @@ public class SocketDevResponseService {
|
|||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(dataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(dataMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//检测不合格关闭设备服务
|
||||||
if (info.stream().anyMatch(it -> !it.getIsQualified())) {
|
if (info.stream().anyMatch(it -> !it.getIsQualified())) {
|
||||||
WebSocketVO<String> webSocketVO = new WebSocketVO<>();
|
WebSocketVO<String> webSocketVO = new WebSocketVO<>();
|
||||||
webSocketVO.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
webSocketVO.setRequestId(SourceOperateCodeEnum.YJC_XUJY.getValue());
|
||||||
@@ -1049,12 +1104,8 @@ public class SocketDevResponseService {
|
|||||||
successComm.clear();
|
successComm.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 后续做系数校准
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.PRE_TEST.getValue())) {
|
if (param.getTestItemList().get(1)) {
|
||||||
System.out.println("预检测流程结束-----------------关闭源");
|
|
||||||
//同时关闭设备三个步骤
|
|
||||||
CnSocketUtil.quitSend(param);
|
|
||||||
} else if (param.getOperateType().equals(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue())) {
|
|
||||||
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
webSocketVO.setRequestId(SourceOperateCodeEnum.Coefficient_Check.getValue());
|
webSocketVO.setRequestId(SourceOperateCodeEnum.Coefficient_Check.getValue());
|
||||||
webSocketVO.setOperateCode(SourceOperateCodeEnum.big_start.getValue());
|
webSocketVO.setOperateCode(SourceOperateCodeEnum.big_start.getValue());
|
||||||
@@ -1078,11 +1129,69 @@ public class SocketDevResponseService {
|
|||||||
XiNumberManager.smallDevXiNumDataMap.clear();
|
XiNumberManager.smallDevXiNumDataMap.clear();
|
||||||
|
|
||||||
System.out.println("开始系数校准》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
System.out.println("开始系数校准》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》");
|
||||||
}
|
} else if (param.getTestItemList().get(2)) {
|
||||||
|
// 后续做正式检测
|
||||||
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
issueParam.setPlanId(param.getPlanId());
|
||||||
|
issueParam.setSourceId(param.getSourceId());
|
||||||
|
issueParam.setDevIds(param.getDevIds());
|
||||||
|
issueParam.setScriptId(param.getScriptId());
|
||||||
|
|
||||||
|
if (param.getOperateType().equals(SourceOperateCodeEnum.RE_ERROR_TEST.getValue())) {
|
||||||
|
//不合格项复检
|
||||||
|
Set<Integer> indexes = new HashSet<>();
|
||||||
|
StorageParam storageParam = new StorageParam();
|
||||||
|
storageParam.setCode(param.getCode());
|
||||||
|
storageParam.setScriptId(param.getScriptId());
|
||||||
|
param.getDevIds().forEach(devId -> {
|
||||||
|
storageParam.setDevId(devId);
|
||||||
|
indexes.addAll(adHarmonicService.getIndex(storageParam));
|
||||||
|
});
|
||||||
|
issueParam.setIndexList(indexes.stream().collect(Collectors.toList()));
|
||||||
|
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.RE_ERROR_TEST.getValue());
|
||||||
|
} else {
|
||||||
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
|
}
|
||||||
|
//正式检测
|
||||||
|
sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
sourceIssues = sourceIssues.stream().sorted(Comparator.comparing(SourceIssue::getIndex)).collect(Collectors.toList());
|
||||||
|
// 使用 LinkedHashMap 保持分组顺序
|
||||||
|
Map<String, List<SourceIssue>> groupedIssues = sourceIssues.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
SourceIssue::getType,
|
||||||
|
LinkedHashMap::new,
|
||||||
|
Collectors.toList()
|
||||||
|
));
|
||||||
|
|
||||||
|
// 将分组后的元素合并成一个新的集合,保持原有顺序
|
||||||
|
sourceIssues = groupedIssues.values().stream()
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 存放所有检测小项
|
||||||
|
SocketManager.addSourceList(sourceIssues);
|
||||||
|
// 按照大项分组。key为大项code,value为小项个数
|
||||||
|
Map<String, Long> sourceIssueMap = sourceIssues.stream().collect(Collectors.groupingBy(SourceIssue::getType, Collectors.counting()));
|
||||||
|
SocketManager.initMap(sourceIssueMap);
|
||||||
|
|
||||||
|
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssues.get(0).getType());
|
||||||
|
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
|
||||||
|
//告诉前端当前项开始了
|
||||||
|
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||||
|
webSocketVO.setRequestId(sourceIssues.get(0).getType() + stepBegin);
|
||||||
|
webSocketVO.setDesc(null);
|
||||||
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(webSocketVO));
|
||||||
|
} else {
|
||||||
|
//后续什么都不做
|
||||||
|
System.out.println("预检测流程结束-----------------关闭源");
|
||||||
|
//同时关闭设备三个步骤
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("被抛除的数据:" + data);
|
System.out.println("相序校验被抛除的数据:" + data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
@@ -1090,7 +1199,11 @@ public class SocketDevResponseService {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NORMAL_RESPONSE:
|
case NORMAL_RESPONSE:
|
||||||
devInfo.add(devData);
|
if (devData.getResult()) {
|
||||||
|
devInfo.add(devData);
|
||||||
|
} else {
|
||||||
|
System.out.println("相序校验被抛除的数据:" + data);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DEV_ERROR:
|
case DEV_ERROR:
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 0));
|
WebServiceManager.sendMsg(param.getUserPageId(), MsgUtil.msgToWebData(socketDataMsg, FormalTestManager.devNameMapComm, 0));
|
||||||
@@ -1130,10 +1243,12 @@ public class SocketDevResponseService {
|
|||||||
FormalTestManager.realDataXiList.add(devData);
|
FormalTestManager.realDataXiList.add(devData);
|
||||||
successComm.add(devData.getId());
|
successComm.add(devData.getId());
|
||||||
|
|
||||||
|
//成功收到数据后重置超时统计时间
|
||||||
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
||||||
SocketManager.clockMap.put(sourceIssue.getIndex(), 0L);
|
SocketManager.clockMap.put(sourceIssue.getIndex(), 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//当成功的通道数量和检测通道数量相同时进入
|
||||||
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
||||||
System.out.println(sourceIssue.getType() + splitTag + sourceIssue.getIndex() + "当前测试小项读取数据已经全部结束。。。。。。。。。");
|
System.out.println(sourceIssue.getType() + splitTag + sourceIssue.getIndex() + "当前测试小项读取数据已经全部结束。。。。。。。。。");
|
||||||
//修改装置为监测中
|
//修改装置为监测中
|
||||||
@@ -1145,16 +1260,19 @@ public class SocketDevResponseService {
|
|||||||
Map<String, Integer> textResult = detectionServiceImpl.processing(FormalTestManager.realDataXiList, param, FormalTestManager.devIdMapComm, sourceIssue, dataRule);
|
Map<String, Integer> textResult = detectionServiceImpl.processing(FormalTestManager.realDataXiList, param, FormalTestManager.devIdMapComm, sourceIssue, dataRule);
|
||||||
|
|
||||||
System.out.println(textResult);
|
System.out.println(textResult);
|
||||||
//组装实体推送给前台
|
//对检测结果组装实体推送给前台
|
||||||
assWebJson(param, textResult, socketDataMsg, sourceIssue);
|
assWebJson(param, textResult, socketDataMsg, sourceIssue);
|
||||||
|
|
||||||
//当小项结束后需要删除集合中的小项
|
//当小项结束后需要删除集合中的小项
|
||||||
SocketManager.delSource(sourceIssue.getIndex());
|
SocketManager.delSource(sourceIssue.getIndex());
|
||||||
System.out.println("当前小项结束进行删除============" + sourceIssue.getType() + splitTag + sourceIssue.getIndex());
|
System.out.println("当前小项结束进行删除============" + sourceIssue.getType() + splitTag + sourceIssue.getIndex());
|
||||||
|
|
||||||
|
//小项检测完后小项数减一,并更新map
|
||||||
long residueCount = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
long residueCount = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
||||||
SocketManager.addTargetMap(sourceIssue.getType(), residueCount);
|
SocketManager.addTargetMap(sourceIssue.getType(), residueCount);
|
||||||
System.out.println("该大项还有" + residueCount + "个小项没有进行检测!!!!!!!!");
|
System.out.println("该大项还有" + residueCount + "个小项没有进行检测!!!!!!!!");
|
||||||
|
|
||||||
|
//当该大项中小项数量变为0,则任务该大项检测结束
|
||||||
if (residueCount == 0) {
|
if (residueCount == 0) {
|
||||||
System.out.println(sourceIssue.getType() + sourceIssue.getIndex() + "当前测试大项已经全部结束》》》》》》》》");
|
System.out.println(sourceIssue.getType() + sourceIssue.getIndex() + "当前测试大项已经全部结束》》》》》》》》");
|
||||||
//当residueCount为0则认为大项中的小项已经全部跑完,开始组装信息推送给前端
|
//当residueCount为0则认为大项中的小项已经全部跑完,开始组装信息推送给前端
|
||||||
@@ -1196,6 +1314,7 @@ public class SocketDevResponseService {
|
|||||||
CnSocketUtil.sendToWebSocket(param.getUserPageId(), sourceIssues.getType() + stepBegin, null, new ArrayList<>(), null);
|
CnSocketUtil.sendToWebSocket(param.getUserPageId(), sourceIssues.getType() + stepBegin, null, new ArrayList<>(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//控源下发下一个小项脚本
|
||||||
SocketMsg<String> xuMsg = new SocketMsg<>();
|
SocketMsg<String> xuMsg = new SocketMsg<>();
|
||||||
xuMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
xuMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
xuMsg.setData(JSON.toJSONString(sourceIssues));
|
xuMsg.setData(JSON.toJSONString(sourceIssues));
|
||||||
@@ -1249,43 +1368,6 @@ public class SocketDevResponseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
private void processData(List<DevData> FormalTestManager.realDataXiList, List<String> successComm, SourceIssue sourceIssue, PreDetectionParam param, SocketDataMsg socketDataMsg, Object dataRule, String handlerSourceStr) {
|
|
||||||
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {
|
|
||||||
SocketManager.clockMap.put(sourceIssue.getIndex(), 0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (successComm.size() == FormalTestManager.monitorIdListComm.size()) {
|
|
||||||
System.out.println(sourceIssue.getType() + stepTag + sourceIssue.getIndex() + "当前测试小项读取数据已经全部结束。。。。。。。。。");
|
|
||||||
handleSmallItemCompletion(FormalTestManager.realDataXiList, sourceIssue, param, socketDataMsg, dataRule);
|
|
||||||
if (handlePauseCondition(param, successComm, FormalTestManager.realDataXiList)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
startNextDetection(sourceIssue, param, socketDataMsg, handlerSourceStr);
|
|
||||||
successComm.clear();
|
|
||||||
FormalTestManager.realDataXiList.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void handleSmallItemCompletion(List<DevData> FormalTestManager.realDataXiList, SourceIssue sourceIssue, PreDetectionParam param, SocketDataMsg socketDataMsg, Object dataRule) {
|
|
||||||
adPlanService.updateTestState(param.getPlanId(), param.getDevIds());
|
|
||||||
baseDataInsertService.insert(FormalTestManager.realDataXiList, sourceIssue, param, SocketManager.valueTypeMap);
|
|
||||||
Map<String, Integer> textResult = detectionServiceImpl.processing(FormalTestManager.realDataXiList, param, FormalTestManager.devIdMapComm, sourceIssue, dataRule);
|
|
||||||
assWebJson(param, textResult, socketDataMsg, sourceIssue);
|
|
||||||
SocketManager.delSource(sourceIssue.getIndex());
|
|
||||||
System.out.println("当前小项结束进行删除============" + sourceIssue.getType() + stepTag + sourceIssue.getIndex());
|
|
||||||
long residueCount = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
|
||||||
SocketManager.addTargetMap(sourceIssue.getType(), residueCount);
|
|
||||||
System.out.println("该大项还有" + residueCount + "个小项没有进行检测!!!!!!!!");
|
|
||||||
if (residueCount == 0) {
|
|
||||||
handleLargeItemCompletion(sourceIssue, param, socketDataMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装实体推送给前端
|
* 组装实体推送给前端
|
||||||
*/
|
*/
|
||||||
@@ -1308,11 +1390,6 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
if (targetTestMap.containsKey(sourceIssue.getType())) {
|
if (targetTestMap.containsKey(sourceIssue.getType())) {
|
||||||
List<DevLineTestResult> devLineTestResultList = targetTestMap.get(sourceIssue.getType());
|
List<DevLineTestResult> devLineTestResultList = targetTestMap.get(sourceIssue.getType());
|
||||||
// devListRes.forEach(it1 -> {
|
|
||||||
// devLineTestResultList.stream().filter(it2 -> it2.getDeviceId().equals(it1.getDeviceId())).findFirst().ifPresent(it2 -> {
|
|
||||||
// setNewChnResult(it2.getChnResult(), it1.getChnResult());
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
devLineTestResultList.addAll(devListRes);
|
devLineTestResultList.addAll(devListRes);
|
||||||
} else {
|
} else {
|
||||||
targetTestMap.put(sourceIssue.getType(), devListRes);
|
targetTestMap.put(sourceIssue.getType(), devListRes);
|
||||||
@@ -1649,6 +1726,9 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
List<PreDetection> pqDevList = iPqDevService.getDevInfo(param.getDevIds());
|
List<PreDetection> pqDevList = iPqDevService.getDevInfo(param.getDevIds());
|
||||||
FormalTestManager.devList = pqDevList;
|
FormalTestManager.devList = pqDevList;
|
||||||
|
FormalTestManager.devList.forEach(x -> {
|
||||||
|
x.setDevType(x.getIcdType());
|
||||||
|
});
|
||||||
FormalTestManager.devMapMonitorNum = pqDevList.stream().collect(Collectors.toMap(PreDetection::getDevIP, it -> it.getMonitorList().stream().map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList())));
|
FormalTestManager.devMapMonitorNum = pqDevList.stream().collect(Collectors.toMap(PreDetection::getDevIP, it -> it.getMonitorList().stream().map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList())));
|
||||||
FormalTestManager.monitorIdListComm = pqDevList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList());
|
FormalTestManager.monitorIdListComm = pqDevList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -1669,7 +1749,7 @@ public class SocketDevResponseService {
|
|||||||
//字典树
|
//字典树
|
||||||
SocketManager.valueTypeMap = iPqScriptCheckDataService.getValueTypeMap(param.getScriptId());
|
SocketManager.valueTypeMap = iPqScriptCheckDataService.getValueTypeMap(param.getScriptId());
|
||||||
|
|
||||||
if (param.getOperateType().equals(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue())) {
|
if (param.getTestItemList().get(1)) {
|
||||||
initXiManager(param);
|
initXiManager(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1700,7 +1780,7 @@ public class SocketDevResponseService {
|
|||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.COEFFICIENT_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.COEFFICIENT_TEST.getValue());
|
||||||
issueParam.setIndexList(Stream.of(-2, -3).collect(Collectors.toList()));
|
issueParam.setIndexList(Stream.of(-2, -3).collect(Collectors.toList()));
|
||||||
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
for (int j = 0; j < sourceIssues.size(); j++) {
|
for (int j = 0; j < sourceIssues.size(); j++) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.njcn.gather.device.service.IPqDevService;
|
|||||||
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;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -133,16 +134,13 @@ public class SocketSourceResponseService {
|
|||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
case UNKNOWN_ERROR:
|
|
||||||
CnSocketUtil.quitSendSource(param);
|
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
|
||||||
break;
|
|
||||||
case UNABLE_TO_RESPOND:
|
case UNABLE_TO_RESPOND:
|
||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CnSocketUtil.sendUnSocket(param.getUserPageId());
|
CnSocketUtil.sendUnSocket(param.getUserPageId());
|
||||||
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,8 +194,10 @@ public class SocketSourceResponseService {
|
|||||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||||
phaseSequenceParam.setMoniterIdList(monitorIdList);
|
phaseSequenceParam.setMoniterIdList(monitorIdList);
|
||||||
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
|
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
|
||||||
phaseSequenceParam.setReadCount(10);
|
// 读取3次数据用于系数计算
|
||||||
phaseSequenceParam.setIgnoreCount(7);
|
phaseSequenceParam.setReadCount(7); //3
|
||||||
|
// 忽略前4次数据,等待测量稳定
|
||||||
|
phaseSequenceParam.setIgnoreCount(3); //4
|
||||||
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
||||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||||
|
|
||||||
@@ -219,8 +219,8 @@ public class SocketSourceResponseService {
|
|||||||
/**
|
/**
|
||||||
* 装置检测(当源初始化成功后,直接向装置通道向装置服务器发送,装置检测)
|
* 装置检测(当源初始化成功后,直接向装置通道向装置服务器发送,装置检测)
|
||||||
*
|
*
|
||||||
* @param param
|
* @param param 参数
|
||||||
* @param socketDataMsg
|
* @param socketDataMsg 消息
|
||||||
*/
|
*/
|
||||||
private void detectionDev(PreDetectionParam param, SocketDataMsg socketDataMsg) {
|
private void detectionDev(PreDetectionParam param, SocketDataMsg socketDataMsg) {
|
||||||
SourceResponseCodeEnum dictDataEnumByCode = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
|
SourceResponseCodeEnum dictDataEnumByCode = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
|
||||||
@@ -233,9 +233,9 @@ public class SocketSourceResponseService {
|
|||||||
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
String s = param.getUserPageId() + DEV;
|
String s = param.getUserPageId() + DEV;
|
||||||
//开始设备通讯检测(发送设备初始化)
|
//开始设备通讯检测(发送设备初始化)
|
||||||
List<PreDetection> devList = iPqDevService.getDevInfo(param.getDevIds());
|
//List<PreDetection> devList = iPqDevService.getDevInfo(param.getDevIds());
|
||||||
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
||||||
map.put("deviceList", devList);
|
map.put("deviceList", FormalTestManager.devList);
|
||||||
String jsonString = JSON.toJSONString(map);
|
String jsonString = JSON.toJSONString(map);
|
||||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
||||||
@@ -375,9 +375,11 @@ public class SocketSourceResponseService {
|
|||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_01.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_01.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<String> moniterIdList = devList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList());
|
System.out.println("devList is empty:" + CollectionUtils.isEmpty(devList));
|
||||||
|
|
||||||
|
//List<String> moniterIdList = devList.stream().flatMap(x -> x.getMonitorList().stream()).map(PreDetection.MonitorListDTO::getLineId).collect(Collectors.toList());
|
||||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||||
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
phaseSequenceParam.setMoniterIdList(monitorIdList);
|
||||||
phaseSequenceParam.setDataType(comm);
|
phaseSequenceParam.setDataType(comm);
|
||||||
phaseSequenceParam.setReadCount(readData);
|
phaseSequenceParam.setReadCount(readData);
|
||||||
phaseSequenceParam.setIgnoreCount(ignoreCount);
|
phaseSequenceParam.setIgnoreCount(ignoreCount);
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public interface DetectionCommunicateConstant {
|
|||||||
|
|
||||||
String DEVICE_CHANNEL_NAME = "AUTO_DETECTION_DEV";
|
String DEVICE_CHANNEL_NAME = "AUTO_DETECTION_DEV";
|
||||||
|
|
||||||
|
String DEV = "_Dev";
|
||||||
|
|
||||||
|
String SOURCE = "_Source";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public enum SourceOperateCodeEnum {
|
|||||||
QUITE_SOURCE("close_source","关闭源通讯"),
|
QUITE_SOURCE("close_source","关闭源通讯"),
|
||||||
ERROR_FLOW_END("error_flow_end","当前流程存在异常结束"),
|
ERROR_FLOW_END("error_flow_end","当前流程存在异常结束"),
|
||||||
YXT("yxt","心跳"),
|
YXT("yxt","心跳"),
|
||||||
|
REPORT_CAT("FTP_SEND$01","处理报告"),
|
||||||
|
|
||||||
UNKNOWN_OPERATE("unknown_operate","未知的操作返回,请联系管理员排查"),
|
UNKNOWN_OPERATE("unknown_operate","未知的操作返回,请联系管理员排查"),
|
||||||
SOCKET_TIMEOUT("socket_timeout","与源或者装置通讯等待超时"),
|
SOCKET_TIMEOUT("socket_timeout","与源或者装置通讯等待超时"),
|
||||||
@@ -69,17 +70,18 @@ public enum SourceOperateCodeEnum {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
COEFFICIENT_TEST("0","系数校验"),
|
// COEFFICIENT_TEST("0","系数校验"),
|
||||||
PRE_TEST("1","预检测"),
|
// PRE_TEST("1","预检测"),
|
||||||
FORMAL_TEST("2","正式检测"),
|
// FORMAL_TEST("2","正式检测"),
|
||||||
TIME_TEST("3","守时检测"),
|
// TIME_TEST("3","守时检测"),
|
||||||
PHASE_TEST("4","相序检测"),
|
// PHASE_TEST("4","相序检测"),
|
||||||
TEST_TEM_STOP("5","临时停止"),
|
// TEST_TEM_STOP("5","临时停止"),
|
||||||
TEST_TEM_START("6","继续检测"),
|
ALL_TEST("1","全部检测"),
|
||||||
TEST_STOP("7","停止检测"),
|
RE_ERROR_TEST("2","不合格项复检"),
|
||||||
RE_ERROR_TEST("8","不合格项复检"),
|
TEST_TEM_START("3","继续检测"),
|
||||||
SIMULATE_TEST("9","模拟检测"),
|
SIMULATE_TEST("4","模拟检测"),
|
||||||
|
//TEST_STOP("7","停止检测"),
|
||||||
|
//FAST_TEST("10","一键检测"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系数校验步骤
|
* 系数校验步骤
|
||||||
@@ -94,6 +96,11 @@ public enum SourceOperateCodeEnum {
|
|||||||
small_comp_end("small_comp_end","小电压校准结束"),
|
small_comp_end("small_comp_end","小电压校准结束"),
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ftp文件传送指令
|
||||||
|
*/
|
||||||
|
FTP_SEND_01("FTP_SEND$01", "发送文件")
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class PreDetectionParam {
|
public class PreDetectionParam {
|
||||||
|
|
||||||
/**
|
private String operateType;
|
||||||
* 操作类型 0.预检测 1.正式检测 2.系数校验
|
|
||||||
*/
|
|
||||||
private String operateType = "0";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测计划id
|
* 检测计划id
|
||||||
@@ -75,4 +72,9 @@ public class PreDetectionParam {
|
|||||||
* 相对湿度
|
* 相对湿度
|
||||||
*/
|
*/
|
||||||
private Float humidity;
|
private Float humidity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测项列表。第一个元素为预检测、第二个元素为系数校准、第三个元素为正式检测
|
||||||
|
*/
|
||||||
|
private List<Boolean> testItemList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
|||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
||||||
|
import com.njcn.gather.device.pojo.enums.CheckResultEnum;
|
||||||
import com.njcn.gather.err.pojo.param.PqErrSysParam;
|
import com.njcn.gather.err.pojo.param.PqErrSysParam;
|
||||||
import com.njcn.gather.err.pojo.po.PqErrSysDtls;
|
import com.njcn.gather.err.pojo.po.PqErrSysDtls;
|
||||||
import com.njcn.gather.err.pojo.vo.ErrDtlsCheckDataVO;
|
import com.njcn.gather.err.pojo.vo.ErrDtlsCheckDataVO;
|
||||||
@@ -23,6 +24,8 @@ import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
|||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
||||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
||||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||||
|
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||||
|
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -50,6 +53,7 @@ public class DetectionServiceImpl {
|
|||||||
private final IPqErrSysDtlsService pqErrSysDtlsService;
|
private final IPqErrSysDtlsService pqErrSysDtlsService;
|
||||||
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
private final IPqScriptCheckDataService pqScriptCheckDataService;
|
||||||
private final DetectionDataDealService detectionDataDealService;
|
private final DetectionDataDealService detectionDataDealService;
|
||||||
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
|
|
||||||
private final String TYPE_A = "A";
|
private final String TYPE_A = "A";
|
||||||
private final String TYPE_B = "B";
|
private final String TYPE_B = "B";
|
||||||
@@ -763,7 +767,7 @@ public class DetectionServiceImpl {
|
|||||||
result.setResultFlag(setResultFlag(Arrays.asList(a, b, c)));
|
result.setResultFlag(setResultFlag(Arrays.asList(a, b, c)));
|
||||||
} else {
|
} else {
|
||||||
List<SourceIssue.ChannelListDTO> channelTypeAList = sourceIssue.getChannelList().stream()
|
List<SourceIssue.ChannelListDTO> channelTypeAList = sourceIssue.getChannelList().stream()
|
||||||
.filter(x -> x.getChannelType().contains("U"))
|
.filter(x -> x.getChannelType().contains("Ua"))
|
||||||
.sorted(Comparator.comparing(
|
.sorted(Comparator.comparing(
|
||||||
x -> Optional.ofNullable(x.getDipData())
|
x -> Optional.ofNullable(x.getDipData())
|
||||||
.map(SourceIssue.ChannelListDTO.DipDataDTO::getFTransValue)
|
.map(SourceIssue.ChannelListDTO.DipDataDTO::getFTransValue)
|
||||||
@@ -771,6 +775,9 @@ public class DetectionServiceImpl {
|
|||||||
))
|
))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
DetectionData a = setDetectionData(isQualified, dataRule, mag, fData, dur, magErrList, channelTypeAList, TYPE_A);
|
DetectionData a = setDetectionData(isQualified, dataRule, mag, fData, dur, magErrList, channelTypeAList, TYPE_A);
|
||||||
|
if (CollUtil.isEmpty(mag.get(TYPE_A))) {
|
||||||
|
a.setIsData(2);
|
||||||
|
}
|
||||||
result.setAValue(JSON.toJSONString(a));
|
result.setAValue(JSON.toJSONString(a));
|
||||||
result.setTValue(JSON.toJSONString(a));
|
result.setTValue(JSON.toJSONString(a));
|
||||||
result.setResultFlag(a.getIsData());
|
result.setResultFlag(a.getIsData());
|
||||||
@@ -976,7 +983,10 @@ public class DetectionServiceImpl {
|
|||||||
data.setIsData(isQualified);
|
data.setIsData(isQualified);
|
||||||
data.setNum(harm);
|
data.setNum(harm);
|
||||||
if (CollUtil.isNotEmpty(harmDataList)) {
|
if (CollUtil.isNotEmpty(harmDataList)) {
|
||||||
data.setData(harmDataList.get(0));
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(harmDataList.get(0));
|
||||||
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
data.setData(bd.doubleValue());
|
||||||
}
|
}
|
||||||
Double channelData = issueHarmMap.get(harm);
|
Double channelData = issueHarmMap.get(harm);
|
||||||
data.setResultData(channelData);
|
data.setResultData(channelData);
|
||||||
@@ -1007,12 +1017,13 @@ public class DetectionServiceImpl {
|
|||||||
private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double channelData, Double ratedValue) {
|
private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double channelData, Double ratedValue) {
|
||||||
if (CollUtil.isNotEmpty(harmDataList)) {
|
if (CollUtil.isNotEmpty(harmDataList)) {
|
||||||
// 存放合格的数据
|
// 存放合格的数据
|
||||||
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
List<Double> qualifiedList = harmDataList.stream()
|
List<Double> qualifiedList = harmDataList.stream()
|
||||||
.filter(x -> channelData == 0 ? NumberUtil.isIn(devSubtractChannelData(x, channelData, ratedValue, errSysDtl),
|
.filter(x -> channelData == 0 ? NumberUtil.isIn(devSubtractChannelData(x, channelData, ratedValue, errSysDtl, oneConfig.getScale()),
|
||||||
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
|
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
|
||||||
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))
|
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))
|
||||||
:
|
:
|
||||||
x != 0 && NumberUtil.isIn(devSubtractChannelData(x, channelData, ratedValue, errSysDtl),
|
x != 0 && NumberUtil.isIn(devSubtractChannelData(x, channelData, ratedValue, errSysDtl, oneConfig.getScale()),
|
||||||
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
|
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
|
||||||
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
|
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(qualifiedList)) {
|
if (CollUtil.isNotEmpty(qualifiedList)) {
|
||||||
@@ -1020,21 +1031,23 @@ public class DetectionServiceImpl {
|
|||||||
case AT_WILL_VALUE:
|
case AT_WILL_VALUE:
|
||||||
case CP95_VALUE:
|
case CP95_VALUE:
|
||||||
case AVG_VALUE:
|
case AVG_VALUE:
|
||||||
data.setErrorData(devSubtractChannelData(qualifiedList.get(0), channelData, ratedValue, errSysDtl));
|
data.setErrorData(devSubtractChannelData(qualifiedList.get(0), channelData, ratedValue, errSysDtl, oneConfig.getScale()));
|
||||||
break;
|
break;
|
||||||
case SECTION_VALUE:
|
case SECTION_VALUE:
|
||||||
case Own_value:
|
case Own_value:
|
||||||
if (qualifiedList.size() == harmDataList.size()) {
|
if (qualifiedList.size() == harmDataList.size()) {
|
||||||
data.setErrorData(devSubtractChannelData(qualifiedList.get(0), channelData, ratedValue, errSysDtl));
|
data.setErrorData(devSubtractChannelData(qualifiedList.get(0), channelData, ratedValue, errSysDtl, oneConfig.getScale()));
|
||||||
} else {
|
} else {
|
||||||
List<Double> subtract = CollectionUtils.subtract(harmDataList, qualifiedList).stream().collect(Collectors.toList());
|
List<Double> subtract = CollectionUtils.subtract(harmDataList, qualifiedList).stream().collect(Collectors.toList());
|
||||||
data.setData(subtract.get(0));
|
BigDecimal bd = BigDecimal.valueOf(subtract.get(0));
|
||||||
data.setErrorData(devSubtractChannelData(subtract.get(0), channelData, ratedValue, errSysDtl));
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
data.setData(bd.doubleValue());
|
||||||
|
data.setErrorData(devSubtractChannelData(subtract.get(0), channelData, ratedValue, errSysDtl, oneConfig.getScale()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data.setErrorData(devSubtractChannelData(harmDataList.get(0), channelData, ratedValue, errSysDtl));
|
data.setErrorData(devSubtractChannelData(harmDataList.get(0), channelData, ratedValue, errSysDtl, oneConfig.getScale()));
|
||||||
}
|
}
|
||||||
isData(dataRule, harmDataList, data, qualifiedList);
|
isData(dataRule, harmDataList, data, qualifiedList);
|
||||||
}
|
}
|
||||||
@@ -1042,7 +1055,10 @@ public class DetectionServiceImpl {
|
|||||||
|
|
||||||
private void isData(DictDataEnum dataRule, List<Double> harmDataList, DetectionData data, List<Double> qualifiedList) {
|
private void isData(DictDataEnum dataRule, List<Double> harmDataList, DetectionData data, List<Double> qualifiedList) {
|
||||||
if (CollUtil.isNotEmpty(qualifiedList)) {
|
if (CollUtil.isNotEmpty(qualifiedList)) {
|
||||||
data.setData(qualifiedList.get(0));
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(qualifiedList.get(0));
|
||||||
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
data.setData(bd.doubleValue());
|
||||||
switch (dataRule) {
|
switch (dataRule) {
|
||||||
case AT_WILL_VALUE:
|
case AT_WILL_VALUE:
|
||||||
case CP95_VALUE:
|
case CP95_VALUE:
|
||||||
@@ -1059,7 +1075,9 @@ public class DetectionServiceImpl {
|
|||||||
data.setIsData(1);
|
data.setIsData(1);
|
||||||
} else {
|
} else {
|
||||||
List<Double> subtract = CollectionUtils.subtract(harmDataList, qualifiedList).stream().collect(Collectors.toList());
|
List<Double> subtract = CollectionUtils.subtract(harmDataList, qualifiedList).stream().collect(Collectors.toList());
|
||||||
data.setData(subtract.get(0));
|
bd = BigDecimal.valueOf(subtract.get(0));
|
||||||
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
data.setData(bd.doubleValue());
|
||||||
data.setIsData(2);
|
data.setIsData(2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1171,7 +1189,10 @@ public class DetectionServiceImpl {
|
|||||||
DetectionData detectionData = new DetectionData();
|
DetectionData detectionData = new DetectionData();
|
||||||
detectionData.setIsData(isQualified);
|
detectionData.setIsData(isQualified);
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
detectionData.setData(list.get(0));
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(list.get(0));
|
||||||
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
detectionData.setData(bd.doubleValue());
|
||||||
detectionData.setResultData(channelData);
|
detectionData.setResultData(channelData);
|
||||||
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
||||||
//获得误差体系
|
//获得误差体系
|
||||||
@@ -1195,7 +1216,10 @@ public class DetectionServiceImpl {
|
|||||||
DetectionData detectionData = new DetectionData();
|
DetectionData detectionData = new DetectionData();
|
||||||
detectionData.setIsData(isQualified);
|
detectionData.setIsData(isQualified);
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
detectionData.setData(list.get(0));
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
|
BigDecimal bd = BigDecimal.valueOf(list.get(0));
|
||||||
|
bd = bd.setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
|
detectionData.setData(bd.doubleValue());
|
||||||
detectionData.setResultData(BigDecimal.valueOf(1.0 / data).doubleValue() * channelData);
|
detectionData.setResultData(BigDecimal.valueOf(1.0 / data).doubleValue() * channelData);
|
||||||
|
|
||||||
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
//先根据源所下发的数据,是否在误差体系范围内在则可以进行误差体系判断
|
||||||
@@ -1220,11 +1244,11 @@ public class DetectionServiceImpl {
|
|||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(qualifiedList)) {
|
if (CollUtil.isNotEmpty(qualifiedList)) {
|
||||||
BigDecimal subtract = BigDecimal.valueOf(qualifiedList.get(0))
|
BigDecimal subtract = BigDecimal.valueOf(qualifiedList.get(0))
|
||||||
.subtract(BigDecimal.valueOf(1.0 / data * (channelData)));
|
.subtract(BigDecimal.valueOf(1.0 / data * (channelData))).setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
detectionData.setErrorData(subtract);
|
detectionData.setErrorData(subtract);
|
||||||
} else {
|
} else {
|
||||||
BigDecimal subtract = BigDecimal.valueOf(list.get(0))
|
BigDecimal subtract = BigDecimal.valueOf(list.get(0))
|
||||||
.subtract(BigDecimal.valueOf(1.0 / data * (channelData)));
|
.subtract(BigDecimal.valueOf(1.0 / data * (channelData))).setScale(oneConfig.getScale(), RoundingMode.HALF_UP);
|
||||||
detectionData.setErrorData(subtract);
|
detectionData.setErrorData(subtract);
|
||||||
}
|
}
|
||||||
isData(dataRule, list, detectionData, qualifiedList);
|
isData(dataRule, list, detectionData, qualifiedList);
|
||||||
@@ -1282,23 +1306,24 @@ public class DetectionServiceImpl {
|
|||||||
* @param channelData 通道值
|
* @param channelData 通道值
|
||||||
* @param ratedValue 额定值
|
* @param ratedValue 额定值
|
||||||
* @param error
|
* @param error
|
||||||
|
* @param scale 小数点位数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public BigDecimal devSubtractChannelData(Double devData, Double channelData, Double ratedValue, PqErrSysDtls error) {
|
public BigDecimal devSubtractChannelData(Double devData, Double channelData, Double ratedValue, PqErrSysDtls error, Integer scale) {
|
||||||
//计算装置值返回值 - 源下发值的数据 = 差值
|
//计算装置值返回值 - 源下发值的数据 = 差值
|
||||||
BigDecimal subtract = BigDecimal.valueOf(devData).subtract(BigDecimal.valueOf(channelData));
|
BigDecimal subtract = BigDecimal.valueOf(devData).setScale(scale, RoundingMode.HALF_UP).subtract(BigDecimal.valueOf(channelData));
|
||||||
//只有相对值需要%比较,绝对值直接相减就行
|
//只有相对值需要%比较,绝对值直接相减就行
|
||||||
if (2 == error.getValueType()) {
|
if (2 == error.getValueType()) {
|
||||||
switch (error.getErrorValueType()) {
|
switch (error.getErrorValueType()) {
|
||||||
case 0:
|
case 0:
|
||||||
//下发的谐波电压幅值,返回的是谐波电压含有率,拿(含有率值*基波 - 源下发对应谐波值幅值)/ 额定值
|
//下发的谐波电压幅值,返回的是谐波电压含有率,拿(含有率值*基波 - 源下发对应谐波值幅值)/ 额定值
|
||||||
return subtract.multiply(BigDecimal.valueOf(100))
|
return subtract.multiply(BigDecimal.valueOf(100))
|
||||||
.divide(BigDecimal.valueOf(ratedValue), 4, RoundingMode.HALF_UP);
|
.divide(BigDecimal.valueOf(ratedValue), scale, RoundingMode.HALF_UP);
|
||||||
case 1:
|
case 1:
|
||||||
//todo 当谐波电压和间谐波电压默认都是按照相对值误差进行计算(用户关心的是含有率)
|
//todo 当谐波电压和间谐波电压默认都是按照相对值误差进行计算(用户关心的是含有率)
|
||||||
//下发的谐波电压幅值,返回的是谐波电压含有率,拿(含有率值*基波 - 源下发对应谐波值幅值)/ 下发的幅值
|
//下发的谐波电压幅值,返回的是谐波电压含有率,拿(含有率值*基波 - 源下发对应谐波值幅值)/ 下发的幅值
|
||||||
return subtract.multiply(BigDecimal.valueOf(100))
|
return subtract.multiply(BigDecimal.valueOf(100))
|
||||||
.divide(BigDecimal.valueOf(channelData), 4, RoundingMode.HALF_UP);
|
.divide(BigDecimal.valueOf(channelData), scale, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return subtract;
|
return subtract;
|
||||||
@@ -1314,14 +1339,15 @@ public class DetectionServiceImpl {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double startRadiusEnd(Double value, Double ratedData, Double harmData, Integer type) {
|
public Double startRadiusEnd(Double value, Double ratedData, Double harmData, Integer type) {
|
||||||
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
if (ObjectUtil.isNotNull(value)) {
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
return BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(ratedData))
|
return BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(ratedData))
|
||||||
.setScale(4, RoundingMode.HALF_UP).doubleValue();
|
.setScale(oneConfig.getScale(), RoundingMode.HALF_UP).doubleValue();
|
||||||
case 1:
|
case 1:
|
||||||
return BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(harmData))
|
return BigDecimal.valueOf(value).multiply(BigDecimal.valueOf(harmData))
|
||||||
.setScale(4, RoundingMode.HALF_UP).doubleValue();
|
.setScale(oneConfig.getScale(), RoundingMode.HALF_UP).doubleValue();
|
||||||
default:
|
default:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -1340,6 +1366,7 @@ public class DetectionServiceImpl {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Double maxErrorMultiply(PqErrSysDtls error, Double ratedData, Double harmData) {
|
public Double maxErrorMultiply(PqErrSysDtls error, Double ratedData, Double harmData) {
|
||||||
|
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||||
Double errorValue = error.getMaxErrorValue();
|
Double errorValue = error.getMaxErrorValue();
|
||||||
//1绝对值
|
//1绝对值
|
||||||
if (1 == error.getValueType()) {
|
if (1 == error.getValueType()) {
|
||||||
@@ -1347,11 +1374,11 @@ public class DetectionServiceImpl {
|
|||||||
//绝对值-标称值= 最大误差值 * 额定电压
|
//绝对值-标称值= 最大误差值 * 额定电压
|
||||||
case 0:
|
case 0:
|
||||||
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(ratedData))
|
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(ratedData))
|
||||||
.setScale(4, RoundingMode.HALF_UP).doubleValue();
|
.setScale(oneConfig.getScale(), RoundingMode.HALF_UP).doubleValue();
|
||||||
//绝对值-标准值 = 最大误差值 * 谐波下发值
|
//绝对值-标准值 = 最大误差值 * 谐波下发值
|
||||||
case 1:
|
case 1:
|
||||||
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(harmData))
|
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(harmData))
|
||||||
.setScale(4, RoundingMode.HALF_UP).doubleValue();
|
.setScale(oneConfig.getScale(), RoundingMode.HALF_UP).doubleValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//2相对值
|
//2相对值
|
||||||
@@ -1361,7 +1388,7 @@ public class DetectionServiceImpl {
|
|||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(100))
|
return BigDecimal.valueOf(errorValue).multiply(BigDecimal.valueOf(100))
|
||||||
.setScale(4, RoundingMode.HALF_UP).doubleValue();
|
.setScale(oneConfig.getScale(), RoundingMode.HALF_UP).doubleValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errorValue;
|
return errorValue;
|
||||||
|
|||||||
@@ -78,14 +78,18 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sourceCommunicationCheck(PreDetectionParam param) {
|
public void sourceCommunicationCheck(PreDetectionParam param) {
|
||||||
// 参数校验,目前仅检查IP是否重复
|
// 参数校验,目前仅检查IP是否重复,后续可在里面扩展
|
||||||
checkDevIp(param);
|
checkDevIp(param);
|
||||||
|
//用于处理异常导致的socket通道未关闭,socket交互异常
|
||||||
DetectionCommunicateUtil.checkCommunicateChannel(param);
|
DetectionCommunicateUtil.checkCommunicateChannel(param);
|
||||||
/*
|
/*
|
||||||
先组装源通讯协议
|
先组装源通讯协议
|
||||||
查询计划什么模式的(除了对比式,其他都是一个计划对应一个源)
|
查询计划什么模式的(除了对比式,其他都是一个计划对应一个源)
|
||||||
*/
|
*/
|
||||||
AdPlan plan = iAdPlanService.getById(param.getPlanId());
|
AdPlan plan = iAdPlanService.getById(param.getPlanId());
|
||||||
|
param.setScriptId(plan.getScriptId());
|
||||||
|
param.setErrorSysId(plan.getErrorSysId());
|
||||||
|
param.setCode(String.valueOf(plan.getCode()));
|
||||||
if (ObjectUtil.isNotNull(plan)) {
|
if (ObjectUtil.isNotNull(plan)) {
|
||||||
String code = dictDataService.getDictDataById(plan.getPattern()).getCode();
|
String code = dictDataService.getDictDataById(plan.getPattern()).getCode();
|
||||||
DictDataEnum dictDataEnumByCode = DictDataEnum.getDictDataEnumByCode(code);
|
DictDataEnum dictDataEnumByCode = DictDataEnum.getDictDataEnumByCode(code);
|
||||||
@@ -134,13 +138,10 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
|
|
||||||
private void sendYtxSocket(PreDetectionParam param) {
|
private void sendYtxSocket(PreDetectionParam param) {
|
||||||
WebServiceManager.addPreDetectionParam(param);
|
WebServiceManager.addPreDetectionParam(param);
|
||||||
AdPlan plan = iAdPlanService.getById(param.getPlanId());
|
|
||||||
AdPlanSource planSource = adPlanSourceService.getOne(new LambdaQueryWrapper<AdPlanSource>().eq(AdPlanSource::getPlanId, param.getPlanId()));
|
AdPlanSource planSource = adPlanSourceService.getOne(new LambdaQueryWrapper<AdPlanSource>().eq(AdPlanSource::getPlanId, param.getPlanId()));
|
||||||
param.setSourceId(planSource.getSourceId());
|
param.setSourceId(planSource.getSourceId());
|
||||||
param.setScriptId(plan.getScriptId());
|
|
||||||
param.setErrorSysId(plan.getErrorSysId());
|
|
||||||
param.setCode(String.valueOf(plan.getCode()));
|
|
||||||
if (ObjectUtil.isNotNull(planSource)) {
|
if (ObjectUtil.isNotNull(planSource)) {
|
||||||
|
//获取源初始化参数
|
||||||
SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId());
|
SourceInitialize sourceParam = pqSourceService.getSourceInitializeParam(planSource.getSourceId());
|
||||||
if (ObjectUtil.isNotNull(sourceParam)) {
|
if (ObjectUtil.isNotNull(sourceParam)) {
|
||||||
//开始组装socket报文请求头
|
//开始组装socket报文请求头
|
||||||
@@ -150,6 +151,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_YTXJY.getValue());
|
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_YTXJY.getValue());
|
||||||
socketMsg.setOperateCode(SourceOperateCodeEnum.INIT_GATHER.getValue());
|
socketMsg.setOperateCode(SourceOperateCodeEnum.INIT_GATHER.getValue());
|
||||||
socketMsg.setData(JSON.toJSONString(sourceParam));
|
socketMsg.setData(JSON.toJSONString(sourceParam));
|
||||||
|
//建立与源控程序的socket连接,
|
||||||
NettyClient.socketClient(ip, port, param, JSON.toJSONString(socketMsg), new NettySourceClientHandler(param, sourceResponseService));
|
NettyClient.socketClient(ip, port, param, JSON.toJSONString(socketMsg), new NettySourceClientHandler(param, sourceResponseService));
|
||||||
} else {
|
} else {
|
||||||
throw new BusinessException(DetectionResponseEnum.SOURCE_INFO_NOT);
|
throw new BusinessException(DetectionResponseEnum.SOURCE_INFO_NOT);
|
||||||
@@ -191,7 +193,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
xuMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
xuMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||||
xuMsg.setData(JSON.toJSONString(sourceIssues));
|
xuMsg.setData(JSON.toJSONString(sourceIssues));
|
||||||
xuMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + "&&" + sourceIssues.getType());
|
xuMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + "&&" + sourceIssues.getType());
|
||||||
SocketManager.sendMsg(DetectionCommunicateConstant.SOURCE_CHANNEL_NAME, JSON.toJSONString(xuMsg));
|
SocketManager.sendMsg(param.getUserPageId() + DetectionCommunicateConstant.SOURCE, JSON.toJSONString(xuMsg));
|
||||||
} else {
|
} else {
|
||||||
//TODO 是否最终检测完成需要推送给用户
|
//TODO 是否最终检测完成需要推送给用户
|
||||||
PqScriptCheckDataParam checkDataParam = new PqScriptCheckDataParam();
|
PqScriptCheckDataParam checkDataParam = new PqScriptCheckDataParam();
|
||||||
@@ -219,7 +221,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendScript(SimulateDetectionParam param) {
|
public void sendScript(SimulateDetectionParam param) {
|
||||||
Channel channel = SocketManager.getChannelByUserId(DetectionCommunicateConstant.SOURCE_CHANNEL_NAME);
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
||||||
if (Objects.isNull(channel) || !channel.isActive()) {
|
if (Objects.isNull(channel) || !channel.isActive()) {
|
||||||
// 进行源通信连接
|
// 进行源通信连接
|
||||||
PreDetectionParam preDetectionParam = new PreDetectionParam();
|
PreDetectionParam preDetectionParam = new PreDetectionParam();
|
||||||
@@ -253,7 +255,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeTestSimulate(SimulateDetectionParam param) {
|
public void closeTestSimulate(SimulateDetectionParam param) {
|
||||||
Channel channel = SocketManager.getChannelByUserId(DetectionCommunicateConstant.SOURCE_CHANNEL_NAME);
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
||||||
if (Objects.isNull(channel) || !channel.isActive()) {
|
if (Objects.isNull(channel) || !channel.isActive()) {
|
||||||
throw new BusinessException(DetectionResponseEnum.SOURCE_NOT_CONNECT);
|
throw new BusinessException(DetectionResponseEnum.SOURCE_NOT_CONNECT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 检测通讯工具类
|
* 检测通讯工具类
|
||||||
*
|
*
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -26,8 +25,9 @@ public class DetectionCommunicateUtil {
|
|||||||
* 有则强行关闭
|
* 有则强行关闭
|
||||||
*/
|
*/
|
||||||
public static void checkCommunicateChannel(PreDetectionParam param) {
|
public static void checkCommunicateChannel(PreDetectionParam param) {
|
||||||
Channel channelSource = SocketManager.getChannelByUserId(DetectionCommunicateConstant.SOURCE_CHANNEL_NAME);
|
Channel channelSource = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
||||||
Channel channelDev = SocketManager.getChannelByUserId(DetectionCommunicateConstant.DEVICE_CHANNEL_NAME);
|
Channel channelDev = SocketManager.getChannelByUserId(param.getUserPageId() + DetectionCommunicateConstant.DEV);
|
||||||
|
|
||||||
if (Objects.nonNull(channelSource) && channelSource.isActive()) {
|
if (Objects.nonNull(channelSource) && channelSource.isActive()) {
|
||||||
System.out.println("发送关闭源指令。。。。。。。。");
|
System.out.println("发送关闭源指令。。。。。。。。");
|
||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
@@ -43,8 +43,8 @@ public class DetectionCommunicateUtil {
|
|||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketManager.removeUser(DetectionCommunicateConstant.SOURCE_CHANNEL_NAME);
|
SocketManager.removeUser(param.getUserPageId() + DetectionCommunicateConstant.SOURCE);
|
||||||
SocketManager.removeUser(DetectionCommunicateConstant.DEVICE_CHANNEL_NAME);
|
SocketManager.removeUser(param.getUserPageId() + DetectionCommunicateConstant.DEV);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
@@ -54,5 +54,4 @@ public class DetectionCommunicateUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ public class NettyClient {
|
|||||||
//空闲状态的handler
|
//空闲状态的handler
|
||||||
// 添加LineBasedFrameDecoder来按行分割数据
|
// 添加LineBasedFrameDecoder来按行分割数据
|
||||||
.addLast(new LineBasedFrameDecoder(10240))
|
.addLast(new LineBasedFrameDecoder(10240))
|
||||||
// .addLast(new IdleStateHandler(0, 10, 0, TimeUnit.SECONDS))
|
// .addLast(new IdleStateHandler(0, 10, 0, TimeUnit.SECONDS))
|
||||||
.addLast(new StringDecoder(CharsetUtil.UTF_8))
|
.addLast(new StringDecoder(CharsetUtil.UTF_8))
|
||||||
.addLast(new StringEncoder(CharsetUtil.UTF_8))
|
.addLast(new StringEncoder(CharsetUtil.UTF_8))
|
||||||
.addLast(new HeartbeatHandler(param,source))
|
.addLast(new HeartbeatHandler(param, source))
|
||||||
.addLast(handler);
|
.addLast(handler);
|
||||||
} else {
|
} else {
|
||||||
ch.pipeline()
|
ch.pipeline()
|
||||||
@@ -61,7 +61,7 @@ public class NettyClient {
|
|||||||
.addLast(new LineBasedFrameDecoder(10240))
|
.addLast(new LineBasedFrameDecoder(10240))
|
||||||
.addLast(new StringDecoder(CharsetUtil.UTF_8))
|
.addLast(new StringDecoder(CharsetUtil.UTF_8))
|
||||||
.addLast(new StringEncoder(CharsetUtil.UTF_8))
|
.addLast(new StringEncoder(CharsetUtil.UTF_8))
|
||||||
.addLast(new HeartbeatHandler(param,dev))
|
.addLast(new HeartbeatHandler(param, dev))
|
||||||
//空闲状态的handler
|
//空闲状态的handler
|
||||||
.addLast(new IdleStateHandler(60, 0, 0, TimeUnit.SECONDS))
|
.addLast(new IdleStateHandler(60, 0, 0, TimeUnit.SECONDS))
|
||||||
.addLast(handler);
|
.addLast(handler);
|
||||||
@@ -73,22 +73,28 @@ public class NettyClient {
|
|||||||
channelFuture.addListener((ChannelFutureListener) ch -> {
|
channelFuture.addListener((ChannelFutureListener) ch -> {
|
||||||
if (!ch.isSuccess()) {
|
if (!ch.isSuccess()) {
|
||||||
System.out.println("链接服务端失败...");
|
System.out.println("链接服务端失败...");
|
||||||
|
// 连接失败时关闭 group
|
||||||
|
group.shutdownGracefully();
|
||||||
} else {
|
} else {
|
||||||
System.out.println("链接服务端成功...");
|
System.out.println("链接服务端成功...");
|
||||||
System.out.println("客户端向服务端发送消息:"+port+msg);
|
if (handler instanceof NettySourceClientHandler) {
|
||||||
channelFuture.channel().writeAndFlush(msg+"\n");
|
NioEventLoopGroup groupByUserId = SocketManager.getGroupByUserId(param.getUserPageId() + source);
|
||||||
|
if(ObjectUtil.isNotNull(groupByUserId)){
|
||||||
|
groupByUserId.shutdownGracefully().sync();
|
||||||
|
}
|
||||||
|
SocketManager.addGroup(param.getUserPageId() + source, group);
|
||||||
|
} else {
|
||||||
|
NioEventLoopGroup groupByUserId = SocketManager.getGroupByUserId(param.getUserPageId() + dev);
|
||||||
|
if(ObjectUtil.isNotNull(groupByUserId)){
|
||||||
|
groupByUserId.shutdownGracefully().sync();
|
||||||
|
}
|
||||||
|
SocketManager.addGroup(param.getUserPageId() + dev, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("客户端向服务端发送消息:" + port + msg);
|
||||||
|
channelFuture.channel().writeAndFlush(msg + "\n");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
NioEventLoopGroup groupByUserId = SocketManager.getGroupByUserId(param.getUserPageId() + "_Dev");
|
|
||||||
if(ObjectUtil.isNotNull(groupByUserId)){
|
|
||||||
groupByUserId.shutdownGracefully();
|
|
||||||
}else{
|
|
||||||
if (handler instanceof NettySourceClientHandler) {
|
|
||||||
SocketManager.addGroup(param.getUserPageId()+source,group);
|
|
||||||
}else{
|
|
||||||
SocketManager.addGroup(param.getUserPageId()+dev,group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("连接socket服务端发送异常............" + e.getMessage());
|
System.out.println("连接socket服务端发送异常............" + e.getMessage());
|
||||||
group.shutdownGracefully();
|
group.shutdownGracefully();
|
||||||
@@ -100,7 +106,7 @@ 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 {
|
||||||
CnSocketUtil.quitSendSource(param);
|
CnSocketUtil.quitSendSource(param);
|
||||||
socketDataMsg.setOperateCode("Dev");
|
socketDataMsg.setOperateCode("Dev");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import lombok.Getter;
|
|||||||
public enum DevReportStateEnum {
|
public enum DevReportStateEnum {
|
||||||
NOT_GENERATED("未生成", 0),
|
NOT_GENERATED("未生成", 0),
|
||||||
GENERATED("已生成", 1),
|
GENERATED("已生成", 1),
|
||||||
|
GENERATED_UPLOADED("已生成且已上传", 3),
|
||||||
UNCHECKED("未检", 2);
|
UNCHECKED("未检", 2);
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class ProvinceDevExcel implements Serializable {
|
|||||||
private String sampleId;
|
private String sampleId;
|
||||||
|
|
||||||
@Excel(name = "送样日期(yyyy-MM-dd)", width = 25, format = "yyyy-MM-dd", orderNum = "18")
|
@Excel(name = "送样日期(yyyy-MM-dd)", width = 25, format = "yyyy-MM-dd", orderNum = "18")
|
||||||
private String arrivedDate;
|
private LocalDate arrivedDate;
|
||||||
|
|
||||||
@Excel(name="委托方", width = 40, orderNum = "19")
|
@Excel(name="委托方", width = 40, orderNum = "19")
|
||||||
private String delegate;
|
private String delegate;
|
||||||
|
|||||||
@@ -351,7 +351,6 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
.like(StrUtil.isNotBlank(param.getName()), PqDev::getName, param.getName())
|
.like(StrUtil.isNotBlank(param.getName()), PqDev::getName, param.getName())
|
||||||
.in(ObjectUtil.isNotEmpty(param.getCheckStateList()), PqDev::getCheckState, param.getCheckStateList())
|
.in(ObjectUtil.isNotEmpty(param.getCheckStateList()), PqDev::getCheckState, param.getCheckStateList())
|
||||||
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
||||||
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
|
||||||
.eq(ObjectUtil.isNotNull(param.getReportState()), PqDev::getReportState, param.getReportState())
|
.eq(ObjectUtil.isNotNull(param.getReportState()), PqDev::getReportState, param.getReportState())
|
||||||
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
|
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
|
||||||
.orderByDesc(PqDev::getCreateTime)
|
.orderByDesc(PqDev::getCreateTime)
|
||||||
@@ -757,8 +756,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
queryWrapper
|
queryWrapper
|
||||||
.eq("state", DataStateEnum.ENABLE.getCode())
|
.eq("state", DataStateEnum.ENABLE.getCode())
|
||||||
.eq("Dev_Type", param.getDevType())
|
.eq("Dev_Type", param.getDevType())
|
||||||
.and(q -> q.eq("name", param.getName()).or()
|
.and(q -> q.eq("Create_Id", param.getCreateId())); //设备序列号重复,不管设备类型,原设备类型条件删除
|
||||||
.eq("Create_Id", param.getCreateId())); //设备序列号重复
|
|
||||||
// .eq("pattern", param.getPattern())
|
// .eq("pattern", param.getPattern())
|
||||||
// .eq("manufacturer", param.getManufacturer())
|
// .eq("manufacturer", param.getManufacturer())
|
||||||
// .eq("Dev_Type", param.getDevType()).or()
|
// .eq("Dev_Type", param.getDevType()).or()
|
||||||
|
|||||||
@@ -156,4 +156,15 @@ public class ReportController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/uploadReportToCloud")
|
||||||
|
@ApiOperation("批量上传检测报告到云端")
|
||||||
|
@ApiImplicitParam(name = "deviceIds", value = "被检设备ID列表,为空时上传所有已生成报告的设备", required = false)
|
||||||
|
public HttpResult<Object> uploadReportToCloud(@RequestBody(required = false) List<String> deviceIds) {
|
||||||
|
String methodDescribe = getMethodDescribe("uploadReportToCloud");
|
||||||
|
LogUtil.njcnDebug(log, "{},设备ID列表为:{}", methodDescribe, deviceIds);
|
||||||
|
pqReportService.uploadReportToCloud(deviceIds);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ public enum BaseReportKeyEnum {
|
|||||||
YEAR_MONTH_DAY("year-month-day","年-月-日"),
|
YEAR_MONTH_DAY("year-month-day","年-月-日"),
|
||||||
TEMPERATURE("temp","温度"),
|
TEMPERATURE("temp","温度"),
|
||||||
HUMIDITY("hum","相对湿度"),
|
HUMIDITY("hum","相对湿度"),
|
||||||
DELEGATE("delegate","委托方");
|
DELEGATE("delegate","委托方"),
|
||||||
|
CREATEDATE("createDate","出厂日期"),
|
||||||
|
HW_VERSION("hardwareVersion","硬件版本"),
|
||||||
|
SW_VERSION("softwareVersion","软件版本");
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public enum ItemReportKeyEnum {
|
|||||||
|
|
||||||
NAME("name", "检测项,比如:频率"),
|
NAME("name", "检测项,比如:频率"),
|
||||||
NAME_DETAIL("nameDetail", "检测项详细,比如:频率测量准确度"),
|
NAME_DETAIL("nameDetail", "检测项详细,比如:频率测量准确度"),
|
||||||
|
INFLUENCE("influence", "影响量的描述,比如额定工作条件、谐波对电压的影响等等"),
|
||||||
ERROR_SCOPE("errorScope", "误差范围,注:在段落中时需加上(),表格中无需添加"),
|
ERROR_SCOPE("errorScope", "误差范围,注:在段落中时需加上(),表格中无需添加"),
|
||||||
ERROR_SCOPE_MAG("errorScopeMag", "特征幅值:误差范围"),
|
ERROR_SCOPE_MAG("errorScopeMag", "特征幅值:误差范围"),
|
||||||
ERROR_SCOPE_DUR("errorScopeDur", "持续时间:误差范围"),
|
ERROR_SCOPE_DUR("errorScopeDur", "持续时间:误差范围"),
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ public enum ReportResponseEnum {
|
|||||||
REPORT_TEMPLATE_NOT_EXIST("A012009", "报告模板缺失,请联系管理员!"),
|
REPORT_TEMPLATE_NOT_EXIST("A012009", "报告模板缺失,请联系管理员!"),
|
||||||
NO_CHECK_DATA("A012010", "没有检测数据,无法生成报告!"),
|
NO_CHECK_DATA("A012010", "没有检测数据,无法生成报告!"),
|
||||||
FILE_RENAME_FAILED("A012011", "文件重命名失败"),
|
FILE_RENAME_FAILED("A012011", "文件重命名失败"),
|
||||||
REPORT_NAME_PATTERN_ERROR("A012012","报告名称格式错误,可包含中文、字母、数字、中划线、点号、空格,长度不能超过32个字符"),
|
REPORT_NAME_PATTERN_ERROR("A012012", "报告名称格式错误,可包含中文、字母、数字、中划线、点号、空格,长度不能超过32个字符"),
|
||||||
REPORT_VERSION_PATTERN_ERROR("A012013","报告版本号格式错误,可包含中文、字母、数字、中划线、点号、空格,长度不能超过32个字符"),
|
REPORT_VERSION_PATTERN_ERROR("A012013", "报告版本号格式错误,可包含中文、字母、数字、中划线、点号、空格,长度不能超过32个字符"),
|
||||||
FILE_SIZE_ERROR("A012014","文件大小不能超过5MB" ),
|
FILE_SIZE_ERROR("A012014", "文件大小不能超过5MB"),
|
||||||
GENERATE_REPORT_ERROR("A012015","生成报告失败"),
|
GENERATE_REPORT_ERROR("A012015", "生成报告失败"),
|
||||||
;
|
FTP_CONNECTION_FAILED("A012016", "FTP连接失败,无法将二维码文件上传至装置");
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
private String message;
|
private String message;
|
||||||
|
|||||||
@@ -64,8 +64,10 @@ public interface IPqReportService extends IService<PqReport> {
|
|||||||
|
|
||||||
void generateReport(DevReportParam devReportParam);
|
void generateReport(DevReportParam devReportParam);
|
||||||
|
|
||||||
|
|
||||||
void downloadReport(DevReportParam devReportParam, HttpServletResponse response);
|
void downloadReport(DevReportParam devReportParam, HttpServletResponse response);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备归档操作
|
* 设备归档操作
|
||||||
*
|
*
|
||||||
@@ -73,4 +75,12 @@ public interface IPqReportService extends IService<PqReport> {
|
|||||||
* @return 归档成功返回true,否则返回false
|
* @return 归档成功返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
boolean documented(List<String> id);
|
boolean documented(List<String> id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量上传检测报告到云端
|
||||||
|
*
|
||||||
|
* @param deviceIds 被检设备ID列表,为空时上传所有已生成报告的设备
|
||||||
|
*/
|
||||||
|
void uploadReportToCloud(List<String> deviceIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -92,24 +92,27 @@ public class BookmarkUtil {
|
|||||||
}
|
}
|
||||||
idx = idx + 1;
|
idx = idx + 1;
|
||||||
parentContent.add(idx, p);
|
parentContent.add(idx, p);
|
||||||
} else if (textFromP.startsWith(PowerIndexEnum.IMBV.getDesc())
|
}
|
||||||
|| textFromP.startsWith(PowerIndexEnum.HV.getDesc())
|
// else if (textFromP.startsWith(PowerIndexEnum.IMBV.getDesc())
|
||||||
|| textFromP.startsWith(PowerIndexEnum.HI.getDesc())
|
// || textFromP.startsWith(PowerIndexEnum.HV.getDesc())
|
||||||
|
// || textFromP.startsWith(PowerIndexEnum.HI.getDesc())
|
||||||
) {
|
//
|
||||||
// 另起一页
|
// ) {
|
||||||
P pagePara = Docx4jUtil.getPageBreak();
|
// // 另起一页
|
||||||
idx = idx + 1;
|
// P pagePara = Docx4jUtil.getPageBreak();
|
||||||
parentContent.add(idx, pagePara);
|
// idx = idx + 1;
|
||||||
idx = idx + 1;
|
// parentContent.add(idx, pagePara);
|
||||||
parentContent.add(idx, element);
|
// idx = idx + 1;
|
||||||
}else if(textFromP.startsWith("注:基波电流幅值5.000A,基波频率50.0Hz,各次间谐波电流含有率均为3.0%。")){
|
// parentContent.add(idx, element);
|
||||||
|
// }
|
||||||
|
else if(textFromP.startsWith("注:基波电流幅值5.000A,基波频率50.0Hz,各次间谐波电流含有率均为3.0%。")){
|
||||||
idx = idx + 1;
|
idx = idx + 1;
|
||||||
parentContent.add(idx, element);
|
parentContent.add(idx, element);
|
||||||
P pagePara = Docx4jUtil.getPageBreak();
|
P pagePara = Docx4jUtil.getPageBreak();
|
||||||
idx = idx + 1;
|
idx = idx + 1;
|
||||||
parentContent.add(idx, pagePara);
|
parentContent.add(idx, pagePara);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
idx = idx + 1;
|
idx = idx + 1;
|
||||||
parentContent.add(idx, element);
|
parentContent.add(idx, element);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,17 +322,20 @@ public class Docx4jUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据已知信息创建新航
|
* 根据已知信息创建新行
|
||||||
*
|
*
|
||||||
* @param factory 工厂
|
* @param factory 工厂
|
||||||
* @param valueMap 数据
|
* @param valueMap 数据
|
||||||
* @param tableKeys keys
|
* @param tableKeys keys
|
||||||
* @param trPr 行样式
|
* @param trPr 行样式
|
||||||
* @param tcPr 单元格样式
|
* @param tcPrList 每个单元格的样式列表(用于保留各单元格独立的边框设置)
|
||||||
|
* @param templateRPr 模板中的字体样式(可为null,为null时使用默认宋体10号)
|
||||||
|
* @param centerFlag 是否居中
|
||||||
*/
|
*/
|
||||||
public static Tr createCustomRow(ObjectFactory factory, Map<String, String> valueMap, List<String> tableKeys, TrPr trPr, TcPr tcPr, boolean centerFlag) {
|
public static Tr createCustomRow(ObjectFactory factory, Map<String, String> valueMap, List<String> tableKeys, TrPr trPr, List<TcPr> tcPrList, RPr templateRPr, boolean centerFlag) {
|
||||||
Tr row = factory.createTr();
|
Tr row = factory.createTr();
|
||||||
for (String tableKey : tableKeys) {
|
for (int i = 0; i < tableKeys.size(); i++) {
|
||||||
|
String tableKey = tableKeys.get(i);
|
||||||
Tc cell = factory.createTc();
|
Tc cell = factory.createTc();
|
||||||
P paragraph = factory.createP();
|
P paragraph = factory.createP();
|
||||||
R run = factory.createR();
|
R run = factory.createR();
|
||||||
@@ -341,20 +344,41 @@ public class Docx4jUtil {
|
|||||||
text.setValue(value);
|
text.setValue(value);
|
||||||
run.getContent().add(text);
|
run.getContent().add(text);
|
||||||
paragraph.getContent().add(run);
|
paragraph.getContent().add(run);
|
||||||
// 字体
|
|
||||||
// 设置字体
|
// 从模板复制字体样式
|
||||||
RPr rPr = factory.createRPr();
|
RPr rPr = factory.createRPr();
|
||||||
RFonts rFonts = factory.createRFonts();
|
if (templateRPr != null) {
|
||||||
if (containsChinese(value)) {
|
// 复制字体
|
||||||
|
if (templateRPr.getRFonts() != null) {
|
||||||
|
RFonts rFonts = factory.createRFonts();
|
||||||
|
rFonts.setEastAsia(templateRPr.getRFonts().getEastAsia());
|
||||||
|
rFonts.setAscii(templateRPr.getRFonts().getAscii());
|
||||||
|
rFonts.setHAnsi(templateRPr.getRFonts().getHAnsi());
|
||||||
|
rPr.setRFonts(rFonts);
|
||||||
|
}
|
||||||
|
// 复制字号
|
||||||
|
if (templateRPr.getSz() != null) {
|
||||||
|
HpsMeasure sz = factory.createHpsMeasure();
|
||||||
|
sz.setVal(templateRPr.getSz().getVal());
|
||||||
|
rPr.setSz(sz);
|
||||||
|
}
|
||||||
|
if (templateRPr.getSzCs() != null) {
|
||||||
|
HpsMeasure szCs = factory.createHpsMeasure();
|
||||||
|
szCs.setVal(templateRPr.getSzCs().getVal());
|
||||||
|
rPr.setSzCs(szCs);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 默认使用宋体10号
|
||||||
|
RFonts rFonts = factory.createRFonts();
|
||||||
rFonts.setEastAsia("宋体");
|
rFonts.setEastAsia("宋体");
|
||||||
rFonts.setAscii("宋体");
|
rFonts.setAscii("宋体");
|
||||||
rFonts.setHAnsi("宋体");
|
rFonts.setHAnsi("宋体");
|
||||||
} else {
|
rPr.setRFonts(rFonts);
|
||||||
rFonts.setEastAsia("Arial");
|
HpsMeasure sz = factory.createHpsMeasure();
|
||||||
rFonts.setAscii("Arial");
|
sz.setVal(new BigInteger("20"));
|
||||||
rFonts.setHAnsi("Arial");
|
rPr.setSz(sz);
|
||||||
}
|
}
|
||||||
rPr.setRFonts(rFonts);
|
|
||||||
// 设置段落居中
|
// 设置段落居中
|
||||||
if (centerFlag) {
|
if (centerFlag) {
|
||||||
PPr pPr = factory.createPPr();
|
PPr pPr = factory.createPPr();
|
||||||
@@ -363,20 +387,19 @@ public class Docx4jUtil {
|
|||||||
pPr.setJc(jc);
|
pPr.setJc(jc);
|
||||||
paragraph.setPPr(pPr);
|
paragraph.setPPr(pPr);
|
||||||
}
|
}
|
||||||
if (value.equals("不合格")) {
|
// 不合格标红
|
||||||
|
if (value != null && value.equals("不合格")) {
|
||||||
Color color = factory.createColor();
|
Color color = factory.createColor();
|
||||||
// 红色
|
|
||||||
color.setVal("FF0000");
|
color.setVal("FF0000");
|
||||||
rPr.setColor(color);
|
rPr.setColor(color);
|
||||||
run.setRPr(rPr);
|
|
||||||
}
|
}
|
||||||
HpsMeasure sz = factory.createHpsMeasure();
|
run.setRPr(rPr);
|
||||||
// 10号字体 = 20 half-points
|
|
||||||
sz.setVal(new BigInteger("20"));
|
|
||||||
rPr.setSz(sz);
|
|
||||||
|
|
||||||
cell.getContent().add(paragraph);
|
cell.getContent().add(paragraph);
|
||||||
cell.setTcPr(tcPr);
|
// 使用对应位置的单元格样式(保留边框设置)
|
||||||
|
if (tcPrList != null && i < tcPrList.size()) {
|
||||||
|
cell.setTcPr(tcPrList.get(i));
|
||||||
|
}
|
||||||
row.getContent().add(cell);
|
row.getContent().add(cell);
|
||||||
row.setTrPr(trPr);
|
row.setTrPr(trPr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
|
|||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
||||||
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
import com.njcn.gather.plan.service.IAdPlanService;
|
import com.njcn.gather.plan.service.IAdPlanService;
|
||||||
@@ -54,7 +54,6 @@ import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
|||||||
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
||||||
import com.njcn.gather.system.cfg.service.ISysTestConfigService;
|
|
||||||
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
import com.njcn.gather.system.dictionary.pojo.po.DictData;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||||
@@ -354,7 +353,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
unit = ResultUnitEnum.V_ABSOLUTELY.getUnit();
|
unit = ResultUnitEnum.V_ABSOLUTELY.getUnit();
|
||||||
}
|
}
|
||||||
List<PqScriptDtls> v = scriptDtlIndexList.stream().filter(x -> "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
List<PqScriptDtls> v = scriptDtlIndexList.stream().filter(x -> "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue().intValue() + unit);
|
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue() + unit);
|
||||||
break;
|
break;
|
||||||
/**
|
/**
|
||||||
* 电流
|
* 电流
|
||||||
@@ -368,7 +367,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
|
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
|
||||||
}
|
}
|
||||||
List<PqScriptDtls> I = scriptDtlIndexList.stream().filter(x -> "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
List<PqScriptDtls> I = scriptDtlIndexList.stream().filter(x -> "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + I.get(0).getValue().intValue() + unitI);
|
dtlType.setScriptTypeName(dictTree.getName() + "=" + I.get(0).getValue() + unitI);
|
||||||
break;
|
break;
|
||||||
/**
|
/**
|
||||||
* 谐波电压
|
* 谐波电压
|
||||||
@@ -393,7 +392,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
+ "次" + dictTree.getName()); // + "(含有率为GB/T)"
|
+ "次" + dictTree.getName()); // + "(含有率为GB/T)"
|
||||||
} else {
|
} else {
|
||||||
//叠加5%的2次谐波电压
|
//叠加5%的2次谐波电压
|
||||||
dtlType.setScriptTypeName("叠加" + hv.get(0).getValue().intValue() + ResultUnitEnum.HV.getUnit() + "的" + hv.get(0).getHarmNum().intValue() + "次" + dictTree.getName());
|
dtlType.setScriptTypeName("叠加" + hv.get(0).getValue() + ResultUnitEnum.HV.getUnit() + "的" + hv.get(0).getHarmNum().intValue() + "次" + dictTree.getName());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/**
|
/**
|
||||||
@@ -427,7 +426,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
dtlType.setScriptTypeName(a.toString());
|
dtlType.setScriptTypeName(a.toString());
|
||||||
} else {
|
} else {
|
||||||
//叠加5%的2次谐波电压
|
//叠加5%的2次谐波电压
|
||||||
dtlType.setScriptTypeName("叠加" + harmInNumList.get(0).getValue().intValue() + ResultUnitEnum.HV.getUnit() + "的" + harmInNumList.get(0).getHarmNum() + "次" + dictTree.getName());
|
dtlType.setScriptTypeName("叠加" + harmInNumList.get(0).getValue() + ResultUnitEnum.HV.getUnit() + "的" + harmInNumList.get(0).getHarmNum() + "次" + dictTree.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -484,7 +483,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
PqScriptDtls dtls = harmNumVMap.entrySet().iterator().next().getValue().get(0);
|
PqScriptDtls dtls = harmNumVMap.entrySet().iterator().next().getValue().get(0);
|
||||||
a.append(dtls.getValue().intValue() + ResultUnitEnum.HV.getUnit() + "的" + dtls.getHarmNum().intValue() + ResultUnitEnum.HV.getName());
|
a.append(dtls.getValue() + ResultUnitEnum.HV.getUnit() + "的" + dtls.getHarmNum().intValue() + ResultUnitEnum.HV.getName());
|
||||||
}
|
}
|
||||||
a.append(",");
|
a.append(",");
|
||||||
if (harmNumIMap.size() > 1) {
|
if (harmNumIMap.size() > 1) {
|
||||||
@@ -503,7 +502,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
PqScriptDtls dtls = harmNumIMap.entrySet().iterator().next().getValue().get(0);
|
PqScriptDtls dtls = harmNumIMap.entrySet().iterator().next().getValue().get(0);
|
||||||
a.append(dtls.getValue().intValue() + ResultUnitEnum.HI.getUnit() + "的" + dtls.getHarmNum().intValue() + "次" + ResultUnitEnum.HI.getName());
|
a.append(dtls.getValue() + ResultUnitEnum.HI.getUnit() + "的" + dtls.getHarmNum().intValue() + "次" + ResultUnitEnum.HI.getName());
|
||||||
}
|
}
|
||||||
dtlType.setScriptTypeName(a.toString());
|
dtlType.setScriptTypeName(a.toString());
|
||||||
break;
|
break;
|
||||||
@@ -1133,7 +1132,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (Objects.nonNull(tempA.getErrorData())) {
|
if (Objects.nonNull(tempA.getErrorData())) {
|
||||||
errorA = PubUtils.doubleRoundStr(4, tempA.getErrorData().doubleValue());
|
errorA = PubUtils.doubleRoundStr(4, tempA.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
resultA = tempA.getIsData() == 1 ? "合格" : tempA.getIsData() == 0 ? "不合格" : "/";
|
resultA = tempA.getIsData() == 1 ? "合格" : tempA.getIsData() == 2 ? "不合格" : "/";
|
||||||
errorScope = tempA.getRadius() == null ? "/" : tempA.getRadius();
|
errorScope = tempA.getRadius() == null ? "/" : tempA.getRadius();
|
||||||
unit = tempA.getUnit() == null ? "" : tempA.getUnit();
|
unit = tempA.getUnit() == null ? "" : tempA.getUnit();
|
||||||
standard = PubUtils.doubleRoundStr(4, tempA.getResultData()) == null ? "/" : PubUtils.doubleRoundStr(4, tempA.getResultData());
|
standard = PubUtils.doubleRoundStr(4, tempA.getResultData()) == null ? "/" : PubUtils.doubleRoundStr(4, tempA.getResultData());
|
||||||
@@ -1144,7 +1143,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (Objects.nonNull(tempB.getErrorData())) {
|
if (Objects.nonNull(tempB.getErrorData())) {
|
||||||
errorB = PubUtils.doubleRoundStr(4, tempB.getErrorData().doubleValue());
|
errorB = PubUtils.doubleRoundStr(4, tempB.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
resultB = tempB.getIsData() == 1 ? "合格" : tempB.getIsData() == 0 ? "不合格" : "/";
|
resultB = tempB.getIsData() == 1 ? "合格" : tempB.getIsData() == 2 ? "不合格" : "/";
|
||||||
if (errorScope.equals("/")) {
|
if (errorScope.equals("/")) {
|
||||||
errorScope = tempB.getRadius() == null ? "/" : tempB.getRadius();
|
errorScope = tempB.getRadius() == null ? "/" : tempB.getRadius();
|
||||||
}
|
}
|
||||||
@@ -1161,7 +1160,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (Objects.nonNull(tempC.getErrorData())) {
|
if (Objects.nonNull(tempC.getErrorData())) {
|
||||||
errorC = PubUtils.doubleRoundStr(4, tempC.getErrorData().doubleValue());
|
errorC = PubUtils.doubleRoundStr(4, tempC.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
resultC = tempC.getIsData() == 1 ? "合格" : tempC.getIsData() == 0 ? "不合格" : "/";
|
resultC = tempC.getIsData() == 1 ? "合格" : tempC.getIsData() == 2 ? "不合格" : "/";
|
||||||
if (errorScope.equals("/")) {
|
if (errorScope.equals("/")) {
|
||||||
errorScope = tempC.getRadius() == null ? "/" : tempC.getRadius();
|
errorScope = tempC.getRadius() == null ? "/" : tempC.getRadius();
|
||||||
}
|
}
|
||||||
@@ -1172,6 +1171,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
standard = PubUtils.doubleRoundStr(4, tempC.getResultData()) == null ? "/" : PubUtils.doubleRoundStr(4, tempC.getResultData());
|
standard = PubUtils.doubleRoundStr(4, tempC.getResultData()) == null ? "/" : PubUtils.doubleRoundStr(4, tempC.getResultData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 浙江脚本特殊处理
|
||||||
if (scriptCode.equalsIgnoreCase("I")) {
|
if (scriptCode.equalsIgnoreCase("I")) {
|
||||||
resultA = "/";
|
resultA = "/";
|
||||||
resultB = "/";
|
resultB = "/";
|
||||||
@@ -1267,7 +1267,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (Objects.nonNull(tempT.getErrorData())) {
|
if (Objects.nonNull(tempT.getErrorData())) {
|
||||||
error = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
error = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
result = tempT.getIsData() == 1 ? "合格" : tempT.getIsData() == 0 ? "不合格" : "/";
|
result = tempT.getIsData() == 1 ? "合格" : tempT.getIsData() == 2 ? "不合格" : "/";
|
||||||
unit = tempT.getUnit() == null ? "" : tempT.getUnit();
|
unit = tempT.getUnit() == null ? "" : tempT.getUnit();
|
||||||
errorScope = tempT.getRadius() == null ? "/" : tempT.getRadius();
|
errorScope = tempT.getRadius() == null ? "/" : tempT.getRadius();
|
||||||
}
|
}
|
||||||
@@ -1306,7 +1306,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
if (Objects.nonNull(tempT.getErrorData())) {
|
if (Objects.nonNull(tempT.getErrorData())) {
|
||||||
errorMag = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
errorMag = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
resultMag = tempT.getIsData() == 1 ? "合格" : tempT.getIsData() == 0 ? "不合格" : "/";
|
resultMag = tempT.getIsData() == 1 ? "合格" : tempT.getIsData() == 2 ? "不合格" : "/";
|
||||||
unitMag = tempT.getUnit();
|
unitMag = tempT.getUnit();
|
||||||
errorScopeMag = tempT.getRadius();
|
errorScopeMag = tempT.getRadius();
|
||||||
}
|
}
|
||||||
@@ -1314,7 +1314,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
// 持续时间,需要注意时间单位处理,默认是秒
|
// 持续时间,需要注意时间单位处理,默认是秒
|
||||||
String timeUnit = "s";
|
String timeUnit = "s";
|
||||||
for (String tableKey : tableKeys) {
|
for (String tableKey : tableKeys) {
|
||||||
if (tableKey.contains(ItemReportKeyEnum.STANDARD_DUR.getKey())) {
|
if (tableKey.contains("standardDur")) {
|
||||||
//截取单位
|
//截取单位
|
||||||
String[] tempStr = tableKey.split(StrPool.UNDERLINE);
|
String[] tempStr = tableKey.split(StrPool.UNDERLINE);
|
||||||
if (tempStr.length > 1) {
|
if (tempStr.length > 1) {
|
||||||
@@ -1322,6 +1322,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
timeUnit = "ms";
|
timeUnit = "ms";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(tempT.getResultData())) {
|
if (Objects.nonNull(tempT.getResultData())) {
|
||||||
@@ -1331,7 +1332,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
testDur = PubUtils.doubleRoundStr(4, tempT.getData());
|
testDur = PubUtils.doubleRoundStr(4, tempT.getData());
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(tempT.getErrorData())) {
|
if (Objects.nonNull(tempT.getErrorData())) {
|
||||||
testDur = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
errorDur = PubUtils.doubleRoundStr(4, tempT.getErrorData().doubleValue());
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(tempT.getIsData())) {
|
if (Objects.nonNull(tempT.getIsData())) {
|
||||||
resultDur = tempT.getIsData() == 1 ? "合格" : "不合格";
|
resultDur = tempT.getIsData() == 1 ? "合格" : "不合格";
|
||||||
@@ -1363,8 +1364,8 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errorScopeMag = dealErrorScope(errorScopeMag).concat(unitMag);
|
errorScopeMag = dealErrorScope(errorScopeMag).concat(StrUtil.isBlank(unitMag) ? "" : unitMag);
|
||||||
errorScopeDur = dealErrorScope(errorScopeDur).concat(unitDur);
|
errorScopeDur = dealErrorScope(errorScopeDur).concat(StrUtil.isBlank(unitDur) ? "" : unitDur);
|
||||||
|
|
||||||
errorScope = "特征幅值:".concat(errorScopeMag).concat(StrPool.COMMA).concat("持续时间:").concat(errorScopeDur);
|
errorScope = "特征幅值:".concat(errorScopeMag).concat(StrPool.COMMA).concat("持续时间:").concat(errorScopeDur);
|
||||||
keyFillMap.put(ItemReportKeyEnum.ERROR_SCOPE.getKey(), errorScope);
|
keyFillMap.put(ItemReportKeyEnum.ERROR_SCOPE.getKey(), errorScope);
|
||||||
@@ -1398,6 +1399,9 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
* @param errorScope 误差范围
|
* @param errorScope 误差范围
|
||||||
*/
|
*/
|
||||||
private String dealErrorScope(String errorScope) {
|
private String dealErrorScope(String errorScope) {
|
||||||
|
if (StrUtil.isBlank(errorScope)) {
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
if (errorScope.contains("~")) {
|
if (errorScope.contains("~")) {
|
||||||
String[] split = errorScope.split("~");
|
String[] split = errorScope.split("~");
|
||||||
String begin = split[0];
|
String begin = split[0];
|
||||||
@@ -1533,7 +1537,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
}
|
}
|
||||||
String sql1 = "CREATE TABLE if not exists AD_Harmonic_Result_" + code + "(\n" +
|
String sql1 = "CREATE TABLE if not exists AD_Harmonic_Result_" + code + "(\n" +
|
||||||
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
||||||
" Time_Id DATETIME NULL COMMENT '时间',\n" +
|
" Time_Id DATETIME(3) NULL COMMENT '时间',\n" +
|
||||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
||||||
" Sort int(5) NOT NULL COMMENT '总检测脚本中的测试项序号',\n" +
|
" Sort int(5) NOT NULL COMMENT '总检测脚本中的测试项序号',\n" +
|
||||||
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
||||||
@@ -1607,7 +1611,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
|
|
||||||
issueParam.setDevIds(Arrays.asList(devId));
|
issueParam.setDevIds(Arrays.asList(devId));
|
||||||
issueParam.setScriptId(scriptId);
|
issueParam.setScriptId(scriptId);
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam);
|
||||||
|
|
||||||
sourceIssues.forEach(sourceIssue -> {
|
sourceIssues.forEach(sourceIssue -> {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ 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.device.pojo.enums.CommonEnum;
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.pojo.po.PqDev;
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
|
import com.njcn.gather.device.pojo.vo.PqDevVO;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
import com.njcn.gather.plan.mapper.AdPlanMapper;
|
import com.njcn.gather.plan.mapper.AdPlanMapper;
|
||||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||||
@@ -706,7 +707,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
issueParam.setSourceId(param.getSourceId());
|
issueParam.setSourceId(param.getSourceId());
|
||||||
issueParam.setDevIds(param.getDevIds());
|
issueParam.setDevIds(param.getDevIds());
|
||||||
issueParam.setScriptId(param.getScriptId());
|
issueParam.setScriptId(param.getScriptId());
|
||||||
issueParam.setIsPhaseSequence(SourceOperateCodeEnum.FORMAL_TEST.getValue());
|
issueParam.setIsPhaseSequence(CommonEnum.FORMAL_TEST.getValue());
|
||||||
List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam);
|
List<SourceIssue> sourceIssues = this.listSourceIssue(issueParam);
|
||||||
|
|
||||||
Set<String> dataTypeSet = new HashSet<>();
|
Set<String> dataTypeSet = new HashSet<>();
|
||||||
@@ -886,6 +887,22 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
queryWrapper.eq(PqScriptDtls::getScriptIndex, -1)
|
queryWrapper.eq(PqScriptDtls::getScriptIndex, -1)
|
||||||
.eq(PqScriptDtls::getEnable, 1);
|
.eq(PqScriptDtls::getEnable, 1);
|
||||||
pqScriptDtls = this.list(queryWrapper);
|
pqScriptDtls = this.list(queryWrapper);
|
||||||
|
// 相序校验中电流需加量需要依据企标10650.2中章节5.5.3的描述过载能力:2 倍额定电流连续,10 倍额定电流持续 1 s。
|
||||||
|
// 考虑到有可能存在1A的额定电流,本处做特殊处理,加量分别为额定电流的0.2/0.4/0.6的标幺乘积加量
|
||||||
|
// 电压暂不做处理,原因:1、电压的企标描述过载能力为4倍,空间较大;2、额定电压比如57.74V为浮点数,存在不确定小数位,避免引起算术误差;
|
||||||
|
// 1. 获取额定电流,前端已做限制,相同额定电流才能一起检测
|
||||||
|
String deviceId = param.getDevIds().get(0);
|
||||||
|
PqDevVO pqDev = pqDevService.getPqDevById(deviceId);
|
||||||
|
String devTypeId = pqDev.getDevType();
|
||||||
|
DevType devType = devTypeService.getById(devTypeId);
|
||||||
|
Double devCurr = devType.getDevCurr();
|
||||||
|
for (int i = 0; i < pqScriptDtls.size(); i++) {
|
||||||
|
PqScriptDtls scriptDtls = pqScriptDtls.get(i);
|
||||||
|
// 注意此处scriptDtls.getValue() < 1.0,考虑到有些已经投入运行的地方,可能没有改库,避免不必要的异常
|
||||||
|
if(scriptDtls.getValueType().equalsIgnoreCase("CUR") && scriptDtls.getValue() < 1.0){
|
||||||
|
scriptDtls.setValue(devCurr * scriptDtls.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (param.getIsPhaseSequence().equals(CommonEnum.COEFFICIENT_TEST.getValue())) {
|
} else if (param.getIsPhaseSequence().equals(CommonEnum.COEFFICIENT_TEST.getValue())) {
|
||||||
//系数
|
//系数
|
||||||
queryWrapper.in(PqScriptDtls::getScriptIndex, param.getIndexList())
|
queryWrapper.in(PqScriptDtls::getScriptIndex, param.getIndexList())
|
||||||
@@ -1015,11 +1032,12 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
PqScriptDtls dip = dipList.get(0);
|
PqScriptDtls dip = dipList.get(0);
|
||||||
dipDataDTO.setFTransValue(dip.getTransValue());
|
dipDataDTO.setFTransValue(dip.getTransValue());
|
||||||
if (devFly) {
|
if (devFly) {
|
||||||
if (isValueType) {
|
// if (isValueType) {
|
||||||
dipDataDTO.setFTransValue(dip.getTransValue());
|
dipDataDTO.setFTransValue(dip.getTransValue());
|
||||||
} else {
|
// }
|
||||||
dipDataDTO.setFTransValue(NumberUtil.round(dip.getTransValue() / dtls.getValue(), 4).doubleValue());
|
// else {
|
||||||
}
|
// dipDataDTO.setFTransValue(NumberUtil.round(dip.getTransValue() / dtls.getValue(), 4).doubleValue());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// 1.0/频率*持续时间(周波)= 暂态持续时间(s)
|
// 1.0/频率*持续时间(周波)= 暂态持续时间(s)
|
||||||
dipDataDTO.setFRetainTime(NumberUtil.round(1.0 / fFreq * dip.getRetainTime(), 3).doubleValue());
|
dipDataDTO.setFRetainTime(NumberUtil.round(1.0 / fFreq * dip.getRetainTime(), 3).doubleValue());
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class ScriptDtlsDesc {
|
|||||||
buffer.append(name + " ");
|
buffer.append(name + " ");
|
||||||
for (PqScriptDtls dtls : list) {
|
for (PqScriptDtls dtls : list) {
|
||||||
buffer.append(dtls.getPhase() + "相(暂态深度=" + dtls.getTransValue() + ResultUnitEnum.VOLTAGE_DUR_UNIT.getUnit()
|
buffer.append(dtls.getPhase() + "相(暂态深度=" + dtls.getTransValue() + ResultUnitEnum.VOLTAGE_DUR_UNIT.getUnit()
|
||||||
+ ",暂态持续时间=" + (ObjectUtil.isNull(dtls.getRetainTime()) ? dtls.getRetainTime() : dtls.getRetainTime().intValue()) + ResultUnitEnum.VOLTAGE_MAG_UNIT.getUnit() + ") ");
|
+ ",暂态持续时间=" + (ObjectUtil.isNull(dtls.getRetainTime()) ? "/" : dtls.getRetainTime().toString()) + ResultUnitEnum.VOLTAGE_MAG_UNIT.getUnit() + ") ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.1.24:13306/pqs91003?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT
|
url: jdbc:mysql://192.168.1.24:13306/pqs9100_bj?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
|
||||||
@@ -49,10 +49,10 @@ phaseAngle:
|
|||||||
|
|
||||||
socket:
|
socket:
|
||||||
source:
|
source:
|
||||||
ip: 192.168.1.138
|
ip: 192.168.1.125
|
||||||
port: 62000
|
port: 62000
|
||||||
device:
|
device:
|
||||||
ip: 192.168.1.138
|
ip: 192.168.1.125
|
||||||
port: 61000
|
port: 61000
|
||||||
# source:
|
# source:
|
||||||
# ip: 192.168.1.121
|
# ip: 192.168.1.121
|
||||||
@@ -77,8 +77,8 @@ Dip:
|
|||||||
|
|
||||||
|
|
||||||
Flicker:
|
Flicker:
|
||||||
waveFluType: SQU
|
waveFluType: CPM
|
||||||
waveType: CPM
|
waveType: SQU
|
||||||
fDutyCycle: 50f
|
fDutyCycle: 50f
|
||||||
|
|
||||||
log:
|
log:
|
||||||
@@ -87,4 +87,19 @@ log:
|
|||||||
report:
|
report:
|
||||||
template: D:\template
|
template: D:\template
|
||||||
reportDir: D:\report
|
reportDir: D:\report
|
||||||
|
dateFormat: yyyy年MM月dd日
|
||||||
|
qr:
|
||||||
|
cloud: http://pqmcc.com:18082/api/file
|
||||||
|
dev:
|
||||||
|
name: njcn
|
||||||
|
password: Pqs@12345678
|
||||||
|
port: 21
|
||||||
|
path: /etc/qrc.bin
|
||||||
|
gcDev:
|
||||||
|
name: root
|
||||||
|
password: Pqs@12345678
|
||||||
|
port: 21
|
||||||
|
path: /emmc/qrc.bin
|
||||||
|
|
||||||
|
db:
|
||||||
|
type: mysql
|
||||||
BIN
entrance/src/main/resources/model/NPQS-580.docx
Normal file
BIN
entrance/src/main/resources/model/NPQS-580.docx
Normal file
Binary file not shown.
BIN
entrance/src/main/resources/model/NPQS680.docx
Normal file
BIN
entrance/src/main/resources/model/NPQS680.docx
Normal file
Binary file not shown.
BIN
entrance/src/main/resources/model/PQ-COM.docx
Normal file
BIN
entrance/src/main/resources/model/PQ-COM.docx
Normal file
Binary file not shown.
BIN
entrance/src/main/resources/model/PQV-700.docx
Normal file
BIN
entrance/src/main/resources/model/PQV-700.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
entrance/src/main/resources/model/report_table - PQ-COM.docx
Normal file
BIN
entrance/src/main/resources/model/report_table - PQ-COM.docx
Normal file
Binary file not shown.
Binary file not shown.
@@ -3,13 +3,18 @@ package com.njcn;
|
|||||||
import com.njcn.gather.EntranceApplication;
|
import com.njcn.gather.EntranceApplication;
|
||||||
import com.njcn.gather.report.pojo.DevReportParam;
|
import com.njcn.gather.report.pojo.DevReportParam;
|
||||||
import com.njcn.gather.report.service.IPqReportService;
|
import com.njcn.gather.report.service.IPqReportService;
|
||||||
|
import com.njcn.http.util.RestTemplateUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
import org.springframework.test.context.web.WebAppConfiguration;
|
import org.springframework.test.context.web.WebAppConfiguration;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -24,14 +29,18 @@ public class BaseJunitTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPqReportService pqReportService;
|
private IPqReportService pqReportService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RestTemplateUtil restTemplateUtil;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
DevReportParam devReportParam = new DevReportParam();
|
File file = new File("D:\\report\\PQS_882B4\\5555.docx");
|
||||||
devReportParam.setPlanId("ad3df9e4a90b4c3c8ce7d21a84ce6f59");
|
|
||||||
devReportParam.setPlanCode("31");
|
try{
|
||||||
devReportParam.setScriptId("810e4050e1d445e3542c998a077a263a");
|
ResponseEntity<String> stringResponseEntity = restTemplateUtil.uploadFile("http://localhost:18082/api/file/upload",file);
|
||||||
devReportParam.setDevId("a46349a3b3cf4789a6b82690a6076afd");
|
}catch (Exception runtimeException){
|
||||||
pqReportService.generateReport(devReportParam);
|
System.out.println(runtimeException.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
33
event_smart/.gitignore
vendored
Normal file
33
event_smart/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
166
event_smart/pom.xml
Normal file
166
event_smart/pom.xml
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.njcn.gather</groupId>
|
||||||
|
<artifactId>CN_Gather</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>event_smart</artifactId>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>njcn-common</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>rocket-mq-springboot-starter</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
<version>2.7.12</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 多数据源切换,当数据源为oracle时需要使用 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
|
<version>3.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>spingboot2.3.12</artifactId>
|
||||||
|
<version>2.3.12</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>mybatis-plus</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--oracle驱动-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc8</artifactId>
|
||||||
|
<version>21.6.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.nls</groupId>
|
||||||
|
<artifactId>orai18n</artifactId>
|
||||||
|
<version>21.1.0.0</version> <!-- 版本号需要与你的ojdbc版本匹配 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JWT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-event</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>common-microservice</artifactId>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>common-web</artifactId>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>32.1.3-jre</version> <!-- 使用最新稳定版 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>event_smart</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.gather.event;
|
||||||
|
|
||||||
|
import com.njcn.event.file.component.WavePicComponent;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.FilterType;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||||
|
//@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = WavePicComponent.class))
|
||||||
|
@MapperScan("com.njcn.**.mapper")
|
||||||
|
public class EventSmartApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(EventSmartApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.gather.event.devcie.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqDeviceMapper extends BaseMapper<PqDevice> {
|
||||||
|
List<DeviceDTO> queryListByIds(@Param("ids") List<Integer> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.gather.event.devcie.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:43【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqLineMapper extends BaseMapper<PqLine> {
|
||||||
|
|
||||||
|
List<LedgerBaseInfoDTO> getBaseLineInfo(@Param("ids")List<Integer> ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.gather.event.devcie.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLinedetail;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PqLinedetailMapper extends BaseMapper<PqLinedetail> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.gather.event.devcie.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:48【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqSubstationMapper extends BaseMapper<PqSubstation> {
|
||||||
|
List<SubstationDTO> queryListByIds(@Param("ids")List<Integer> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.devcie.mapper.PqDeviceMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqDevice">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQ_DEVICE-->
|
||||||
|
<id column="DEV_INDEX" jdbcType="DECIMAL" property="devIndex" />
|
||||||
|
<result column="GD_INDEX" jdbcType="DECIMAL" property="gdIndex" />
|
||||||
|
<result column="SUB_INDEX" jdbcType="DECIMAL" property="subIndex" />
|
||||||
|
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="STATUS" jdbcType="DECIMAL" property="status" />
|
||||||
|
<result column="DEVTYPE" jdbcType="VARCHAR" property="devtype" />
|
||||||
|
<result column="LOGONTIME" jdbcType="TIMESTAMP" property="logontime" />
|
||||||
|
<result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
|
||||||
|
<result column="NODE_INDEX" jdbcType="DECIMAL" property="nodeIndex" />
|
||||||
|
<result column="PORTID" jdbcType="DECIMAL" property="portid" />
|
||||||
|
<result column="DEVFLAG" jdbcType="DECIMAL" property="devflag" />
|
||||||
|
<result column="DEV_SERIES" jdbcType="VARCHAR" property="devSeries" />
|
||||||
|
<result column="DEV_KEY" jdbcType="VARCHAR" property="devKey" />
|
||||||
|
<result column="IP" jdbcType="VARCHAR" property="ip" />
|
||||||
|
<result column="DEVMODEL" jdbcType="DECIMAL" property="devmodel" />
|
||||||
|
<result column="CALLFLAG" jdbcType="DECIMAL" property="callflag" />
|
||||||
|
<result column="DATATYPE" jdbcType="DECIMAL" property="datatype" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
DEV_INDEX, GD_INDEX, SUB_INDEX, "NAME", "STATUS", DEVTYPE, LOGONTIME, UPDATETIME,
|
||||||
|
NODE_INDEX, PORTID, DEVFLAG, DEV_SERIES, DEV_KEY, IP, DEVMODEL, CALLFLAG, DATATYPE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="queryListByIds" resultType="com.njcn.gather.event.devcie.pojo.dto.DeviceDTO">
|
||||||
|
select
|
||||||
|
pq_device.dev_index devId,
|
||||||
|
pq_device.name devName,
|
||||||
|
pq_device.UpdateTime updateTime,
|
||||||
|
pq_device.DevFlag devFlag,
|
||||||
|
pq_device.IP ip,
|
||||||
|
PQ_SUBSTATION.sub_index stationId,
|
||||||
|
PQ_SUBSTATION.name stationName,
|
||||||
|
PQ_GDINFORMATION.Name gdName
|
||||||
|
from
|
||||||
|
pq_device,
|
||||||
|
PQ_SUBSTATION,
|
||||||
|
PQ_GDINFORMATION
|
||||||
|
where
|
||||||
|
pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
|
||||||
|
and pq_device.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
|
||||||
|
and pq_device.DEV_INDEX in
|
||||||
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.devcie.mapper.PqLineMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqLine">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQ_LINE-->
|
||||||
|
<id column="LINE_INDEX" jdbcType="DECIMAL" property="lineIndex" />
|
||||||
|
<result column="GD_INDEX" jdbcType="DECIMAL" property="gdIndex" />
|
||||||
|
<result column="SUB_INDEX" jdbcType="DECIMAL" property="subIndex" />
|
||||||
|
<result column="SUBV_INDEX" jdbcType="DECIMAL" property="subvIndex" />
|
||||||
|
<result column="DEV_INDEX" jdbcType="DECIMAL" property="devIndex" />
|
||||||
|
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="PT1" jdbcType="FLOAT" property="pt1" />
|
||||||
|
<result column="PT2" jdbcType="FLOAT" property="pt2" />
|
||||||
|
<result column="CT1" jdbcType="FLOAT" property="ct1" />
|
||||||
|
<result column="CT2" jdbcType="FLOAT" property="ct2" />
|
||||||
|
<result column="DEVCMP" jdbcType="FLOAT" property="devcmp" />
|
||||||
|
<result column="DLCMP" jdbcType="FLOAT" property="dlcmp" />
|
||||||
|
<result column="JZCMP" jdbcType="FLOAT" property="jzcmp" />
|
||||||
|
<result column="XYCMP" jdbcType="FLOAT" property="xycmp" />
|
||||||
|
<result column="SUBV_NO" jdbcType="DECIMAL" property="subvNo" />
|
||||||
|
<result column="SCALE" jdbcType="VARCHAR" property="scale" />
|
||||||
|
<result column="SUBV_NAME" jdbcType="VARCHAR" property="subvName" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
LINE_INDEX, GD_INDEX, SUB_INDEX, SUBV_INDEX, DEV_INDEX, "NAME", PT1, PT2, CT1, CT2,
|
||||||
|
DEVCMP, DLCMP, JZCMP, XYCMP, SUBV_NO, "SCALE", SUBV_NAME
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getBaseLineInfo" resultType="com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO">
|
||||||
|
select
|
||||||
|
pq_line.line_index lineId,
|
||||||
|
pq_line.name lineName,
|
||||||
|
PQ_LINEDETAIL.objname objName,
|
||||||
|
PQ_SUBVOLTAGE.SUBV_INDEX busBarId,
|
||||||
|
PQ_SUBVOLTAGE.name busBarName,
|
||||||
|
pq_device.dev_index devId,
|
||||||
|
pq_device.name devName,
|
||||||
|
pq_device.Status runFlag,
|
||||||
|
PQ_SUBSTATION.sub_index stationId,
|
||||||
|
PQ_SUBSTATION.name stationName
|
||||||
|
from
|
||||||
|
pq_line,
|
||||||
|
PQ_LINEDETAIL,
|
||||||
|
PQ_SUBVOLTAGE,
|
||||||
|
pq_device,
|
||||||
|
PQ_SUBSTATION
|
||||||
|
where pq_line.line_index = PQ_LINEDETAIL.line_index
|
||||||
|
and pq_line.SUBV_INDEX = PQ_SUBVOLTAGE.SUBV_INDEX
|
||||||
|
and PQ_SUBVOLTAGE.DEV_INDEX = pq_device.DEV_INDEX
|
||||||
|
and pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
|
||||||
|
and pq_line.line_index in
|
||||||
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.devcie.mapper.PqSubstationMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqSubstation">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQ_SUBSTATION-->
|
||||||
|
<id column="SUB_INDEX" jdbcType="DECIMAL" property="subIndex" />
|
||||||
|
<result column="GD_INDEX" jdbcType="DECIMAL" property="gdIndex" />
|
||||||
|
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="SCALE" jdbcType="VARCHAR" property="scale" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
SUB_INDEX, GD_INDEX, "NAME", "SCALE"
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="queryListByIds" resultType="com.njcn.gather.event.devcie.pojo.dto.SubstationDTO">
|
||||||
|
select
|
||||||
|
PQ_SUBSTATION.sub_index stationId,
|
||||||
|
PQ_SUBSTATION.name stationName,
|
||||||
|
PQ_GDINFORMATION.Name gdName
|
||||||
|
from
|
||||||
|
PQ_SUBSTATION,
|
||||||
|
PQ_GDINFORMATION
|
||||||
|
where
|
||||||
|
PQ_SUBSTATION.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
|
||||||
|
and PQ_SUBSTATION.SUB_INDEX in
|
||||||
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/27 下午 3:25【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeviceDTO {
|
||||||
|
private Integer devId;
|
||||||
|
private String devName;
|
||||||
|
private Integer stationId;
|
||||||
|
private String stationName;
|
||||||
|
private String gdName;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
private String devFlag;
|
||||||
|
private String ip;
|
||||||
|
//通讯状态
|
||||||
|
private Integer runFlag=0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-25
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class LedgerBaseInfoDTO {
|
||||||
|
|
||||||
|
private Integer lineId;
|
||||||
|
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
private Integer busBarId;
|
||||||
|
|
||||||
|
private String busBarName;
|
||||||
|
|
||||||
|
private Integer devId;
|
||||||
|
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
private Integer stationId;
|
||||||
|
|
||||||
|
private String stationName;
|
||||||
|
//通讯状态
|
||||||
|
private Integer runFlag=0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/27 下午 3:37【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SubstationDTO {
|
||||||
|
|
||||||
|
private Integer stationId;
|
||||||
|
private String stationName;
|
||||||
|
private String gdName;
|
||||||
|
private Integer runFlag=0;;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQ_DEVICE")
|
||||||
|
public class PqDevice {
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableId(value = "DEV_INDEX", type = IdType.INPUT)
|
||||||
|
private Integer devIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "GD_INDEX")
|
||||||
|
private Integer gdIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "SUB_INDEX")
|
||||||
|
private Integer subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"NAME\"")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠(0:靠;1:靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"STATUS\"")
|
||||||
|
private Short status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (靠縋QS_Dicdata)靠靠Guid
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEVTYPE")
|
||||||
|
private String devtype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "LOGONTIME")
|
||||||
|
private LocalDateTime logontime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "UPDATETIME")
|
||||||
|
private LocalDateTime updatetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠縉odeInformation)靠靠靠,靠靠靠靠靠靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "NODE_INDEX")
|
||||||
|
private Integer nodeIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠ID,靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "PORTID")
|
||||||
|
private Long portid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠(0:靠;1:靠;2:靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEVFLAG")
|
||||||
|
private Short devflag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠?靠3ds靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEV_SERIES")
|
||||||
|
private String devSeries;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠,靠3ds靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEV_KEY")
|
||||||
|
private String devKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "IP")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠(0:靠靠;1:靠靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEVMODEL")
|
||||||
|
private Short devmodel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "CALLFLAG")
|
||||||
|
private Short callflag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠(0:靠靠;1:靠靠;2:靠靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "DATATYPE")
|
||||||
|
private Short datatype;
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:43【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQ_LINE")
|
||||||
|
public class PqLine {
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableId(value = "LINE_INDEX", type = IdType.INPUT)
|
||||||
|
private Integer lineIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "GD_INDEX")
|
||||||
|
private Integer gdIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "SUB_INDEX")
|
||||||
|
private Integer subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "SUBV_INDEX")
|
||||||
|
private Integer subvIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEV_INDEX")
|
||||||
|
private Integer devIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"NAME\"")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "PT1")
|
||||||
|
private Double pt1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "PT2")
|
||||||
|
private Double pt2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "CT1")
|
||||||
|
private Double ct1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "CT2")
|
||||||
|
private Double ct2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEVCMP")
|
||||||
|
private Double devcmp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "DLCMP")
|
||||||
|
private Double dlcmp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "JZCMP")
|
||||||
|
private Double jzcmp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "XYCMP")
|
||||||
|
private Double xycmp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠?靠靠靠靠靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "SUBV_NO")
|
||||||
|
private Short subvNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (靠PQS_Dictionary?靠靠Guid
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"SCALE\"")
|
||||||
|
private String scale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "SUBV_NAME")
|
||||||
|
private String subvName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.po;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("PQ_LINEDETAIL")
|
||||||
|
public class PqLinedetail {
|
||||||
|
|
||||||
|
@TableId(value = "LINE_INDEX", type = IdType.INPUT)
|
||||||
|
private Integer lineIndex;
|
||||||
|
|
||||||
|
private Integer gdIndex;
|
||||||
|
|
||||||
|
private Integer subIndex;
|
||||||
|
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
private Integer pttype;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date lastTime;
|
||||||
|
|
||||||
|
private Integer tinterval;
|
||||||
|
|
||||||
|
private String loadtype;
|
||||||
|
|
||||||
|
private String businesstype;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
private Integer powerid;
|
||||||
|
|
||||||
|
private String objname;
|
||||||
|
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Integer statflag;
|
||||||
|
|
||||||
|
private String lineGrade;
|
||||||
|
|
||||||
|
private String powerSubstationName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:48【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQ_SUBSTATION")
|
||||||
|
public class PqSubstation {
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@TableId(value = "SUB_INDEX", type = IdType.INPUT)
|
||||||
|
private Integer subIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "GD_INDEX")
|
||||||
|
private Integer gdIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"NAME\"")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@TableField(value = "\"SCALE\"")
|
||||||
|
private String scale;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.gather.event.devcie.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQS_DEPTSLINE")
|
||||||
|
public class PqsDeptsline {
|
||||||
|
/**
|
||||||
|
* 部门表Guid
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEPTS_INDEX")
|
||||||
|
private String deptsIndex;
|
||||||
|
|
||||||
|
@TableField(value = "LINE_INDEX")
|
||||||
|
private Integer lineIndex;
|
||||||
|
|
||||||
|
@TableField(value = "SYSTYPE")
|
||||||
|
private String systype;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqDeviceService extends IService<PqDevice>{
|
||||||
|
|
||||||
|
List<DeviceDTO> queryListByIds(List<Integer> lineIds);
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:43【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqLineService extends IService<PqLine>{
|
||||||
|
|
||||||
|
|
||||||
|
List<LedgerBaseInfoDTO> getBaseLineInfo(List<Integer> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:48【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqSubstationService extends IService<PqSubstation>{
|
||||||
|
|
||||||
|
List<SubstationDTO> queryListByIds(List<Integer> lineIds);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqsDeptslineService extends IService<PqsDeptsline>{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqDeviceMapper;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqDeviceService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqDeviceServiceImpl extends ServiceImpl<PqDeviceMapper, PqDevice> implements PqDeviceService{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceDTO> queryListByIds(List<Integer> lineIds) {
|
||||||
|
return this.baseMapper.queryListByIds(lineIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqLineService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:43【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqLineServiceImpl extends ServiceImpl<PqLineMapper, PqLine> implements PqLineService{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LedgerBaseInfoDTO> getBaseLineInfo(List<Integer> ids){
|
||||||
|
List<LedgerBaseInfoDTO> ledgerBaseInfoDTOS = new ArrayList<>();
|
||||||
|
if(ids.size()>1000){
|
||||||
|
List<List<Integer>> listIds = CollUtil.split(ids,1000);
|
||||||
|
for(List<Integer> itemIds : listIds){
|
||||||
|
List<LedgerBaseInfoDTO> temp =this.baseMapper.getBaseLineInfo(itemIds);
|
||||||
|
ledgerBaseInfoDTOS.addAll(temp);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
List<LedgerBaseInfoDTO> temp =this.baseMapper.getBaseLineInfo(ids);
|
||||||
|
ledgerBaseInfoDTOS.addAll(temp);
|
||||||
|
}
|
||||||
|
return ledgerBaseInfoDTOS;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service.impl;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.SubstationDTO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqSubstation;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqSubstationMapper;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqSubstationService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:48【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqSubstationServiceImpl extends ServiceImpl<PqSubstationMapper, PqSubstation> implements PqSubstationService{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SubstationDTO> queryListByIds(List<Integer> lineIds) {
|
||||||
|
return this.baseMapper.queryListByIds(lineIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.gather.event.devcie.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.event.transientes.mapper.PqsDeptslineMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqsDeptslineServiceImpl extends ServiceImpl<PqsDeptslineMapper, PqsDeptsline> implements PqsDeptslineService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,289 @@
|
|||||||
|
package com.njcn.gather.event.transientes.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
|
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.param.SimulationMsgParam;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.*;
|
||||||
|
import com.njcn.gather.event.transientes.service.*;
|
||||||
|
import com.njcn.gather.event.transientes.service.impl.MsgEventInfoServiceImpl;
|
||||||
|
import com.njcn.gather.event.transientes.websocket.WebSocketServer;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-23
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Api(tags = "暂降接收")
|
||||||
|
@RequestMapping("accept")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class EventGateController extends BaseController {
|
||||||
|
private final MsgEventInfoServiceImpl msgEventInfoServiceImpl;
|
||||||
|
@Value("${SYS_TYPE_ZT}")
|
||||||
|
private String sysTypeZt;
|
||||||
|
|
||||||
|
private final WebSocketServer webSocketServer;
|
||||||
|
|
||||||
|
private final PqsDeptslineService pqsDeptslineService;
|
||||||
|
|
||||||
|
private final PqsDeptsService pqsDeptsService;
|
||||||
|
|
||||||
|
private final PqsUserService pqsUserService;
|
||||||
|
|
||||||
|
private final PqsUsersetService pqsUsersetService;
|
||||||
|
|
||||||
|
private final PqLineMapper pqLineMapper;
|
||||||
|
|
||||||
|
private final EventGateService eventGateService;
|
||||||
|
|
||||||
|
private final MsgEventConfigService msgEventConfigService;
|
||||||
|
|
||||||
|
private final PqsEventdetailService pqsEventdetailService;
|
||||||
|
|
||||||
|
private final MsgEventInfoService msgEventInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@GetMapping("/eventMsg")
|
||||||
|
@ApiOperation("接收远程推送的暂态事件")
|
||||||
|
@ApiImplicitParam(name = "eventMsg", value = "暂态事件json字符", required = true)
|
||||||
|
public HttpResult<Object> eventMsg(@RequestParam("msg") String msg) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventMsg");
|
||||||
|
System.out.println(msg);
|
||||||
|
|
||||||
|
JSONObject jsonObject;
|
||||||
|
try {
|
||||||
|
//下面一行代码正式环境需要放开
|
||||||
|
//jsonObject = new JSONObject(msg);
|
||||||
|
//下面一行代码正式环境需要放开
|
||||||
|
jsonObject = test();
|
||||||
|
|
||||||
|
if (msgEventConfigService.getEventType().contains(jsonObject.get("wavetype").toString())) {
|
||||||
|
webSocketServer.sendMessageToAll(jsonObject.toString());
|
||||||
|
}
|
||||||
|
//开始发送短信
|
||||||
|
sendMessage(jsonObject);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("暂降json格式异常!{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//测试模拟,正式环境删除
|
||||||
|
private PqsEventdetail createEvent(JSONObject jsonObject, LocalDateTime now) {
|
||||||
|
PqsEventdetail pqsEventdetail = new PqsEventdetail();
|
||||||
|
pqsEventdetail.setEventdetailIndex(jsonObject.get("eventdetail_index").toString());
|
||||||
|
pqsEventdetail.setLineid(Integer.valueOf(jsonObject.get("lineid").toString()));
|
||||||
|
pqsEventdetail.setTimeid(now);
|
||||||
|
pqsEventdetail.setMs(new BigDecimal(jsonObject.get("ms").toString()));
|
||||||
|
pqsEventdetail.setWavetype(Integer.valueOf(jsonObject.get("wavetype").toString()));
|
||||||
|
pqsEventdetail.setPersisttime(Double.valueOf(jsonObject.get("persisttime").toString()));
|
||||||
|
pqsEventdetail.setEventvalue(Double.valueOf(jsonObject.get("eventvalue").toString()));
|
||||||
|
pqsEventdetail.setEventreason(jsonObject.get("eventreason").toString());
|
||||||
|
pqsEventdetail.setEventtype(jsonObject.get("eventtype").toString());
|
||||||
|
|
||||||
|
return pqsEventdetail;
|
||||||
|
}
|
||||||
|
|
||||||
|
//测试模拟,正式环境删除
|
||||||
|
private JSONObject test() {
|
||||||
|
/*----------------------------------------------------------------------------------------*/
|
||||||
|
//以下部分为测试数据后续删除
|
||||||
|
List<PqLine> pqLineList = pqLineMapper.selectList(new LambdaQueryWrapper<>());
|
||||||
|
List<Integer> lineList = pqLineList.stream().map(PqLine::getLineIndex).collect(Collectors.toList());
|
||||||
|
List<LedgerBaseInfoDTO> baseInfoDTOList = pqLineMapper.getBaseLineInfo(lineList);
|
||||||
|
Map<Integer, LedgerBaseInfoDTO> map = baseInfoDTOList.stream().collect(Collectors.toMap(LedgerBaseInfoDTO::getLineId, Function.identity()));
|
||||||
|
|
||||||
|
Random random = new Random();
|
||||||
|
Integer lineId = lineList.get(random.nextInt(lineList.size()));
|
||||||
|
LedgerBaseInfoDTO dto = map.get(lineId);
|
||||||
|
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
String timeStr = DateUtil.format(now, DatePattern.NORM_DATETIME_PATTERN);
|
||||||
|
Long ms = (long) random.nextInt(999);
|
||||||
|
|
||||||
|
Integer[] temArr = new Integer[]{1, 3};
|
||||||
|
Integer wave = random.nextInt(2);
|
||||||
|
|
||||||
|
double min = 0.5;
|
||||||
|
double max = 10.0;
|
||||||
|
|
||||||
|
// 生成 (0.5, 10.0) 范围内的随机小数
|
||||||
|
Double perTem = min + (max - min) * Math.random();
|
||||||
|
Double per = new BigDecimal(perTem).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||||
|
|
||||||
|
double minV = 0.1;
|
||||||
|
double maxV = 0.9;
|
||||||
|
Double eventValue = minV + (maxV - minV) * Math.random();
|
||||||
|
|
||||||
|
String id = IdUtil.simpleUUID();
|
||||||
|
|
||||||
|
JSONObject tem = new JSONObject();
|
||||||
|
tem.set("eventdetail_index", id);
|
||||||
|
tem.set("lineid", lineId.toString());
|
||||||
|
tem.set("timeid", timeStr);
|
||||||
|
tem.set("ms", ms.toString());
|
||||||
|
tem.set("wavetype", temArr[wave]);
|
||||||
|
tem.set("persisttime", per.toString());
|
||||||
|
tem.set("eventvalue", eventValue);
|
||||||
|
tem.set("eventreason", "97a56e0f-b546-4c1e-b27c-52463fc1d82f");
|
||||||
|
tem.set("eventtype", "676683a0-7f80-43e6-8df8-bea8ed235d67");
|
||||||
|
tem.set("gdname", "测试供电公司");
|
||||||
|
tem.set("bdname", dto.getStationName());
|
||||||
|
tem.set("pointname", dto.getLineName());
|
||||||
|
|
||||||
|
PqsEventdetail pqsEventdetail = createEvent(tem, now);
|
||||||
|
if (msgEventConfigService.getEventType().contains(tem.get("wavetype").toString())) {
|
||||||
|
webSocketServer.sendMessageToAll(tem.toString());
|
||||||
|
}
|
||||||
|
pqsEventdetailService.save(pqsEventdetail);
|
||||||
|
/*----------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
return tem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getTransientAnalyseWave")
|
||||||
|
@ApiOperation("暂态事件波形分析")
|
||||||
|
public HttpResult<WaveDataDTO> getTransientAnalyseWave(@RequestBody MonitorTerminalParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getTransientAnalyseWave");
|
||||||
|
WaveDataDTO wave = eventGateService.getTransientAnalyseWave(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, wave, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/simulationSend")
|
||||||
|
@ApiOperation("模拟发送短信")
|
||||||
|
public HttpResult<WaveDataDTO> simulationSend(@RequestBody @Validated SimulationMsgParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("simulationSend");
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sendMessage(JSONObject jsonObject) {
|
||||||
|
Integer lineId = Integer.valueOf(jsonObject.get("lineid").toString());
|
||||||
|
List<PqsDeptsline> pqLineDept = pqsDeptslineService.lambdaQuery().eq(PqsDeptsline::getLineIndex, lineId).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||||
|
Set<String> deptIds = pqLineDept.stream().map(PqsDeptsline::getDeptsIndex).collect(Collectors.toSet());
|
||||||
|
Set<String> resultIds = getAllParentDeptIds(deptIds);
|
||||||
|
|
||||||
|
List<PqsUserSet> pqsUserSetList = pqsUsersetService.lambdaQuery().eq(PqsUserSet::getIsNotice, 1).in(PqsUserSet::getDeptsIndex, resultIds).list();
|
||||||
|
if (CollUtil.isEmpty(pqsUserSetList)) {
|
||||||
|
//当前事件未找到用户信息,判断为不需要发送短信用户
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<PqsUser> pqsUserList = pqsUserService.lambdaQuery().select(PqsUser::getUserIndex,PqsUser::getPhone,PqsUser::getName).in(PqsUser::getUserIndex, pqsUserSetList.stream().map(PqsUserSet::getUserIndex).collect(Collectors.toList())).list();
|
||||||
|
List<String> userIds = pqsUserList.stream().map(PqsUser::getUserIndex).collect(Collectors.toList());
|
||||||
|
List<PqsUserSet> poList = pqsUserSetList.stream().filter(it -> userIds.contains(it.getUserIndex())).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(poList)) {
|
||||||
|
StringBuilder stringBuilder = new StringBuilder(jsonObject.get("timeid").toString());
|
||||||
|
List<LedgerBaseInfoDTO> list = pqLineMapper.getBaseLineInfo(Stream.of(lineId).collect(Collectors.toList()));
|
||||||
|
LedgerBaseInfoDTO ledgerBaseInfoDTO = list.get(0);
|
||||||
|
BigDecimal bigDecimal = new BigDecimal(jsonObject.get("eventvalue").toString()).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
stringBuilder.append(".").append(jsonObject.get("ms").toString()).append(", ").append(ledgerBaseInfoDTO.getStationName()).append(ledgerBaseInfoDTO.getLineName())
|
||||||
|
.append("发生暂降事件,事件特征幅值").append(bigDecimal).append("%,持续时间:").append(jsonObject.get("persisttime").toString()).append("S");
|
||||||
|
//TODO 发送短信
|
||||||
|
// System.out.println(stringBuilder);
|
||||||
|
|
||||||
|
List<MsgEventInfo> resultList = new ArrayList<>();
|
||||||
|
for (PqsUser user : pqsUserList) {
|
||||||
|
MsgEventInfo msgEventInfo = new MsgEventInfo();
|
||||||
|
msgEventInfo.setEventIndex(jsonObject.get("eventdetail_index").toString());
|
||||||
|
msgEventInfo.setMsgContent(stringBuilder.toString());
|
||||||
|
msgEventInfo.setMsgIndex(IdUtil.simpleUUID());
|
||||||
|
msgEventInfo.setPhone(user.getPhone());
|
||||||
|
msgEventInfo.setSendResult(0);
|
||||||
|
msgEventInfo.setUserId(user.getUserIndex());
|
||||||
|
msgEventInfo.setUserName(user.getName());
|
||||||
|
msgEventInfo.setIsHandle(0);
|
||||||
|
msgEventInfo.setSendTime(LocalDateTime.now());
|
||||||
|
resultList.add(msgEventInfo);
|
||||||
|
}
|
||||||
|
msgEventInfoService.saveBatch(resultList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取远程短信平台token
|
||||||
|
*/
|
||||||
|
private String apiToken() {
|
||||||
|
|
||||||
|
return "token";
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean apiSend(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Set<String> getAllParentDeptIds(Set<String> deptIds) {
|
||||||
|
// 首次获取直接父级
|
||||||
|
List<PqsDepts> allDeptList = pqsDeptsService.lambdaQuery().list();
|
||||||
|
// 递归获取所有父级
|
||||||
|
Set<String> result = recursivelyGetParentIds(deptIds, allDeptList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归获取所有父级ID
|
||||||
|
*
|
||||||
|
* @param currentParentIds 当前层级的父级ID集合
|
||||||
|
* @return 所有层级的父级ID集合
|
||||||
|
*/
|
||||||
|
private Set<String> recursivelyGetParentIds(Set<String> currentParentIds, List<PqsDepts> allDeptList) {
|
||||||
|
Set<String> result = new HashSet<>(currentParentIds);
|
||||||
|
Set<String> nextLevelParentIds = new HashSet<>();
|
||||||
|
List<PqsDepts> parentDeptList = allDeptList.stream().filter(it -> currentParentIds.contains(it.getDeptsIndex())).collect(Collectors.toList());
|
||||||
|
for (PqsDepts pqsDepts : parentDeptList) {
|
||||||
|
if (!pqsDepts.getParentnodeid().equals("0")) {
|
||||||
|
nextLevelParentIds.add(pqsDepts.getParentnodeid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果有更高层级的父级,继续递归
|
||||||
|
if (!nextLevelParentIds.isEmpty()) {
|
||||||
|
Set<String> deeperParentIds = recursivelyGetParentIds(nextLevelParentIds, allDeptList);
|
||||||
|
result.addAll(deeperParentIds);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
package com.njcn.gather.event.transientes.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.param.MessageEventFeedbackParam;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||||
|
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:00【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "大屏统计")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/largescreen")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LargeScreenCountController extends BaseController {
|
||||||
|
|
||||||
|
private final LargeScreenCountService largeScreenCountService;
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/ledgercount")
|
||||||
|
@ApiOperation("台账规模统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<LedgerCountVO> scaleStatistics(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("scaleStatistics");
|
||||||
|
LedgerCountVO result = largeScreenCountService.scaleStatistics(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/alarmAnalysis")
|
||||||
|
@ApiOperation("告警统计分析")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<AlarmAnalysisVO> alarmAnalysis(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("alarmAnalysis");
|
||||||
|
AlarmAnalysisVO result = largeScreenCountService.alarmAnalysis(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/alarmAnalysisDetail")
|
||||||
|
@ApiOperation("告警统计分析详情")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<AlarmAnalysisVO> alarmAnalysisDetail(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("alarmAnalysisDetail");
|
||||||
|
AlarmAnalysisVO result = largeScreenCountService.alarmAnalysisDetail(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/eventTrend")
|
||||||
|
@ApiOperation("暂降事件趋势")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<EventTrendVO>> eventTrend(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventTrend");
|
||||||
|
List<EventTrendVO> result = largeScreenCountService.eventTrend(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/eventList")
|
||||||
|
@ApiOperation("暂降事件列表")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<EventDetailVO>> eventList(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventList");
|
||||||
|
Page<EventDetailVO> result = largeScreenCountService.eventList(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/noDealEventList")
|
||||||
|
@ApiOperation("未处理暂降事件列表")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<EventDetailVO>> noDealEventList(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("noDealEventList");
|
||||||
|
List<EventDetailVO> result = largeScreenCountService.noDealEventList(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/mapCount")
|
||||||
|
@ApiOperation("地图统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<MapCountVO>> mapCount(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("mapCount");
|
||||||
|
List<MapCountVO> result = largeScreenCountService.mapCount(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(operateType= OperateType.UPDATE)
|
||||||
|
@PostMapping("/lookEvent")
|
||||||
|
@ApiOperation("处理暂降事件")
|
||||||
|
@ApiImplicitParam(name = "eventIds", value = "暂降事件id", required = true)
|
||||||
|
public HttpResult<Boolean> lookEvent(@RequestBody List<String> eventIds) {
|
||||||
|
String methodDescribe = getMethodDescribe("lookEvent");
|
||||||
|
boolean result = largeScreenCountService.lookEvent(eventIds);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@GetMapping("/eventMsgDetail")
|
||||||
|
@ApiOperation("暂降事件列表详情按钮")
|
||||||
|
@ApiImplicitParam(name = "eventId", value = "暂降事件id", required = true)
|
||||||
|
public HttpResult<EventMsgDetailVO> eventMsgDetail(@RequestParam("eventId")String eventId) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventMsgDetail");
|
||||||
|
EventMsgDetailVO result = largeScreenCountService.eventMsgDetail(eventId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/msgSendList")
|
||||||
|
@ApiOperation("远程通知列表")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "参数", required = true)
|
||||||
|
public HttpResult<List<MsgEventInfo>> msgSendList(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("msgSendList");
|
||||||
|
List<MsgEventInfo> result = largeScreenCountService.msgSendList(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/hasSendMsgPage")
|
||||||
|
@ApiOperation("已发送短信列表")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<MsgEventInfo>> hasSendMsgPage(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("hasSendMsgPage");
|
||||||
|
Page<MsgEventInfo> result = largeScreenCountService.hasSendMsgPage(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/msgHandle")
|
||||||
|
@ApiOperation("短信处理")
|
||||||
|
@ApiImplicitParam(name = "eventId", value = "暂降事件id", required = true)
|
||||||
|
public HttpResult<Boolean> msgHandle(@RequestBody @Validated MessageEventFeedbackParam messageEventFeedbackParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("msgHandle");
|
||||||
|
largeScreenCountService.msgHandle(messageEventFeedbackParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.gather.event.transientes.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventConfig;
|
||||||
|
import com.njcn.gather.event.transientes.service.MsgEventConfigService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-27
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Api(tags = "暂降平台配置")
|
||||||
|
@RequestMapping("config")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class MsgEventConfigController extends BaseController {
|
||||||
|
|
||||||
|
private final MsgEventConfigService msgEventConfigService;
|
||||||
|
|
||||||
|
@OperateInfo(operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/eventConfig")
|
||||||
|
@ApiOperation("暂降平台配置")
|
||||||
|
@ApiImplicitParam(name = "msgEventConfig", value = "实体", required = true)
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public HttpResult<Object> eventConfig(@RequestBody @Validated MsgEventConfig msgEventConfig) {
|
||||||
|
String methodDescribe = getMethodDescribe("eventConfig");
|
||||||
|
msgEventConfigService.eventConfig(msgEventConfig);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@GetMapping("/queryConfig")
|
||||||
|
@ApiOperation("接收远程推送的暂态事件")
|
||||||
|
public HttpResult<MsgEventConfig> queryConfig() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryConfig");
|
||||||
|
MsgEventConfig msgEventConfig = msgEventConfigService.queryConfig();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, msgEventConfig, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.njcn.gather.event.transientes.filter;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.gather.event.transientes.utils.JwtUtil;
|
||||||
|
import io.jsonwebtoken.ExpiredJwtException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
|
|
||||||
|
import javax.servlet.FilterChain;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class JwtRequestFilter extends OncePerRequestFilter {
|
||||||
|
|
||||||
|
private final UserDetailsService userDetailsService;
|
||||||
|
private final JwtUtil jwtUtil;
|
||||||
|
|
||||||
|
public JwtRequestFilter(UserDetailsService userDetailsService, JwtUtil jwtUtil) {
|
||||||
|
this.userDetailsService = userDetailsService;
|
||||||
|
this.jwtUtil = jwtUtil;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
|
||||||
|
final String authorizationHeader = request.getHeader("Authorization");
|
||||||
|
String username = null;
|
||||||
|
String jwt = null;
|
||||||
|
if (authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
|
||||||
|
jwt = authorizationHeader.substring(7);
|
||||||
|
try {
|
||||||
|
username = jwtUtil.extractUsername(jwt);
|
||||||
|
} catch (ExpiredJwtException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
sendErrorResponse(response,CommonResponseEnum.TOKEN_EXPIRE_JWT);
|
||||||
|
return;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
sendErrorResponse(response,CommonResponseEnum.PARSE_TOKEN_ERROR);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
|
||||||
|
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
|
||||||
|
|
||||||
|
if (jwtUtil.validateToken(jwt, userDetails)) {
|
||||||
|
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken =
|
||||||
|
new UsernamePasswordAuthenticationToken(
|
||||||
|
userDetails, null, userDetails.getAuthorities());
|
||||||
|
usernamePasswordAuthenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
|
||||||
|
SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendErrorResponse(HttpServletResponse response, CommonResponseEnum error) throws IOException {
|
||||||
|
response.setStatus(HttpServletResponse.SC_OK);
|
||||||
|
response.setContentType("application/json;charset=UTF-8");
|
||||||
|
|
||||||
|
HttpResult<String> httpResult = new HttpResult<>();
|
||||||
|
httpResult.setCode(error.getCode());
|
||||||
|
httpResult.setMessage(error.getMessage());
|
||||||
|
|
||||||
|
response.getWriter().write(new JSONObject(httpResult, false).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.gather.event.transientes.handler;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.LogInfo;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年06月22日 10:25
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class ControllerUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对methodArgumentNotValidException 异常的处理
|
||||||
|
* @author cdf
|
||||||
|
*/
|
||||||
|
public static String getMethodArgumentNotValidException(MethodArgumentNotValidException methodArgumentNotValidException) {
|
||||||
|
String operate = LogInfo.UNKNOWN_OPERATE;
|
||||||
|
Method method = null;
|
||||||
|
try {
|
||||||
|
method = methodArgumentNotValidException.getParameter().getMethod();
|
||||||
|
if (!Objects.isNull(method) && method.isAnnotationPresent(ApiOperation.class)) {
|
||||||
|
ApiOperation apiOperation = method.getAnnotation(ApiOperation.class);
|
||||||
|
operate = apiOperation.value();
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("根据方法参数非法异常获取@ApiOperation注解值失败,参数非法异常信息:{},方法名:{},异常信息:{}",methodArgumentNotValidException.getMessage(),method,e.getMessage());
|
||||||
|
}
|
||||||
|
return operate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
package com.njcn.gather.event.transientes.handler;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.StrFormatter;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
|
import com.njcn.web.utils.HttpServletUtil;
|
||||||
|
import com.njcn.web.utils.ReflectCommonUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.springframework.validation.ObjectError;
|
||||||
|
import org.springframework.web.HttpMediaTypeNotSupportedException;
|
||||||
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import org.springframework.web.util.NestedServletException;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.validation.ConstraintViolation;
|
||||||
|
import javax.validation.ConstraintViolationException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局通用业务异常处理器
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021年04月20日 18:04
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class GlobalBusinessExceptionHandler {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final ThreadPoolExecutor executor = new ThreadPoolExecutor(
|
||||||
|
4, 8, 30, TimeUnit.SECONDS,
|
||||||
|
new LinkedBlockingQueue<>(100),
|
||||||
|
// 队列满时由主线程执行
|
||||||
|
new ThreadPoolExecutor.CallerRunsPolicy()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 捕获业务功能异常,通常为业务数据抛出的异常
|
||||||
|
*
|
||||||
|
* @param businessException 业务异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(BusinessException.class)
|
||||||
|
public HttpResult<String> handleBusinessException(BusinessException businessException) {
|
||||||
|
String operate = ReflectCommonUtil.getMethodDescribeByException(businessException);
|
||||||
|
// recodeBusinessExceptionLog(businessException, businessException.getMessage());
|
||||||
|
return HttpResultUtil.assembleBusinessExceptionResult(businessException, null, operate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空指针异常捕捉
|
||||||
|
*
|
||||||
|
* @param nullPointerException 空指针异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(NullPointerException.class)
|
||||||
|
public HttpResult<String> handleNullPointerException(NullPointerException nullPointerException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.NULL_POINTER_EXCEPTION.getMessage(), nullPointerException);
|
||||||
|
//recodeBusinessExceptionLog(nullPointerException, CommonResponseEnum.NULL_POINTER_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NULL_POINTER_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(nullPointerException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 算数运算异常
|
||||||
|
*
|
||||||
|
* @param arithmeticException 算数运算异常,由于除数为0引起的异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(ArithmeticException.class)
|
||||||
|
public HttpResult<String> handleArithmeticException(ArithmeticException arithmeticException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.ARITHMETIC_EXCEPTION.getMessage(), arithmeticException);
|
||||||
|
// recodeBusinessExceptionLog(arithmeticException, CommonResponseEnum.ARITHMETIC_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.ARITHMETIC_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(arithmeticException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型转换异常捕捉
|
||||||
|
*
|
||||||
|
* @param classCastException 类型转换异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(ClassCastException.class)
|
||||||
|
public HttpResult<String> handleClassCastException(ClassCastException classCastException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.CLASS_CAST_EXCEPTION.getMessage(), classCastException);
|
||||||
|
// recodeBusinessExceptionLog(classCastException, CommonResponseEnum.CLASS_CAST_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.CLASS_CAST_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(classCastException));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 索引下标越界异常捕捉
|
||||||
|
*
|
||||||
|
* @param indexOutOfBoundsException 索引下标越界异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(IndexOutOfBoundsException.class)
|
||||||
|
public HttpResult<String> handleIndexOutOfBoundsException(IndexOutOfBoundsException indexOutOfBoundsException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.INDEX_OUT_OF_BOUNDS_EXCEPTION.getMessage(), indexOutOfBoundsException);
|
||||||
|
// recodeBusinessExceptionLog(indexOutOfBoundsException, CommonResponseEnum.INDEX_OUT_OF_BOUNDS_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.INDEX_OUT_OF_BOUNDS_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(indexOutOfBoundsException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端请求后端,请求中参数的媒体方式不支持异常
|
||||||
|
*
|
||||||
|
* @param httpMediaTypeNotSupportedException 请求中参数的媒体方式不支持异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
|
||||||
|
public HttpResult<String> httpMediaTypeNotSupportedExceptionHandler(HttpMediaTypeNotSupportedException httpMediaTypeNotSupportedException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.HTTP_MEDIA_TYPE_NOT_SUPPORTED_EXCEPTION.getMessage(), httpMediaTypeNotSupportedException);
|
||||||
|
// 然后提取错误提示信息进行返回
|
||||||
|
// recodeBusinessExceptionLog(httpMediaTypeNotSupportedException, CommonResponseEnum.HTTP_MEDIA_TYPE_NOT_SUPPORTED_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.HTTP_MEDIA_TYPE_NOT_SUPPORTED_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(httpMediaTypeNotSupportedException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端请求后端,参数校验异常捕捉
|
||||||
|
* RequestBody注解参数异常
|
||||||
|
*
|
||||||
|
* @param methodArgumentNotValidException 参数校验异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||||
|
public HttpResult<String> methodArgumentNotValidExceptionHandler(MethodArgumentNotValidException methodArgumentNotValidException) {
|
||||||
|
// 从异常对象中拿到allErrors数据
|
||||||
|
String messages = methodArgumentNotValidException.getBindingResult().getAllErrors()
|
||||||
|
.stream().map(ObjectError::getDefaultMessage).collect(Collectors.joining(";"));
|
||||||
|
// 然后提取错误提示信息进行返回
|
||||||
|
LogUtil.njcnDebug(log, "参数校验异常,异常为:{}", messages);
|
||||||
|
// recodeBusinessExceptionLog(methodArgumentNotValidException, CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION, messages, ControllerUtil.getMethodArgumentNotValidException(methodArgumentNotValidException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端请求后端,参数校验异常捕捉
|
||||||
|
* PathVariable注解、RequestParam注解参数异常
|
||||||
|
*
|
||||||
|
* @param constraintViolationException 参数校验异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(ConstraintViolationException.class)
|
||||||
|
public HttpResult<String> constraintViolationExceptionExceptionHandler(ConstraintViolationException constraintViolationException) {
|
||||||
|
String exceptionMessage = constraintViolationException.getMessage();
|
||||||
|
StringBuilder messages = new StringBuilder();
|
||||||
|
if (exceptionMessage.indexOf(StrUtil.COMMA) > 0) {
|
||||||
|
String[] tempMessage = exceptionMessage.split(StrUtil.COMMA);
|
||||||
|
Stream.of(tempMessage).forEach(message -> {
|
||||||
|
messages.append(message.substring(message.indexOf(StrUtil.COLON) + 2)).append(';');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
messages.append(exceptionMessage.substring(exceptionMessage.indexOf(StrUtil.COLON) + 2));
|
||||||
|
}
|
||||||
|
// 然后提取错误提示信息进行返回
|
||||||
|
LogUtil.njcnDebug(log, "参数校验异常,异常为:{}", messages);
|
||||||
|
// recodeBusinessExceptionLog(constraintViolationException, CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION.getMessage());
|
||||||
|
List<ConstraintViolation<?>> constraintViolationList = new ArrayList<>(constraintViolationException.getConstraintViolations());
|
||||||
|
ConstraintViolation<?> constraintViolation = constraintViolationList.get(0);
|
||||||
|
Class<?> rootBeanClass = constraintViolation.getRootBeanClass();
|
||||||
|
//判断校验参数异常捕获的根源是controller还是service处
|
||||||
|
if (rootBeanClass.getName().endsWith("Controller")) {
|
||||||
|
String methodName = constraintViolation.getPropertyPath().toString().substring(0, constraintViolation.getPropertyPath().toString().indexOf(StrUtil.DOT));
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION, messages.toString(), ReflectCommonUtil.getMethodDescribeByClassAndMethodName(rootBeanClass, methodName));
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.METHOD_ARGUMENT_NOT_VALID_EXCEPTION, messages.toString(), ReflectCommonUtil.getMethodDescribeByException(constraintViolationException));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 索引下标越界异常捕捉
|
||||||
|
*
|
||||||
|
* @param illegalArgumentException 参数校验异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(IllegalArgumentException.class)
|
||||||
|
public HttpResult<String> handleIndexOutOfBoundsException(IllegalArgumentException illegalArgumentException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION.getMessage(), illegalArgumentException);
|
||||||
|
// recodeBusinessExceptionLog(illegalArgumentException, CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.ILLEGAL_ARGUMENT_EXCEPTION, illegalArgumentException.getMessage(), ReflectCommonUtil.getMethodDescribeByException(illegalArgumentException));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未声明异常捕捉
|
||||||
|
*
|
||||||
|
* @param exception 未声明异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(Exception.class)
|
||||||
|
public HttpResult<String> handleException(Exception exception) {
|
||||||
|
//针对fallbackFactory降级异常特殊处理
|
||||||
|
Exception tempException = exception;
|
||||||
|
String exceptionCause = CommonResponseEnum.UN_DECLARE.getMessage();
|
||||||
|
String code = CommonResponseEnum.UN_DECLARE.getCode();
|
||||||
|
if (exception instanceof NestedServletException) {
|
||||||
|
Throwable cause = exception.getCause();
|
||||||
|
if (cause instanceof AssertionError) {
|
||||||
|
if (cause.getCause() instanceof BusinessException) {
|
||||||
|
tempException = (BusinessException) cause.getCause();
|
||||||
|
BusinessException tempBusinessException = (BusinessException) cause.getCause();
|
||||||
|
exceptionCause = tempBusinessException.getMessage();
|
||||||
|
code = tempBusinessException.getCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LogUtil.logExceptionStackInfo(exceptionCause, tempException);
|
||||||
|
// recodeBusinessExceptionLog(exception, exceptionCause);
|
||||||
|
//判断方法上是否有自定义注解,做特殊处理
|
||||||
|
// Method method = ReflectCommonUtil.getMethod(exception);
|
||||||
|
// if (!Objects.isNull(method)){
|
||||||
|
// if(method.isAnnotationPresent(ReturnMsg.class)){
|
||||||
|
// return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}",exceptionCause));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
return HttpResultUtil.assembleResult(code, null, StrFormatter.format("{}{}{}", ReflectCommonUtil.getMethodDescribeByException(tempException), StrUtil.C_COMMA, exceptionCause));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json解析异常
|
||||||
|
*
|
||||||
|
* @param jsonException json参数
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(JSONException.class)
|
||||||
|
public HttpResult<String> handleIndexOutOfBoundsException(JSONException jsonException) {
|
||||||
|
LogUtil.logExceptionStackInfo(CommonResponseEnum.JSON_CONVERT_EXCEPTION.getMessage(), jsonException);
|
||||||
|
// recodeBusinessExceptionLog(jsonException, CommonResponseEnum.JSON_CONVERT_EXCEPTION.getMessage());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.JSON_CONVERT_EXCEPTION, jsonException.getMessage(), ReflectCommonUtil.getMethodDescribeByException(jsonException));
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
private void recodeBusinessExceptionLog(Exception businessException, String methodDescribe) {
|
||||||
|
HttpServletRequest httpServletRequest = HttpServletUtil.getRequest();
|
||||||
|
Future<?> future = executor.submit(() -> {
|
||||||
|
HttpServletUtil.setRequest(httpServletRequest);
|
||||||
|
sysLogAuditService.recodeBusinessExceptionLog(businessException, methodDescribe);
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
// 抛出 ExecutionException
|
||||||
|
future.get();
|
||||||
|
} catch (ExecutionException | InterruptedException e) {
|
||||||
|
log.error("保存审计日志异常,异常为:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MessageEventFeedback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface MessageEventFeedbackMapper extends BaseMapper<MessageEventFeedback> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventConfig;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MSG_EVENT_CONFIG表Mapper接口
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MsgEventConfigMapper extends BaseMapper<MsgEventConfig> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MsgEventInfoMapper extends BaseMapper<MsgEventInfo> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqDevicedetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqDevicedetailMapper extends BaseMapper<PqDevicedetail> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqsDeptsMapper extends BaseMapper<PqsDepts> {
|
||||||
|
List<String> findDeptAndChildren(@Param("deptId") String deptId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsUserSet;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqsDeptslineMapper extends BaseMapper<PqsDeptsline> {
|
||||||
|
|
||||||
|
List<PqsDeptsline> getPhoneUser(@Param("lineId")String lineId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqsEventdetailMapper extends BaseMapper<PqsEventdetail> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsUser;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PqsUserMapper extends BaseMapper<PqsUser> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.gather.event.transientes.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsUserSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-24
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public interface PqsUserSetMapper extends BaseMapper<PqsUserSet> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqDevicedetailMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqDevicedetail">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQ_DEVICEDETAIL-->
|
||||||
|
<id column="DEV_INDEX" jdbcType="DECIMAL" property="devIndex" />
|
||||||
|
<result column="MANUFACTURER" jdbcType="VARCHAR" property="manufacturer" />
|
||||||
|
<result column="CHECKFLAG" jdbcType="DECIMAL" property="checkflag" />
|
||||||
|
<result column="THISTIMECHECK" jdbcType="TIMESTAMP" property="thistimecheck" />
|
||||||
|
<result column="NEXTTIMECHECK" jdbcType="TIMESTAMP" property="nexttimecheck" />
|
||||||
|
<result column="ONLINERATETJ" jdbcType="DECIMAL" property="onlineratetj" />
|
||||||
|
<result column="DATAPLAN" jdbcType="DECIMAL" property="dataplan" />
|
||||||
|
<result column="NEWTRAFFIC" jdbcType="DECIMAL" property="newtraffic" />
|
||||||
|
<result column="ELECTROPLATE" jdbcType="DECIMAL" property="electroplate" />
|
||||||
|
<result column="ONTIME" jdbcType="DECIMAL" property="ontime" />
|
||||||
|
<result column="CONTRACT" jdbcType="VARCHAR" property="contract" />
|
||||||
|
<result column="SIM" jdbcType="VARCHAR" property="sim" />
|
||||||
|
<result column="DEV_CATENA" jdbcType="VARCHAR" property="devCatena" />
|
||||||
|
<result column="DEV_LOCATION" jdbcType="VARCHAR" property="devLocation" />
|
||||||
|
<result column="DEV_NO" jdbcType="VARCHAR" property="devNo" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
DEV_INDEX, MANUFACTURER, CHECKFLAG, THISTIMECHECK, NEXTTIMECHECK, ONLINERATETJ, DATAPLAN,
|
||||||
|
NEWTRAFFIC, ELECTROPLATE, ONTIME, CONTRACT, SIM, DEV_CATENA, DEV_LOCATION, DEV_NO
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsDeptsMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqsDepts">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQS_DEPTS-->
|
||||||
|
<id column="DEPTS_INDEX" jdbcType="VARCHAR" property="deptsIndex" />
|
||||||
|
<result column="DEPTSNAME" jdbcType="VARCHAR" property="deptsname" />
|
||||||
|
<result column="DEPTS_DESC" jdbcType="DECIMAL" property="deptsDesc" />
|
||||||
|
<result column="USER_INDEX" jdbcType="VARCHAR" property="userIndex" />
|
||||||
|
<result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
|
||||||
|
<result column="DEPTS_DESCRIPTION" jdbcType="VARCHAR" property="deptsDescription" />
|
||||||
|
<result column="STATE" jdbcType="DECIMAL" property="state" />
|
||||||
|
<result column="AREA" jdbcType="VARCHAR" property="area" />
|
||||||
|
<result column="CUSTOM_DEPT" jdbcType="DECIMAL" property="customDept" />
|
||||||
|
<result column="PARENTNODEID" jdbcType="VARCHAR" property="parentnodeid" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
DEPTS_INDEX, DEPTSNAME, DEPTS_DESC, USER_INDEX, UPDATETIME, DEPTS_DESCRIPTION, "STATE",
|
||||||
|
AREA, CUSTOM_DEPT, PARENTNODEID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="findDeptAndChildren" resultType="java.lang.String">
|
||||||
|
SELECT DEPTS_INDEX
|
||||||
|
FROM PQS_DEPTS
|
||||||
|
START WITH DEPTS_INDEX = #{deptId}
|
||||||
|
CONNECT BY PRIOR DEPTS_INDEX = PARENTNODEID
|
||||||
|
and state = 1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsDeptslineMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqsDeptsline">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQS_DEPTSLINE-->
|
||||||
|
<result column="DEPTS_INDEX" jdbcType="VARCHAR" property="deptsIndex" />
|
||||||
|
<result column="LINE_INDEX" jdbcType="DECIMAL" property="lineIndex" />
|
||||||
|
<result column="SYSTYPE" jdbcType="VARCHAR" property="systype" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
DEPTS_INDEX, LINE_INDEX, SYSTYPE
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getPhoneUser">
|
||||||
|
select *
|
||||||
|
from
|
||||||
|
PQS_DEPTSLINE deptLine
|
||||||
|
inner join PQS_DEPTS dept on deptLine.DEPTS_INDEX = DEPTS_INDEX
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsEventdetailMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqsEventdetail">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table PQS_EVENTDETAIL-->
|
||||||
|
<id column="EVENTDETAIL_INDEX" jdbcType="VARCHAR" property="eventdetailIndex" />
|
||||||
|
<result column="LINEID" jdbcType="DECIMAL" property="lineid" />
|
||||||
|
<result column="TIMEID" jdbcType="TIMESTAMP" property="timeid" />
|
||||||
|
<result column="MS" jdbcType="DECIMAL" property="ms" />
|
||||||
|
<result column="DESCRIBE" jdbcType="VARCHAR" property="describe" />
|
||||||
|
<result column="WAVETYPE" jdbcType="DECIMAL" property="wavetype" />
|
||||||
|
<result column="PERSISTTIME" jdbcType="FLOAT" property="persisttime" />
|
||||||
|
<result column="EVENTVALUE" jdbcType="FLOAT" property="eventvalue" />
|
||||||
|
<result column="EVENTREASON" jdbcType="VARCHAR" property="eventreason" />
|
||||||
|
<result column="EVENTTYPE" jdbcType="VARCHAR" property="eventtype" />
|
||||||
|
<result column="EVENTASS_INDEX" jdbcType="VARCHAR" property="eventassIndex" />
|
||||||
|
<result column="DQTIME" jdbcType="FLOAT" property="dqtime" />
|
||||||
|
<result column="DEALTIME" jdbcType="TIMESTAMP" property="dealtime" />
|
||||||
|
<result column="DEALFLAG" jdbcType="DECIMAL" property="dealflag" />
|
||||||
|
<result column="NUM" jdbcType="DECIMAL" property="num" />
|
||||||
|
<result column="FILEFLAG" jdbcType="DECIMAL" property="fileflag" />
|
||||||
|
<result column="FIRSTTIME" jdbcType="TIMESTAMP" property="firsttime" />
|
||||||
|
<result column="FIRSTTYPE" jdbcType="VARCHAR" property="firsttype" />
|
||||||
|
<result column="FIRSTMS" jdbcType="DECIMAL" property="firstms" />
|
||||||
|
<result column="WAVENAME" jdbcType="VARCHAR" property="wavename" />
|
||||||
|
<result column="ENERGY" jdbcType="FLOAT" property="energy" />
|
||||||
|
<result column="SEVERITY" jdbcType="FLOAT" property="severity" />
|
||||||
|
<result column="LOOK_FLAG" jdbcType="DECIMAL" property="lookFlag" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
EVENTDETAIL_INDEX, LINEID, TIMEID, MS, "DESCRIBE", WAVETYPE, PERSISTTIME, EVENTVALUE,
|
||||||
|
EVENTREASON, EVENTTYPE, EVENTASS_INDEX, DQTIME, DEALTIME, DEALFLAG, NUM, FILEFLAG,
|
||||||
|
FIRSTTIME, FIRSTTYPE, FIRSTMS, WAVENAME, ENERGY, SEVERITY, LOOK_FLAG
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- <select id="queryByCondition" resultType="com.njcn.gather.event.transientes.pojo.vo.EventDetailVO">-->
|
||||||
|
<!--<!– SELECT * from( –>-->
|
||||||
|
<!-- select * from PQS_EVENTDETAIL eve where eve.LINEID in-->
|
||||||
|
<!-- <foreach collection="deptslineIds" item="item" open="(" close=")" separator=",">-->
|
||||||
|
<!-- #{item}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- and eve.TIMEID between TO_DATE( #{startTime},'YYYY-MM-DD HH24:MI:SS') and TO_DATE( #{endTime},'YYYY-MM-DD HH24:MI:SS')-->
|
||||||
|
<!-- <if test="eventtype != null and eventtype ==1">-->
|
||||||
|
<!-- and eve.NOTICE_FLAG =1-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="eventtype == null or eventtype ==0">-->
|
||||||
|
<!-- and (eve.NOTICE_FLAG =0 or eve.NOTICE_FLAG is null)-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- order by eve.NOTICE_FLAG asc NULLS FIRST , eve.TIMEID desc-->
|
||||||
|
<!--<!– )–>-->
|
||||||
|
<!--<!– WHERE ROWNUM <= 10;–>-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:38【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class LargeScreenCountParam extends BaseParam {
|
||||||
|
@ApiModelProperty(name="deptId",value="部门id")
|
||||||
|
private String deptId;
|
||||||
|
@ApiModelProperty(name="type",value="类型(1年 2季度 3月份 4周 5日)")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(name="eventtype",value="类型(0 暂降事件 1远程通知)")
|
||||||
|
private Integer eventtype;
|
||||||
|
|
||||||
|
@ApiModelProperty(name="eventDeep",value="0.普通事件 1.严重事件 null.全部事件")
|
||||||
|
private Integer eventDeep;
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.param;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageEventFeedbackParam {
|
||||||
|
|
||||||
|
@NotBlank(message = "暂降事件id不可为空")
|
||||||
|
private String eventIndex;
|
||||||
|
|
||||||
|
@NotNull(message = "是否影响敏感用户不可为空")
|
||||||
|
@ApiModelProperty(value = " 0.否 1.是")
|
||||||
|
private Integer isSensitive;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "方案")
|
||||||
|
private String influenceFactors;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "处理时间")
|
||||||
|
private LocalDate dealDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "原因")
|
||||||
|
private String dealScheme;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <监测点波形入参>
|
||||||
|
*
|
||||||
|
* @author wr
|
||||||
|
* @createTime: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MonitorTerminalParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@NotBlank(message = "id不能为空")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区分主配网(0:主网 1:配网)")
|
||||||
|
@NotNull(message = "区分类别不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区分系统(0:pq 1:pms)")
|
||||||
|
@NotNull(message = "区分系统不能为空")
|
||||||
|
private Integer systemType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-07-01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MsgEventConfigParam {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 严重通知标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "严重通知标识不可为空")
|
||||||
|
private Integer seriousNotice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通通知标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "普通通知标识不可为空")
|
||||||
|
private Integer normalNotic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语音类型
|
||||||
|
*/
|
||||||
|
@NotNull(message = "语音类型不可为空")
|
||||||
|
private Integer voiceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 屏幕通知标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "屏幕通知标识不可为空")
|
||||||
|
private Integer screenNotic;
|
||||||
|
|
||||||
|
@NotBlank(message = "事件类型不可为空")
|
||||||
|
private List<Integer> eventTypeList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-07-01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SimulationMsgParam {
|
||||||
|
|
||||||
|
@NotBlank(message = "号码不可为空")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@NotBlank(message = "短信内容不可为空")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-26
|
||||||
|
* @Description: 暂降远程通知反馈
|
||||||
|
*/
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("MSG_EVENT_FEEDBACK")
|
||||||
|
public class MessageEventFeedback {
|
||||||
|
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String eventIndex;
|
||||||
|
|
||||||
|
private Integer isSensitive;
|
||||||
|
|
||||||
|
private String influenceFactors;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date dealDate;
|
||||||
|
|
||||||
|
private String dealScheme;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-27
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MSG_EVENT_CONFIG表实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("MSG_EVENT_CONFIG")
|
||||||
|
public class MsgEventConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId("ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 严重通知标识
|
||||||
|
*/
|
||||||
|
@TableField("SERIOUS_NOTICE")
|
||||||
|
@NotNull(message = "严重通知标识不可为空")
|
||||||
|
private Integer seriousNotice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通通知标识
|
||||||
|
*/
|
||||||
|
@TableField("NORMAL_NOTIC")
|
||||||
|
@NotNull(message = "普通通知标识不可为空")
|
||||||
|
private Integer normalNotic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语音类型
|
||||||
|
*/
|
||||||
|
@TableField("VOICE_TYPE")
|
||||||
|
@NotNull(message = "语音类型不可为空")
|
||||||
|
private Integer voiceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 屏幕通知标识
|
||||||
|
*/
|
||||||
|
@TableField("SCREEN_NOTIC")
|
||||||
|
@NotNull(message = "屏幕通知标识不可为空")
|
||||||
|
private Integer screenNotic;
|
||||||
|
|
||||||
|
private String eventType;
|
||||||
|
|
||||||
|
@NotEmpty(message = "事件类型不可为空")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<String> eventTypeList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-25
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息事件信息实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("MSG_EVENT_INFO")
|
||||||
|
public class MsgEventInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息索引
|
||||||
|
*/
|
||||||
|
private String msgIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime sendTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String msgContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件索引
|
||||||
|
*/
|
||||||
|
private String eventIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送结果
|
||||||
|
*/
|
||||||
|
private Integer sendResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否反馈
|
||||||
|
*/
|
||||||
|
private Integer isHandle;
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 1:47【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 靠靠靠?
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQ_DEVICEDETAIL")
|
||||||
|
public class PqDevicedetail {
|
||||||
|
/**
|
||||||
|
* 靠靠
|
||||||
|
*/
|
||||||
|
@TableId(value = "DEV_INDEX", type = IdType.INPUT)
|
||||||
|
private Integer devIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (靠PQS_Dicdata)靠靠縂uid
|
||||||
|
*/
|
||||||
|
@TableField(value = "MANUFACTURER")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠(0:靠 1:靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "CHECKFLAG")
|
||||||
|
private Short checkflag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠
|
||||||
|
*/
|
||||||
|
@TableField(value = "THISTIMECHECK")
|
||||||
|
private LocalDateTime thistimecheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠(靠靠靠靠靠3靠靠靠靠靠靠靠)
|
||||||
|
*/
|
||||||
|
@TableField(value = "NEXTTIMECHECK")
|
||||||
|
private LocalDateTime nexttimecheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 靠靠靠?
|
||||||
|
*/
|
||||||
|
@TableField(value = "ONLINERATETJ")
|
||||||
|
private Integer onlineratetj;
|
||||||
|
|
||||||
|
@TableField(value = "DATAPLAN")
|
||||||
|
private Integer dataplan;
|
||||||
|
|
||||||
|
@TableField(value = "NEWTRAFFIC")
|
||||||
|
private Integer newtraffic;
|
||||||
|
|
||||||
|
@TableField(value = "ELECTROPLATE")
|
||||||
|
private Short electroplate;
|
||||||
|
|
||||||
|
@TableField(value = "ONTIME")
|
||||||
|
private Short ontime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同
|
||||||
|
*/
|
||||||
|
@TableField(value = "CONTRACT")
|
||||||
|
private String contract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sim卡号
|
||||||
|
*/
|
||||||
|
@TableField(value = "SIM")
|
||||||
|
private String sim;
|
||||||
|
|
||||||
|
@TableField(value = "DEV_CATENA")
|
||||||
|
private String devCatena;
|
||||||
|
|
||||||
|
@TableField(value = "DEV_LOCATION")
|
||||||
|
private String devLocation;
|
||||||
|
|
||||||
|
@TableField(value = "DEV_NO")
|
||||||
|
private String devNo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 部门表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQS_DEPTS")
|
||||||
|
public class PqsDepts {
|
||||||
|
/**
|
||||||
|
* 部门表Guid
|
||||||
|
*/
|
||||||
|
@TableId(value = "DEPTS_INDEX", type = IdType.INPUT)
|
||||||
|
private String deptsIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEPTSNAME")
|
||||||
|
private String deptsname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEPTS_DESC")
|
||||||
|
private Short deptsDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (关联表PQS_User)用户表Guid
|
||||||
|
*/
|
||||||
|
@TableField(value = "USER_INDEX")
|
||||||
|
private String userIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "UPDATETIME")
|
||||||
|
private LocalDateTime updatetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门描述
|
||||||
|
*/
|
||||||
|
@TableField(value = "DEPTS_DESCRIPTION")
|
||||||
|
private String deptsDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色状态0:删除;1:正常;
|
||||||
|
*/
|
||||||
|
@TableField(value = "\"STATE\"")
|
||||||
|
private Short state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行政区域
|
||||||
|
*/
|
||||||
|
@TableField(value = "AREA")
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
@TableField(value = "CUSTOM_DEPT")
|
||||||
|
private Short customDept;
|
||||||
|
|
||||||
|
@TableField(value = "PARENTNODEID")
|
||||||
|
private String parentnodeid;
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "PQS_EVENTDETAIL")
|
||||||
|
public class PqsEventdetail {
|
||||||
|
@TableId(value = "EVENTDETAIL_INDEX", type = IdType.INPUT)
|
||||||
|
private String eventdetailIndex;
|
||||||
|
|
||||||
|
@TableField(value = "LINEID")
|
||||||
|
private Integer lineid;
|
||||||
|
|
||||||
|
@TableField(value = "TIMEID")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime timeid;
|
||||||
|
|
||||||
|
@TableField(value = "MS")
|
||||||
|
private BigDecimal ms;
|
||||||
|
|
||||||
|
@TableField(value = "\"DESCRIBE\"")
|
||||||
|
private String describe;
|
||||||
|
|
||||||
|
@TableField(value = "WAVETYPE")
|
||||||
|
private Integer wavetype;
|
||||||
|
|
||||||
|
@TableField(value = "PERSISTTIME")
|
||||||
|
private Double persisttime;
|
||||||
|
|
||||||
|
@TableField(value = "EVENTVALUE")
|
||||||
|
private Double eventvalue;
|
||||||
|
|
||||||
|
@TableField(value = "EVENTREASON")
|
||||||
|
private String eventreason;
|
||||||
|
|
||||||
|
@TableField(value = "EVENTTYPE")
|
||||||
|
private String eventtype;
|
||||||
|
|
||||||
|
@TableField(value = "EVENTASS_INDEX")
|
||||||
|
private String eventassIndex;
|
||||||
|
|
||||||
|
@TableField(value = "DQTIME")
|
||||||
|
private Double dqtime;
|
||||||
|
|
||||||
|
@TableField(value = "DEALTIME")
|
||||||
|
private LocalDateTime dealtime;
|
||||||
|
|
||||||
|
@TableField(value = "DEALFLAG")
|
||||||
|
private Short dealflag;
|
||||||
|
|
||||||
|
@TableField(value = "NUM")
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
@TableField(value = "FILEFLAG")
|
||||||
|
private Short fileflag;
|
||||||
|
|
||||||
|
@TableField(value = "FIRSTTIME")
|
||||||
|
private LocalDateTime firsttime;
|
||||||
|
|
||||||
|
@TableField(value = "FIRSTTYPE")
|
||||||
|
private String firsttype;
|
||||||
|
|
||||||
|
@TableField(value = "FIRSTMS")
|
||||||
|
private BigDecimal firstms;
|
||||||
|
|
||||||
|
@TableField(value = "WAVENAME")
|
||||||
|
private String wavename;
|
||||||
|
|
||||||
|
@TableField(value = "ENERGY")
|
||||||
|
private Double energy;
|
||||||
|
|
||||||
|
@TableField(value = "SEVERITY")
|
||||||
|
private Double severity;
|
||||||
|
|
||||||
|
@TableField(value = "LOOK_FLAG")
|
||||||
|
private Integer lookFlag;
|
||||||
|
|
||||||
|
@TableField(value = "NOTICE_FLAG")
|
||||||
|
private Integer noticeFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer eventSeverity;
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("PQS_USER")
|
||||||
|
public class PqsUser {
|
||||||
|
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String userIndex;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String loginname;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date registertime;
|
||||||
|
|
||||||
|
private Date psdvalidity;
|
||||||
|
|
||||||
|
private Date logintime;
|
||||||
|
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
private Integer mark;
|
||||||
|
|
||||||
|
private String limitIpstart;
|
||||||
|
|
||||||
|
private String limitIpend;
|
||||||
|
|
||||||
|
private String limitTime;
|
||||||
|
|
||||||
|
private Integer loginErrorTimes;
|
||||||
|
|
||||||
|
@TableField("CASUAL_USER")
|
||||||
|
private Integer casualUser;
|
||||||
|
|
||||||
|
private Date firsterrorTime;
|
||||||
|
|
||||||
|
|
||||||
|
private Date lockTime;
|
||||||
|
|
||||||
|
private String referralCode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-06-24
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("PQS_USERSET")
|
||||||
|
public class PqsUserSet implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户设置索引
|
||||||
|
*/
|
||||||
|
@TableId("USERSET_INDEX")
|
||||||
|
private String usersetIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户索引
|
||||||
|
*/
|
||||||
|
@TableField("USER_INDEX")
|
||||||
|
private String userIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否通知(0-否,1-是)
|
||||||
|
*/
|
||||||
|
@TableField("ISNOTICE")
|
||||||
|
private Integer isNotice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色组索引
|
||||||
|
*/
|
||||||
|
@TableField("ROLEGP_INDEX")
|
||||||
|
private String roleGpIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门索引
|
||||||
|
*/
|
||||||
|
@TableField("DEPTS_INDEX")
|
||||||
|
private String deptsIndex;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/06/20 上午 9:29【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AlarmAnalysisVO {
|
||||||
|
@ApiModelProperty(name="eventCount",value="暂降次数")
|
||||||
|
private Integer eventCount;
|
||||||
|
@ApiModelProperty(name="aLarmCount",value="告警事件统计")
|
||||||
|
private Integer aLarmCount;
|
||||||
|
@ApiModelProperty(name="warnCount",value="预警事件统计")
|
||||||
|
private Integer warnCount;
|
||||||
|
@ApiModelProperty(name="noticeCount",value="远程通知统计")
|
||||||
|
private Integer noticeCount;
|
||||||
|
@ApiModelProperty(name="lookALarmCount",value="告警事件处置数")
|
||||||
|
private Integer lookALarmCount;
|
||||||
|
@ApiModelProperty(name="lookWarnCount",value="预警事件处置数")
|
||||||
|
private Integer lookWarnCount;
|
||||||
|
@ApiModelProperty(name="lookNoticeCount",value="远程通知处置数")
|
||||||
|
private Integer lookNoticeCount;
|
||||||
|
|
||||||
|
List<EventDetailVO> eventdetails;
|
||||||
|
List<EventDetailVO> aLarmEvent;
|
||||||
|
List<EventDetailVO> warnEvent;
|
||||||
|
List<MsgEventInfo> noticeEvent;
|
||||||
|
List<EventDetailVO> lookALarmEvent;
|
||||||
|
List<EventDetailVO> lookWarnEvent;
|
||||||
|
List<MsgEventInfo> lookNoticeEvent;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user