Experiment edit
This commit is contained in:
@@ -16,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.database.entity.ExperimentDeviationCondition;
|
||||
import org.jeecg.modules.database.service.IExperimentDeviationConditionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -56,6 +57,7 @@ public class ExperimentDeviationConditionController
|
||||
req.getParameterMap());
|
||||
Page<ExperimentDeviationCondition> page = new Page<ExperimentDeviationCondition>(pageNo, pageSize);
|
||||
IPage<ExperimentDeviationCondition> pageList = experimentDeviationConditionService.page(page, queryWrapper);
|
||||
pageList.getRecords().forEach(v -> experimentDeviationConditionService.assembleDetails(v));
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -70,6 +72,9 @@ public class ExperimentDeviationConditionController
|
||||
@RequiresPermissions("database:experiment:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ExperimentDeviationCondition experimentDeviationCondition) {
|
||||
Assert.hasText(experimentDeviationCondition.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentDeviationCondition.getSampleId(), "样品ID不能为空!");
|
||||
|
||||
experimentDeviationConditionService.save(experimentDeviationCondition);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
@@ -85,6 +90,8 @@ public class ExperimentDeviationConditionController
|
||||
@RequiresPermissions("database:experiment:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ExperimentDeviationCondition experimentDeviationCondition) {
|
||||
Assert.hasText(experimentDeviationCondition.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentDeviationCondition.getSampleId(), "样品ID不能为空!");
|
||||
experimentDeviationConditionService.updateById(experimentDeviationCondition);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
@@ -133,6 +140,8 @@ public class ExperimentDeviationConditionController
|
||||
if (experimentDeviationCondition == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
experimentDeviationConditionService.assembleDetails(experimentDeviationCondition);
|
||||
|
||||
return Result.OK(experimentDeviationCondition);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.jeecg.modules.database.entity.ExperimentDeviationEquipment;
|
||||
import org.jeecg.modules.database.service.IEquipmentService;
|
||||
import org.jeecg.modules.database.service.IExperimentDeviationEquipmentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -61,6 +62,8 @@ public class ExperimentDeviationEquipmentController
|
||||
req.getParameterMap());
|
||||
Page<ExperimentDeviationEquipment> page = new Page<ExperimentDeviationEquipment>(pageNo, pageSize);
|
||||
IPage<ExperimentDeviationEquipment> pageList = experimentDeviationEquipmentService.page(page, queryWrapper);
|
||||
pageList.getRecords().forEach(v -> experimentDeviationEquipmentService.assembleDetails(v));
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -75,9 +78,13 @@ public class ExperimentDeviationEquipmentController
|
||||
@RequiresPermissions("database:experiment:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ExperimentDeviationEquipment experimentDeviationEquipment) {
|
||||
String equipmentNo = experimentDeviationEquipment.getEquipmentNo();
|
||||
Assert.hasText(experimentDeviationEquipment.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentDeviationEquipment.getSampleId(), "样品ID不能为空!");
|
||||
|
||||
String equipmentNo = experimentDeviationEquipment.getManagementNo();
|
||||
if (StringUtils.isNotBlank(equipmentNo) && StringUtils.isBlank(experimentDeviationEquipment.getMeasurementValidity())) {
|
||||
Equipment equipment = equipmentService.getByManagementNo(equipmentNo);
|
||||
experimentDeviationEquipment.setEquipmentId(equipment.getId());
|
||||
experimentDeviationEquipment.setMeasurementValidity(equipment.getExpireDate());
|
||||
}
|
||||
experimentDeviationEquipmentService.save(experimentDeviationEquipment);
|
||||
@@ -95,6 +102,14 @@ public class ExperimentDeviationEquipmentController
|
||||
@RequiresPermissions("database:experiment:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ExperimentDeviationEquipment experimentDeviationEquipment) {
|
||||
Assert.hasText(experimentDeviationEquipment.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentDeviationEquipment.getSampleId(), "样品ID不能为空!");
|
||||
String equipmentNo = experimentDeviationEquipment.getManagementNo();
|
||||
if (StringUtils.isNotBlank(equipmentNo) && StringUtils.isBlank(experimentDeviationEquipment.getMeasurementValidity())) {
|
||||
Equipment equipment = equipmentService.getByManagementNo(equipmentNo);
|
||||
experimentDeviationEquipment.setEquipmentId(equipment.getId());
|
||||
experimentDeviationEquipment.setMeasurementValidity(equipment.getExpireDate());
|
||||
}
|
||||
experimentDeviationEquipmentService.updateById(experimentDeviationEquipment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
@@ -143,6 +158,8 @@ public class ExperimentDeviationEquipmentController
|
||||
if (experimentDeviationEquipment == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
experimentDeviationEquipmentService.assembleDetails(experimentDeviationEquipment);
|
||||
|
||||
return Result.OK(experimentDeviationEquipment);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.database.entity.ExperimentIrradiationBoard;
|
||||
import org.jeecg.modules.database.service.IExperimentIrradiationBoardService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -55,6 +56,7 @@ public class ExperimentIrradiationBoardController extends JeecgController<Experi
|
||||
req.getParameterMap());
|
||||
Page<ExperimentIrradiationBoard> page = new Page<ExperimentIrradiationBoard>(pageNo, pageSize);
|
||||
IPage<ExperimentIrradiationBoard> pageList = experimentIrradiationBoardService.page(page, queryWrapper);
|
||||
pageList.getRecords().forEach(v -> experimentIrradiationBoardService.assembleDetails(v));
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -69,6 +71,8 @@ public class ExperimentIrradiationBoardController extends JeecgController<Experi
|
||||
@RequiresPermissions("database:experiment:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ExperimentIrradiationBoard experimentIrradiationBoard) {
|
||||
Assert.hasText(experimentIrradiationBoard.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentIrradiationBoard.getSampleId(), "样品ID不能为空!");
|
||||
experimentIrradiationBoardService.save(experimentIrradiationBoard);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
@@ -84,6 +88,8 @@ public class ExperimentIrradiationBoardController extends JeecgController<Experi
|
||||
@RequiresPermissions("database:experiment:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ExperimentIrradiationBoard experimentIrradiationBoard) {
|
||||
Assert.hasText(experimentIrradiationBoard.getExperimentId(), "实验ID不能为空!");
|
||||
Assert.hasText(experimentIrradiationBoard.getSampleId(), "样品ID不能为空!");
|
||||
experimentIrradiationBoardService.updateById(experimentIrradiationBoard);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
@@ -132,6 +138,7 @@ public class ExperimentIrradiationBoardController extends JeecgController<Experi
|
||||
if (experimentIrradiationBoard == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
experimentIrradiationBoardService.assembleDetails(experimentIrradiationBoard);
|
||||
return Result.OK(experimentIrradiationBoard);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
||||
import org.jeecg.modules.database.service.IExperimentSampleInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -104,6 +105,7 @@ public class ExperimentSampleInfoController extends JeecgController<ExperimentSa
|
||||
@RequiresPermissions("database:experiment:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ExperimentSampleInfo experimentSampleInfo) {
|
||||
Assert.hasText(experimentSampleInfo.getExperimentId(), "实验ID不能为空!");
|
||||
experimentSampleInfoService.save(experimentSampleInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
@@ -119,6 +121,7 @@ public class ExperimentSampleInfoController extends JeecgController<ExperimentSa
|
||||
@RequiresPermissions("database:experiment:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ExperimentSampleInfo experimentSampleInfo) {
|
||||
Assert.hasText(experimentSampleInfo.getExperimentId(), "实验ID不能为空!");
|
||||
experimentSampleInfoService.updateById(experimentSampleInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.modules.database.dto.ExperimentNoDTO;
|
||||
import org.jeecg.modules.database.entity.Experiment;
|
||||
import org.jeecg.modules.database.entity.ExperimentSequence;
|
||||
import org.jeecg.modules.database.service.IExperimentSequenceService;
|
||||
import org.jeecg.modules.database.service.IExperimentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class ExperimentSequenceController extends JeecgController<ExperimentSequence, IExperimentSequenceService> {
|
||||
@Autowired
|
||||
private IExperimentSequenceService experimentSequenceService;
|
||||
@Autowired
|
||||
private IExperimentService experimentService;
|
||||
|
||||
/**
|
||||
* 获取序号
|
||||
@@ -32,9 +37,15 @@ public class ExperimentSequenceController extends JeecgController<ExperimentSequ
|
||||
//@AutoLog(value = "试验序列-分页列表查询")
|
||||
@Operation(summary = "试验序列-获取序号")
|
||||
@GetMapping(value = "/next")
|
||||
public Result<String> next() {
|
||||
|
||||
return Result.OK(experimentSequenceService.next());
|
||||
public Result<ExperimentNoDTO> next() {
|
||||
String experimentNo = experimentSequenceService.next();
|
||||
Experiment experiment = new Experiment();
|
||||
experiment.setExperimentNo(experimentNo);
|
||||
experimentService.save(experiment);
|
||||
ExperimentNoDTO experimentNoDTO = new ExperimentNoDTO();
|
||||
experimentNoDTO.setExperimentId(experiment.getId());
|
||||
experimentNoDTO.setExperimentNo(experimentNo);
|
||||
return Result.OK(experimentNoDTO);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.jeecg.modules.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class ExperimentNoDTO {
|
||||
private String experimentId;
|
||||
private String experimentNo;
|
||||
}
|
||||
@@ -66,24 +66,67 @@ public class ExperimentDeviationCondition implements Serializable {
|
||||
@Excel(name = "试验ID", width = 15)
|
||||
@Schema(description = "试验ID")
|
||||
private java.lang.String experimentId;
|
||||
|
||||
/**
|
||||
* 样品ID
|
||||
*/
|
||||
@Excel(name = "样品ID", width = 15)
|
||||
@Schema(description = "样品ID")
|
||||
private java.lang.String sampleId;
|
||||
|
||||
/**
|
||||
* 样品信息
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private ExperimentSampleInfo sampleInfo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "样品名称", width = 15)
|
||||
@Schema(description = "样品名称")
|
||||
@TableField(exist = false)
|
||||
private String sampleName;
|
||||
/**
|
||||
* 样品类型
|
||||
*/
|
||||
@Excel(name = "样品类型", width = 15)
|
||||
@Schema(description = "样品类型")
|
||||
private java.lang.String sampleType;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleType;
|
||||
/**
|
||||
* 样品型号
|
||||
*/
|
||||
@Excel(name = "样品型号", width = 15)
|
||||
@Schema(description = "样品型号")
|
||||
private java.lang.String sampleModel;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleModel;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
@Excel(name = "批次", width = 15)
|
||||
@Schema(description = "批次")
|
||||
private java.lang.String sampleBatch;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleBatch;
|
||||
/**
|
||||
* 型号批次
|
||||
*/
|
||||
@Schema(description = "型号批次")
|
||||
@TableField(exist = false)
|
||||
private String modelBatch;
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
@Schema(description = "生产厂家")
|
||||
@TableField(exist = false)
|
||||
private String sampleManufacturer;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@Schema(description = "图片")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleImage;
|
||||
/**
|
||||
* 样品编号
|
||||
*/
|
||||
|
||||
@@ -30,100 +30,162 @@ public class ExperimentDeviationEquipment implements Serializable {
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
private java.lang.String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Schema(description = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Schema(description = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
private java.lang.String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Schema(description = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
private java.util.Date updateTime;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@Schema(description = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
private java.lang.String sysOrgCode;
|
||||
/**
|
||||
* 试验ID
|
||||
*/
|
||||
@Excel(name = "试验ID", width = 15)
|
||||
@Schema(description = "试验ID")
|
||||
private java.lang.String experimentId;
|
||||
private java.lang.String experimentId;
|
||||
/**
|
||||
* 样品ID
|
||||
*/
|
||||
@Excel(name = "样品ID", width = 15)
|
||||
@Schema(description = "样品ID")
|
||||
private java.lang.String sampleId;
|
||||
/**
|
||||
* 样品信息
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private ExperimentSampleInfo sampleInfo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "样品名称", width = 15)
|
||||
@Schema(description = "样品名称")
|
||||
@TableField(exist = false)
|
||||
private String sampleName;
|
||||
/**
|
||||
* 样品类型
|
||||
*/
|
||||
@Excel(name = "样品类型", width = 15)
|
||||
@Schema(description = "样品类型")
|
||||
private java.lang.String sampleType;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleType;
|
||||
/**
|
||||
* 样品型号
|
||||
*/
|
||||
@Excel(name = "样品型号", width = 15)
|
||||
@Schema(description = "样品型号")
|
||||
private java.lang.String sampleModel;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleModel;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
@Excel(name = "批次", width = 15)
|
||||
@Schema(description = "批次")
|
||||
private java.lang.String sampleBatch;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleBatch;
|
||||
/**
|
||||
* 设备型号
|
||||
* 型号批次
|
||||
*/
|
||||
@Excel(name = "设备型号", width = 15)
|
||||
@Schema(description = "设备型号")
|
||||
private java.lang.String equipmentModel;
|
||||
@Schema(description = "型号批次")
|
||||
@TableField(exist = false)
|
||||
private String modelBatch;
|
||||
/**
|
||||
* 设备名称
|
||||
* 生产厂家
|
||||
*/
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
@Schema(description = "设备名称")
|
||||
private java.lang.String equipmentName;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Excel(name = "设备类型", width = 15)
|
||||
@Schema(description = "设备类型")
|
||||
private java.lang.String equipmentType;
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
@Schema(description = "生产厂家")
|
||||
@TableField(exist = false)
|
||||
private String sampleManufacturer;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@Schema(description = "图片")
|
||||
private java.lang.String sampleImage;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleImage;
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
@Excel(name = "设备型号", width = 15)
|
||||
@Schema(description = "设备型号")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String equipmentModel;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
@Schema(description = "设备名称")
|
||||
private java.lang.String equipmentId;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
@Schema(description = "设备名称")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String equipmentName;
|
||||
@TableField(exist = false)
|
||||
private Equipment equipment;
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Excel(name = "设备类型", width = 15)
|
||||
@Schema(description = "设备类型")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String equipmentType;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "设备图片", width = 15)
|
||||
@Schema(description = "设备图片")
|
||||
private java.lang.String equipmentImage;
|
||||
/**
|
||||
* 计量有效期
|
||||
*/
|
||||
@Excel(name = "计量有效期", width = 15)
|
||||
@Schema(description = "计量有效期")
|
||||
private java.lang.String measurementValidity;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String measurementValidity;
|
||||
/**
|
||||
* 房间号
|
||||
*/
|
||||
@Excel(name = "房间号", width = 15)
|
||||
@Schema(description = "房间号")
|
||||
private java.lang.String roomNo;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String roomNo;
|
||||
/**
|
||||
* 设备编号
|
||||
* 出厂编号
|
||||
*/
|
||||
@Excel(name = "设备编号", width = 15)
|
||||
@Schema(description = "设备编号")
|
||||
private java.lang.String equipmentNo;
|
||||
@Excel(name = "出厂编号", width = 15)
|
||||
@Schema(description = "出厂编号")
|
||||
@TableField(exist = false)
|
||||
private String factoryNo;
|
||||
/**
|
||||
* 管理编号
|
||||
*/
|
||||
@Excel(name = "管理编号", width = 15)
|
||||
@Schema(description = "管理编号")
|
||||
@TableField(exist = false)
|
||||
private String managementNo;
|
||||
}
|
||||
|
||||
@@ -30,88 +30,130 @@ public class ExperimentIrradiationBoard implements Serializable {
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
private java.lang.String createBy;
|
||||
private java.lang.String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Schema(description = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@Schema(description = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
private java.lang.String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Schema(description = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
private java.util.Date updateTime;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@Schema(description = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
private java.lang.String sysOrgCode;
|
||||
/**
|
||||
* 试验ID
|
||||
*/
|
||||
@Excel(name = "试验ID", width = 15)
|
||||
@Schema(description = "试验ID")
|
||||
private java.lang.String experimentId;
|
||||
private java.lang.String experimentId;
|
||||
/**
|
||||
* 样品ID
|
||||
*/
|
||||
@Excel(name = "样品ID", width = 15)
|
||||
@Schema(description = "样品ID")
|
||||
private java.lang.String sampleId;
|
||||
/**
|
||||
* 样品信息
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private ExperimentSampleInfo sampleInfo;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Excel(name = "样品名称", width = 15)
|
||||
@Schema(description = "样品名称")
|
||||
@TableField(exist = false)
|
||||
private String sampleName;
|
||||
/**
|
||||
* 样品类型
|
||||
*/
|
||||
@Excel(name = "样品类型", width = 15)
|
||||
@Schema(description = "样品类型")
|
||||
private java.lang.String sampleType;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleType;
|
||||
/**
|
||||
* 样品型号
|
||||
*/
|
||||
@Excel(name = "样品型号", width = 15)
|
||||
@Schema(description = "样品型号")
|
||||
private java.lang.String sampleModel;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleModel;
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
@Excel(name = "批次", width = 15)
|
||||
@Schema(description = "批次")
|
||||
private java.lang.String sampleBatch;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleBatch;
|
||||
/**
|
||||
* 辐照板数量
|
||||
* 型号批次
|
||||
*/
|
||||
@Excel(name = "辐照板数量", width = 15)
|
||||
@Schema(description = "辐照板数量")
|
||||
private java.lang.String irradiationBoardNumber;
|
||||
@Schema(description = "型号批次")
|
||||
@TableField(exist = false)
|
||||
private String modelBatch;
|
||||
/**
|
||||
* 辐照板编号
|
||||
* 生产厂家
|
||||
*/
|
||||
@Excel(name = "辐照板编号", width = 15)
|
||||
@Schema(description = "辐照板编号")
|
||||
private java.lang.String irradiationBoardCode;
|
||||
/**
|
||||
* 计量有效期
|
||||
*/
|
||||
@Excel(name = "计量有效期", width = 15)
|
||||
@Schema(description = "计量有效期")
|
||||
private java.lang.String measurementValidity;
|
||||
/**
|
||||
* 占源面积
|
||||
*/
|
||||
@Excel(name = "占源面积", width = 15)
|
||||
@Schema(description = "占源面积")
|
||||
private java.lang.String sourceArea;
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
@Schema(description = "生产厂家")
|
||||
@TableField(exist = false)
|
||||
private String sampleManufacturer;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@Schema(description = "图片")
|
||||
private java.lang.String sampleImage;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sampleImage;
|
||||
/**
|
||||
* 辐照板数量
|
||||
*/
|
||||
@Excel(name = "辐照板数量", width = 15)
|
||||
@Schema(description = "辐照板数量")
|
||||
private java.lang.String irradiationBoardNumber;
|
||||
/**
|
||||
* 辐照板编号
|
||||
*/
|
||||
@Excel(name = "辐照板编号", width = 15)
|
||||
@Schema(description = "辐照板编号")
|
||||
private java.lang.String irradiationBoardCode;
|
||||
/**
|
||||
* 计量有效期
|
||||
*/
|
||||
@Excel(name = "计量有效期", width = 15)
|
||||
@Schema(description = "计量有效期")
|
||||
private java.lang.String measurementValidity;
|
||||
/**
|
||||
* 占源面积
|
||||
*/
|
||||
@Excel(name = "占源面积", width = 15)
|
||||
@Schema(description = "占源面积")
|
||||
private java.lang.String sourceArea;
|
||||
|
||||
/**
|
||||
* 辐照板编号
|
||||
*/
|
||||
@Excel(name = "辐照板图片", width = 15)
|
||||
@Schema(description = "辐照板图片")
|
||||
private java.lang.String irradiationBoardImage;
|
||||
}
|
||||
|
||||
@@ -92,9 +92,13 @@ public class ExperimentSampleInfo implements Serializable {
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
@Schema(description = "生产厂家")
|
||||
@Schema(description = "生产厂家ID")
|
||||
private String sampleManufacturer;
|
||||
@Excel(name = "生产厂家", width = 15)
|
||||
|
||||
@Schema(description = "生产厂家名称")
|
||||
@TableField(exist = false)
|
||||
private String sampleManufacturerName;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
left join experiment_report r on r.experiment_id = e.id
|
||||
left join experiment_radiation_process rp on rp.experiment_id = e.id
|
||||
<where>
|
||||
e.status is not null
|
||||
<choose>
|
||||
<when test="experiment.pageName == 'audit'">
|
||||
AND ((r.auditor=#{loginUser.id} and r.status='PROOFREAD_PASS') or (r.proofreader=#{loginUser.id} and r.status='INIT')
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.jeecg.modules.database.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.database.entity.ExperimentDeviationCondition;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -14,4 +15,9 @@ import java.util.List;
|
||||
public interface IExperimentDeviationConditionService extends IService<ExperimentDeviationCondition> {
|
||||
List<ExperimentDeviationCondition> getByExperimentId(String experimentId);
|
||||
|
||||
List<ExperimentDeviationCondition> getBySampleId(String sampleId);
|
||||
|
||||
void assembleDetails(ExperimentDeviationCondition experimentDeviationCondition);
|
||||
|
||||
void removeBySampleId(Serializable id);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.jeecg.modules.database.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.database.entity.ExperimentDeviationEquipment;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -14,4 +15,9 @@ import java.util.List;
|
||||
public interface IExperimentDeviationEquipmentService extends IService<ExperimentDeviationEquipment> {
|
||||
List<ExperimentDeviationEquipment> getByExperimentId(String experimentId);
|
||||
|
||||
List<ExperimentDeviationEquipment> getBySampleId(String sampleId);
|
||||
|
||||
void assembleDetails(ExperimentDeviationEquipment experimentDeviationEquipment);
|
||||
|
||||
void removeBySampleId(Serializable id);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.jeecg.modules.database.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.database.entity.ExperimentIrradiationBoard;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -14,4 +15,9 @@ import java.util.List;
|
||||
public interface IExperimentIrradiationBoardService extends IService<ExperimentIrradiationBoard> {
|
||||
List<ExperimentIrradiationBoard> getByExperimentId(String experimentId);
|
||||
|
||||
List<ExperimentIrradiationBoard> getBySampleId(String sampleId);
|
||||
|
||||
void assembleDetails(ExperimentIrradiationBoard experimentIrradiationBoard);
|
||||
|
||||
void removeBySampleId(Serializable id);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,18 @@ package org.jeecg.modules.database.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.database.entity.ExperimentDeviationCondition;
|
||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
||||
import org.jeecg.modules.database.mapper.ExperimentDeviationConditionMapper;
|
||||
import org.jeecg.modules.database.service.IExperimentDeviationConditionService;
|
||||
import org.jeecg.modules.database.service.IExperimentSampleInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 试验偏置条件信息
|
||||
@@ -18,8 +24,41 @@ import java.util.List;
|
||||
@Service
|
||||
public class ExperimentDeviationConditionServiceImpl extends ServiceImpl<ExperimentDeviationConditionMapper, ExperimentDeviationCondition>
|
||||
implements IExperimentDeviationConditionService {
|
||||
@Autowired
|
||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||
|
||||
@Override
|
||||
public List<ExperimentDeviationCondition> getByExperimentId(String experimentId) {
|
||||
return list(new LambdaQueryWrapper<ExperimentDeviationCondition>().eq(ExperimentDeviationCondition::getExperimentId, experimentId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExperimentDeviationCondition> getBySampleId(String sampleId) {
|
||||
List<ExperimentDeviationCondition> list = list(
|
||||
new LambdaQueryWrapper<ExperimentDeviationCondition>().eq(ExperimentDeviationCondition::getSampleId, sampleId));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assembleDetails(ExperimentDeviationCondition experimentDeviationCondition) {
|
||||
String sampleId = experimentDeviationCondition.getSampleId();
|
||||
if (StringUtils.isNotBlank(sampleId)) {
|
||||
ExperimentSampleInfo sampleInfo = experimentSampleInfoService.getById(sampleId);
|
||||
experimentDeviationCondition.setSampleInfo(sampleInfo);
|
||||
experimentDeviationCondition.setSampleName(sampleInfo.getSampleName());
|
||||
experimentDeviationCondition.setSampleType(sampleInfo.getSampleType());
|
||||
experimentDeviationCondition.setSampleModel(sampleInfo.getSampleModel());
|
||||
experimentDeviationCondition.setSampleBatch(sampleInfo.getSampleBatch());
|
||||
experimentDeviationCondition.setModelBatch(sampleInfo.getModelBatch());
|
||||
experimentDeviationCondition.setSampleImage(sampleInfo.getSampleImage());
|
||||
experimentDeviationCondition.setSampleManufacturer(sampleInfo.getSampleManufacturer());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBySampleId(Serializable sampleId) {
|
||||
List<ExperimentDeviationCondition> bySampleId = getBySampleId(String.valueOf(sampleId));
|
||||
List<String> collect = bySampleId.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||
removeByIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,17 @@ package org.jeecg.modules.database.service.impl;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.database.entity.Equipment;
|
||||
import org.jeecg.modules.database.entity.ExperimentDeviationEquipment;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecg.modules.database.mapper.ExperimentDeviationEquipmentMapper;
|
||||
import org.jeecg.modules.database.service.IEquipmentService;
|
||||
import org.jeecg.modules.database.service.IExperimentDeviationEquipmentService;
|
||||
import org.jeecg.modules.database.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 试验加偏设备信息
|
||||
@@ -25,7 +25,9 @@ import java.util.Objects;
|
||||
public class ExperimentDeviationEquipmentServiceImpl extends ServiceImpl<ExperimentDeviationEquipmentMapper, ExperimentDeviationEquipment>
|
||||
implements IExperimentDeviationEquipmentService {
|
||||
@Autowired
|
||||
private IEquipmentService equipmentService;
|
||||
private IEquipmentService equipmentService;
|
||||
@Autowired
|
||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||
|
||||
@Override
|
||||
public List<ExperimentDeviationEquipment> getByExperimentId(String experimentId) {
|
||||
@@ -34,6 +36,12 @@ public class ExperimentDeviationEquipmentServiceImpl extends ServiceImpl<Experim
|
||||
list.forEach(this::assembleDetails);
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public List<ExperimentDeviationEquipment> getBySampleId(String sampleId) {
|
||||
List<ExperimentDeviationEquipment> list = list(
|
||||
new LambdaQueryWrapper<ExperimentDeviationEquipment>().eq(ExperimentDeviationEquipment::getSampleId, sampleId));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExperimentDeviationEquipment getById(Serializable id) {
|
||||
@@ -42,13 +50,41 @@ public class ExperimentDeviationEquipmentServiceImpl extends ServiceImpl<Experim
|
||||
return byId;
|
||||
}
|
||||
|
||||
private void assembleDetails(ExperimentDeviationEquipment experimentDeviationEquipment) {
|
||||
@Override
|
||||
public void assembleDetails(ExperimentDeviationEquipment experimentDeviationEquipment) {
|
||||
if (ObjUtil.isNull(experimentDeviationEquipment)) {
|
||||
return;
|
||||
}
|
||||
Equipment one = equipmentService.getByManagementNo(experimentDeviationEquipment.getEquipmentNo());
|
||||
if (Objects.nonNull(one)) {
|
||||
experimentDeviationEquipment.setEquipmentName(one.getName());
|
||||
String managementNo = experimentDeviationEquipment.getManagementNo();
|
||||
if (StringUtils.isNotBlank(managementNo)) {
|
||||
Equipment one = equipmentService.getByManagementNo(managementNo);
|
||||
if (Objects.nonNull(one)) {
|
||||
experimentDeviationEquipment.setEquipment(one);
|
||||
experimentDeviationEquipment.setEquipmentName(one.getName());
|
||||
experimentDeviationEquipment.setManagementNo(one.getManagementNo());
|
||||
experimentDeviationEquipment.setEquipmentModel(one.getModel());
|
||||
experimentDeviationEquipment.setEquipmentId(one.getId());
|
||||
experimentDeviationEquipment.setEquipmentImage(one.getImages());
|
||||
}
|
||||
}
|
||||
String sampleId = experimentDeviationEquipment.getSampleId();
|
||||
if (StringUtils.isNotBlank(sampleId)) {
|
||||
ExperimentSampleInfo sampleInfo = experimentSampleInfoService.getById(sampleId);
|
||||
experimentDeviationEquipment.setSampleInfo(sampleInfo);
|
||||
experimentDeviationEquipment.setSampleName(sampleInfo.getSampleName());
|
||||
experimentDeviationEquipment.setSampleType(sampleInfo.getSampleType());
|
||||
experimentDeviationEquipment.setSampleModel(sampleInfo.getSampleModel());
|
||||
experimentDeviationEquipment.setSampleBatch(sampleInfo.getSampleBatch());
|
||||
experimentDeviationEquipment.setModelBatch(sampleInfo.getModelBatch());
|
||||
experimentDeviationEquipment.setSampleImage(sampleInfo.getSampleImage());
|
||||
experimentDeviationEquipment.setSampleManufacturer(sampleInfo.getSampleManufacturer());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBySampleId(Serializable sampleId) {
|
||||
List<ExperimentDeviationEquipment> bySampleId = getBySampleId(String.valueOf(sampleId));
|
||||
List<String> collect = bySampleId.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||
removeByIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,13 +381,23 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
if (StringUtils.isNotBlank(sampleInfo)) {
|
||||
List<JSONObject> sampleInfoList = JSON.parseArray(sampleInfo, JSONObject.class);
|
||||
if (CollUtil.isNotEmpty(sampleInfoList)) {
|
||||
List<ExperimentDeviationCondition> deviationConditionList = experiment.getDeviationConditionList();
|
||||
if (CollUtil.isEmpty(deviationConditionList)) {
|
||||
deviationConditionList = new ArrayList<>();
|
||||
}
|
||||
for (int i = 0; i < sampleInfoList.size(); i++) {
|
||||
JSONObject info = sampleInfoList.get(i);
|
||||
params.put("table" + i, Tables.of(new String[][] {new String[] {"试验样品名称", getStringOrDefault(info,
|
||||
"sampleName"), "试验样品型号", getStringOrDefault(info, "sampleModel")},
|
||||
new String[] {"批 次", getStringOrDefault(info, "sampleBatch"), "试验样品编号", getStringOrDefault(info,
|
||||
"sampleType")}, new String[] {"生产厂家", getStringOrDefault(info, "sampleManufacturer"),
|
||||
"试验样品数量", sampleInfoList.size() + ""}, new String[] {"放置地点", "", "接收日期", ""},})
|
||||
String batchNo = deviationConditionList.stream().filter(
|
||||
v -> StringUtils.equals(v.getSampleModel(), getStringOrDefault(
|
||||
info, "sampleModel")) && StringUtils.equals(v.getSampleType(), getStringOrDefault(
|
||||
info, "sampleType"))).findFirst().map(ExperimentDeviationCondition::getSampleNumber).orElse("");
|
||||
params.put("table" + i, Tables.of(new String[][] {
|
||||
new String[] {"试验样品名称", getStringOrDefault(info, "sampleName"), "试验样品型号", getStringOrDefault(
|
||||
info, "sampleModel")},
|
||||
new String[] {"批 次", getStringOrDefault(info, "sampleBatch"), "试验样品编号", batchNo},
|
||||
new String[] {"生产厂家", getStringOrDefault(info, "sampleManufacturer"), "试验样品数量",
|
||||
batchNo.split(",").length + ""},
|
||||
new String[] {"放置地点", "", "接收日期", ""},})
|
||||
.border(BorderStyle.DEFAULT).create());
|
||||
String imgUrls = info.getString("picture");
|
||||
if (StringUtils.isNotBlank(imgUrls)) {
|
||||
@@ -473,7 +483,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
for (int i = 0; i < deviationEquipmentList.size(); i++) {
|
||||
ExperimentDeviationEquipment deviationEquipment = deviationEquipmentList.get(i);
|
||||
strings[i + 1] = new String[] {(i + 1) + "", Optional.ofNullable(deviationEquipment.getEquipmentName()).orElse(""),
|
||||
Optional.ofNullable(deviationEquipment.getEquipmentNo()).orElse(""), Optional.ofNullable(
|
||||
Optional.ofNullable(deviationEquipment.getManagementNo()).orElse(""), Optional.ofNullable(
|
||||
deviationEquipment.getMeasurementValidity()).orElse(""), Optional.ofNullable(deviationEquipment.getRoomNo()).orElse(
|
||||
""),};
|
||||
}
|
||||
@@ -531,10 +541,10 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("index", i + 1);
|
||||
params.put("设备名称", Optional.ofNullable(v.getEquipmentName()).orElse(""));
|
||||
params.put("管理编号", Optional.ofNullable(v.getEquipmentNo()).orElse(""));
|
||||
params.put("管理编号", Optional.ofNullable(v.getManagementNo()).orElse(""));
|
||||
params.put("使用日期", experiment.getStartDate());
|
||||
params.put("归还日期", experiment.getEndDate());
|
||||
Equipment equipment = equipmentService.getByManagementNo(v.getEquipmentNo());
|
||||
Equipment equipment = equipmentService.getByManagementNo(v.getManagementNo());
|
||||
params.put("计量有效期", Optional.ofNullable(equipment).map(s -> s.getExpireDate()).orElse(""));
|
||||
params.put("异常记录", "");
|
||||
list.add(params);
|
||||
|
||||
@@ -2,12 +2,18 @@ package org.jeecg.modules.database.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.database.entity.ExperimentIrradiationBoard;
|
||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
||||
import org.jeecg.modules.database.mapper.ExperimentIrradiationBoardMapper;
|
||||
import org.jeecg.modules.database.service.IExperimentIrradiationBoardService;
|
||||
import org.jeecg.modules.database.service.IExperimentSampleInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 试验辐照板信息
|
||||
@@ -18,9 +24,44 @@ import java.util.List;
|
||||
@Service
|
||||
public class ExperimentIrradiationBoardServiceImpl extends ServiceImpl<ExperimentIrradiationBoardMapper, ExperimentIrradiationBoard>
|
||||
implements IExperimentIrradiationBoardService {
|
||||
@Autowired
|
||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||
|
||||
@Override
|
||||
public List<ExperimentIrradiationBoard> getByExperimentId(String experimentId) {
|
||||
return list(new LambdaQueryWrapper<ExperimentIrradiationBoard>().eq(ExperimentIrradiationBoard::getExperimentId, experimentId));
|
||||
List<ExperimentIrradiationBoard> list = list(
|
||||
new LambdaQueryWrapper<ExperimentIrradiationBoard>().eq(ExperimentIrradiationBoard::getExperimentId, experimentId));
|
||||
list.forEach(this::assembleDetails);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExperimentIrradiationBoard> getBySampleId(String sampleId) {
|
||||
List<ExperimentIrradiationBoard> list = list(
|
||||
new LambdaQueryWrapper<ExperimentIrradiationBoard>().eq(ExperimentIrradiationBoard::getSampleId, sampleId));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assembleDetails(ExperimentIrradiationBoard experimentIrradiationBoard) {
|
||||
String sampleId = experimentIrradiationBoard.getSampleId();
|
||||
if (StringUtils.isNotBlank(sampleId)) {
|
||||
ExperimentSampleInfo sampleInfo = experimentSampleInfoService.getById(sampleId);
|
||||
experimentIrradiationBoard.setSampleInfo(sampleInfo);
|
||||
experimentIrradiationBoard.setSampleName(sampleInfo.getSampleName());
|
||||
experimentIrradiationBoard.setSampleType(sampleInfo.getSampleType());
|
||||
experimentIrradiationBoard.setSampleModel(sampleInfo.getSampleModel());
|
||||
experimentIrradiationBoard.setSampleBatch(sampleInfo.getSampleBatch());
|
||||
experimentIrradiationBoard.setModelBatch(sampleInfo.getModelBatch());
|
||||
experimentIrradiationBoard.setSampleImage(sampleInfo.getSampleImage());
|
||||
experimentIrradiationBoard.setSampleManufacturer(sampleInfo.getSampleManufacturer());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBySampleId(Serializable sampleId) {
|
||||
List<ExperimentIrradiationBoard> bySampleId = getBySampleId(String.valueOf(sampleId));
|
||||
List<String> collect = bySampleId.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||
removeByIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
package org.jeecg.modules.database.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.modules.database.entity.Client;
|
||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
||||
import org.jeecg.modules.database.mapper.ExperimentSampleInfoMapper;
|
||||
import org.jeecg.modules.database.service.IExperimentSampleInfoService;
|
||||
import org.jeecg.modules.database.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Description: 试验样品信息
|
||||
@@ -18,6 +24,41 @@ import java.util.List;
|
||||
@Service
|
||||
public class ExperimentSampleInfoServiceImpl extends ServiceImpl<ExperimentSampleInfoMapper, ExperimentSampleInfo>
|
||||
implements IExperimentSampleInfoService {
|
||||
@Autowired
|
||||
private IClientService clientService;
|
||||
@Autowired
|
||||
private IExperimentDeviationEquipmentService experimentDeviationEquipmentService;
|
||||
@Autowired
|
||||
private IExperimentDeviationConditionService experimentDeviationConditionService;
|
||||
@Autowired
|
||||
private IExperimentIrradiationBoardService experimentIrradiationBoardService;
|
||||
|
||||
@Override
|
||||
public ExperimentSampleInfo getById(Serializable id) {
|
||||
ExperimentSampleInfo byId = super.getById(id);
|
||||
this.assembleDetails(byId);
|
||||
return byId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeById(Serializable id) {
|
||||
super.removeById(id);
|
||||
experimentDeviationEquipmentService.removeBySampleId(id);
|
||||
experimentDeviationConditionService.removeBySampleId(id);
|
||||
experimentIrradiationBoardService.removeBySampleId(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void assembleDetails(ExperimentSampleInfo sampleInfo) {
|
||||
if (ObjUtil.isNull(sampleInfo)) {
|
||||
return;
|
||||
}
|
||||
String sampleManufacturerId = sampleInfo.getSampleManufacturer();
|
||||
if (StringUtils.isNotBlank(sampleManufacturerId)) {
|
||||
Client byId = clientService.getById(sampleManufacturerId);
|
||||
sampleInfo.setSampleManufacturerName(Optional.ofNullable(byId).map(v -> v.getName()).orElse(sampleManufacturerId));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExperimentSampleInfo> getByExperimentId(String experimentId) {
|
||||
|
||||
@@ -262,34 +262,34 @@ public class ExperimentServiceImpl extends ServiceImpl<ExperimentMapper, Experim
|
||||
experimentUserService.save(userDomain);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
//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);
|
||||
// }
|
||||
//}
|
||||
|
||||
List<ExperimentFile> fileList = experiment.getFileList();
|
||||
if (CollUtil.isNotEmpty(fileList)) {
|
||||
|
||||
Reference in New Issue
Block a user