1、报告生成修改状态;
2、设备全部归档,修改计划完成状态;
This commit is contained in:
@@ -5,11 +5,13 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.gather.detection.pojo.vo.DetectionData;
|
||||
import com.njcn.gather.device.device.pojo.vo.PqDevVO;
|
||||
import com.njcn.gather.device.device.service.IPqDevService;
|
||||
import com.njcn.gather.device.pojo.enums.DevReportStateEnum;
|
||||
import com.njcn.gather.device.script.pojo.po.PqScript;
|
||||
import com.njcn.gather.device.script.pojo.po.PqScriptCheckData;
|
||||
import com.njcn.gather.device.script.pojo.po.PqScriptDtls;
|
||||
@@ -98,7 +100,17 @@ public class ReportServiceImpl implements IReportService {
|
||||
System.out.println("报告生成成功!");
|
||||
|
||||
// 将改设备的报告生成状态调整为已生成
|
||||
iPqDevService.updatePqDevReportState(devReportParam.getDevId(),1);
|
||||
iPqDevService.updatePqDevReportState(devReportParam.getDevId(), 1);
|
||||
|
||||
// 判断该计划下是否所有设备报告已生成,如果已生成则将计划状态改为已完成
|
||||
int count = iPqDevService.countUnReportDev(devReportParam.getPlanId());
|
||||
if(count == 0){
|
||||
LambdaUpdateWrapper<AdPlan> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(AdPlan::getId, devReportParam.getPlanId())
|
||||
.set(AdPlan::getReportState, DevReportStateEnum.GENERATED.getValue());
|
||||
adPlanService.update(updateWrapper);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -355,7 +367,7 @@ public class ReportServiceImpl implements IReportService {
|
||||
private String devValue(String dataJson, double baseValue) {
|
||||
DetectionData tempA = JSONUtil.toBean(dataJson, DetectionData.class);
|
||||
if (Objects.nonNull(tempA) && Objects.nonNull(tempA.getData())) {
|
||||
return doubleRound(4, (tempA.getData()/100) * baseValue);
|
||||
return doubleRound(4, (tempA.getData() / 100) * baseValue);
|
||||
}
|
||||
return "/";
|
||||
}
|
||||
@@ -379,7 +391,7 @@ public class ReportServiceImpl implements IReportService {
|
||||
private void fillMapValueT(SingleNonHarmParam singleNonHarmParam, Map<String, String> dataModelMap, String tSymbol) {
|
||||
AdNonHarmonicResult adNonHarmonicResult = adNonHarmonicService.getSingleResult(singleNonHarmParam);
|
||||
if (Objects.nonNull(adNonHarmonicResult)) {
|
||||
dataModelMap.put("${".concat(tSymbol).concat("}"), devValue(adNonHarmonicResult.getTValue(), 1));
|
||||
dataModelMap.put("${".concat(tSymbol).concat("}"), devValue(adNonHarmonicResult.getTValue(), 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user