update
This commit is contained in:
@@ -106,7 +106,7 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
|
|||||||
}
|
}
|
||||||
experimentService.changeStatus(experimentId, ExperimentStatus.PROGRESSING);
|
experimentService.changeStatus(experimentId, ExperimentStatus.PROGRESSING);
|
||||||
|
|
||||||
experimentAnnealProcessService.saveWithDetails(experimentAnnealProcess);
|
experimentAnnealProcessService.saveWithDetails(experimentAnnealProcess,"add");
|
||||||
|
|
||||||
ExperimentLog experimentLog = new ExperimentLog();
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
experimentLog.setExperimentId(experimentId);
|
experimentLog.setExperimentId(experimentId);
|
||||||
@@ -145,7 +145,7 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
|
|||||||
}
|
}
|
||||||
experimentService.changeStatus(experimentId, ExperimentStatus.PROGRESSING);
|
experimentService.changeStatus(experimentId, ExperimentStatus.PROGRESSING);
|
||||||
|
|
||||||
experimentAnnealProcessService.saveWithDetails(experimentAnnealProcess);
|
experimentAnnealProcessService.saveWithDetails(experimentAnnealProcess,"edit");
|
||||||
|
|
||||||
ExperimentLog experimentLog = new ExperimentLog();
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
experimentLog.setExperimentId(experimentId);
|
experimentLog.setExperimentId(experimentId);
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ import org.jeecg.common.system.util.JwtUtil;
|
|||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.*;
|
import org.jeecg.common.util.*;
|
||||||
import org.jeecg.modules.database.constant.ExperimentStatus;
|
import org.jeecg.modules.database.constant.ExperimentStatus;
|
||||||
import org.jeecg.modules.database.dto.ExperimentExportDTO;
|
import org.jeecg.modules.database.dto.*;
|
||||||
import org.jeecg.modules.database.dto.ExperimentExportDetailDTO;
|
|
||||||
import org.jeecg.modules.database.entity.*;
|
import org.jeecg.modules.database.entity.*;
|
||||||
import org.jeecg.modules.database.service.*;
|
import org.jeecg.modules.database.service.*;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
@@ -421,14 +420,15 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
|||||||
Collectors.joining("\n"));
|
Collectors.joining("\n"));
|
||||||
dto.setRateUserAndScore(rateStr);
|
dto.setRateUserAndScore(rateStr);
|
||||||
List<ExperimentRadiationProcess> experimentRadiationProcess = experimentRadiationProcessService.getByExperimentId(ex.getId());
|
List<ExperimentRadiationProcess> experimentRadiationProcess = experimentRadiationProcessService.getByExperimentId(ex.getId());
|
||||||
List<ExperimentExportDetailDTO> detailList = new ArrayList<>();
|
//辐照过程
|
||||||
|
List<RadiationProcessExportDTO> detailList = new ArrayList<>();
|
||||||
//List<ExperimentIrradiationBoard> irradiationBoardList = ex.getIrradiationBoardList();
|
//List<ExperimentIrradiationBoard> irradiationBoardList = ex.getIrradiationBoardList();
|
||||||
if (CollUtil.isNotEmpty(experimentRadiationProcess)) {
|
if (CollUtil.isNotEmpty(experimentRadiationProcess)) {
|
||||||
experimentRadiationProcess.forEach(v -> {
|
experimentRadiationProcess.forEach(v -> {
|
||||||
List<ExperimentSampleInfo> sampleInfoList = v.getSampleInfoList();
|
List<ExperimentSampleInfo> sampleInfoList = v.getSampleInfoList();
|
||||||
if (CollUtil.isNotEmpty(sampleInfoList)) {
|
if (CollUtil.isNotEmpty(sampleInfoList)) {
|
||||||
sampleInfoList.forEach(sample -> {
|
sampleInfoList.forEach(sample -> {
|
||||||
ExperimentExportDetailDTO detail = new ExperimentExportDetailDTO();
|
RadiationProcessExportDTO detail = new RadiationProcessExportDTO();
|
||||||
detail.setRadiateType(v.getRadiationSource());
|
detail.setRadiateType(v.getRadiationSource());
|
||||||
detail.setSampleModel(sample.getSampleModel());
|
detail.setSampleModel(sample.getSampleModel());
|
||||||
detail.setSampleType(sample.getSampleType());
|
detail.setSampleType(sample.getSampleType());
|
||||||
@@ -440,9 +440,51 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
dto.setDetailList(detailList);
|
|
||||||
resultList.add(dto);
|
|
||||||
|
|
||||||
|
//退火过程
|
||||||
|
List<AnnealProcessExportDTO> annealProcessList = new ArrayList<>();
|
||||||
|
List<ExperimentAnnealProcess> experimentAnnealProcessList = experimentAnnealProcessService.getByExperimentId(ex.getId());
|
||||||
|
if (CollUtil.isNotEmpty(experimentAnnealProcessList)) {
|
||||||
|
experimentAnnealProcessList.forEach(v -> {
|
||||||
|
|
||||||
|
List<ExperimentSampleInfo> 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
dto.setAnnealProcessList(annealProcessList);
|
||||||
|
|
||||||
|
//测试过程
|
||||||
|
List<ExperimentTestProcess> experimentTestProcessList = experimentTestProcessService.getByExperimentId(ex.getId());
|
||||||
|
List<TestProcessExportDTO> testProcessList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(experimentTestProcessList)) {
|
||||||
|
experimentTestProcessList.forEach(v -> {
|
||||||
|
List<ExperimentSampleInfo> sampleInfoList = v.getSampleInfoList();
|
||||||
|
if (CollUtil.isNotEmpty(sampleInfoList)) {
|
||||||
|
TestProcessExportDTO testProcessExportDTO = new TestProcessExportDTO();
|
||||||
|
testProcessExportDTO.setEnvironmentalTemperature(v.getEnvironmentalTemperature());
|
||||||
|
testProcessExportDTO.setEnvironmentalHumidity(v.getEnvironmentalHumidity());
|
||||||
|
|
||||||
|
testProcessList.add(testProcessExportDTO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dto.setTestProcessList(testProcessList);
|
||||||
|
|
||||||
|
dto.setRadiationProcessList(detailList);
|
||||||
|
resultList.add(dto);
|
||||||
}
|
}
|
||||||
// Step.3 AutoPoi 导出Excel
|
// Step.3 AutoPoi 导出Excel
|
||||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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: 退火过程
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-08-30
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class AnnealProcessExportDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Excel(name = "样品名称", width = 15)
|
||||||
|
private String sampleName;
|
||||||
|
@Excel(name = "样品型号", width = 15)
|
||||||
|
private String sampleModel;
|
||||||
|
@Excel(name = "样品类型", width = 15)
|
||||||
|
private String sampleType;
|
||||||
|
|
||||||
|
@Excel(name = "退火温度")
|
||||||
|
private String annealTemperature;
|
||||||
|
@Excel(name = "退火开始时间")
|
||||||
|
private String annealStartTime;
|
||||||
|
@Excel(name = "退火结束时间")
|
||||||
|
private String annealEndTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -48,7 +48,13 @@ public class ExperimentExportDTO implements Serializable {
|
|||||||
@Excel(name = "试验员及评分", width = 15, needMerge = true)
|
@Excel(name = "试验员及评分", width = 15, needMerge = true)
|
||||||
private String rateUserAndScore;
|
private String rateUserAndScore;
|
||||||
|
|
||||||
@ExcelCollection(name = "试验实施")
|
@ExcelCollection(name = "辐照过程")
|
||||||
private List<ExperimentExportDetailDTO> detailList;
|
private List<RadiationProcessExportDTO> radiationProcessList;
|
||||||
|
|
||||||
|
@ExcelCollection(name = "退火过程")
|
||||||
|
private List<AnnealProcessExportDTO> annealProcessList;
|
||||||
|
|
||||||
|
@ExcelCollection(name = "测试过程")
|
||||||
|
private List<TestProcessExportDTO> testProcessList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 试验管理
|
* @Description: 辐照过程
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-08-30
|
* @Date: 2024-08-30
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -16,7 +16,7 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class ExperimentExportDetailDTO implements Serializable {
|
public class RadiationProcessExportDTO implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.jeecg.modules.database.dto;
|
||||||
|
|
||||||
|
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 java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 测试过程
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-08-30
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class TestProcessExportDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Excel(name = "环境温度", width = 15)
|
||||||
|
@Schema(description = "环境温度")
|
||||||
|
private String environmentalTemperature;
|
||||||
|
|
||||||
|
@Excel(name = "环境湿度", width = 15)
|
||||||
|
private String environmentalHumidity;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -85,6 +85,7 @@ public class ExperimentAnnealProcess implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "退火温度")
|
@Schema(description = "退火温度")
|
||||||
private String annealTemperature;
|
private String annealTemperature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public interface IExperimentAnnealProcessService extends IService<ExperimentAnne
|
|||||||
|
|
||||||
void assembleDetails(ExperimentAnnealProcess experimentAnnealProcess);
|
void assembleDetails(ExperimentAnnealProcess experimentAnnealProcess);
|
||||||
|
|
||||||
void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess);
|
void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess, String type);
|
||||||
|
|
||||||
void copy(String oldId,String newExperimentId);
|
void copy(String oldId,String newExperimentId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.jeecg.modules.database.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -79,7 +80,7 @@ public class ExperimentAnnealProcessServiceImpl extends ServiceImpl<ExperimentAn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess) {
|
public void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess, String type) {
|
||||||
// 保存样品信息
|
// 保存样品信息
|
||||||
List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList();
|
List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList();
|
||||||
List<String> sampleInfoIds = new ArrayList<>();
|
List<String> sampleInfoIds = new ArrayList<>();
|
||||||
@@ -93,31 +94,34 @@ public class ExperimentAnnealProcessServiceImpl extends ServiceImpl<ExperimentAn
|
|||||||
experimentAnnealProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ","));
|
experimentAnnealProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ","));
|
||||||
|
|
||||||
// 保存偏置条件信息
|
// 保存偏置条件信息
|
||||||
List<ExperimentDeviationCondition> deviationConditionList = experimentAnnealProcess.getDeviationConditionList();
|
String deviationCondition = experimentAnnealProcess.getDeviationCondition();
|
||||||
List<String> deviationConditionIds = new ArrayList<>();
|
if (StringUtils.isNotBlank(deviationCondition)) {
|
||||||
if (CollUtil.isNotEmpty(deviationConditionList)) {
|
List<ExperimentDeviationCondition> deviationConditionList = JSON.parseArray(deviationCondition,
|
||||||
|
ExperimentDeviationCondition.class);
|
||||||
for (ExperimentDeviationCondition sampleInfo : deviationConditionList) {
|
for (ExperimentDeviationCondition sampleInfo : deviationConditionList) {
|
||||||
|
if (StringUtils.equals(type, "add")) {
|
||||||
|
sampleInfo.setId(null);
|
||||||
|
}
|
||||||
experimentDeviationConditionService.saveOrUpdate(sampleInfo);
|
experimentDeviationConditionService.saveOrUpdate(sampleInfo);
|
||||||
deviationConditionIds.add(sampleInfo.getId());
|
|
||||||
}
|
}
|
||||||
|
experimentAnnealProcess.setDeviationCondition(JSON.toJSONString(deviationConditionList));
|
||||||
}
|
}
|
||||||
experimentAnnealProcess.setDeviationCondition(StringUtils.join(deviationConditionIds, ","));
|
|
||||||
|
|
||||||
//加偏设备信息
|
//加偏设备信息
|
||||||
List<ExperimentDeviationEquipment> deviationEquipmentList = experimentAnnealProcess.getDeviationEquipmentList();
|
String deviationEquipment = experimentAnnealProcess.getDeviationEquipment();
|
||||||
List<String> deviationEquipmentIds = new ArrayList<>();
|
if (StringUtils.isNotBlank(deviationEquipment)) {
|
||||||
if (CollUtil.isNotEmpty(deviationEquipmentList)) {
|
List<ExperimentDeviationEquipment> deviationEquipmentList = JSON.parseArray(deviationEquipment,
|
||||||
|
ExperimentDeviationEquipment.class);
|
||||||
for (ExperimentDeviationEquipment sampleInfo : deviationEquipmentList) {
|
for (ExperimentDeviationEquipment sampleInfo : deviationEquipmentList) {
|
||||||
experimentDeviationEquipmentService.saveOrUpdate(sampleInfo);
|
experimentDeviationEquipmentService.saveOrUpdate(sampleInfo);
|
||||||
deviationEquipmentIds.add(sampleInfo.getId());
|
|
||||||
}
|
}
|
||||||
|
experimentAnnealProcess.setDeviationEquipment(JSON.toJSONString(deviationEquipmentList));
|
||||||
}
|
}
|
||||||
experimentAnnealProcess.setDeviationEquipment(StringUtils.join(deviationEquipmentIds, ","));
|
|
||||||
saveOrUpdate(experimentAnnealProcess);
|
saveOrUpdate(experimentAnnealProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void copy(String oldId,String newExperimentId){
|
public void copy(String oldId, String newExperimentId) {
|
||||||
ExperimentAnnealProcess experiment = new ExperimentAnnealProcess();
|
ExperimentAnnealProcess experiment = new ExperimentAnnealProcess();
|
||||||
BeanUtil.copyProperties(getById(oldId), experiment);
|
BeanUtil.copyProperties(getById(oldId), experiment);
|
||||||
experiment.setId(null);
|
experiment.setId(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user