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

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

@@ -108,7 +108,6 @@ public interface IPqDevService extends IService<PqDev> {
/**
* 正式监测完成,修改中断状态
*
* @param isContrast
* @param ids
* @param adType
* @param code
@@ -117,7 +116,15 @@ public interface IPqDevService extends IService<PqDev> {
* @param humidity
* @return
*/
boolean updateResult(boolean isContrast, List<String> ids, List<String> adType, String code, String userId, Float temperature, Float humidity);
boolean updateResult(List<String> ids, List<String> adType, String code, String userId, Float temperature, Float humidity);
/**
* 比对式-修改设备状态
*
* @param devId
* @param userId
*/
void updateResult(String devId,String userId);
void updatePqDevReportState(String devId, int i);

View File

@@ -434,11 +434,11 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
@Override
public boolean updateResult(boolean isContrast, List<String> ids, List<String> adType, String code, String userId, Float temperature, Float humidity) {
public boolean updateResult(List<String> ids, List<String> adType, String code, String userId, Float temperature, Float humidity) {
if (CollUtil.isNotEmpty(ids)) {
SysTestConfig config = sysTestConfigService.getOneConfig();
Map<String, Integer> result = detectionDataDealService.devResult(isContrast, ids, adType, code);
Map<String, Integer> result = detectionDataDealService.devResult(false, ids, adType, code);
List<PqDevVO> list = new ArrayList<>();
if (CollUtil.isNotEmpty(ids)) {
list.addAll(this.baseMapper.listByDevIds(ids));
@@ -508,6 +508,39 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
return true;
}
@Override
public void updateResult(String devId, String userId) {
PqDev dev = this.getById(devId);
Integer checkState = pqMonitorService.getDevCheckState(devId);
Integer checkResult = pqMonitorService.getDevCheckResult(devId);
pqDevSubService.lambdaUpdate()
.set(PqDevSub::getCheckState, checkState)
.set(PqDevSub::getCheckResult, checkResult)
.eq(PqDevSub::getDevId, devId).update();
PqDevParam.QueryParam param = new PqDevParam.QueryParam();
String planId = dev.getPlanId();
param.setPlanIdList(Arrays.asList(planId));
List<PqDevVO> pqDevVOList = this.baseMapper.selectByQueryParam(param);
if (CollUtil.isNotEmpty(pqDevVOList)) {
Set<Integer> set = pqDevVOList.stream().map(PqDevVO::getCheckResult).collect(Collectors.toSet());
if (set.contains(CheckResultEnum.NOT_ACCORD.getValue())) {
this.baseMapper.updatePlanCheckResult(planId, CheckResultEnum.NOT_ACCORD.getValue());
} else if (set.contains(CheckResultEnum.UNCHECKED.getValue())) {
this.baseMapper.updatePlanCheckResult(planId, CheckResultEnum.UNCHECKED.getValue());
} else {
this.baseMapper.updatePlanCheckResult(planId, CheckResultEnum.ACCORD.getValue());
}
set = pqDevVOList.stream().map(PqDevVO::getCheckState).collect(Collectors.toSet());
if (set.contains(CheckStateEnum.UNCHECKED.getValue())) {
this.baseMapper.updatePlanTestState(planId, CheckStateEnum.CHECKING.getValue());
}
}
}
@Override
public void updatePqDevReportState(String devId, int reportState) {
LambdaUpdateWrapper<PqDevSub> updateWrapper = new LambdaUpdateWrapper<>();