This commit is contained in:
ls
2024-12-05 11:45:09 +08:00
parent 476f9a34ab
commit d6244d1b1b
9 changed files with 211 additions and 54 deletions

View File

@@ -24,8 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.*;
import java.util.Objects;
/** /**
* @Description: 退火过程 * @Description: 退火过程
@@ -49,6 +48,8 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@Autowired @Autowired
private IExperimentLogService experimentLogService; private IExperimentLogService experimentLogService;
@Autowired
private IExperimentSampleInfoService experimentSampleInfoService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -99,7 +100,12 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList();
if (sampleInfoList!= null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentId); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("添加退火过程"); experimentLog.setLogContent("添加退火过程");
@@ -140,6 +146,12 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList();
if (sampleInfoList!= null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentId); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑退火过程"); experimentLog.setLogContent("编辑退火过程");

View File

@@ -55,6 +55,15 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
@Autowired @Autowired
private IExperimentSequenceService experimentSequenceService; private IExperimentSequenceService experimentSequenceService;
@Autowired
private IExperimentSampleInfoService experimentSampleInfoService;
@Autowired
private IExperimentDeviationConditionService experimentDeviationConditionService;
@Autowired
private IExperimentDeviationEquipmentService experimentDeviationEquipmentService;
@Autowired
private IExperimentIrradiationBoardService experimentIrradiationBoardService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -106,7 +115,38 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
userDomain.setType("OPERATOR"); userDomain.setType("OPERATOR");
experimentUserService.save(userDomain); experimentUserService.save(userDomain);
} }
}
List<ExperimentSampleInfo> sampleInfoList = experiment.getSampleInfoList();
if (CollUtil.isNotEmpty(sampleInfoList)) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
sampleInfo.setId(null);
sampleInfo.setExperimentId(experiment.getId());
experimentSampleInfoService.save(sampleInfo);
}
}
List<ExperimentDeviationCondition> deviationConditionList = experiment.getDeviationConditionList();
if (CollUtil.isNotEmpty(deviationConditionList)) {
for (ExperimentDeviationCondition deviationCondition : deviationConditionList) {
deviationCondition.setId(null);
deviationCondition.setExperimentId(experiment.getId());
experimentDeviationConditionService.save(deviationCondition);
}
}
List<ExperimentDeviationEquipment> deviationEquipmentList = experiment.getDeviationEquipmentList();
if (CollUtil.isNotEmpty(deviationEquipmentList)) {
for (ExperimentDeviationEquipment deviationEquipment : deviationEquipmentList) {
deviationEquipment.setId(null);
deviationEquipment.setExperimentId(experiment.getId());
experimentDeviationEquipmentService.save(deviationEquipment);
}
}
List<ExperimentIrradiationBoard> irradiationBoardList = experiment.getIrradiationBoardList();
if (CollUtil.isNotEmpty(irradiationBoardList)) {
for (ExperimentIrradiationBoard irradiationBoard : irradiationBoardList) {
irradiationBoard.setId(null);
irradiationBoard.setExperimentId(experiment.getId());
experimentIrradiationBoardService.save(irradiationBoard);
}
} }
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
@@ -136,6 +176,9 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
@RequiresPermissions("database:experiment:edit") @RequiresPermissions("database:experiment:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody Experiment experiment, HttpServletRequest request) { public Result<String> edit(@RequestBody Experiment experiment, HttpServletRequest request) {
if (StringUtils.containsAny(experiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + experiment.getStatus() + "]不能进行修改!");
}
String experimentUser = experiment.getExperimentUser(); String experimentUser = experiment.getExperimentUser();
if (StringUtils.isNotBlank(experimentUser)) { if (StringUtils.isNotBlank(experimentUser)) {
experimentUserService.removeByExperimentId(experiment.getId()); experimentUserService.removeByExperimentId(experiment.getId());
@@ -150,8 +193,34 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
} }
experimentUserService.saveBatch(userList); experimentUserService.saveBatch(userList);
} }
if (StringUtils.containsAny(experiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + experiment.getStatus() + "]不能进行修改!"); List<ExperimentSampleInfo> sampleInfoList = experiment.getSampleInfoList();
if (CollUtil.isNotEmpty(sampleInfoList)) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
sampleInfo.setExperimentId(experiment.getId());
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
List<ExperimentDeviationCondition> deviationConditionList = experiment.getDeviationConditionList();
if (CollUtil.isNotEmpty(deviationConditionList)) {
for (ExperimentDeviationCondition deviationCondition : deviationConditionList) {
deviationCondition.setExperimentId(experiment.getId());
experimentDeviationConditionService.saveOrUpdate(deviationCondition);
}
}
List<ExperimentDeviationEquipment> deviationEquipmentList = experiment.getDeviationEquipmentList();
if (CollUtil.isNotEmpty(deviationEquipmentList)) {
for (ExperimentDeviationEquipment deviationEquipment : deviationEquipmentList) {
deviationEquipment.setExperimentId(experiment.getId());
experimentDeviationEquipmentService.saveOrUpdate(deviationEquipment);
}
}
List<ExperimentIrradiationBoard> irradiationBoardList = experiment.getIrradiationBoardList();
if (CollUtil.isNotEmpty(irradiationBoardList)) {
for (ExperimentIrradiationBoard irradiationBoard : irradiationBoardList) {
irradiationBoard.setExperimentId(experiment.getId());
experimentIrradiationBoardService.saveOrUpdate(irradiationBoard);
}
} }
experimentService.updateById(experiment); experimentService.updateById(experiment);
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();

View File

@@ -25,8 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.*;
import java.util.Objects;
/** /**
* @Description: 辐照过程 * @Description: 辐照过程
@@ -50,6 +49,9 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
@Autowired @Autowired
private IExperimentService experimentService; private IExperimentService experimentService;
@Autowired
private IExperimentSampleInfoService experimentSampleInfoService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -102,6 +104,13 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentRadiationProcess.getSampleInfoList();
if (sampleInfoList!= null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentId); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("添加辐照过程"); experimentLog.setLogContent("添加辐照过程");
@@ -141,7 +150,12 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentRadiationProcess.getSampleInfoList();
if (sampleInfoList!= null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentId); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑辐照过程"); experimentLog.setLogContent("编辑辐照过程");

View File

@@ -25,8 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.*;
import java.util.Objects;
/** /**
* @Description: 测试过程 * @Description: 测试过程
@@ -50,6 +49,9 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
@Autowired @Autowired
private IExperimentService experimentService; private IExperimentService experimentService;
@Autowired
private IExperimentSampleInfoService experimentSampleInfoService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -100,7 +102,12 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentTestProcess.getSampleInfoList();
if (sampleInfoList != null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentTestProcess.getExperimentId()); experimentLog.setExperimentId(experimentTestProcess.getExperimentId());
experimentLog.setLogContent("添加测试过程"); experimentLog.setLogContent("添加测试过程");
@@ -142,7 +149,12 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment); experimentService.updateById(experiment);
List<ExperimentSampleInfo> sampleInfoList = experimentTestProcess.getSampleInfoList();
if (sampleInfoList != null && sampleInfoList.size() > 0) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
experimentSampleInfoService.saveOrUpdate(sampleInfo);
}
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentId); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑测试过程"); experimentLog.setLogContent("编辑测试过程");

View File

@@ -99,4 +99,8 @@ public class Equipment implements Serializable {
@Excel(name = "房间号", width = 15) @Excel(name = "房间号", width = 15)
@Schema(description = "房间号") @Schema(description = "房间号")
private String roomNo; private String roomNo;
@Excel(name = "图片", width = 15)
@Schema(description = "图片")
private String images;
} }

View File

@@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Description: 退火过程 * @Description: 退火过程
@@ -139,6 +140,18 @@ public class ExperimentAnnealProcess implements Serializable {
@Schema(description = "加偏设备(json 大字段)") @Schema(description = "加偏设备(json 大字段)")
private String biasEquipment; private String biasEquipment;
@Schema(description = "偏置条件")
@TableField(exist = false)
private List<ExperimentDeviationCondition> deviationConditionList;
@Schema(description = "加偏设备")
@TableField(exist = false)
private List<ExperimentDeviationEquipment> deviationEquipmentList;
@TableField(exist = false)
private List<ExperimentSampleInfo> sampleInfoList;
public ExperimentAnnealProcess copy(String experimentId) { public ExperimentAnnealProcess copy(String experimentId) {
ExperimentAnnealProcess experiment = new ExperimentAnnealProcess(); ExperimentAnnealProcess experiment = new ExperimentAnnealProcess();
BeanUtil.copyProperties(this, experiment); BeanUtil.copyProperties(this, experiment);

View File

@@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Description: 辐照过程 * @Description: 辐照过程
@@ -71,8 +72,8 @@ public class ExperimentRadiationProcess implements Serializable {
/** /**
* 计量率 * 计量率
*/ */
@Excel(name = "量率", width = 15) @Excel(name = "量率", width = 15)
@Schema(description = "量率") @Schema(description = "量率")
private String measurementRate; private String measurementRate;
/** /**
* 辐照标准 * 辐照标准
@@ -128,6 +129,9 @@ public class ExperimentRadiationProcess implements Serializable {
@Schema(description = "辐照结束时间") @Schema(description = "辐照结束时间")
private Date radiationEndTime; private Date radiationEndTime;
@TableField(exist = false)
private List<ExperimentSampleInfo> sampleInfoList;
public ExperimentRadiationProcess copy(String experimentId) { public ExperimentRadiationProcess copy(String experimentId) {
ExperimentRadiationProcess experiment = new ExperimentRadiationProcess(); ExperimentRadiationProcess experiment = new ExperimentRadiationProcess();
BeanUtil.copyProperties(this, experiment); BeanUtil.copyProperties(this, experiment);

View File

@@ -1,21 +1,16 @@
package org.jeecg.modules.database.entity; package org.jeecg.modules.database.entity;
import java.io.Serializable; import com.baomidou.mybatisplus.annotation.*;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; 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: 试验样品信息 * @Description: 试验样品信息
@@ -31,51 +26,81 @@ import lombok.experimental.Accessors;
public class ExperimentSampleInfo implements Serializable { public class ExperimentSampleInfo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键") @Schema(description = "主键")
private String id; private String id;
/**创建人*/ /**
* 创建人
*/
@Schema(description = "创建人") @Schema(description = "创建人")
private String createBy; private String createBy;
/**创建日期*/ /**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期") @Schema(description = "创建日期")
private Date createTime; private Date createTime;
/**更新人*/ /**
* 更新人
*/
@Schema(description = "更新人") @Schema(description = "更新人")
private String updateBy; private String updateBy;
/**更新日期*/ /**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期") @Schema(description = "更新日期")
private Date updateTime; private Date updateTime;
/**所属部门*/ /**
* 所属部门
*/
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String sysOrgCode; private String sysOrgCode;
/**试验ID*/ /**
* 试验ID
*/
@Excel(name = "试验ID", width = 15) @Excel(name = "试验ID", width = 15)
@Schema(description = "试验ID") @Schema(description = "试验ID")
private String experimentId; private String experimentId;
/**样品类型*/ /**
* 样品类型
*/
@Excel(name = "样品类型", width = 15) @Excel(name = "样品类型", width = 15)
@Schema(description = "样品类型") @Schema(description = "样品类型")
private String sampleType; private String sampleType;
/**样品型号*/ /**
* 样品型号
*/
@Excel(name = "样品型号", width = 15) @Excel(name = "样品型号", width = 15)
@Schema(description = "样品型号") @Schema(description = "样品型号")
private String sampleModel; private String sampleModel;
/**样品批次*/ /**
* 样品批次
*/
@Excel(name = "样品批次", width = 15) @Excel(name = "样品批次", width = 15)
@Schema(description = "样品批次") @Schema(description = "样品批次")
private String sampleBatch; private String sampleBatch;
/**生产厂家*/ /**
* 生产厂家
*/
@Excel(name = "生产厂家", width = 15) @Excel(name = "生产厂家", width = 15)
@Schema(description = "生产厂家") @Schema(description = "生产厂家")
private String sampleManufacturer; private String sampleManufacturer;
/**图片*/ /**
* 图片
*/
@Excel(name = "图片", width = 15) @Excel(name = "图片", width = 15)
@Schema(description = "图片") @Schema(description = "图片")
private String sampleImage; private String sampleImage;
/**
* 名称
*/
@Excel(name = "样品名称", width = 15)
@Schema(description = "样品名称")
private String sampleName;
} }

View File

@@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Description: 测试过程 * @Description: 测试过程
@@ -175,6 +176,9 @@ public class ExperimentTestProcess implements Serializable {
@Schema(description = "测试结果") @Schema(description = "测试结果")
private String testResult; private String testResult;
@TableField(exist = false)
private List<ExperimentSampleInfo> sampleInfoList;
public ExperimentTestProcess copy(String experimentId) { public ExperimentTestProcess copy(String experimentId) {
ExperimentTestProcess experiment = new ExperimentTestProcess(); ExperimentTestProcess experiment = new ExperimentTestProcess();
BeanUtil.copyProperties(this, experiment); BeanUtil.copyProperties(this, experiment);