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

@@ -77,7 +77,7 @@ public class Experiment implements Serializable {
/** /**
* 试验类型 * 试验类型
*/ */
@Excel(name = "试验类型", width = 15) @Excel(name = "试验类型", width = 15, replace = {"科研试验_1", "外协试验_2"})
@Schema(description = "试验类型") @Schema(description = "试验类型")
private String type; private String type;
/** /**
@@ -111,15 +111,20 @@ public class Experiment implements Serializable {
/** /**
* 样品型号 * 样品型号
*/ */
@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())) {