代码调整
This commit is contained in:
@@ -1,10 +1,20 @@
|
|||||||
package com.njcn.gather.detection.controller;
|
package com.njcn.gather.detection.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.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.service.PreDetectionService;
|
import com.njcn.gather.detection.service.PreDetectionService;
|
||||||
|
import com.njcn.gather.detection.service.impl.DetectionServiceImpl;
|
||||||
|
import com.njcn.gather.detection.util.socket.MsgUtil;
|
||||||
|
import com.njcn.gather.device.device.pojo.vo.PreDetection;
|
||||||
|
import com.njcn.gather.device.device.service.IPqDevService;
|
||||||
|
import com.njcn.gather.device.script.pojo.param.PqScriptIssueParam;
|
||||||
|
import com.njcn.gather.device.script.pojo.po.SourceIssue;
|
||||||
|
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
||||||
|
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.utils.HttpResultUtil;
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -14,6 +24,11 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags = "预检测")
|
@Api(tags = "预检测")
|
||||||
@@ -24,6 +39,12 @@ public class PreDetectionController extends BaseController {
|
|||||||
|
|
||||||
private final PreDetectionService preDetectionService;
|
private final PreDetectionService preDetectionService;
|
||||||
|
|
||||||
|
private final DetectionServiceImpl detectionServiceImpl;
|
||||||
|
|
||||||
|
private final IPqScriptDtlsService pqScriptDtlsService;
|
||||||
|
|
||||||
|
private final IPqDevService iPqDevService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +85,44 @@ public class PreDetectionController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||||
public HttpResult<String> startTest(@RequestBody PreDetectionParam param){
|
public HttpResult<String> startTest(@RequestBody PreDetectionParam param){
|
||||||
String methodDescribe = getMethodDescribe("startTest");
|
String methodDescribe = getMethodDescribe("startTest");
|
||||||
preDetectionService.startTest(param);
|
//preDetectionService.startTest(param);
|
||||||
|
|
||||||
|
String a = "{\"Time\":\"2025-01-02T14:14:44.958\",\"ID\":\"192.168.1.186_1\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.035600\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
String b = "{\"Time\":\"2025-01-02T14:14:39.004\",\"ID\":\"192.168.1.203_1\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.000000\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
String c = "{\"Time\":\"2025-01-02T14:14:39.004\",\"ID\":\"192.168.1.203_2\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.000000\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
String d = "{\"Time\":\"2025-01-02T14:14:47.956\",\"ID\":\"192.168.1.186_1\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.032300\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
String e = "{\"Time\":\"2025-01-02T14:14:42.004\",\"ID\":\"192.168.1.203_1\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.000000\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
String f = "{\"Time\":\"2025-01-02T14:14:42.004\",\"ID\":\"192.168.1.203_2\",\"result\":false,\"SqlData\":[{\"type\":\"real\",\"desc\":\"FREQ\",\"list\":{\"A\":null,\"B\":null,\"C\":null,\"T\":\"50.000000\"}}],\"SqlDataHarm\":[]}";
|
||||||
|
|
||||||
|
List<DevData> devDataList = new ArrayList<>();
|
||||||
|
DevData aa = JSON.parseObject(a, DevData.class);
|
||||||
|
DevData bb = JSON.parseObject(a, DevData.class);
|
||||||
|
DevData cc = JSON.parseObject(a, DevData.class);
|
||||||
|
DevData dd = JSON.parseObject(a, DevData.class);
|
||||||
|
DevData ee = JSON.parseObject(a, DevData.class);
|
||||||
|
DevData ff = JSON.parseObject(a, DevData.class);
|
||||||
|
devDataList.add(aa);
|
||||||
|
devDataList.add(bb);
|
||||||
|
devDataList.add(cc);
|
||||||
|
devDataList.add(dd);
|
||||||
|
devDataList.add(ee);
|
||||||
|
devDataList.add(ff);
|
||||||
|
|
||||||
|
PqScriptIssueParam issueParam = new PqScriptIssueParam();
|
||||||
|
issueParam.setPlanId(param.getPlanId());
|
||||||
|
issueParam.setSourceId(param.getSourceId());
|
||||||
|
issueParam.setDevIds(param.getDevIds());
|
||||||
|
issueParam.setScriptId("a303b2224845fcc6f60198b8ca23dca9");
|
||||||
|
issueParam.setIsPhaseSequence(false);
|
||||||
|
SourceIssue sourceIssues = pqScriptDtlsService.listSourceIssue(issueParam).get(0);
|
||||||
|
|
||||||
|
List<PreDetection> pqDevList = iPqDevService.getDevInfo(param.getDevIds());
|
||||||
|
Map<String, String> devIdMapComm = pqDevList.stream().collect(Collectors.toMap(PreDetection::getDevIP, PreDetection::getDevId));
|
||||||
|
|
||||||
|
detectionServiceImpl.text(devDataList,param.getErrorSysId(),devIdMapComm,sourceIssues, DictDataEnum.AT_WILL_VALUE);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.njcn.gather.device.script.pojo.po.SourceIssue;
|
|||||||
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
||||||
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.system.dictionary.pojo.enums.DictDataEnum;
|
import com.njcn.gather.system.dictionary.pojo.enums.DictDataEnum;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -54,6 +55,8 @@ public class SocketDevResponseService {
|
|||||||
private final IPqScriptDtlsService pqScriptDtlsService;
|
private final IPqScriptDtlsService pqScriptDtlsService;
|
||||||
private final DetectionServiceImpl detectionServiceImpl;
|
private final DetectionServiceImpl detectionServiceImpl;
|
||||||
|
|
||||||
|
private final DetectionDataDealService detectionDataDealService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +102,7 @@ public class SocketDevResponseService {
|
|||||||
List<AdNonHarmonicResult> adNonHarmonicResultList = new ArrayList<>();
|
List<AdNonHarmonicResult> adNonHarmonicResultList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public void deal(PreDetectionParam param, String msg) {
|
public void deal(PreDetectionParam param, String msg) throws Exception{
|
||||||
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
||||||
String[] tem = socketDataMsg.getRequestId().split("&&");
|
String[] tem = socketDataMsg.getRequestId().split("&&");
|
||||||
|
|
||||||
@@ -455,12 +458,16 @@ public class SocketDevResponseService {
|
|||||||
System.out.println(flag);
|
System.out.println(flag);
|
||||||
|
|
||||||
long tem = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
long tem = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
||||||
SocketManager.addTargetMap(sourceIssue.getSubType(), tem);
|
SocketManager.addTargetMap(sourceIssue.getType(), tem);
|
||||||
|
|
||||||
System.out.println("该大项还有"+tem+"个小项没有进行检测!!!!!!!!");
|
System.out.println("该大项还有"+tem+"个小项没有进行检测!!!!!!!!");
|
||||||
|
|
||||||
if (tem == 0) {
|
if (tem == 0) {
|
||||||
System.out.println(sourceIssue.getType() + sourceIssue.getIndex() + "当前测试大项已经全部结束》》》》》》》》");
|
System.out.println(sourceIssue.getType() + sourceIssue.getIndex() + "当前测试大项已经全部结束》》》》》》》》");
|
||||||
|
|
||||||
|
|
||||||
|
baseDataInsert(devDataList,sourceIssue,param);
|
||||||
|
|
||||||
//当val为0则认为大项中的小项已经全部跑完,开始组装信息推送给前端
|
//当val为0则认为大项中的小项已经全部跑完,开始组装信息推送给前端
|
||||||
WebSocketVO<List<DevLineTestResult>> webSocketVO = new WebSocketVO<>();
|
WebSocketVO<List<DevLineTestResult>> webSocketVO = new WebSocketVO<>();
|
||||||
webSocketVO.setRequestId(socketDataMsg.getRequestId().split("&&")[1] + "_End");
|
webSocketVO.setRequestId(socketDataMsg.getRequestId().split("&&")[1] + "_End");
|
||||||
@@ -738,7 +745,7 @@ public class SocketDevResponseService {
|
|||||||
* @author cdf
|
* @author cdf
|
||||||
* @date 2024/12/29
|
* @date 2024/12/29
|
||||||
*/
|
*/
|
||||||
private void baseDataInsert(List<DevData> devDataList,Integer index,PreDetectionParam param){
|
private void baseDataInsert(List<DevData> devDataList,SourceIssue sourceIssue,PreDetectionParam param){
|
||||||
Runnable runnable = new Runnable() {
|
Runnable runnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -753,14 +760,15 @@ public class SocketDevResponseService {
|
|||||||
adNonHarmonicResult.setTimeId(localDateTime);
|
adNonHarmonicResult.setTimeId(localDateTime);
|
||||||
adNonHarmonicResult.setMonitorId(data.getId());
|
adNonHarmonicResult.setMonitorId(data.getId());
|
||||||
adNonHarmonicResult.setScriptId(param.getScriptId());
|
adNonHarmonicResult.setScriptId(param.getScriptId());
|
||||||
adNonHarmonicResult.setIndex(index);
|
adNonHarmonicResult.setSort(sourceIssue.getIndex());
|
||||||
|
adNonHarmonicResult.setAdType(sourceIssue.getSourceId());
|
||||||
adNonHarmonicResult.setAValue(data.getSqlData().get(0).getList().getA().toString());
|
adNonHarmonicResult.setAValue(data.getSqlData().get(0).getList().getA().toString());
|
||||||
adNonHarmonicResult.setBValue(data.getSqlData().get(0).getList().getB().toString());
|
adNonHarmonicResult.setBValue(data.getSqlData().get(0).getList().getB().toString());
|
||||||
adNonHarmonicResult.setCValue(data.getSqlData().get(0).getList().getC().toString());
|
adNonHarmonicResult.setCValue(data.getSqlData().get(0).getList().getC().toString());
|
||||||
adHarmonicResultList.add(adNonHarmonicResult);
|
adHarmonicResultList.add(adNonHarmonicResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//detectionDataDealService.acceptAdNon(adHarmonicResultList,"1");
|
detectionDataDealService.acceptAdNon(adHarmonicResultList,"1");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
runnable.run();
|
runnable.run();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class SocketSourceResponseService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void deal(PreDetectionParam param, String msg) {
|
public void deal(PreDetectionParam param, String msg) throws Exception {
|
||||||
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
SocketDataMsg socketDataMsg = MsgUtil.socketDataMsg(msg);
|
||||||
String[] tem = socketDataMsg.getRequestId().split("&&");
|
String[] tem = socketDataMsg.getRequestId().split("&&");
|
||||||
SourceOperateCodeEnum enumByCode = SourceOperateCodeEnum.getDictDataEnumByCode(tem[0]);
|
SourceOperateCodeEnum enumByCode = SourceOperateCodeEnum.getDictDataEnumByCode(tem[0]);
|
||||||
@@ -90,7 +90,7 @@ public class SocketSourceResponseService {
|
|||||||
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());
|
||||||
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
||||||
SocketMsg socketMsg = new SocketMsg();
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
|
|
||||||
switch (dictDataEnumByCode) {
|
switch (dictDataEnumByCode) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
@@ -114,7 +114,7 @@ public class SocketSourceResponseService {
|
|||||||
webSocketHandler.sendMsgToUser(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
webSocketHandler.sendMsgToUser(param.getUserPageId(), JSON.toJSONString(socketDataMsg));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
socketMsg = new SocketMsg();
|
socketMsg = new SocketMsg<>();
|
||||||
socketMsg.setRequestId(socketDataMsg.getRequestId());
|
socketMsg.setRequestId(socketDataMsg.getRequestId());
|
||||||
socketMsg.setOperateCode(socketDataMsg.getOperateCode());
|
socketMsg.setOperateCode(socketDataMsg.getOperateCode());
|
||||||
socketMsg.setData(dictDataEnumByCode.getMessage());
|
socketMsg.setData(dictDataEnumByCode.getMessage());
|
||||||
@@ -133,7 +133,7 @@ public class SocketSourceResponseService {
|
|||||||
private void phaseSequenceDev(PreDetectionParam param, SocketDataMsg socketDataMsg) {
|
private void phaseSequenceDev(PreDetectionParam param, SocketDataMsg socketDataMsg) {
|
||||||
SourceResponseCodeEnum dictDataEnumByCode = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
|
SourceResponseCodeEnum dictDataEnumByCode = SourceResponseCodeEnum.getDictDataEnumByCode(socketDataMsg.getCode());
|
||||||
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
if (ObjectUtil.isNotNull(dictDataEnumByCode)) {
|
||||||
SocketMsg socketMsg = new SocketMsg();
|
SocketMsg<String> socketMsg = new SocketMsg();
|
||||||
switch (dictDataEnumByCode) {
|
switch (dictDataEnumByCode) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
//向前端推送信息
|
//向前端推送信息
|
||||||
@@ -196,7 +196,7 @@ public class SocketSourceResponseService {
|
|||||||
System.out.println("向装置下发的参数"+comm);
|
System.out.println("向装置下发的参数"+comm);
|
||||||
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
||||||
phaseSequenceParam.setDataType(Arrays.asList(comm));
|
phaseSequenceParam.setDataType(Arrays.asList(comm));
|
||||||
phaseSequenceParam.setReadCount(5);
|
phaseSequenceParam.setReadCount(2);
|
||||||
phaseSequenceParam.setIgnoreCount(10);
|
phaseSequenceParam.setIgnoreCount(10);
|
||||||
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
||||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public class DetectionServiceImpl {
|
|||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
result.setMonitorId(devID + "_" + split[1]);
|
result.setMonitorId(devID + "_" + split[1]);
|
||||||
result.setScriptId(sourceIssue.getScriptId());
|
result.setScriptId(sourceIssue.getScriptId());
|
||||||
result.setIndex(sourceIssue.getIndex());
|
result.setSort(sourceIssue.getIndex());
|
||||||
result.setAdType(pqErrSysDtls.get(0).getScriptType());
|
result.setAdType(pqErrSysDtls.get(0).getScriptType());
|
||||||
result.setDataType("avg");
|
result.setDataType("avg");
|
||||||
if (map.containsKey(TYPE_T)) {
|
if (map.containsKey(TYPE_T)) {
|
||||||
@@ -275,7 +275,7 @@ public class DetectionServiceImpl {
|
|||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
harmonicResult.setMonitorId(devID + "_" + split[1]);
|
harmonicResult.setMonitorId(devID + "_" + split[1]);
|
||||||
harmonicResult.setScriptId(sourceIssue.getScriptId());
|
harmonicResult.setScriptId(sourceIssue.getScriptId());
|
||||||
harmonicResult.setIndex(sourceIssue.getIndex());
|
harmonicResult.setSort(sourceIssue.getIndex());
|
||||||
harmonicResult.setAdType(pqErrSysDtls.get(0).getScriptType());
|
harmonicResult.setAdType(pqErrSysDtls.get(0).getScriptType());
|
||||||
harmonicResult.setDataType("avg");
|
harmonicResult.setDataType("avg");
|
||||||
reflectHarmonic("a", integerBooleanA, harmonicResult);
|
reflectHarmonic("a", integerBooleanA, harmonicResult);
|
||||||
@@ -324,7 +324,7 @@ public class DetectionServiceImpl {
|
|||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
result.setMonitorId(devID + "_" + split[1]);
|
result.setMonitorId(devID + "_" + split[1]);
|
||||||
result.setScriptId(sourceIssue.getScriptId());
|
result.setScriptId(sourceIssue.getScriptId());
|
||||||
result.setIndex(sourceIssue.getIndex());
|
result.setSort(sourceIssue.getIndex());
|
||||||
result.setAdType(pqErrSysDtls.get(0).getScriptType());
|
result.setAdType(pqErrSysDtls.get(0).getScriptType());
|
||||||
result.setDataType("avg");
|
result.setDataType("avg");
|
||||||
//取出源所对应的相别信息
|
//取出源所对应的相别信息
|
||||||
@@ -418,7 +418,7 @@ public class DetectionServiceImpl {
|
|||||||
String devID = devIdMapComm.get(split[0]);
|
String devID = devIdMapComm.get(split[0]);
|
||||||
result.setMonitorId(devID + "_" + split[1]);
|
result.setMonitorId(devID + "_" + split[1]);
|
||||||
result.setScriptId(sourceIssue.getScriptId());
|
result.setScriptId(sourceIssue.getScriptId());
|
||||||
result.setIndex(sourceIssue.getIndex());
|
result.setSort(sourceIssue.getIndex());
|
||||||
result.setDataType("avg");
|
result.setDataType("avg");
|
||||||
//取出源所对应的相别信息
|
//取出源所对应的相别信息
|
||||||
List<SourceIssue.ChannelListDTO> channelTypeAList = sourceIssue.getChannelList().stream()
|
List<SourceIssue.ChannelListDTO> channelTypeAList = sourceIssue.getChannelList().stream()
|
||||||
|
|||||||
@@ -69,8 +69,10 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
|||||||
public void sourceCommunicationCheck(PreDetectionParam param) {
|
public void sourceCommunicationCheck(PreDetectionParam param) {
|
||||||
|
|
||||||
|
|
||||||
System.out.println("进来了啊啊啊啊啊啊啊啊啊啊啊啊啊");
|
System.out.println("进来了啊啊啊啊啊啊啊啊啊啊啊啊啊----------------------------------------------------------------");
|
||||||
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + source);
|
Channel channel = SocketManager.getChannelByUserId(param.getUserPageId() + source);
|
||||||
|
System.out.println("存活的源=========================="+channel);
|
||||||
|
|
||||||
if (Objects.nonNull(channel) && channel.isActive()) {
|
if (Objects.nonNull(channel) && channel.isActive()) {
|
||||||
System.out.println("进入关闭源。。//////");
|
System.out.println("进入关闭源。。//////");
|
||||||
SocketDataMsg socketDataMsg = new SocketDataMsg();
|
SocketDataMsg socketDataMsg = new SocketDataMsg();
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.njcn.gather.detection.util.socket;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
||||||
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
|
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-01-02
|
||||||
|
* @Description: 工具类
|
||||||
|
*/
|
||||||
|
public class CnSocketUtil {
|
||||||
|
|
||||||
|
private final static String handlerStr = "_Dev";
|
||||||
|
private final static String handlerSourceStr = "_Source";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出检测
|
||||||
|
*/
|
||||||
|
public static void quitSend(PreDetectionParam param) {
|
||||||
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.QUITE.getValue());
|
||||||
|
socketMsg.setOperateCode(SourceOperateCodeEnum.QUIT_INIT_03.getValue());
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerStr, JSON.toJSONString(socketMsg));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭源连接
|
||||||
|
*/
|
||||||
|
public static void quitSendSource(PreDetectionParam param) {
|
||||||
|
SocketMsg<String> socketMsg = new SocketMsg<>();
|
||||||
|
socketMsg.setRequestId(SourceOperateCodeEnum.QUITE_SOURCE.getValue());
|
||||||
|
socketMsg.setOperateCode(SourceOperateCodeEnum.CLOSE_GATHER.getValue());
|
||||||
|
SocketManager.sendMsg(param.getUserPageId() + handlerSourceStr, JSON.toJSONString(socketMsg));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,10 @@ package com.njcn.gather.detection.util.socket;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
||||||
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.vo.SocketDataMsg;
|
import com.njcn.gather.detection.pojo.vo.SocketDataMsg;
|
||||||
|
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -16,6 +19,7 @@ import java.util.Map;
|
|||||||
public class MsgUtil {
|
public class MsgUtil {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static SocketDataMsg socketDataMsg(String textMsg){
|
public static SocketDataMsg socketDataMsg(String textMsg){
|
||||||
return JSON.parseObject(textMsg,SocketDataMsg.class);
|
return JSON.parseObject(textMsg,SocketDataMsg.class);
|
||||||
}
|
}
|
||||||
@@ -68,4 +72,5 @@ public class MsgUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.gather.detection.util.socket.cilent;
|
|||||||
|
|
||||||
import com.njcn.gather.detection.handler.SocketDevResponseService;
|
import com.njcn.gather.detection.handler.SocketDevResponseService;
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
|
import com.njcn.gather.detection.util.socket.CnSocketUtil;
|
||||||
import com.njcn.gather.detection.util.socket.SocketManager;
|
import com.njcn.gather.detection.util.socket.SocketManager;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
@@ -51,7 +52,12 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
|
|||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws InterruptedException {
|
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws InterruptedException {
|
||||||
System.out.println("devhandler接收server端数据>>>>>>"+msg);
|
System.out.println("devhandler接收server端数据>>>>>>"+msg);
|
||||||
socketResponseService.deal(param,msg);
|
try {
|
||||||
|
socketResponseService.deal(param,msg);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
CnSocketUtil.quitSend(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,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.detection.pojo.vo.SocketDataMsg;
|
import com.njcn.gather.detection.pojo.vo.SocketDataMsg;
|
||||||
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
import com.njcn.gather.detection.pojo.vo.SocketMsg;
|
||||||
|
import com.njcn.gather.detection.util.socket.CnSocketUtil;
|
||||||
import com.njcn.gather.detection.util.socket.MsgUtil;
|
import com.njcn.gather.detection.util.socket.MsgUtil;
|
||||||
import com.njcn.gather.detection.util.socket.SocketManager;
|
import com.njcn.gather.detection.util.socket.SocketManager;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
@@ -51,7 +52,12 @@ public class NettySourceClientHandler extends SimpleChannelInboundHandler<String
|
|||||||
@Override
|
@Override
|
||||||
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws InterruptedException {
|
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws InterruptedException {
|
||||||
System.out.println("接收server端数据>>>>>>" + msg);
|
System.out.println("接收server端数据>>>>>>" + msg);
|
||||||
sourceResponseService.deal(webUser, msg);
|
try {
|
||||||
|
sourceResponseService.deal(webUser, msg);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
CnSocketUtil.quitSend(webUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -90,7 +96,8 @@ public class NettySourceClientHandler extends SimpleChannelInboundHandler<String
|
|||||||
ctx.writeAndFlush(MsgUtil.toJsonWithNewLinePlain(msg));
|
ctx.writeAndFlush(MsgUtil.toJsonWithNewLinePlain(msg));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userEventTriggered(ctx, evt);
|
//防止堆栈溢出
|
||||||
|
//userEventTriggered(ctx, evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
|||||||
script.setIsValueTypeName(false);
|
script.setIsValueTypeName(false);
|
||||||
List<String> valueType = pqScriptCheckDataService.getValueType(script);
|
List<String> valueType = pqScriptCheckDataService.getValueType(script);
|
||||||
//根据检测脚本id和检测序号,查询出检测子项目
|
//根据检测脚本id和检测序号,查询出检测子项目
|
||||||
return this.list(new MPJLambdaWrapper<PqErrSysDtls>()
|
return this.list(new MPJLambdaWrapper<PqErrSysDtls>().selectAll(PqErrSysDtls.class)
|
||||||
.selectAll(PqErrSysDtls.class)
|
.selectAll(PqErrSysDtls.class)
|
||||||
.selectAs(DictTree::getCode, PqErrSysDtls::getScriptCode)
|
.selectAs(DictTree::getCode, PqErrSysDtls::getScriptCode)
|
||||||
.leftJoin(DictTree.class, DictTree::getId, PqErrSysDtls::getScriptType)
|
.leftJoin(DictTree.class, DictTree::getId, PqErrSysDtls::getScriptType)
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
public class SourceIssue {
|
public class SourceIssue {
|
||||||
|
/**
|
||||||
|
* 检测小项dtls Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 源ID
|
* 源ID
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
if (CollUtil.isNotEmpty(freq)) {
|
if (CollUtil.isNotEmpty(freq)) {
|
||||||
PqScriptDtls freqDtls = freq.get(0);
|
PqScriptDtls freqDtls = freq.get(0);
|
||||||
SourceIssue issue = new SourceIssue();
|
SourceIssue issue = new SourceIssue();
|
||||||
|
issue.setId(freqDtls.getId());
|
||||||
issue.setSourceId(param.getSourceId());
|
issue.setSourceId(param.getSourceId());
|
||||||
issue.setType(freqDtls.getScriptCode());
|
issue.setType(freqDtls.getScriptCode());
|
||||||
issue.setIndex(freqDtls.getIndex());
|
issue.setIndex(freqDtls.getIndex());
|
||||||
|
|||||||
@@ -4,17 +4,17 @@
|
|||||||
|
|
||||||
<update id="genAdNonHarmonicTable" parameterType="string">
|
<update id="genAdNonHarmonicTable" parameterType="string">
|
||||||
CREATE TABLE ad_non_harmonic_${code} (
|
CREATE TABLE ad_non_harmonic_${code} (
|
||||||
Monitor_Id CHAR(32) NOT NULL COMMENT '监测点Id',
|
Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',
|
||||||
Time_Id DATETIME NOT NULL COMMENT '时间',
|
Time_Id DATETIME NOT NULL COMMENT '时间',
|
||||||
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
||||||
index int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
||||||
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
||||||
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
||||||
A_Value varchar(30) NOT NULL COMMENT 'A相值',
|
A_Value varchar(30) DEFAULT NULL COMMENT 'A相值',
|
||||||
B_Value varchar(30) NOT NULL COMMENT 'B相值',
|
B_Value varchar(30) DEFAULT NULL COMMENT 'B相值',
|
||||||
C_Value varchar(30) NOT NULL COMMENT 'C相值',
|
C_Value varchar(30) DEFAULT NULL COMMENT 'C相值',
|
||||||
T_Value varchar(30) NOT NULL COMMENT 'T相值(没有相别的则存这里)',
|
T_Value varchar(30) DEFAULT NULL COMMENT 'T相值(没有相别的则存这里)',
|
||||||
PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, index, Data_Type)
|
PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, Sort, Data_Type)
|
||||||
) COMMENT='监测数据表';
|
) COMMENT='监测数据表';
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -26,18 +26,18 @@
|
|||||||
|
|
||||||
<update id="genAdNonHarmonicResultTable" parameterType="string">
|
<update id="genAdNonHarmonicResultTable" parameterType="string">
|
||||||
CREATE TABLE ad_non_harmonic_result_${code} (
|
CREATE TABLE ad_non_harmonic_result_${code} (
|
||||||
Monitor_Id CHAR(32) NOT NULL COMMENT '监测点Id',
|
Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',
|
||||||
Time_Id DATETIME NOT NULL COMMENT '时间',
|
Time_Id DATETIME NULL COMMENT '时间',
|
||||||
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',
|
||||||
index int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
Sort int(4) NOT NULL COMMENT '总检测脚本中的测试项序号',
|
||||||
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',
|
||||||
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',
|
||||||
Result_Flag int(1) NOT NULL COMMENT '0.不合格 1.合格',
|
Result_Flag int(1) NOT NULL COMMENT '0.不合格 1.合格',
|
||||||
A_Value varchar(30) NOT NULL COMMENT 'A相值',
|
A_Value varchar(30) NULL COMMENT 'A相值',
|
||||||
B_Value varchar(30) NOT NULL COMMENT 'B相值',
|
B_Value varchar(30) NULL COMMENT 'B相值',
|
||||||
C_Value varchar(30) NOT NULL COMMENT 'C相值',
|
C_Value varchar(30) NULL COMMENT 'C相值',
|
||||||
T_Value varchar(30) NOT NULL COMMENT 'T相值(没有相别的则存这里)',
|
T_Value varchar(30) NULL COMMENT 'T相值(没有相别的则存这里)',
|
||||||
PRIMARY KEY (Monitor_Id, Time_Id, Script_Id, index, Data_Type)
|
PRIMARY KEY (Monitor_Id, Script_Id, Sort, Data_Type)
|
||||||
) COMMENT='监测数据表';
|
) COMMENT='监测数据表';
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ public class AdHarmonicResult {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String scriptDtlsId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点Id
|
* 监测点Id
|
||||||
@@ -44,7 +42,7 @@ public class AdHarmonicResult {
|
|||||||
/**
|
/**
|
||||||
* 总检测脚本中的测试项序号
|
* 总检测脚本中的测试项序号
|
||||||
*/
|
*/
|
||||||
private Integer index;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测指标,字典表
|
* 检测指标,字典表
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.gather.storage.pojo.po;
|
package com.njcn.gather.storage.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -39,7 +40,7 @@ public class AdNonHarmonicResult {
|
|||||||
/**
|
/**
|
||||||
* 总检测脚本中的测试项序号
|
* 总检测脚本中的测试项序号
|
||||||
*/
|
*/
|
||||||
private Integer index;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测指标,字典表
|
* 检测指标,字典表
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
}
|
}
|
||||||
wrapper.like(AdHarmonicResult::getMonitorId, monitorId)
|
wrapper.like(AdHarmonicResult::getMonitorId, monitorId)
|
||||||
.eq(ObjectUtil.isNotNull(scriptId), AdHarmonicResult::getScriptId, scriptId)
|
.eq(ObjectUtil.isNotNull(scriptId), AdHarmonicResult::getScriptId, scriptId)
|
||||||
.in(CollUtil.isNotEmpty(index), AdHarmonicResult::getIndex, index);
|
.in(CollUtil.isNotEmpty(index), AdHarmonicResult::getSort, index);
|
||||||
List<AdHarmonicResult> list = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<AdHarmonicResult> list = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
return BeanUtil.copyToList(list, AdBaseResult.class);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
|||||||
}
|
}
|
||||||
wrapper.like(AdNonHarmonicResult::getMonitorId, monitorId)
|
wrapper.like(AdNonHarmonicResult::getMonitorId, monitorId)
|
||||||
.eq(ObjectUtil.isNotNull(scriptId), AdNonHarmonicResult::getScriptId, scriptId)
|
.eq(ObjectUtil.isNotNull(scriptId), AdNonHarmonicResult::getScriptId, scriptId)
|
||||||
.in(CollUtil.isNotEmpty(index), AdNonHarmonicResult::getIndex, index);
|
.in(CollUtil.isNotEmpty(index), AdNonHarmonicResult::getSort, index);
|
||||||
List<AdNonHarmonicResult> list = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
List<AdNonHarmonicResult> list = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
return BeanUtil.copyToList(list, AdBaseResult.class);
|
||||||
|
|||||||
@@ -25,38 +25,38 @@ public class TableGenServiceImpl implements TableGenService {
|
|||||||
StringBuilder C = new StringBuilder();
|
StringBuilder C = new StringBuilder();
|
||||||
for(int i=1;i<=50;i++){
|
for(int i=1;i<=50;i++){
|
||||||
if(i == 1){
|
if(i == 1){
|
||||||
A.append("A_Value_").append(i).append(" varchar(30) NOT NULL COMMENT 'A相基波',");
|
A.append("A_Value_").append(i).append(" varchar(30) NULL COMMENT 'A相基波',");
|
||||||
B.append("B_Value_").append(i).append(" varchar(30) NOT NULL COMMENT 'B相基波',");
|
B.append("B_Value_").append(i).append(" varchar(30) NULL COMMENT 'B相基波',");
|
||||||
C.append("C_Value_").append(i).append(" varchar(30) NOT NULL COMMENT 'C相基波',");
|
C.append("C_Value_").append(i).append(" varchar(30) NULL COMMENT 'C相基波',");
|
||||||
}else {
|
}else {
|
||||||
A.append("A_Value_").append(i).append(" varchar(30) NOT NULL COMMENT '").append(i).append("次A相谐波',");
|
A.append("A_Value_").append(i).append(" varchar(30) NULL COMMENT '").append(i).append("次A相谐波',");
|
||||||
B.append("B_Value_").append(i).append(" varchar(30) NOT NULL COMMENT '").append(i).append("次B相谐波',");
|
B.append("B_Value_").append(i).append(" varchar(30) NULL COMMENT '").append(i).append("次B相谐波',");
|
||||||
C.append("C_Value_").append(i).append(" varchar(30) NOT NULL COMMENT '").append(i).append("次C相谐波',");
|
C.append("C_Value_").append(i).append(" varchar(30) NULL COMMENT '").append(i).append("次C相谐波',");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String sql = "CREATE TABLE AD_Harmonic_"+code+" (\n" +
|
String sql = "CREATE TABLE AD_Harmonic_"+code+" (\n" +
|
||||||
" Monitor_Id CHAR(32) NOT NULL COMMENT '监测点Id',\n" +
|
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
||||||
" Time_Id DATETIME NOT NULL COMMENT '时间',\n" +
|
" Time_Id DATETIME NULL COMMENT '时间',\n" +
|
||||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
||||||
" index 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" +
|
||||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||||
A+B+C+
|
A+B+C+
|
||||||
" PRIMARY KEY (Monitor_Id, Time_Id, Scripts_Id, index, Data_Type)\n" +
|
" PRIMARY KEY (Monitor_Id, Script_Id, Sort, Data_Type)\n" +
|
||||||
") COMMENT='监测数据表';";
|
") COMMENT='监测数据表';";
|
||||||
tableGenMapper.genAdHarmonicTable(sql);
|
tableGenMapper.genAdHarmonicTable(sql);
|
||||||
|
|
||||||
String sql2 = "CREATE TABLE AD_Harmonic_Result_"+code+" (\n" +
|
String sql2 = "CREATE TABLE AD_Harmonic_Result_"+code+" (\n" +
|
||||||
" Monitor_Id CHAR(32) NOT NULL COMMENT '监测点Id',\n" +
|
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
||||||
" Time_Id DATETIME NOT NULL COMMENT '时间',\n" +
|
" Time_Id DATETIME NOT NULL COMMENT '时间',\n" +
|
||||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
||||||
" index 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" +
|
||||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||||
" Result_Flag int(1) NOT NULL COMMENT '0.不合格 1.合格',\n" +
|
" Result_Flag int(1) NOT NULL COMMENT '0.不合格 1.合格',\n" +
|
||||||
A+B+C+
|
A+B+C+
|
||||||
" PRIMARY KEY (Monitor_Id, Time_Id, Script_Dtls_Id, index, Data_Type)\n" +
|
" PRIMARY KEY (Monitor_Id,Time_Id, Script_Id, Sort, Data_Type)\n" +
|
||||||
") COMMENT='监测数据表';";
|
") COMMENT='监测数据表';";
|
||||||
tableGenMapper.genAdHarmonicTable(sql2);
|
tableGenMapper.genAdHarmonicTable(sql2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user