Compare commits
4 Commits
04ada8740a
...
5d161acfad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d161acfad | ||
|
|
1534327f6f | ||
|
|
98cca582f6 | ||
|
|
071c6e3d64 |
@@ -67,7 +67,8 @@ public class PqStandardDevServiceImpl extends ServiceImpl<PqStandardDevMapper, P
|
|||||||
wrapper.like(StrUtil.isNotBlank(queryParam.getName()), "name", queryParam.getName())
|
wrapper.like(StrUtil.isNotBlank(queryParam.getName()), "name", queryParam.getName())
|
||||||
.eq(StrUtil.isNotBlank(queryParam.getManufacturer()), "manufacturer", queryParam.getManufacturer())
|
.eq(StrUtil.isNotBlank(queryParam.getManufacturer()), "manufacturer", queryParam.getManufacturer())
|
||||||
.eq(StrUtil.isNotBlank(queryParam.getDevType()), "dev_type", queryParam.getDevType())
|
.eq(StrUtil.isNotBlank(queryParam.getDevType()), "dev_type", queryParam.getDevType())
|
||||||
.eq("state", DataStateEnum.ENABLE.getCode());
|
.eq("state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("create_time");
|
||||||
return this.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), wrapper);
|
return this.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ public class ResultController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("getCheckItem");
|
String methodDescribe = getMethodDescribe("getCheckItem");
|
||||||
|
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, monitorQueryParam);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, monitorQueryParam);
|
||||||
List<ContrastTestItemVO> result = resultService.getCheckItem(monitorQueryParam.getDevId(),monitorQueryParam.getChnNum(), monitorQueryParam.getNum());
|
List<ContrastTestItemVO> result = resultService.getCheckItem(monitorQueryParam.getPlanId(), monitorQueryParam.getDevId(), monitorQueryParam.getChnNum(), monitorQueryParam.getNum());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,6 @@ public class MonitorQueryParam {
|
|||||||
private Integer num;
|
private Integer num;
|
||||||
|
|
||||||
private Integer waveNum;
|
private Integer waveNum;
|
||||||
|
|
||||||
|
private String planId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,15 +119,17 @@ public interface IResultService {
|
|||||||
/**
|
/**
|
||||||
* 获取检测项
|
* 获取检测项
|
||||||
*
|
*
|
||||||
|
* @param planId
|
||||||
* @param devId
|
* @param devId
|
||||||
* @param chnNum
|
* @param chnNum
|
||||||
* @param num
|
* @param num
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ContrastTestItemVO> getCheckItem(String devId, String chnNum, Integer num);
|
List<ContrastTestItemVO> getCheckItem(String planId, String devId, String chnNum, Integer num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取设备比对式结果,用于出比对检测的报告
|
* 获取设备比对式结果,用于出比对检测的报告
|
||||||
|
*
|
||||||
* @param devReportParam 设备报告参数
|
* @param devReportParam 设备报告参数
|
||||||
* @param pqDevVO 设备信息 省去一次sql查询
|
* @param pqDevVO 设备信息 省去一次sql查询
|
||||||
* @return 该设备的比对式结果
|
* @return 该设备的比对式结果
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.gather.detection.handler.SocketContrastResponseService;
|
import com.njcn.gather.detection.handler.SocketContrastResponseService;
|
||||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
|
import com.njcn.gather.detection.pojo.enums.ResultEnum;
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
import com.njcn.gather.detection.pojo.po.AdPair;
|
import com.njcn.gather.detection.pojo.po.AdPair;
|
||||||
import com.njcn.gather.detection.pojo.po.DevData;
|
import com.njcn.gather.detection.pojo.po.DevData;
|
||||||
@@ -1604,7 +1605,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contrastResultVO.setResultMap(this.getResultMap(dictTree, adTypeList, queryParam.getDeviceId() + CnSocketUtil.SPLIT_TAG + queryParam.getChnNum(), unit, queryParam.getNum(), queryParam.getWaveNum(), queryParam.getIsWave(), String.valueOf(plan.getCode())));
|
contrastResultVO.setResultMap(this.getResultMap(dictTree, adTypeList, queryParam.getDeviceId() + CnSocketUtil.SPLIT_TAG + queryParam.getChnNum(), unit, queryParam.getNum(), queryParam.getWaveNum(), queryParam.getIsWave(), String.valueOf(plan.getCode())));
|
||||||
contrastResultVO.setRawDataMap(this.getRawDataMap(dictTree, adTypeList, queryParam.getDeviceId() + CnSocketUtil.SPLIT_TAG + queryParam.getChnNum(), unit, queryParam.getNum(), queryParam.getWaveNum(), queryParam.getIsWave(), String.valueOf(plan.getCode())));
|
contrastResultVO.setRawDataMap(this.getRawDataMap(dictTree, adTypeList, queryParam.getDeviceId() + CnSocketUtil.SPLIT_TAG + queryParam.getChnNum(), unit, queryParam.getNum(), queryParam.getWaveNum(), queryParam.getIsWave(), String.valueOf(plan.getCode()), contrastResultVO.getResultMap().keySet().stream().collect(Collectors.toList())));
|
||||||
return contrastResultVO;
|
return contrastResultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1806,9 +1807,9 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ContrastTestItemVO> getCheckItem(String devId, String chnNum, Integer num) {
|
public List<ContrastTestItemVO> getCheckItem(String planId, String devId, String chnNum, Integer num) {
|
||||||
PqDev dev = pqDevService.getById(devId);
|
// PqDev dev = pqDevService.getById(devId);
|
||||||
AdPlan plan = adPlanService.getById(dev.getPlanId());
|
AdPlan plan = adPlanService.getById(planId);
|
||||||
String code = String.valueOf(plan.getCode());
|
String code = String.valueOf(plan.getCode());
|
||||||
|
|
||||||
String monitorId = devId + CnSocketUtil.SPLIT_TAG + chnNum;
|
String monitorId = devId + CnSocketUtil.SPLIT_TAG + chnNum;
|
||||||
@@ -2749,6 +2750,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
List<RawResultDataVO.DetectionData> cList = JSON.parseArray(fieldC.get(contrastHarmonicResult) + "", RawResultDataVO.DetectionData.class);
|
List<RawResultDataVO.DetectionData> cList = JSON.parseArray(fieldC.get(contrastHarmonicResult) + "", RawResultDataVO.DetectionData.class);
|
||||||
|
|
||||||
List<RawResultDataVO> rawResultDataVOList = new ArrayList<>();
|
List<RawResultDataVO> rawResultDataVOList = new ArrayList<>();
|
||||||
|
List<Integer> isDataList = new ArrayList<>();
|
||||||
for (int j = 0; j < aList.size(); j++) {
|
for (int j = 0; j < aList.size(); j++) {
|
||||||
RawResultDataVO dataVO = new RawResultDataVO();
|
RawResultDataVO dataVO = new RawResultDataVO();
|
||||||
dataVO.setHarmNum(n);
|
dataVO.setHarmNum(n);
|
||||||
@@ -2758,9 +2760,11 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
dataVO.setDataC(cList.get(j));
|
dataVO.setDataC(cList.get(j));
|
||||||
dataVO.setRadius(aList.get(j).getRadius());
|
dataVO.setRadius(aList.get(j).getRadius());
|
||||||
dataVO.setIsData(StorageUtil.setResultFlag(Arrays.asList(aList.get(j), bList.get(j), cList.get(j))));
|
dataVO.setIsData(StorageUtil.setResultFlag(Arrays.asList(aList.get(j), bList.get(j), cList.get(j))));
|
||||||
|
isDataList.add(dataVO.getIsData());
|
||||||
rawResultDataVOList.add(dataVO);
|
rawResultDataVOList.add(dataVO);
|
||||||
}
|
}
|
||||||
resultMap.put(String.valueOf(n), rawResultDataVOList);
|
Integer isData = StorageUtil.getInteger(isDataList);
|
||||||
|
resultMap.put(n + (isData == ResultEnum.NOT_QUALIFIED.getValue() ? "(不符合)" : (isData == ResultEnum.NO_ERROR_SYS.getValue() ? "(/)" : "")), rawResultDataVOList);
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
@@ -2771,7 +2775,7 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, List<AlignDataVO.RawData>> getRawDataMap(DictTree dictTree, List<String> adTypeList, String monitorId, String unit, Integer num, Integer waveNum, Boolean isWave, String code) {
|
private Map<String, List<AlignDataVO.RawData>> getRawDataMap(DictTree dictTree, List<String> adTypeList, String monitorId, String unit, Integer num, Integer waveNum, Boolean isWave, String code, List<String> keys) {
|
||||||
Map<String, List<AlignDataVO.RawData>> rawMap = new LinkedHashMap<>();
|
Map<String, List<AlignDataVO.RawData>> rawMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
List<ContrastNonHarmonicResult> devNonHarmonicRawDataList = contrastNonHarmonicService.listAllRawData(code, num, waveNum, isWave, 0, monitorId, adTypeList);
|
List<ContrastNonHarmonicResult> devNonHarmonicRawDataList = contrastNonHarmonicService.listAllRawData(code, num, waveNum, isWave, 0, monitorId, adTypeList);
|
||||||
@@ -2810,11 +2814,14 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
|
|
||||||
if (CollUtil.isNotEmpty(devHarmonicRawDataList) && CollUtil.isNotEmpty(stdDevHarmonicRawDataList)) {
|
if (CollUtil.isNotEmpty(devHarmonicRawDataList) && CollUtil.isNotEmpty(stdDevHarmonicRawDataList)) {
|
||||||
List<Double> harmonicNum = null;
|
List<Double> harmonicNum = null;
|
||||||
|
boolean isHarm = true;
|
||||||
if (DicDataEnum.HV.getCode().equals(dictTree.getCode()) || DicDataEnum.HI.getCode().equals(dictTree.getCode()) || DicDataEnum.HP.getCode().equals(dictTree.getCode())) {
|
if (DicDataEnum.HV.getCode().equals(dictTree.getCode()) || DicDataEnum.HI.getCode().equals(dictTree.getCode()) || DicDataEnum.HP.getCode().equals(dictTree.getCode())) {
|
||||||
harmonicNum = Stream.iterate(2.0, n -> n + 1).limit(49).collect(Collectors.toList());
|
harmonicNum = Stream.iterate(2.0, n -> n + 1).limit(49).collect(Collectors.toList());
|
||||||
|
isHarm = true;
|
||||||
}
|
}
|
||||||
if (DicDataEnum.HSV.getCode().equals(dictTree.getCode()) || DicDataEnum.HSI.getCode().equals(dictTree.getCode())) {
|
if (DicDataEnum.HSV.getCode().equals(dictTree.getCode()) || DicDataEnum.HSI.getCode().equals(dictTree.getCode())) {
|
||||||
harmonicNum = Stream.iterate(0.5, n -> n + 1).limit(50).collect(Collectors.toList());
|
harmonicNum = Stream.iterate(0.5, n -> n + 1).limit(50).collect(Collectors.toList());
|
||||||
|
isHarm = false;
|
||||||
}
|
}
|
||||||
for (Double n : harmonicNum) {
|
for (Double n : harmonicNum) {
|
||||||
List<AlignDataVO.RawData> rawDataVOList1 = new ArrayList<>();
|
List<AlignDataVO.RawData> rawDataVOList1 = new ArrayList<>();
|
||||||
@@ -2865,7 +2872,10 @@ public class ResultServiceImpl implements IResultService {
|
|||||||
}
|
}
|
||||||
rawDataVOList1.add(rawDataVO);
|
rawDataVOList1.add(rawDataVO);
|
||||||
}
|
}
|
||||||
rawMap.put(String.valueOf(n), rawDataVOList1);
|
int num1 = n.intValue();
|
||||||
|
num1 = isHarm ? num1 - 2 : num1;
|
||||||
|
String key = keys.get(num1);
|
||||||
|
rawMap.put(key, rawDataVOList1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ public class DevTypeServiceImpl extends ServiceImpl<DevTypeMapper, DevType> impl
|
|||||||
@Override
|
@Override
|
||||||
public List<DevType> listAll() {
|
public List<DevType> listAll() {
|
||||||
LambdaQueryWrapper<DevType> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DevType> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(DevType::getState, DataStateEnum.ENABLE.getCode());
|
queryWrapper.eq(DevType::getState, DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByAsc(DevType::getName);
|
||||||
List<DevType> devTypes = this.baseMapper.selectList(queryWrapper);
|
List<DevType> devTypes = this.baseMapper.selectList(queryWrapper);
|
||||||
return devTypes;
|
return devTypes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user