优化数据源问题,删除检测脚本中值类型,由绑定检测计划中数据源来,获取是实时数据还是分钟数据
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
package com.njcn.gather.detection.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
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.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/12/10 14:25
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "守时检测")
|
||||
@RestController
|
||||
@RequestMapping("/punctuality")
|
||||
@RequiredArgsConstructor
|
||||
public class PunctualityController extends BaseController {
|
||||
|
||||
// private final PunctualityService punctualityService;
|
||||
|
||||
@OperateInfo
|
||||
@PostMapping("/deliveryTime")
|
||||
@ApiOperation("下发守时检测")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<?> list(@RequestBody Object param) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
// punctualityService.triggerTimeMark();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -1703,7 +1703,7 @@ public class SocketDevResponseService {
|
||||
adNonHarmonicResult.setSort(sourceIssue.getIndex());
|
||||
|
||||
adNonHarmonicResult.setAdType(checkDataMap.get(sqlDataDTO.getDesc()));
|
||||
adNonHarmonicResult.setDataType("avg");
|
||||
adNonHarmonicResult.setDataType(sourceIssue.getDataType());
|
||||
|
||||
Double a = listDTO.getA();
|
||||
Double b = listDTO.getB();
|
||||
@@ -1735,7 +1735,7 @@ public class SocketDevResponseService {
|
||||
adHarmonicResult.setScriptId(param.getScriptId());
|
||||
adHarmonicResult.setSort(sourceIssue.getIndex());
|
||||
adHarmonicResult.setAdType(checkDataMap.get(sqlDataDTO.getDesc()));
|
||||
adHarmonicResult.setDataType("avg");
|
||||
adHarmonicResult.setDataType(sourceIssue.getDataType());
|
||||
|
||||
if (!DicDataEnum.HSV.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HSI.getCode().equals(sourceIssue.getType()) && !DicDataEnum.HP.getCode().equals(sourceIssue.getType())) {
|
||||
if (CollUtil.isNotEmpty(data.getSqlData())) {
|
||||
|
||||
@@ -357,14 +357,10 @@ public class SocketSourceResponseService {
|
||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + stepTag + sourceIssue.getType());
|
||||
int ignoreCount;
|
||||
int readData;
|
||||
if (sourceIssue.getType().equals(DicDataEnum.F.getCode())) {
|
||||
if (DicDataEnum.F.getCode().equals(sourceIssue.getType())) {
|
||||
ignoreCount = 1;
|
||||
readData = 2;
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_01.getValue());
|
||||
} else if (sourceIssue.getType().equals(DicDataEnum.HP.getCode())) {
|
||||
ignoreCount = 2;
|
||||
readData = 5;
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_01.getValue());
|
||||
} else if (DicDataEnum.VOLTAGE.getCode().equals(sourceIssue.getType())) {
|
||||
ignoreCount = 5;
|
||||
readData = 1;
|
||||
@@ -372,9 +368,13 @@ public class SocketSourceResponseService {
|
||||
} else {
|
||||
ignoreCount = 5;
|
||||
readData = 5;
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_02.getValue());
|
||||
//区分实时数据还是分钟数据
|
||||
if ("real".equals(sourceIssue.getDataType())) {
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_DATA_REQUEST_02.getValue());
|
||||
} else {
|
||||
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());
|
||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||
phaseSequenceParam.setMoniterIdList(moniterIdList);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.njcn.gather.detection.service;
|
||||
|
||||
/**
|
||||
* @Description: 守时检测流程
|
||||
* @Author: wr
|
||||
* @Date: 2024/12/10 14:23
|
||||
*/
|
||||
public interface PunctualityService {
|
||||
|
||||
/**
|
||||
* 触发时间标识
|
||||
*/
|
||||
void triggerTimeMark();
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class DetectionServiceImpl {
|
||||
result.setMonitorId(devID + "_" + split[1]);
|
||||
result.setScriptId(sourceIssue.getScriptId());
|
||||
result.setSort(sourceIssue.getIndex());
|
||||
result.setDataType("avg");
|
||||
result.setDataType(sourceIssue.getDataType());
|
||||
Integer isQualified;
|
||||
List<ErrDtlsCheckDataVO> dtlsCheckData = errDtlsCheckData.stream().filter(x -> x.getValueTypeCode().equals(s.split("\\$")[1])).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(dtlsCheckData)) {
|
||||
@@ -312,7 +312,7 @@ public class DetectionServiceImpl {
|
||||
List<DetectionData> integerBooleanA = harmRangeComparison(isQualified, new ArrayList<>(), type, TYPE_A, sourceIssue, dataRule, devHarmMap.get(TYPE_A), fData, num);
|
||||
List<DetectionData> integerBooleanB = harmRangeComparison(isQualified, new ArrayList<>(), type, TYPE_B, sourceIssue, dataRule, devHarmMap.get(TYPE_B), fData, num);
|
||||
List<DetectionData> integerBooleanC = harmRangeComparison(isQualified, new ArrayList<>(), type, TYPE_C, sourceIssue, dataRule, devHarmMap.get(TYPE_C), fData, num);
|
||||
harmonicResult.setDataType("avg");
|
||||
harmonicResult.setDataType(sourceIssue.getDataType());
|
||||
reflectHarmonic("a", integerBooleanA, harmonicResult, num);
|
||||
reflectHarmonic("b", integerBooleanB, harmonicResult, num);
|
||||
reflectHarmonic("c", integerBooleanC, harmonicResult, num);
|
||||
@@ -375,7 +375,7 @@ public class DetectionServiceImpl {
|
||||
result.setMonitorId(devID + "_" + split[1]);
|
||||
result.setScriptId(sourceIssue.getScriptId());
|
||||
result.setSort(sourceIssue.getIndex());
|
||||
result.setDataType("avg");
|
||||
result.setDataType(sourceIssue.getDataType());
|
||||
List<PqErrSysDtls> pqErrSysDtls = new ArrayList<>();
|
||||
Integer isQualified = 4;
|
||||
if (CollUtil.isNotEmpty(errDtlsCheckData)) {
|
||||
@@ -498,7 +498,7 @@ public class DetectionServiceImpl {
|
||||
List<DetectionData> integerBooleanA = harmRangeComparison(isQualified, pqErrSysDtls, type, TYPE_A, sourceIssue, dataRule, devMap.get(TYPE_A), fData, num);
|
||||
List<DetectionData> integerBooleanB = harmRangeComparison(isQualified, pqErrSysDtls, type, TYPE_B, sourceIssue, dataRule, devMap.get(TYPE_B), fData, num);
|
||||
List<DetectionData> integerBooleanC = harmRangeComparison(isQualified, pqErrSysDtls, type, TYPE_C, sourceIssue, dataRule, devMap.get(TYPE_C), fData, num);
|
||||
harmonicResult.setDataType("avg");
|
||||
harmonicResult.setDataType(sourceIssue.getDataType());
|
||||
reflectHarmonic("a", integerBooleanA, harmonicResult, num);
|
||||
reflectHarmonic("b", integerBooleanB, harmonicResult, num);
|
||||
reflectHarmonic("c", integerBooleanC, harmonicResult, num);
|
||||
@@ -558,7 +558,7 @@ public class DetectionServiceImpl {
|
||||
pqErrSysDtls = errDtlsCheckData.get(0).getErrSysDtls();
|
||||
}
|
||||
}
|
||||
result.setDataType("avg");
|
||||
result.setDataType(sourceIssue.getDataType());
|
||||
if (StrUtil.isBlank(type)) {
|
||||
//取出源所对应的相别信息
|
||||
List<PqScriptCheckData> channelTypeAList = checkData.stream()
|
||||
@@ -729,7 +729,7 @@ public class DetectionServiceImpl {
|
||||
result.setMonitorId(devID + "_" + split[1]);
|
||||
result.setScriptId(sourceIssue.getScriptId());
|
||||
result.setSort(sourceIssue.getIndex());
|
||||
result.setDataType("avg");
|
||||
result.setDataType(sourceIssue.getDataType());
|
||||
List<PqErrSysDtls> magErrList = new ArrayList<>();
|
||||
Integer isQualified = 4;
|
||||
if (CollUtil.isNotEmpty(errDtlsCheckData)) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.njcn.gather.monitor.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.device.pojo.po.PqDev;
|
||||
import com.njcn.gather.monitor.mapper.PqMonitorMapper;
|
||||
import com.njcn.gather.monitor.pojo.param.PqMonitorParam;
|
||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.njcn.gather.storage.pojo.vo.RawDataVO;
|
||||
import com.njcn.gather.storage.pojo.vo.RawResultDataVO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@ public class PqScriptCheckDataParam {
|
||||
@ApiModelProperty("相别,字典表")
|
||||
private String phase;
|
||||
|
||||
/**
|
||||
* pq_script_checkdata 里dataType 删除,由根据计划中的数据源,来进行配置脚本增加扩展性
|
||||
*/
|
||||
@ApiModelProperty("数据类型,来源于字典表,包括实时数据(3s)、分钟统计数据(1min/3min/5min/10min)等")
|
||||
private String dataType;
|
||||
|
||||
@ApiModelProperty("检测指标类型(true:code(I$real) ,false展示id ,默认false)")
|
||||
private Boolean isValueTypeName=false;
|
||||
|
||||
|
||||
@@ -84,11 +84,6 @@ public class PqScriptDtlsParam {
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 数据类型,来源于字典表,包括实时数据(3s)、分钟统计数据(1min/3min/5min/10min)等
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 相别,字典表
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PqScriptIssueParam {
|
||||
@ApiModelProperty("终端id集合")
|
||||
private List<String> devIds;
|
||||
|
||||
@ApiModelProperty()
|
||||
@ApiModelProperty("校验步骤")
|
||||
private String isPhaseSequence;
|
||||
|
||||
@ApiModelProperty("源id")
|
||||
|
||||
@@ -39,10 +39,6 @@ public class PqScriptCheckData implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String valueTypeCode;
|
||||
|
||||
/**
|
||||
* 数据类型,来源于字典表,包括实时数据(3s)、分钟统计数据(1min/3min/5min/10min)等
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 相别,字典表
|
||||
|
||||
@@ -50,6 +50,9 @@ public class SourceIssue {
|
||||
@JSONField(serialize = false)
|
||||
private List<String> devValueTypeList;
|
||||
|
||||
@JSONField(serialize = false)
|
||||
private String dataType;
|
||||
|
||||
|
||||
@JSONField(serialize = false)
|
||||
private String desc;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.njcn.gather.script.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptCheckDataParam;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptCheckDataVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.gather.script.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.detection.pojo.param.DevPhaseSequenceParam;
|
||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptDtlsParam;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptIssueParam;
|
||||
@@ -9,11 +8,9 @@ import com.njcn.gather.script.pojo.param.ScriptParam;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptDtls;
|
||||
import com.njcn.gather.script.pojo.po.SourceIssue;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptCheckDataVO;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptDtlDataVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
|
||||
@@ -2,19 +2,17 @@ package com.njcn.gather.script.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||
import com.njcn.gather.detection.pojo.enums.DetectionResponseEnum;
|
||||
import com.njcn.gather.script.mapper.PqScriptCheckDataMapper;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptCheckDataParam;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptDtls;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptCheckDataVO;
|
||||
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
||||
import com.njcn.gather.system.dictionary.mapper.DictTreeMapper;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||
@@ -36,61 +34,68 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataMapper, PqScriptCheckData> implements IPqScriptCheckDataService {
|
||||
|
||||
private final String REAL="real$";
|
||||
private final String SYMBOL="$";
|
||||
|
||||
private final DictTreeMapper dictTreeMapper;
|
||||
|
||||
@Override
|
||||
public List<String> getValueType(PqScriptCheckDataParam param) {
|
||||
MPJLambdaWrapper<PqScriptCheckData> queryWrapper = new MPJLambdaWrapper<>();
|
||||
queryWrapper.selectAll(PqScriptCheckData.class)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqScriptCheckData::getValueType)
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.eq(ObjectUtil.isNotNull(param.getIndex()),PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
if (param.getIsValueTypeName()) {
|
||||
queryWrapper.selectAs(DictTree::getCode, PqScriptCheckData::getValueType);
|
||||
}
|
||||
List<PqScriptCheckData> pqScriptCheckData = this.getBaseMapper().selectJoinList(PqScriptCheckData.class, queryWrapper);
|
||||
if(CollUtil.isNotEmpty(pqScriptCheckData)){
|
||||
String dataType = param.getDataType();
|
||||
if(StrUtil.isNotBlank(dataType)){
|
||||
String[] split = dataType.split(",");
|
||||
if (split.length > 1) {
|
||||
dataType = split[0];
|
||||
}
|
||||
MPJLambdaWrapper<PqScriptCheckData> queryWrapper = new MPJLambdaWrapper<>();
|
||||
queryWrapper.selectAll(PqScriptCheckData.class)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqScriptCheckData::getValueType)
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.eq(ObjectUtil.isNotNull(param.getIndex()), PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
if (param.getIsValueTypeName()) {
|
||||
List<String> checkData = pqScriptCheckData.stream().map(x -> x.getDataType() + "$" + x.getValueType()).distinct().collect(Collectors.toList());
|
||||
String U = REAL + DetectionCodeEnum.U1.getCode();
|
||||
if(!checkData.contains(U)){
|
||||
if(checkData.contains(REAL+DetectionCodeEnum.V2_50.getCode())){
|
||||
checkData.add(U);
|
||||
queryWrapper.selectAs(DictTree::getCode, PqScriptCheckData::getValueType);
|
||||
}
|
||||
List<PqScriptCheckData> pqScriptCheckData = this.getBaseMapper().selectJoinList(PqScriptCheckData.class, queryWrapper);
|
||||
if (CollUtil.isNotEmpty(pqScriptCheckData)) {
|
||||
if (param.getIsValueTypeName()) {
|
||||
final String finalDataType = dataType;
|
||||
List<String> checkData = pqScriptCheckData.stream().map(x -> finalDataType + SYMBOL + x.getValueType()).distinct().collect(Collectors.toList());
|
||||
String U = finalDataType + SYMBOL+ DetectionCodeEnum.U1.getCode();
|
||||
if (!checkData.contains(U)) {
|
||||
if (checkData.contains(finalDataType + SYMBOL + DetectionCodeEnum.V2_50.getCode())) {
|
||||
checkData.add(U);
|
||||
}
|
||||
}
|
||||
}
|
||||
String I = REAL + DetectionCodeEnum.I1.getCode();
|
||||
if(!checkData.contains(I)){
|
||||
if(checkData.contains(REAL+DetectionCodeEnum.I2_50.getCode())){
|
||||
checkData.add(I);
|
||||
String I = finalDataType + SYMBOL + DetectionCodeEnum.I1.getCode();
|
||||
if (!checkData.contains(I)) {
|
||||
if (checkData.contains(finalDataType + SYMBOL + DetectionCodeEnum.I2_50.getCode())) {
|
||||
checkData.add(I);
|
||||
}
|
||||
}
|
||||
return checkData.stream().distinct().collect(Collectors.toList());
|
||||
} else {
|
||||
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
||||
}
|
||||
return checkData.stream().distinct().collect(Collectors.toList());
|
||||
} else {
|
||||
return pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,String> getValueTypeMap(String scriptId) {
|
||||
public Map<String, String> getValueTypeMap(String scriptId) {
|
||||
LambdaQueryWrapper<PqScriptCheckData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(PqScriptCheckData::getValueType)
|
||||
.eq(PqScriptCheckData::getScriptId, scriptId)
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
List<PqScriptCheckData> pqScriptCheckData = this.baseMapper.selectList(queryWrapper);
|
||||
if(CollUtil.isEmpty(pqScriptCheckData)){
|
||||
// throw new BusinessException(CommonResponseEnum.FAIL,"测试脚本项暂无配置");
|
||||
if (CollUtil.isEmpty(pqScriptCheckData)) {
|
||||
throw new BusinessException(DetectionResponseEnum.SCRIPT_CHECK_DATA_NOT_EXIST);
|
||||
}
|
||||
List<String> valueTypeList = pqScriptCheckData.stream().map(PqScriptCheckData::getValueType).distinct().collect(Collectors.toList());
|
||||
LambdaQueryWrapper<DictTree> dictTreeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictTreeLambdaQueryWrapper.in(DictTree::getId,valueTypeList).eq(DictTree::getState,DataStateEnum.DELETED.getCode());
|
||||
dictTreeLambdaQueryWrapper.in(DictTree::getId, valueTypeList).eq(DictTree::getState, DataStateEnum.DELETED.getCode());
|
||||
List<DictTree> dictTreeList = dictTreeMapper.selectList(dictTreeLambdaQueryWrapper);
|
||||
Map<String,String> map = dictTreeList.stream().collect(Collectors.toMap(DictTree::getCode,DictTree::getId));
|
||||
Map<String, String> map = dictTreeList.stream().collect(Collectors.toMap(DictTree::getCode, DictTree::getId));
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -111,16 +116,16 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
||||
LambdaQueryWrapper<PqScriptCheckData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.eq(ObjectUtil.isNotNull(param.getIndex()),PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
.eq(ObjectUtil.isNotNull(param.getIndex()), PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getValueType, param.getValueType())
|
||||
.eq(PqScriptCheckData::getPhase, param.getPhase())
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
|
||||
PqScriptCheckData data = this.getBaseMapper().selectOne(queryWrapper);
|
||||
if(ObjectUtil.isNotNull(data)){
|
||||
if (ObjectUtil.isNotNull(data)) {
|
||||
return data.getValue();
|
||||
}
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,13 +11,12 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||
import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum;
|
||||
import com.njcn.gather.detection.pojo.param.DevPhaseSequenceParam;
|
||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||
import com.njcn.gather.device.pojo.po.PqDev;
|
||||
import com.njcn.gather.device.service.IPqDevService;
|
||||
import com.njcn.gather.icd.pojo.po.PqIcdPath;
|
||||
import com.njcn.gather.icd.service.IPqIcdPathService;
|
||||
import com.njcn.gather.plan.mapper.AdPlanMapper;
|
||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||
import com.njcn.gather.script.mapper.PqScriptCheckDataMapper;
|
||||
import com.njcn.gather.script.mapper.PqScriptDtlsMapper;
|
||||
import com.njcn.gather.script.mapper.PqScriptMapper;
|
||||
@@ -29,7 +28,6 @@ import com.njcn.gather.script.pojo.po.PqScript;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.script.pojo.po.PqScriptDtls;
|
||||
import com.njcn.gather.script.pojo.po.SourceIssue;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptCheckDataVO;
|
||||
import com.njcn.gather.script.pojo.vo.PqScriptDtlDataVO;
|
||||
import com.njcn.gather.script.service.IPqScriptCheckDataService;
|
||||
import com.njcn.gather.script.service.IPqScriptDtlsService;
|
||||
@@ -91,7 +89,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
private final PqScriptCheckDataMapper pqScriptCheckDataMapper;
|
||||
private final IDevTypeService devTypeService;
|
||||
private final IDictTreeService dictTreeService;
|
||||
private final IPqIcdPathService pqIcdPathService;
|
||||
private final AdPlanMapper adPlanMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -134,6 +132,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
|
||||
@Override
|
||||
public List<SourceIssue> listSourceIssue(PqScriptIssueParam param) {
|
||||
String dataType;
|
||||
if (StrUtil.isNotBlank(param.getPlanId())) {
|
||||
AdPlan plan = adPlanMapper.selectById(param.getPlanId());
|
||||
dataType = plan.getDatasourceId();
|
||||
} else {
|
||||
dataType = "real";
|
||||
}
|
||||
List<SourceIssue> sourceIssues = new ArrayList<>();
|
||||
Set<Double> voltSet = new HashSet<>(1);
|
||||
Set<Double> currSet = new HashSet<>(1);
|
||||
@@ -200,6 +205,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkDataParam.setScriptId(freqDtls.getScriptId());
|
||||
checkDataParam.setIndex(freqDtls.getScriptIndex());
|
||||
checkDataParam.setIsValueTypeName(true);
|
||||
if(DicDataEnum.F.getCode().equals(issue.getType())||DicDataEnum.VOLTAGE.getCode().equals(issue.getType())){
|
||||
checkDataParam.setDataType("avg");
|
||||
issue.setDataType("avg");
|
||||
}else {
|
||||
checkDataParam.setDataType(dataType);
|
||||
issue.setDataType(dataType);
|
||||
}
|
||||
issue.setDevValueTypeList(pqScriptCheckDataService.getValueType(checkDataParam));
|
||||
issue.setDesc(ScriptDtlsDesc.getStringBuffer(value, true, isValueType).toString());
|
||||
issue.setScriptId(freqDtls.getScriptId());
|
||||
@@ -283,7 +295,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
data.setScriptId(sourceIssue.getScriptId());
|
||||
data.setScriptIndex(i);
|
||||
data.setValueType(checkData.getValueType());
|
||||
data.setDataType(checkData.getDataType());
|
||||
data.setPhase(checkData.getPhase());
|
||||
data.setValue(checkData.getValue());
|
||||
data.setHarmNum(checkData.getHarmNum());
|
||||
@@ -439,10 +450,8 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setPhase("T");
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
if (CollUtil.isNotEmpty(checkArchive)) {
|
||||
checkData.setValue(checkArchive.get(0).getValue());
|
||||
checkData.setDataType(checkArchive.get(0).getDataType());
|
||||
} else {
|
||||
checkData.setValue(sourceIssue.getFFreq());
|
||||
}
|
||||
@@ -472,7 +481,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setValue(listDTO.getFPhase());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
setCheckValue(checkArchive, checkData, listDTO);
|
||||
@@ -610,7 +618,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
|
||||
private void setCheck(List<PqScriptDtlsParam.CheckData> info, PqScriptDtlsParam.CheckData checkData, PqScriptDtlsParam.CheckData channelListDTO, List<PqScriptCheckData> checkArchive, PqScriptDtlsParam.ChannelListDTO listDTO) {
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2).toUpperCase());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
setCheckValue(checkArchive, checkData, listDTO);
|
||||
@@ -725,7 +732,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setPhase("T");
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelA = list.stream().filter(x -> x.getChannelType().contains("a")).collect(Collectors.toList());
|
||||
@@ -739,7 +745,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
if (CollUtil.isNotEmpty(checkArchive)) {
|
||||
checkData.setValue(checkArchive.get(0).getValue());
|
||||
checkData.setDataType(checkArchive.get(0).getDataType());
|
||||
}
|
||||
info.add(checkData);
|
||||
}
|
||||
@@ -758,13 +763,11 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2).toUpperCase());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
List<PqScriptCheckData> collect = checkArchive.stream().filter(x -> x.getPhase().equals(listDTO.getChannelType().substring(1, 2).toUpperCase())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
checkData.setValue(collect.get(0).getValue());
|
||||
checkData.setDataType(collect.get(0).getDataType());
|
||||
} else {
|
||||
if (flyDeltaV) {
|
||||
checkData.setValue(0.0);
|
||||
@@ -794,7 +797,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setValue(inharmModel.getFAmp());
|
||||
checkData.setHarmNum(inharmModel.getInharm());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
setCheckValue(checkArchive, checkData, listDTO);
|
||||
@@ -809,7 +811,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
List<PqScriptCheckData> collect = checkArchive.stream().filter(x -> x.getPhase().equals(listDTO.getChannelType().substring(1, 2).toUpperCase())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
checkData.setValue(collect.get(0).getValue());
|
||||
checkData.setDataType(collect.get(0).getDataType());
|
||||
}
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2).toUpperCase());
|
||||
}
|
||||
@@ -831,7 +832,6 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setValue(harmModel.getFAmp());
|
||||
checkData.setPhase(listDTO.getChannelType().substring(1, 2).toUpperCase());
|
||||
checkData.setHarmNum(harmModel.getHarm());
|
||||
checkData.setDataType(channelListDTO.getDataType());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
setCheckValue(checkArchive, checkData, listDTO);
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.gather.plan.pojo.param.AdPlanParam;
|
||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||
import com.njcn.gather.script.mapper.PqScriptMapper;
|
||||
import com.njcn.gather.script.pojo.param.PqScriptParam;
|
||||
|
||||
Reference in New Issue
Block a user