diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentController.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentController.java index 872451c..2de3569 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentController.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/ExperimentController.java @@ -1,6 +1,9 @@ package org.jeecg.modules.database.controller; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -23,6 +26,7 @@ import org.jeecg.modules.database.constant.ExperimentStatus; import org.jeecg.modules.database.dto.*; import org.jeecg.modules.database.entity.*; import org.jeecg.modules.database.service.*; +import org.jeecg.modules.system.controller.SysDataSourceController; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.ISysUserService; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -77,6 +81,8 @@ public class ExperimentController extends JeecgController resultList = new ArrayList<>(); - for (Experiment ex : exportList) { + for (int i = 0; i < exportList.size(); i++) { + Experiment ex = exportList.get(i); ExperimentExportDTO dto = new ExperimentExportDTO(); dto.setId(ex.getId()); - dto.setIndexNo(ex.getIndexNo()); + dto.setIndexNo(i + 1); dto.setExperimentNo(ex.getExperimentNo()); dto.setName(ex.getName()); dto.setClientName(ex.getClientName()); @@ -431,24 +438,20 @@ public class ExperimentController extends JeecgController v.getRateUserName() + ":" + v.getTotalScore()).collect( Collectors.joining("\n")); dto.setRateUserAndScore(rateStr); - List experimentRadiationProcess = experimentRadiationProcessService.getByExperimentId(ex.getId()); + List radiationProcessList = experimentRadiationProcessService.getByExperimentId(ex.getId()); //辐照过程 List detailList = new ArrayList<>(); //List irradiationBoardList = ex.getIrradiationBoardList(); - if (CollUtil.isNotEmpty(experimentRadiationProcess)) { - experimentRadiationProcess.forEach(v -> { - List sampleInfoList = v.getSampleInfoList(); - if (CollUtil.isNotEmpty(sampleInfoList)) { - sampleInfoList.forEach(sample -> { - RadiationProcessExportDTO detail = new RadiationProcessExportDTO(); - detail.setRadiateType(v.getRadiationSource()); - detail.setSampleModel(sample.getSampleModel()); - detail.setSampleType(sample.getSampleType()); - detail.setMeasurementRate(""); - detail.setTotalMeasurementRate(""); - detail.setSourceArea(""); - detailList.add(detail); - }); + if (CollUtil.isNotEmpty(radiationProcessList)) { + radiationProcessList.forEach(radiationProcess -> { + String radiationDetailJson = radiationProcess.getRadiationDetail(); + if (StringUtils.isNotBlank(radiationDetailJson)) { + RadiationMapDTO radiationMap = JSON.parseObject(radiationDetailJson, RadiationMapDTO.class); + addIfNotEmpty(detailList, extractedXgy(radiationProcess, radiationMap.getXgy(), "小钴源")); + addIfNotEmpty(detailList, extractedXgy(radiationProcess, radiationMap.getDgy(), "大钴源")); + addIfNotEmpty(detailList, extractedXgy(radiationProcess, radiationMap.getX(), "X光机")); + addIfNotEmpty(detailList, extractedXgy(radiationProcess, radiationMap.getElectronics(), "电子加速器")); + addIfNotEmpty(detailList, extractedXgy(radiationProcess, radiationMap.getProton(), "质子加速器")); } }); } @@ -458,21 +461,28 @@ public class ExperimentController extends JeecgController experimentAnnealProcessList = experimentAnnealProcessService.getByExperimentId(ex.getId()); if (CollUtil.isNotEmpty(experimentAnnealProcessList)) { experimentAnnealProcessList.forEach(v -> { - List sampleInfoList = v.getSampleInfoList(); - if (CollUtil.isNotEmpty(sampleInfoList)) { - sampleInfoList.forEach(sample -> { - AnnealProcessExportDTO annealProcessExportDTO = new AnnealProcessExportDTO(); - annealProcessExportDTO.setSampleName(sample.getSampleName()); - annealProcessExportDTO.setSampleModel(sample.getSampleModel()); - annealProcessExportDTO.setSampleType(sample.getSampleType()); - annealProcessExportDTO.setAnnealTemperature(v.getAnnealTemperature()); - annealProcessExportDTO.setAnnealStartTime(DateUtils.formatDate(v.getAnnealStartTime(), "yyyy-MM-dd HH:mm")); - annealProcessExportDTO.setAnnealEndTime(DateUtils.formatDate(v.getAnnealEndTime(), "yyyy-MM-dd HH:mm")); - annealProcessList.add(annealProcessExportDTO); - }); - } + List deviationEquipmentList = v.getDeviationEquipmentList(); + List deviationConditionList = v.getDeviationConditionList(); + for (int j = 0; j < sampleInfoList.size(); j++) { + ExperimentSampleInfo sampleInfo = sampleInfoList.get(j); + AnnealProcessExportDTO annealProcessExportDTO = new AnnealProcessExportDTO(); + if (CollUtil.isNotEmpty(deviationConditionList) && ObjUtil.isNotNull(deviationConditionList.get(j))) { + BeanUtil.copyProperties(deviationConditionList.get(j), annealProcessExportDTO); + } + if (CollUtil.isNotEmpty(deviationEquipmentList) && ObjUtil.isNotNull(deviationEquipmentList.get(j))) { + BeanUtil.copyProperties(deviationEquipmentList.get(j), annealProcessExportDTO); + } + + annealProcessExportDTO.setSampleName(sampleInfo.getSampleName()); + annealProcessExportDTO.setSampleModel(sampleInfo.getSampleModel()); + annealProcessExportDTO.setSampleType(sampleInfo.getSampleType()); + annealProcessExportDTO.setAnnealTemperature(v.getAnnealTemperature()); + annealProcessExportDTO.setAnnealStartTime(DateUtils.formatDate(v.getAnnealStartTime(), "yyyy-MM-dd HH:mm")); + annealProcessExportDTO.setAnnealEndTime(DateUtils.formatDate(v.getAnnealEndTime(), "yyyy-MM-dd HH:mm")); + annealProcessList.add(annealProcessExportDTO); + } }); } @@ -484,13 +494,11 @@ public class ExperimentController extends JeecgController { List sampleInfoList = v.getSampleInfoList(); - if (CollUtil.isNotEmpty(sampleInfoList)) { - TestProcessExportDTO testProcessExportDTO = new TestProcessExportDTO(); - testProcessExportDTO.setEnvironmentalTemperature(v.getEnvironmentalTemperature()); - testProcessExportDTO.setEnvironmentalHumidity(v.getEnvironmentalHumidity()); + TestProcessExportDTO testProcessExportDTO = new TestProcessExportDTO(); + testProcessExportDTO.setEnvironmentalTemperature(v.getEnvironmentalTemperature()); + testProcessExportDTO.setEnvironmentalHumidity(v.getEnvironmentalHumidity()); + testProcessList.add(testProcessExportDTO); - testProcessList.add(testProcessExportDTO); - } }); } dto.setTestProcessList(testProcessList); @@ -514,6 +522,88 @@ public class ExperimentController extends JeecgController detailList, RadiationProcessExportDTO dto) { + if (dto != null) { + detailList.add(dto); + } + } + + private RadiationProcessExportDTO extractedXgy(ExperimentRadiationProcess radiationProcess, List xgy, String name) { + if (CollUtil.isEmpty(xgy)) { + return null; + } + RadiationProcessExportDTO detail = new RadiationProcessExportDTO(); + List sampleInfoList = radiationProcess.getSampleInfoList(); + detail.setRadiateType(name); + detail.setSampleModel(sampleInfoList.stream().map(s -> s.getSampleModel()).collect(Collectors.joining(","))); + detail.setSampleType(sampleInfoList.stream().map(s -> s.getSampleType()).collect(Collectors.joining(","))); + //detail.setMeasurementRate(radiationProcess.getMeasurementRate()); + detail.setPlannedMeasurementRate( + xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPlannedMeasurementRate())).map(v -> v.getPlannedMeasurementRate()) + .collect(Collectors.joining(","))); + detail.setActualMeasurementRate( + xgy.stream().filter(v -> StringUtils.isNotBlank(v.getActualMeasurementRate())).map(v -> v.getActualMeasurementRate()) + .collect(Collectors.joining(","))); + detail.setPlannedMeasurementPoint( + xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPlannedMeasurementPoint())).map(v -> v.getPlannedMeasurementPoint()) + .collect(Collectors.joining(","))); + detail.setPoint(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPoint())).map(v -> v.getPoint()) + .collect(Collectors.joining(","))); + + detail.setSourceDistance(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getSourceDistance())).map(v -> v.getSourceDistance()) + .collect(Collectors.joining(","))); + + detail.setTubeCurrent(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getTubeCurrent())).map(v -> v.getTubeCurrent()) + .collect(Collectors.joining(","))); + + detail.setEnergy(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getEnergy())).map(v -> v.getEnergy()) + .collect(Collectors.joining(","))); + + detail.setCalibrationDistance(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getCalibrationDistance())) + .map(v -> v.getCalibrationDistance()) + .collect(Collectors.joining(","))); + + detail.setIrradiationTime(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getIrradiationTime())).map(v -> v.getIrradiationTime()) + .collect(Collectors.joining(","))); + + detail.setActualInjectionRate(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getActualInjectionRate())) + .map(v -> v.getActualInjectionRate()) + .collect(Collectors.joining(","))); + detail.setElectronEnergy(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getElectronEnergy())).map(v -> v.getElectronEnergy()) + .collect(Collectors.joining(","))); + + detail.setBeam(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getBeam())).map(v -> v.getBeam()) + .collect(Collectors.joining(","))); + detail.setPlateSpacing(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPlateSpacing())).map(v -> v.getPlateSpacing()) + .collect(Collectors.joining(","))); + + detail.setProtonEnergy(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getProtonEnergy())).map(v -> v.getProtonEnergy()) + .collect(Collectors.joining(","))); + + detail.setScanArea(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getScanArea())).map(v -> v.getScanArea()) + .collect(Collectors.joining(","))); + detail.setEnvironmentSelect(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getEnvironmentSelect())) + .map(v -> v.getEnvironmentSelect()) + .collect(Collectors.joining(","))); + detail.setXy(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getXy())).map(v -> v.getXy()) + .collect(Collectors.joining(","))); + + detail.setTypeSelect(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getTypeSelect())).map(v -> v.getTypeSelect()) + .collect(Collectors.joining(","))); + + detail.setStartTime(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getStartTime())).map(v -> v.getStartTime()) + .collect(Collectors.joining(","))); + detail.setEndTime(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getEndTime())).map(v -> v.getEndTime()) + .collect(Collectors.joining(","))); + detail.setPlannedInjectionRate(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPlannedInjectionRate())) + .map(v -> v.getPlannedInjectionRate()) + .collect(Collectors.joining(","))); + detail.setPlannedInjectionPoints(xgy.stream().filter(v -> StringUtils.isNotBlank(v.getPlannedInjectionPoints())) + .map(v -> v.getPlannedInjectionPoints()) + .collect(Collectors.joining(","))); + return detail; + } + /** * 通过excel导入数据 * diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/AnnealProcessExportDTO.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/AnnealProcessExportDTO.java index f863f56..fe4edee 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/AnnealProcessExportDTO.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/AnnealProcessExportDTO.java @@ -1,15 +1,12 @@ package org.jeecg.modules.database.dto; -import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecgframework.poi.excel.annotation.Excel; -import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; -import java.util.Date; /** * @Description: 退火过程 @@ -29,15 +26,106 @@ public class AnnealProcessExportDTO implements Serializable { @Excel(name = "样品名称", width = 15) private String sampleName; @Excel(name = "样品型号", width = 15) - private String sampleModel; + private String sampleModel; @Excel(name = "样品类型", width = 15) - private String sampleType; + private String sampleType; @Excel(name = "退火温度") - private String annealTemperature; + private String annealTemperature; @Excel(name = "退火开始时间") - private String annealStartTime; + private String annealStartTime; @Excel(name = "退火结束时间") - private String annealEndTime; + private String annealEndTime; + @Excel(name = "偏置条件", width = 15) + private java.lang.String offsetCondition; + + /** + * 偏置电压 + */ + @Excel(name = "偏置电压", width = 15) + private java.lang.String offsetVoltage; + /** + * 偏置电流 + */ + @Excel(name = "偏置电流", width = 15) + private java.lang.String offsetCurrent; + /** + * 负载 + */ + @Excel(name = "负载", width = 15) + private java.lang.String loadCapacity; + /** + * 其它条件 + */ + @Excel(name = "其它条件", width = 15) + private java.lang.String otherCondition; + /** + * 偏置电源显示界面照片 + */ + @Excel(name = "偏置电源显示界面照片", width = 15) + private java.lang.String offsetPowerPhoto; + /** + * 输入信号 + */ + @Excel(name = "输入信号", width = 15) + private java.lang.String inputSignal; + /** + * 信号显示界面源照片 + */ + @Excel(name = "信号显示界面源照片", width = 15) + private java.lang.String signalPhoto; + /** + * 管脚接入方式 + */ + @Excel(name = "管脚接入方式", width = 15) + private java.lang.String pinType; + + @Excel(name = "信号类型", width = 15) + private String signalType; + + @Excel(name = "信号频率", width = 15) + private String signalFrequency; + + @Excel(name = "信号幅值", width = 15) + private String signalAmplitude; + + @Excel(name = "占空比", width = 15) + private String dutyCycle; + + /** + * 设备型号 + */ + @Excel(name = "设备型号", width = 15) + private java.lang.String equipmentModel; + /** + * 设备名称 + */ + @Excel(name = "设备名称", width = 15) + private java.lang.String equipmentName; + /** + * 设备类型 + */ + @Excel(name = "设备类型", width = 15) + private java.lang.String equipmentType; + /** + * 图片 + */ + @Excel(name = "图片", width = 15) + private java.lang.String sampleImage; + /** + * 计量有效期 + */ + @Excel(name = "计量有效期", width = 15) + private java.lang.String measurementValidity; + /** + * 房间号 + */ + @Excel(name = "房间号", width = 15) + private java.lang.String roomNo; + /** + * 设备编号 + */ + @Excel(name = "设备编号", width = 15) + private java.lang.String equipmentNo; } diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/RadiationProcessExportDTO.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/RadiationProcessExportDTO.java index 19ef625..3a65eb5 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/RadiationProcessExportDTO.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/dto/RadiationProcessExportDTO.java @@ -4,8 +4,10 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecgframework.poi.excel.annotation.ExcelCollection; import java.io.Serializable; +import java.util.List; /** * @Description: 辐照过程 @@ -19,20 +21,124 @@ import java.io.Serializable; public class RadiationProcessExportDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * - */ @Excel(name = "辐射源类型", width = 15) private String radiateType; @Excel(name = "样品型号", width = 15) - private String sampleModel; + 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; + private String sampleType; + //@Excel(name = "剂量率/注量率", width = 15) + //private String measurementRate; + + /** + * 计划剂量率 + */ + @Excel(name = "计划剂量率", width = 15) + private String plannedMeasurementRate; + /** + * 实际剂量率 + */ + @Excel(name = "实际剂量率", width = 15) + private String actualMeasurementRate; + /** + * 计划剂量点 + */ + @Excel(name = "计划剂量点", width = 15) + private String plannedMeasurementPoint; + /** + * 计划注量点 + */ + @Excel(name = "计划注量点", width = 15) + private String plannedInjectionPoints; + /** + * 计划注量率 + */ + @Excel(name = "计划注量率", width = 15) + private String plannedInjectionRate; + /** + * 实际注量率 + */ + @Excel(name = "实际注量率", width = 15) + private String actualInjectionRate; + /** + * 实际剂量点 + */ + @Excel(name = "实际剂量点", width = 15) + private String point; + /** + * 源口距离 + */ + @Excel(name = "源口距离", width = 15) + private String sourceDistance; + /** + * 管电流 + */ + @Excel(name = "管电流", width = 15) + private String tubeCurrent; + /** + * 能量 + */ + @Excel(name = "X光机能量", width = 15) + private String energy; + /** + * 标定距离 + */ + @Excel(name = "标定距离", width = 15) + private String calibrationDistance; + /** + * 辐照时间 + */ + @Excel(name = "辐照时间", width = 15) + private String irradiationTime; + /** + * 电子能量 + */ + @Excel(name = "电子能量", width = 15) + private String electronEnergy; + /** + * 束流 + */ + @Excel(name = "束流", width = 15) + private String beam; + /** + * 板距 + */ + @Excel(name = "板距", width = 15) + private String plateSpacing; + /** + * 质子能量 + */ + @Excel(name = "质子能量", width = 15) + private String protonEnergy; + /** + * 扫描面积 + */ + @Excel(name = "扫描面积", width = 15) + private String scanArea; + /** + * 辐射环境 + */ + @Excel(name = "辐射环境", width = 15) + private String environmentSelect; + /** + * 均匀性 + */ + @Excel(name = "均匀性", width = 15) + private String xy; + /** + * 试验类型 + */ + @Excel(name = "试验类型", width = 15) + private String typeSelect; + /** + * 辐照开始时间 + */ + @Excel(name = "辐照开始时间", width = 15) + private String startTime; + /** + * 辐照结束时间 + */ + @Excel(name = "辐照结束时间", width = 15) + private String endTime; }