update
This commit is contained in:
@@ -79,6 +79,8 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
private IExperimentRadiationProcessService experimentRadiationProcessService;
|
||||
@Autowired
|
||||
private ITestStandardsService testStandardsService;
|
||||
@Autowired
|
||||
private IrradiationStandardsServiceImpl irradiationStandardsService;
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
//The core API uses a minimalist design, only one line of code is required
|
||||
@@ -347,22 +349,23 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
params.put("委托方单位地址", Optional.ofNullable(client).map(Client::getAddress).orElse(""));
|
||||
List<ExperimentTestProcess> experimentTestProcesses = experimentTestProcessService.getByExperimentId(experiment.getId());
|
||||
if (CollUtil.isNotEmpty(experimentTestProcesses)) {
|
||||
ExperimentTestProcess experimentTestProcess = experimentTestProcesses.get(0);
|
||||
String testStandardsId = experimentTestProcess.getTestStandardsId();
|
||||
Optional<TestStandards> testStandards = Optional.ofNullable(testStandardsService.getById(testStandardsId));
|
||||
params.put("标准代号", testStandards.map(TestStandards::getCode).orElse(""));
|
||||
params.put("标准名称", testStandards.map(TestStandards::getName).orElse(""));
|
||||
Path lastPathEle = PathUtil.getLastPathEle(Path.of(testStandards.map(TestStandards::getAttachment).orElse("")).getFileName());
|
||||
params.put("依据的文件名称", lastPathEle.toString());
|
||||
|
||||
String testParameters = experimentTestProcess.getTestParameters();
|
||||
if (StringUtils.isNotBlank(testParameters)) {
|
||||
JSONArray jsonObject = JSON.parseArray(testParameters);
|
||||
String collect = jsonObject.stream().map(v -> ((JSONObject) v).getString("name")).collect(Collectors.joining(","));
|
||||
params.put("测试参数", collect);
|
||||
List testParametersList = new ArrayList<>();
|
||||
List EnvironmentalTemperature = new ArrayList<>();
|
||||
List EnvironmentalHumidity = new ArrayList<>();
|
||||
for (ExperimentTestProcess experimentTestProcess : experimentTestProcesses) {
|
||||
String testParameters = experimentTestProcess.getTestParameters();
|
||||
if (StringUtils.isNotBlank(testParameters)) {
|
||||
JSONArray jsonObject = JSON.parseArray(testParameters);
|
||||
String collect = jsonObject.stream().map(v -> ((JSONObject) v).getString("name")).collect(Collectors.joining(","));
|
||||
testParametersList.add(collect);
|
||||
}
|
||||
EnvironmentalHumidity.add(experimentTestProcess.getEnvironmentalHumidity());
|
||||
EnvironmentalTemperature.add(experimentTestProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
params.put("测试环境温度", experimentTestProcess.getEnvironmentalTemperature());
|
||||
params.put("测试环境湿度", experimentTestProcess.getEnvironmentalHumidity());
|
||||
|
||||
params.put("测试参数", StringUtils.join(testParametersList, ";"));
|
||||
params.put("测试环境温度", StringUtils.join(EnvironmentalTemperature, ";"));
|
||||
params.put("测试环境湿度", StringUtils.join(EnvironmentalHumidity, ";"));
|
||||
}
|
||||
if (Objects.nonNull(experimentReport)) {
|
||||
String sampleInfo = experimentReport.getSampleInfo();
|
||||
@@ -388,14 +391,29 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
}
|
||||
}
|
||||
}
|
||||
params.put("试验日期", formatDate(experiment.getStartDate()) + " ~ " + formatDate(experiment.getEndDate()));
|
||||
String formatDate = formatDate(experiment.getStartDate());
|
||||
String toDate = formatDate(experiment.getEndDate());
|
||||
|
||||
params.put("试验日期", formatDate + (StringUtils.isBlank(toDate) ? "" : (" ~ " + toDate)));
|
||||
params.put("负责人名称", experiment.getSupervisorName());
|
||||
params.put("剂量管理员名称", "");
|
||||
String operatorName = experiment.getExperimentUserList().stream().map(v -> v.getUserName()).collect(Collectors.joining(","));
|
||||
params.put("操作员名称", operatorName);
|
||||
params.put("放射操作员", "");
|
||||
List<ExperimentRadiationProcess> radiationProcessList = experimentRadiationProcessService.getByExperimentId(experimentId);
|
||||
if (CollUtil.isNotEmpty(radiationProcessList)) {
|
||||
radiationProcessList.forEach(radiationProcess -> {
|
||||
List<String> standardName = new ArrayList<>();
|
||||
List<String> standardCode = new ArrayList<>();
|
||||
for (ExperimentRadiationProcess radiationProcess : radiationProcessList) {
|
||||
String radiationStandard = radiationProcess.getRadiationStandard();
|
||||
if (StringUtils.isNotBlank(radiationStandard) && radiationStandard.contains(",")) {
|
||||
String standardId = radiationStandard.split(",")[1];
|
||||
IrradiationStandards standards = irradiationStandardsService.getById(standardId);
|
||||
if (Objects.nonNull(standards)) {
|
||||
standardName.add(standards.getName());
|
||||
standardCode.add(standards.getCode());
|
||||
}
|
||||
}
|
||||
String radiationDetail = radiationProcess.getRadiationDetail();
|
||||
if (StringUtils.isNotBlank(radiationDetail)) {
|
||||
RadiationMapDTO radiationMap = JSON.parseObject(radiationDetail, RadiationMapDTO.class);
|
||||
@@ -421,7 +439,11 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
params.put("标准代号", StringUtils.join(standardName, ","));
|
||||
params.put("标准名称", StringUtils.join(standardCode, ","));
|
||||
params.put("依据的文件名称", "");
|
||||
|
||||
}
|
||||
params.put("辐照总注量", experiment.getExperimentNo());
|
||||
params.put("实际能量", experiment.getExperimentNo());
|
||||
@@ -467,10 +489,11 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
String electronEnergy = list.stream().map(x -> x.getElectronEnergy()).filter(point -> StringUtils.isNotBlank(point)).collect(
|
||||
Collectors.joining(","));
|
||||
params.put("辐射源_" + name + "_实际辐照剂量率",
|
||||
"实际辐照剂量率/实际辐照注量率:" + chooseStr(actualMeasurementRate, actualInjectionRate));
|
||||
params.put("辐射源_" + name + "_实际累积剂量点", "实际累积剂量点/实际累积注量点:" + chooseStr(actualMeasurementPoint, ""));
|
||||
"实际辐照剂量率/实际辐照注量率:" + chooseStr(actualMeasurementRate, actualInjectionRate) + " rad(Si)/s");
|
||||
params.put("辐射源_" + name + "_实际累积剂量点",
|
||||
"实际累积剂量点/实际累积注量点:" + chooseStr(actualMeasurementPoint, "") + " krad(Si)");
|
||||
params.put("辐射源_" + name + "_实际辐照总剂量",
|
||||
"实际辐照总剂量/实际辐照总注量:" + chooseStr(maxMeasurementPoint.getAsDouble() + "", ""));
|
||||
"实际辐照总剂量/实际辐照总注量:" + chooseStr(maxMeasurementPoint.getAsDouble() + "", "") + " krad(Si)");
|
||||
params.put("辐射源_" + name + "_实际辐射环境温度", "实际辐射环境温度:" + temperature + " ℃");
|
||||
if (StringUtils.equals(name, "电子加速器")) {
|
||||
params.put("辐射源_" + name + "_实际能量", "实际能量:" + chooseStr(electronEnergy, "") + " MeV");
|
||||
|
||||
Reference in New Issue
Block a user