微调
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.njcn.gather.device.err.pojo.vo;
|
||||
|
||||
import com.njcn.gather.device.err.pojo.po.PqErrSysDtls;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-27
|
||||
*/
|
||||
@Data
|
||||
public class ErrDtlsCheckDataVO implements Serializable {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
private String checkDataId;
|
||||
|
||||
|
||||
private String valueType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String valueTypeCode;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private Double value;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private List<PqErrSysDtls> errSysDtls;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.device.err.pojo.param.PqErrSysDtlsParam;
|
||||
import com.njcn.gather.device.err.pojo.param.PqErrSysParam;
|
||||
import com.njcn.gather.device.err.pojo.po.PqErrSysDtls;
|
||||
import com.njcn.gather.device.err.pojo.vo.ErrDtlsCheckDataVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -49,4 +50,11 @@ public interface IPqErrSysDtlsService extends IService<PqErrSysDtls> {
|
||||
* @return
|
||||
*/
|
||||
List<PqErrSysDtls> listPqErrSysDtlsByPqErrSysIdAndTypes(PqErrSysParam.DetectionParam param);
|
||||
|
||||
/**
|
||||
* 根据查询误差体系
|
||||
* @param param 误差体系id
|
||||
* @return
|
||||
*/
|
||||
List<ErrDtlsCheckDataVO> listByPqErrSysIdAndTypes(PqErrSysParam.DetectionParam param);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.gather.device.err.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
@@ -7,8 +8,10 @@ import com.njcn.gather.device.err.mapper.PqErrSysDtlsMapper;
|
||||
import com.njcn.gather.device.err.pojo.param.PqErrSysDtlsParam;
|
||||
import com.njcn.gather.device.err.pojo.param.PqErrSysParam;
|
||||
import com.njcn.gather.device.err.pojo.po.PqErrSysDtls;
|
||||
import com.njcn.gather.device.err.pojo.vo.ErrDtlsCheckDataVO;
|
||||
import com.njcn.gather.device.err.service.IPqErrSysDtlsService;
|
||||
import com.njcn.gather.device.script.pojo.param.PqScriptCheckDataParam;
|
||||
import com.njcn.gather.device.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.device.script.service.IPqScriptCheckDataService;
|
||||
import com.njcn.gather.system.dictionary.pojo.po.DictTree;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,9 +20,8 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
@@ -86,4 +88,39 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ErrDtlsCheckDataVO> listByPqErrSysIdAndTypes(PqErrSysParam.DetectionParam param) {
|
||||
List<ErrDtlsCheckDataVO> info=new ArrayList<>();
|
||||
PqScriptCheckDataParam checkDataParam = new PqScriptCheckDataParam();
|
||||
checkDataParam.setScriptId(param.getScriptId());
|
||||
checkDataParam.setIndex(param.getIndex());
|
||||
List<PqScriptCheckData> list = pqScriptCheckDataService.listCheckDataCode(checkDataParam);
|
||||
|
||||
List<String> valueType = list.stream().filter(x->x.getErrorFlag()!=0).map(PqScriptCheckData::getValueType).collect(Collectors.toList());
|
||||
Map<String, List<PqErrSysDtls>> errMap =new HashMap<>(3);
|
||||
if(CollUtil.isNotEmpty(valueType)){
|
||||
List<PqErrSysDtls> errSysDtls = this.list(new MPJLambdaWrapper<PqErrSysDtls>().selectAll(PqErrSysDtls.class)
|
||||
.selectAll(PqErrSysDtls.class)
|
||||
.selectAs(DictTree::getCode, PqErrSysDtls::getScriptCode)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqErrSysDtls::getScriptType)
|
||||
.eq(PqErrSysDtls::getErrorSysId, param.getErrorSysId())
|
||||
.in(PqErrSysDtls::getScriptType, valueType)
|
||||
);
|
||||
errMap= errSysDtls.stream().collect(Collectors.groupingBy(PqErrSysDtls::getScriptType));
|
||||
}
|
||||
ErrDtlsCheckDataVO dataVO;
|
||||
for (PqScriptCheckData script : list) {
|
||||
dataVO=new ErrDtlsCheckDataVO();
|
||||
dataVO.setCheckDataId(script.getScriptId());
|
||||
dataVO.setValueTypeCode(script.getValueTypeCode());
|
||||
dataVO.setValueType(script.getValueType());
|
||||
dataVO.setValue(script.getValue());
|
||||
if(errMap.containsKey(script.getValueType())){
|
||||
dataVO.setErrSysDtls(errMap.get(script.getValueType()));
|
||||
}
|
||||
info.add(dataVO);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class PqScriptCheckData implements Serializable {
|
||||
*/
|
||||
private String valueType;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String valueTypeCode;
|
||||
|
||||
/**
|
||||
* 数据类型,来源于字典表,包括实时数据(3s)、分钟统计数据(1min/3min/5min/10min)等
|
||||
*/
|
||||
@@ -60,6 +63,10 @@ public class PqScriptCheckData implements Serializable {
|
||||
*/
|
||||
private Integer enable;
|
||||
|
||||
|
||||
/**
|
||||
* 是否参与误差比较:0-不参与 1-参与
|
||||
*/
|
||||
@TableField("Error_Flag")
|
||||
private Integer errorFlag;
|
||||
|
||||
}
|
||||
@@ -26,6 +26,14 @@ public interface IPqScriptCheckDataService extends IService<PqScriptCheckData> {
|
||||
List<String> getValueType(PqScriptCheckDataParam param);
|
||||
|
||||
|
||||
|
||||
Map<String,String> getValueTypeMap(String scriptId);
|
||||
|
||||
/**
|
||||
* 获取监测脚本code
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<PqScriptCheckData> listCheckDataCode(PqScriptCheckDataParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -80,5 +80,17 @@ public class PqScriptCheckDataServiceImpl extends ServiceImpl<PqScriptCheckDataM
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PqScriptCheckData> listCheckDataCode(PqScriptCheckDataParam param) {
|
||||
MPJLambdaWrapper<PqScriptCheckData> queryWrapper = new MPJLambdaWrapper<>();
|
||||
queryWrapper.selectAll(PqScriptCheckData.class)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqScriptCheckData::getValueType)
|
||||
.selectAs(DictTree::getCode, PqScriptCheckData::getValueTypeCode)
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.eq(PqScriptCheckData::getIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
return this.getBaseMapper().selectJoinList(PqScriptCheckData.class, queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -219,9 +219,9 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
queryWrapper.selectAll(PqScriptDtls.class)
|
||||
.selectAs(DictTree::getCode, PqScriptDtls::getScriptCode)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqScriptDtls::getScriptType)
|
||||
// .ge(PqScriptDtls::getIndex, 14)
|
||||
// .ge(PqScriptDtls::getIndex, 30)
|
||||
// .eq(PqScriptDtls::getIndex, 30)
|
||||
// .ge(PqScriptDtls::getIndex, 9)
|
||||
// .ge(PqScriptDtls::getIndex, 48)
|
||||
// .in(PqScriptDtls::getIndex, Arrays.asList(30,101,105))
|
||||
|
||||
.eq(PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode());
|
||||
if (isPhaseSequence.equals(CommonEnum.PHASE_TEST.getValue())) {
|
||||
|
||||
Reference in New Issue
Block a user