This commit is contained in:
ls
2025-02-09 21:47:16 +08:00
parent 1c1856b0ea
commit 528e56dc49
2 changed files with 33 additions and 27 deletions

View File

@@ -32,54 +32,54 @@ public class Experiment implements Serializable {
*/ */
@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;
/** /**
* 试验编号 * 试验编号
*/ */
@Excel(name = "试验编号", width = 15) @Excel(name = "试验编号", width = 15)
@Schema(description = "试验编号") @Schema(description = "试验编号")
private String experimentNo; private String experimentNo;
/** /**
* 名称 * 名称
*/ */
@Excel(name = "名称", width = 15) @Excel(name = "名称", width = 15)
@Schema(description = "名称") @Schema(description = "名称")
private String name; private String name;
/** /**
* 试验类型 * 试验类型
*/ */
@Excel(name = "试验类型", width = 15) @Excel(name = "试验类型", width = 15, replace = {"科研试验_1", "外协试验_2"})
@Schema(description = "试验类型") @Schema(description = "试验类型")
private String type; private String type;
/** /**
* 试验日期 * 试验日期
*/ */
@@ -87,7 +87,7 @@ public class Experiment implements Serializable {
//@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") //@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
//@DateTimeFormat(pattern = "yyyy-MM-dd") //@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "试验开始日期") @Schema(description = "试验开始日期")
private String startDate; private String startDate;
/** /**
* 试验日期 * 试验日期
*/ */
@@ -95,31 +95,36 @@ public class Experiment implements Serializable {
//@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") //@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
//@DateTimeFormat(pattern = "yyyy-MM-dd") //@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "试验结束日期") @Schema(description = "试验结束日期")
private String endDate; private String endDate;
/** /**
* 辐射源类型 * 辐射源类型
*/ */
@Excel(name = "辐射源类型", width = 15) @Excel(name = "辐射源类型", width = 15)
@Schema(description = "辐射源类型") @Schema(description = "辐射源类型")
private String radiationSourceType; private String radiationSourceType;
/** /**
* 委托方名称 * 委托方名称
*/ */
@Excel(name = "委托方名称", width = 15) @Excel(name = "委托方名称", width = 15)
@Schema(description = "委托方名称") @Schema(description = "委托方名称")
private String clientName; private String clientName;
/** /**
* 样品型号 * 样品型号
*/ */
@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, dictTable = "sys_user", dicText = "realname", dicCode = "id")
@Schema(description = "试验负责人") private String supervisor;
private String supervisor;
/**
* 试验负责人
*/
@TableField(exist = false)
private String supervisorName;
/** /**
* 状态 * 状态
*/ */
@@ -164,7 +169,6 @@ public class Experiment implements Serializable {
/** /**
* 复制次数 * 复制次数
*/ */
@Excel(name = "复制次数", width = 15)
@Schema(description = "复制次数") @Schema(description = "复制次数")
private Integer copyCount; private Integer copyCount;
/** /**
@@ -180,19 +184,13 @@ public class Experiment implements Serializable {
* 试验人员ID, 逗号分割多个 * 试验人员ID, 逗号分割多个
*/ */
@TableField(exist = false) @TableField(exist = false)
@Excel(name = "试验员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String experimentUser; private String experimentUser;
/**
* 试验负责人
*/
@TableField(exist = false)
@Excel(name = "试验负责人", width = 15)
private String supervisorName;
/** /**
* 试验人员 * 试验人员
*/ */
@TableField(exist = false) @TableField(exist = false)
private List<ExperimentUser> experimentUserList; private List<ExperimentUser> experimentUserList;
@Excel(name = "排序号", width = 15)
@Schema(description = "排序号") @Schema(description = "排序号")
private Integer indexNo; private Integer indexNo;

View File

@@ -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.baomidou.mybatisplus.core.conditions.Wrapper;
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;
@@ -45,6 +46,13 @@ public class ExperimentServiceImpl extends ServiceImpl<ExperimentMapper, Experim
@Autowired @Autowired
private IExperimentFileService experimentFileService; private IExperimentFileService experimentFileService;
@Override
public List<Experiment> list(Wrapper<Experiment> queryWrapper) {
List<Experiment> list = super.list(queryWrapper);
list.forEach(this::fetchExperimentDetail);
return list;
}
@Override @Override
public void fetchExperimentDetail(Experiment experiment) { public void fetchExperimentDetail(Experiment experiment) {
if (StringUtils.isNotBlank(experiment.getSupervisor())) { if (StringUtils.isNotBlank(experiment.getSupervisor())) {