update
This commit is contained in:
@@ -437,10 +437,10 @@ public class DateUtils extends PropertyEditorSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String formatDate(String dateStr, String pattern) {
|
public static String formatDate(String dateStr, String pattern) {
|
||||||
if (StringUtils.hasText(dateStr)) {
|
if (!StringUtils.hasText(dateStr)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (StringUtils.hasText(pattern)) {
|
if (!StringUtils.hasText(pattern)) {
|
||||||
return dateStr;
|
return dateStr;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -649,20 +649,66 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
|||||||
s -> s.getCalibrationDistance()).findFirst();
|
s -> s.getCalibrationDistance()).findFirst();
|
||||||
root.put("标定距离", first.orElse(""));
|
root.put("标定距离", first.orElse(""));
|
||||||
|
|
||||||
OptionalDouble maxActualMeasurementRate = detailDTOList.stream().map(obj -> obj.getActualMeasurementRate()) // 获取point字段
|
//OptionalDouble maxActualMeasurementRate = 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
|
// .mapToDouble(Double::parseDouble) // 转换为double
|
||||||
.max();
|
// .max();
|
||||||
OptionalDouble maxPoint = detailDTOList.stream().map(obj -> obj.getPoint()) // 获取point字段
|
//OptionalDouble 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
|
// .mapToDouble(Double::parseDouble) // 转换为double
|
||||||
.max();
|
// .max();
|
||||||
|
//
|
||||||
|
//root.put("剂量率", maxActualMeasurementRate);
|
||||||
|
//root.put("总剂量", maxPoint);
|
||||||
|
if (CollUtil.isNotEmpty(radiationProcessList)) {
|
||||||
|
radiationProcessList.forEach(radiationProcess -> {
|
||||||
|
String radiationDetail = radiationProcess.getRadiationDetail();
|
||||||
|
if (StringUtils.isNotBlank(radiationDetail)) {
|
||||||
|
RadiationMapDTO radiationMap = JSON.parseObject(radiationDetail, RadiationMapDTO.class);
|
||||||
|
List<RadiationDetailDTO> xgy = radiationMap.getXgy();
|
||||||
|
if (CollUtil.isNotEmpty(xgy)) {
|
||||||
|
extractJhb("小钴源", xgy, root);
|
||||||
|
}
|
||||||
|
List<RadiationDetailDTO> dgy = radiationMap.getDgy();
|
||||||
|
if (CollUtil.isNotEmpty(dgy)) {
|
||||||
|
extractJhb("大钴源", dgy, root);
|
||||||
|
}
|
||||||
|
List<RadiationDetailDTO> x = radiationMap.getX();
|
||||||
|
if (CollUtil.isNotEmpty(x)) {
|
||||||
|
extractJhb("X光机", x, root);
|
||||||
|
}
|
||||||
|
List<RadiationDetailDTO> electronics = radiationMap.getElectronics();
|
||||||
|
if (CollUtil.isNotEmpty(electronics)) {
|
||||||
|
extractJhb("电子加速器", electronics, root);
|
||||||
|
}
|
||||||
|
List<RadiationDetailDTO> proton = radiationMap.getProton();
|
||||||
|
if (CollUtil.isNotEmpty(proton)) {
|
||||||
|
extractJhb("质子加速器", proton, root);
|
||||||
|
}
|
||||||
|
|
||||||
root.put("剂量率", maxActualMeasurementRate);
|
}
|
||||||
root.put("总剂量", maxPoint);
|
});
|
||||||
|
}
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void extractJhb(String type, List<RadiationDetailDTO> detailDTOList, Map<String, Object> root) {
|
||||||
|
if (CollUtil.isEmpty(detailDTOList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String actualMeasurementRate = detailDTOList.stream().map(x -> x.getActualMeasurementRate()).filter(
|
||||||
|
point -> StringUtils.isNotBlank(point)).collect(Collectors.joining(","));
|
||||||
|
OptionalDouble maxMeasurementPoint = detailDTOList.stream().map(obj -> obj.getPoint()) // 获取point字段
|
||||||
|
.filter(point -> StringUtils.isNotBlank(point)).filter(str -> str.matches("-?\\d+(\\.\\d+)?")) // 只保留数字格式的字符串
|
||||||
|
.mapToDouble(Double::parseDouble) // 转换为double
|
||||||
|
.max();
|
||||||
|
String actualInjectionRate = detailDTOList.stream().map(x -> x.getActualInjectionRate()).filter(
|
||||||
|
point -> StringUtils.isNotBlank(point)).collect(Collectors.joining(","));
|
||||||
|
root.put(type + "剂量率", chooseStr(actualMeasurementRate, actualInjectionRate));
|
||||||
|
root.put(type + "总剂量", chooseStr(maxMeasurementPoint.getAsDouble() + "", ""));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExperimentDoc generate(String experimentId, String type) {
|
public ExperimentDoc generate(String experimentId, String type) {
|
||||||
String version = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
|
String version = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user