diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentDeviationEquipmentController.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentDeviationEquipmentController.java index 9f4c8ea..1f25af4 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentDeviationEquipmentController.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentDeviationEquipmentController.java @@ -39,7 +39,7 @@ public class ExperimentDeviationEquipmentController @Autowired private IExperimentDeviationEquipmentService experimentDeviationEquipmentService; @Autowired - private IEquipmentService equipmentService; + private IEquipmentService equipmentService; /** * 分页列表查询 @@ -76,7 +76,7 @@ public class ExperimentDeviationEquipmentController @PostMapping(value = "/add") public Result add(@RequestBody ExperimentDeviationEquipment experimentDeviationEquipment) { String equipmentNo = experimentDeviationEquipment.getEquipmentNo(); - if (StringUtils.isNotBlank(equipmentNo)) { + if (StringUtils.isNotBlank(equipmentNo) && StringUtils.isBlank(experimentDeviationEquipment.getMeasurementValidity())) { Equipment equipment = equipmentService.getByManagementNo(equipmentNo); experimentDeviationEquipment.setMeasurementValidity(equipment.getExpireDate()); } diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/service/impl/ExperimentDocServiceImpl.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/service/impl/ExperimentDocServiceImpl.java index 891c159..a9a7b50 100755 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/service/impl/ExperimentDocServiceImpl.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/service/impl/ExperimentDocServiceImpl.java @@ -288,13 +288,11 @@ public class ExperimentDocServiceImpl extends ServiceImpl detailDTOList = radiationMap.assembleDetails(); maxPoint = detailDTOList.stream().map(obj -> obj.getPoint()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); maxRate = detailDTOList.stream().map(obj -> obj.getActualMeasurementRate()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); } @@ -328,11 +326,9 @@ public class ExperimentDocServiceImpl extends ServiceImpl x.getPoint()).filter(point -> StringUtils.isNotBlank(point)).collect( Collectors.joining(",")); OptionalDouble maxMeasurementPoint = list.stream().map(obj -> obj.getPoint()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); @@ -493,6 +484,9 @@ public class ExperimentDocServiceImpl extends ServiceImpl assembleSbsyjlb(String experimentId) { List equipmentList = experimentDeviationEquipmentService.getByExperimentId(experimentId); Experiment experiment = experimentService.getById(experimentId); @@ -503,10 +497,10 @@ public class ExperimentDocServiceImpl extends ServiceImpl s.getExpireDate()).orElse("")); params.put("异常记录", ""); list.add(params); } @@ -537,8 +531,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl sysUserService.getById(v.getProofreader())) .map(SysUser::getRealname).orElse("")); - params.put("审核时间", Optional.ofNullable(latestReport) - .map(v -> DateUtils.formatDate(v.getProofreaderTime(), "yyyy 年 M 月 d 日")) + params.put("审核时间", Optional.ofNullable(latestReport).map(v -> DateUtils.formatDate(v.getProofreaderTime(), "yyyy 年 M 月 d 日")) .orElse(" 年 月 日")); params.put("负责人名称", experiment.getSupervisorName()); @@ -589,45 +582,37 @@ public class ExperimentDocServiceImpl extends ServiceImpl obj.getEnergy()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxBeam = detailDTOList.stream().map(obj -> obj.getBeam()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxElectronEnergy = detailDTOList.stream().map(obj -> obj.getElectronEnergy()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxTubeCurrent = detailDTOList.stream().map(obj -> obj.getTubeCurrent()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxProtonEnergy = detailDTOList.stream().map(obj -> obj.getProtonEnergy()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxScanArea = detailDTOList.stream().map(obj -> obj.getScanArea()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxX = detailDTOList.stream().map(obj -> obj.getXy()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .map(str -> str.split(",")[0]) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).map(str -> str.split(",")[0]) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); OptionalDouble maxY = detailDTOList.stream().map(obj -> obj.getXy()) // 获取point字段 - .filter(point -> StringUtils.isNotBlank(point)) - .map(str -> str.split(",")[0]) // 只保留数字格式的字符串 + .filter(point -> StringUtils.isNotBlank(point)).map(str -> str.split(",")[0]) // 只保留数字格式的字符串 .mapToDouble(Double::parseDouble) // 转换为double .max(); @@ -660,6 +645,21 @@ public class ExperimentDocServiceImpl extends ServiceImpl first = detailDTOList.stream().filter(v -> StringUtils.isNotBlank(v.getCalibrationDistance())).map( + s -> s.getCalibrationDistance()).findFirst(); + root.put("标定距离", first.orElse("")); + + OptionalDouble maxActualMeasurementRate = detailDTOList.stream().map(obj -> obj.getActualMeasurementRate()) // 获取point字段 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .mapToDouble(Double::parseDouble) // 转换为double + .max(); + OptionalDouble maxPoint = detailDTOList.stream().map(obj -> obj.getPoint()) // 获取point字段 + .filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串 + .mapToDouble(Double::parseDouble) // 转换为double + .max(); + + root.put("剂量率", maxActualMeasurementRate); + root.put("总剂量", maxPoint); return root; } diff --git a/templates/fzsyjhb.docx b/templates/fzsyjhb.docx index f6f9269..2e8e777 100644 Binary files a/templates/fzsyjhb.docx and b/templates/fzsyjhb.docx differ