完善监测点结果、设备结果

This commit is contained in:
caozehui
2025-09-12 09:11:56 +08:00
parent 46e8811e59
commit a163150fec
18 changed files with 462 additions and 70 deletions

View File

@@ -7,13 +7,10 @@ import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.LogUtil;
import com.njcn.gather.result.pojo.vo.ContrastResultVO;
import com.njcn.gather.detection.service.IAdPariService;
import com.njcn.gather.detection.util.socket.CnSocketUtil;
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.pojo.vo.*;
import com.njcn.gather.result.service.IResultService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
@@ -26,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author caozehui
@@ -151,4 +149,29 @@ public class ResultController extends BaseController {
ContrastResultVO result = resultService.getContrastResult(queryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitorResult")
@ApiOperation("获取监测点的检测结果")
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
public HttpResult<MonitorResultVO> getMonitorResult(@RequestParam("devId") String devId) {
String methodDescribe = getMethodDescribe("getMonitorResult");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, devId);
MonitorResultVO result = resultService.getMonitorResult(devId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@GetMapping("/getMonitorDataSourceResult")
@ApiOperation("获取监测点的检测结果下拉框")
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
public HttpResult<Map<Integer, DataSourceResultVO>> getMonitorDataSourceResult(@RequestParam("monitorId") String monitorId) {
String methodDescribe = getMethodDescribe("getMonitorDataSourceResult");
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, monitorId);
Map<Integer, DataSourceResultVO> result = resultService.getMonitorDataSourceResult(monitorId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
}

View File

@@ -0,0 +1,26 @@
package com.njcn.gather.result.pojo.vo;
import lombok.Data;
/**
* @author caozehui
* @data 2025-09-12
*/
@Data
public class DataSourceResultVO {
/**
* 通道所使用的数据源名称
*/
private String dataSourceName;
/**
* 通道所使用的数据源code
*/
private String dataSourceCode;
/**
* 通道检测结果
*/
private Integer checkResult;
}

View File

@@ -0,0 +1,51 @@
package com.njcn.gather.result.pojo.vo;
import lombok.Data;
/**
* @author caozehui
* @data 2025-09-10
*/
@Data
public class MonitorResultVO {
/**
* 监测点id
*/
private Integer monitorId;
/**
* 监测点序号
*/
private Integer monitorNum;
/**
* 总检测次数
*/
private Integer totalNum;
/**
* 合格检测次数
*/
private Integer qualifiedNum;
/**
* 不合格检测次数
*/
private Integer unQualifiedNum;
/**
* 误差体系名称
*/
private String errorSysName;
/**
* 检测结果
*/
private Integer checkResult;
/**
* 结论来源
*/
private String resultOrigin;
}

View File

@@ -2,10 +2,7 @@ package com.njcn.gather.result.service;
import com.njcn.gather.report.pojo.result.SingleTestResult;
import com.njcn.gather.result.pojo.param.ResultParam;
import com.njcn.gather.result.pojo.vo.ContrastResultVO;
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.pojo.vo.*;
import com.njcn.gather.script.pojo.vo.PqScriptDtlDataVO;
import java.util.List;
@@ -116,4 +113,8 @@ public interface IResultService {
*/
ContrastResultVO getContrastResult(ResultParam.QueryParam queryParam);
MonitorResultVO getMonitorResult(String devId);
Map<Integer, DataSourceResultVO> getMonitorDataSourceResult(String monitorId);
}

View File

@@ -1636,6 +1636,18 @@ public class ResultServiceImpl implements IResultService {
return contrastResultVO;
}
@Override
public MonitorResultVO getMonitorResult(String devId) {
return null;
}
@Override
public Map<Integer, DataSourceResultVO> getMonitorDataSourceResult(String monitorId) {
return null;
}
private Map<String, List<RawResultDataVO>> getResultMap(DictTree dictTree, List<String> adTypeList, String monitorId, String unit, Integer num, Integer waveNum, Boolean isWave, String code) {
Map<String, List<RawResultDataVO>> resultMap = new LinkedHashMap<>();
@@ -1999,7 +2011,7 @@ public class ResultServiceImpl implements IResultService {
checkDataParam.setIsValueTypeName(false);
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
iPqDevService.updateResult(false, param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(), param.getUserId(), param.getTemperature(), param.getHumidity());
}
/**