update
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package org.jeecg.modules.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 试验管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-08-30
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ExperimentExportDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
@Excel(name = "序号", width = 15)
|
||||
private Integer indexNo;
|
||||
@Excel(name = "试验编号", width = 15)
|
||||
private String experimentNo;
|
||||
@Excel(name = "名称", width = 15)
|
||||
private String name;
|
||||
@Excel(name = "委托方名称", width = 15)
|
||||
private String clientName;
|
||||
@Excel(name = "试验类型", width = 15, replace = {"科研试验_1", "外协试验_2"})
|
||||
private String type;
|
||||
@Excel(name = "试验开始日期", width = 15)
|
||||
private String startDate;
|
||||
@Excel(name = "实验结束日期", width = 15)
|
||||
private String endDate;
|
||||
@Excel(name = "使用设备", width = 15)
|
||||
private String equipment;
|
||||
@Excel(name = "试验负责人", width = 15)
|
||||
private String supervisorName;
|
||||
@Excel(name = "已出报告份数", width = 15)
|
||||
private String reportCount;
|
||||
@Excel(name = "试验员及评分", width = 15)
|
||||
private String rateUserAndScore;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jeecg.modules.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 试验管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-08-30
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ExperimentExportDetailDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Excel(name = "辐射源类型", width = 15)
|
||||
private Integer radiateType;
|
||||
@Excel(name = "样品型号", width = 15)
|
||||
private String sampleModel;
|
||||
@Excel(name = "样品类型", width = 15)
|
||||
private String sampleType;
|
||||
@Excel(name = "剂量率/注量率", width = 15)
|
||||
private String measurementRate;
|
||||
@Excel(name = "总剂量/注量(krad(Si))", width = 15)
|
||||
private String totalMeasurementRate;
|
||||
@Excel(name = "占源面积(cm)", width = 15)
|
||||
private String sourceArea;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.jeecg.modules.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 试验管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-08-30
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class RadiationDetailDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 计划剂量率
|
||||
*/
|
||||
private String plannedMeasurementRate;
|
||||
/**
|
||||
* 实际剂量率
|
||||
*/
|
||||
private String actualMeasurementRate;
|
||||
/**
|
||||
* 计划剂量点
|
||||
*/
|
||||
private String plannedMeasurementPoint;
|
||||
/**
|
||||
* 计划注量点
|
||||
*/
|
||||
private String plannedInjectionPoints;
|
||||
/**
|
||||
* 计划注量率
|
||||
*/
|
||||
private String plannedInjectionRate;
|
||||
/**
|
||||
* 实际注量率
|
||||
*/
|
||||
private String actualInjectionRate;
|
||||
/**
|
||||
* 实际剂量点
|
||||
*/
|
||||
private String point;
|
||||
/**
|
||||
* 源口距离
|
||||
*/
|
||||
private String sourceDistance;
|
||||
/**
|
||||
* 管电流
|
||||
*/
|
||||
private String tubeCurrent;
|
||||
/**
|
||||
* 能量
|
||||
*/
|
||||
private String energy;
|
||||
/**
|
||||
* 标定距离
|
||||
*/
|
||||
private String calibrationDistance;
|
||||
/**
|
||||
* 辐照时间
|
||||
*/
|
||||
private String irradiationTime;
|
||||
/**
|
||||
* 电子能量
|
||||
*/
|
||||
private String electronEnergy;
|
||||
/**
|
||||
* 束流
|
||||
*/
|
||||
private String beam;
|
||||
/**
|
||||
* 板距
|
||||
*/
|
||||
private String plateSpacing;
|
||||
/**
|
||||
* 质子能量
|
||||
*/
|
||||
private String protonEnergy;
|
||||
/**
|
||||
* 扫描面积
|
||||
*/
|
||||
private String scanArea;
|
||||
/**
|
||||
* 辐射环境
|
||||
*/
|
||||
private String environmentSelect;
|
||||
/**
|
||||
* 均匀性
|
||||
*/
|
||||
private String xy;
|
||||
/**
|
||||
* 试验类型
|
||||
*/
|
||||
private String typeSelect;
|
||||
/**
|
||||
* 辐照开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 辐照结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.jeecg.modules.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 试验管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-08-30
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class RadiationMapDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 小钴源
|
||||
*/
|
||||
private List<RadiationDetailDTO> xgy;
|
||||
/**
|
||||
* 大钴源
|
||||
*/
|
||||
private List<RadiationDetailDTO> dgy;
|
||||
/**
|
||||
* X光机
|
||||
*/
|
||||
private List<RadiationDetailDTO> x;
|
||||
/**
|
||||
* 电子加速器
|
||||
*/
|
||||
private List<RadiationDetailDTO> electronics;
|
||||
/**
|
||||
* 质子加速器
|
||||
*/
|
||||
private List<RadiationDetailDTO> proton;
|
||||
|
||||
}
|
||||
@@ -13,17 +13,13 @@ import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.Tables;
|
||||
import com.deepoove.poi.data.style.BorderStyle;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.MinioUtil;
|
||||
import org.jeecg.modules.database.dto.RadiationDetailDTO;
|
||||
import org.jeecg.modules.database.dto.RadiationMapDTO;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecg.modules.database.mapper.ExperimentDocMapper;
|
||||
import org.jeecg.modules.database.service.*;
|
||||
@@ -34,6 +30,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 试验文档
|
||||
* @Author: jeecg-boot
|
||||
@@ -146,7 +149,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
if (Objects.isNull(date)) {
|
||||
return "";
|
||||
}
|
||||
return DateUtils.formatDate(date, "yyyy-MM-dd");
|
||||
return DateUtils.formatDate(date, "yyyy-MM-dd HH:mm");
|
||||
}
|
||||
|
||||
public String generateExperimentDoc(String experimentId, String fileName, String version) {
|
||||
@@ -291,9 +294,9 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
params.put("批准人员姓名", Optional.ofNullable(sysUserService.getById(latestReport.getConfirmer())).map(SysUser::getRealname)
|
||||
.orElse(""));
|
||||
params.put("报告生成日期", formatDate(latestReport.getCreateTime()));
|
||||
params.put("批准日期",latestReport.getConfirmerTime());
|
||||
params.put("校对日期",latestReport.getProofreaderTime());
|
||||
params.put("审核日期",latestReport.getAuditorTime());
|
||||
params.put("批准日期", latestReport.getConfirmerTime());
|
||||
params.put("校对日期", latestReport.getProofreaderTime());
|
||||
params.put("审核日期", latestReport.getAuditorTime());
|
||||
|
||||
}
|
||||
params.put("试验报告名称", experiment.getName());
|
||||
@@ -322,6 +325,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
params.put("测试环境温度", experimentTestProcess.getEnvironmentalTemperature());
|
||||
params.put("测试环境湿度", experimentTestProcess.getEnvironmentalHumidity());
|
||||
}
|
||||
if (Objects.nonNull(latestReport)) {
|
||||
String sampleInfo = latestReport.getSampleInfo();
|
||||
if (StringUtils.isNotBlank(sampleInfo)) {
|
||||
List<JSONObject> sampleInfoList = JSON.parseArray(sampleInfo, JSONObject.class);
|
||||
@@ -331,7 +335,8 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
params.put("table" + i, Tables.of(
|
||||
new String[][] {new String[] {"试验样品名称", getStringOrDefault(info, "sampleName"), "试验样品型号",
|
||||
getStringOrDefault(info, "sampleModel")},
|
||||
new String[] {"批 次", getStringOrDefault(info, "sampleBatch"), "试验样品编号", getStringOrDefault(
|
||||
new String[] {"批 次", getStringOrDefault(info, "sampleBatch"), "试验样品编号",
|
||||
getStringOrDefault(
|
||||
info,
|
||||
"sampleType")},
|
||||
new String[] {"生产厂家", getStringOrDefault(info, "sampleManufacturer"), "试验样品数量",
|
||||
@@ -339,10 +344,11 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
new String[] {"放置地点", "", "接收日期", ""},}).border(BorderStyle.DEFAULT).create());
|
||||
String imgUrls = info.getString("picture");
|
||||
if (StringUtils.isNotBlank(imgUrls)) {
|
||||
if(!StringUtils.startsWith(imgUrls, "http")){
|
||||
if (!StringUtils.startsWith(imgUrls, "http")) {
|
||||
imgUrls = "http://" + serverIp + imgUrls;
|
||||
}
|
||||
params.put("偏置原理图"+i, imgUrls);
|
||||
params.put("偏置原理图" + i, imgUrls);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,23 +360,44 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
params.put("操作员名称", operatorName);
|
||||
List<ExperimentRadiationProcess> radiationProcessList = experimentRadiationProcessService.getByExperimentId(experimentId);
|
||||
if (CollUtil.isNotEmpty(radiationProcessList)) {
|
||||
String name = radiationProcessList.stream().map(v -> v.getRadiationSource()).collect(Collectors.joining(","));
|
||||
params.put("辐射源名称", name);
|
||||
String lv = radiationProcessList.stream().map(v -> v.getMeasurementRate()).collect(Collectors.joining(","));
|
||||
params.put("辐照注量率", lv);
|
||||
params.put("累积注量点", "");
|
||||
String temp = radiationProcessList.stream().map(v -> v.getEnvironmentalTemperature()).collect(Collectors.joining(","));
|
||||
params.put("辐照环境温度", temp);
|
||||
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)) {
|
||||
extractDetail("小钴源", params, xgy, radiationProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
List<RadiationDetailDTO> dgy = radiationMap.getDgy();
|
||||
if (CollUtil.isNotEmpty(dgy)) {
|
||||
extractDetail("大钴源", params, dgy, radiationProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
List<RadiationDetailDTO> x = radiationMap.getX();
|
||||
if (CollUtil.isNotEmpty(x)) {
|
||||
extractDetail("X光机", params, x, radiationProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
List<RadiationDetailDTO> electronics = radiationMap.getElectronics();
|
||||
if (CollUtil.isNotEmpty(electronics)) {
|
||||
extractDetail("电子加速器", params, electronics, radiationProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
List<RadiationDetailDTO> proton = radiationMap.getProton();
|
||||
if (CollUtil.isNotEmpty(proton)) {
|
||||
extractDetail("质子加速器", params, proton, radiationProcess.getEnvironmentalTemperature());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
params.put("辐照总注量", experiment.getExperimentNo());
|
||||
params.put("实际能量", experiment.getExperimentNo());
|
||||
|
||||
if (Objects.nonNull(latestReport)) {
|
||||
String imgUrls = latestReport.getImgUrls();
|
||||
if (!StringUtils.startsWith(imgUrls, "http")) {
|
||||
imgUrls = "http://" + serverIp + imgUrls;
|
||||
}
|
||||
params.put("偏置原理图", imgUrls);
|
||||
}
|
||||
|
||||
List<ExperimentDeviationEquipment> deviationEquipmentList = experiment.getDeviationEquipmentList();
|
||||
String[][] strings = new String[deviationEquipmentList.size() + 1][5];
|
||||
@@ -389,6 +416,43 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
return params;
|
||||
}
|
||||
|
||||
private static void extractDetail(String name, Map<String, Object> params, List<RadiationDetailDTO> list, String temperature) {
|
||||
params.put("辐射源_" + name, "辐射源:" + name);
|
||||
String actualMeasurementRate = list.stream().map(x -> x.getActualMeasurementRate()).filter(point -> StringUtils.isNotBlank(point))
|
||||
.collect(Collectors.joining(","));
|
||||
String actualInjectionRate = list.stream().map(x -> x.getActualInjectionRate()).filter(point -> StringUtils.isNotBlank(point))
|
||||
.collect(Collectors.joining(","));
|
||||
String actualMeasurementPoint = list.stream().map(x -> 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+)?")) // 只保留数字格式的字符串
|
||||
.mapToDouble(Double::parseDouble) // 转换为double
|
||||
.max();
|
||||
|
||||
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, ""));
|
||||
params.put("辐射源_" + name + "_实际辐照总剂量",
|
||||
"实际辐照总剂量/实际辐照总注量:" + chooseStr(maxMeasurementPoint.getAsDouble() + "", ""));
|
||||
params.put("辐射源_" + name + "_实际辐射环境温度", "实际辐射环境温度:" + temperature + " ℃");
|
||||
if (StringUtils.equals(name, "电子加速器")) {
|
||||
params.put("辐射源_" + name + "_实际能量", "实际能量:" + chooseStr(electronEnergy, "") + " MeV");
|
||||
}
|
||||
}
|
||||
|
||||
private static String chooseStr(String str1, String str2) {
|
||||
if (StringUtils.isNotBlank(str1) && !StringUtils.equals(str1, "null")) {
|
||||
return str1;
|
||||
}
|
||||
if (StringUtils.isNotBlank(str2) && !StringUtils.equals(str2, "null")) {
|
||||
return str2;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private Map<String, Object> assembleSbsyjlb(String experimentId) {
|
||||
List<ExperimentDeviationEquipment> equipmentList = experimentDeviationEquipmentService.getByExperimentId(experimentId);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
@@ -431,7 +495,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
|
||||
params.put("试验报告名称", experiment.getName());
|
||||
params.put("试验编号", experiment.getExperimentNo());
|
||||
params.put("校对驳回意见",Optional.ofNullable(latestReport).map(ExperimentReport::getProofreaderMemo).orElse(""));
|
||||
params.put("校对驳回意见", Optional.ofNullable(latestReport).map(ExperimentReport::getProofreaderMemo).orElse(""));
|
||||
params.put("审核驳回意见", Optional.ofNullable(latestReport).map(ExperimentReport::getAuditorMemo).orElse(""));
|
||||
params.put("批准驳回意见", Optional.ofNullable(latestReport).map(ExperimentReport::getConfirmerMemo).orElse(""));
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user