1.正式检测-检测详情表格数据代码提交

This commit is contained in:
wr
2025-01-05 15:53:23 +08:00
parent a7b794b4d0
commit 7bc1f768f9
11 changed files with 265 additions and 100 deletions

View File

@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.LogUtil;
import com.njcn.gather.result.pojo.param.ResultParam;
import com.njcn.gather.result.pojo.vo.FormContentVO;
import com.njcn.gather.result.pojo.vo.ResultVO;
import com.njcn.gather.result.pojo.vo.TreeDataVO;
import com.njcn.gather.result.service.IResultService;
import com.njcn.web.controller.BaseController;
@@ -55,4 +56,15 @@ public class ResultController extends BaseController {
List<TreeDataVO> infoVOS = resultService.treeData(queryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, infoVOS, methodDescribe);
}
@OperateInfo
@PostMapping("/resultData")
@ApiOperation("查询检测结果-表格具体检测项")
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
public HttpResult<ResultVO> resultData(@RequestBody @Validated ResultParam queryParam) {
String methodDescribe = getMethodDescribe("resultData");
ResultVO resultVO = resultService.resultData(queryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resultVO, methodDescribe);
}
}

View File

@@ -40,6 +40,11 @@ public class ResultParam {
*/
private Integer code;
/**
* 检测脚本序号
*/
private Integer index;
@Data
public static class QueryParam {

View File

@@ -1,9 +1,12 @@
package com.njcn.gather.result.pojo.vo;
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;
/**
* @author caozehui
@@ -15,82 +18,12 @@ public class ResultVO {
/**
* 结果数据
*/
private List<ResultData> resultData;
private Map<String, RawResultDataVO> resultData;
/**
* 原始数据
*/
private List<RawData> rawData;
private Map<String, List<RawDataVO>> rawData;
@Data
public static class RawData {
/**
* 时间
*/
private String time;
/**
* (间)谐波次数
*/
private Double harmNum;
/**
* A相数据
*/
private BigDecimal dataA;
/**
* B相数据
*/
private BigDecimal dataB;
/**
* C相数据
*/
private BigDecimal dataC;
}
@Data
public static class ResultData {
/**
* 类别
*/
private String type;
/**
* (间)谐波次数
*/
private Double harmNum;
/**
* A相数据
*/
private BigDecimal DevDataA;
private BigDecimal SourceDataA;
/**
* B相数据
*/
private BigDecimal DevDataB;
private BigDecimal SourceDataB;
/**
* C相数据
*/
private BigDecimal DevDataC;
private BigDecimal SourceDataC;
/**
* T相数据
*/
private BigDecimal DevDataT;
private BigDecimal SourceDataT;
}
}

View File

@@ -14,6 +14,7 @@ import java.util.List;
public interface IResultService {
/**
* 检测详情表单头
*
* @param queryParam
* @return
*/
@@ -22,6 +23,7 @@ public interface IResultService {
/**
* 获取检测详情信息
*
* @param param
* @return: java.util.List<com.njcn.gather.result.pojo.vo.DetectionInfoVO>
* @Author: wr
@@ -31,9 +33,11 @@ public interface IResultService {
/**
* 展示结果数据
*
* @param param
* @return
*/
ResultVO resultData(ResultParam param);
ResultVO resultData(ResultParam param);
}

View File

@@ -19,6 +19,7 @@ import com.njcn.gather.result.pojo.vo.FormContentVO;
import com.njcn.gather.result.pojo.vo.ResultVO;
import com.njcn.gather.result.pojo.vo.TreeDataVO;
import com.njcn.gather.result.service.IResultService;
import com.njcn.gather.storage.pojo.param.StorageParam;
import com.njcn.gather.storage.pojo.po.AdBaseResult;
import com.njcn.gather.storage.service.AdHarmonicService;
import com.njcn.gather.storage.service.AdNonHarmonicService;
@@ -779,9 +780,27 @@ public class ResultServiceImpl implements IResultService {
@Override
public ResultVO resultData(ResultParam param) {
return null;
StorageParam storage=new StorageParam();
storage.setIndex(param.getIndex());
storage.setScriptId(param.getScriptId());
storage.setDevId(param.getDevId());
storage.setDevNum(param.getDevNum());
storage.setCode(param.getCode());
List<PqScriptCheckData> list = pqScriptCheckDataService.list(new MPJLambdaWrapper<PqScriptCheckData>()
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
.eq(PqScriptCheckData::getIndex, param.getIndex())
);
List<Double> harmNum = list.stream().map(PqScriptCheckData::getHarmNum).collect(Collectors.toList());
ResultVO resultVO=new ResultVO();
if(CollUtil.isNotEmpty(harmNum)){
storage.setHarmNum(harmNum);
resultVO.setRawData(adNonHarmonicService.listNonHarmData(storage));
resultVO.setResultData(adNonHarmonicService.listNonHarmResultData(storage));
}else{
resultVO.setRawData(adHarmonicService.listHarmData(storage));
resultVO.setResultData(adHarmonicService.listHarmResultData(storage));
}
return resultVO;
}
private static void dtlsSetBuffer(List<PqScriptDtls> scriptDtlIndex, StringBuffer buffer, String valueType, String name, String unit, Boolean fly) {