update
This commit is contained in:
@@ -129,33 +129,33 @@ public class Experiment implements Serializable {
|
||||
/**
|
||||
* 样品信息
|
||||
*/
|
||||
@Excel(name = "样品信息", width = 15)
|
||||
@Schema(description = "样品信息")
|
||||
private String sampleInfo;
|
||||
//@Excel(name = "样品信息", width = 15)
|
||||
//@Schema(description = "样品信息")
|
||||
//private String sampleInfo;
|
||||
@TableField(exist = false)
|
||||
private List<ExperimentSampleInfo> sampleInfoList;
|
||||
/**
|
||||
* 辐照板
|
||||
*/
|
||||
@Excel(name = "辐照板", width = 15)
|
||||
@Schema(description = "辐照板")
|
||||
private String irradiationBoard;
|
||||
//@Excel(name = "辐照板", width = 15)
|
||||
//@Schema(description = "辐照板")
|
||||
//private String irradiationBoard;
|
||||
@TableField(exist = false)
|
||||
private List<ExperimentIrradiationBoard> irradiationBoardList;
|
||||
/**
|
||||
* 偏置条件
|
||||
*/
|
||||
@Excel(name = "偏置条件", width = 15)
|
||||
@Schema(description = "偏置条件")
|
||||
private String deviationCondition;
|
||||
//@Excel(name = "偏置条件", width = 15)
|
||||
//@Schema(description = "偏置条件")
|
||||
//private String deviationCondition;
|
||||
@TableField(exist = false)
|
||||
private List<ExperimentDeviationCondition> deviationConditionList;
|
||||
/**
|
||||
* 加偏设备
|
||||
*/
|
||||
@Excel(name = "加偏设备", width = 15)
|
||||
@Schema(description = "加偏设备")
|
||||
private String deviationEquipment;
|
||||
//@Excel(name = "加偏设备", width = 15)
|
||||
//@Schema(description = "加偏设备")
|
||||
//private String deviationEquipment;
|
||||
/**
|
||||
* 加偏设备
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ public class Experiment implements Serializable {
|
||||
/**
|
||||
* 试验文件
|
||||
*/
|
||||
@Excel(name = "试验文件", width = 15)
|
||||
//@Excel(name = "试验文件", width = 15)
|
||||
@Schema(description = "试验文件")
|
||||
private String files;
|
||||
|
||||
@@ -185,6 +185,7 @@ public class Experiment implements Serializable {
|
||||
* 试验负责人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "试验负责人", width = 15)
|
||||
private String supervisorName;
|
||||
/**
|
||||
* 试验人员
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package org.jeecg.modules.database.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.ExperimentRadiationProcess;
|
||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.date.TimeRange;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecg.modules.database.mapper.ExperimentRadiationProcessMapper;
|
||||
import org.jeecg.modules.database.service.IExperimentRadiationProcessService;
|
||||
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;
|
||||
|
||||
@@ -25,7 +26,9 @@ import java.util.stream.Collectors;
|
||||
public class ExperimentRadiationProcessServiceImpl extends ServiceImpl<ExperimentRadiationProcessMapper, ExperimentRadiationProcess>
|
||||
implements IExperimentRadiationProcessService {
|
||||
@Autowired
|
||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||
@Autowired
|
||||
private IExperimentIrradiationBoardService experimentIrradiationBoardService;
|
||||
|
||||
@Override
|
||||
public List<ExperimentRadiationProcess> getByExperimentId(String experimentId) {
|
||||
@@ -68,6 +71,20 @@ public class ExperimentRadiationProcessServiceImpl extends ServiceImpl<Experimen
|
||||
sampleInfoIds.add(sampleInfo.getId());
|
||||
}
|
||||
}
|
||||
List<ExperimentRadiationProcess> radiationProcessList = getByExperimentId(experimentRadiationProcess.getExperimentId());
|
||||
if (CollUtil.isNotEmpty(radiationProcessList)) {
|
||||
List<TimeRange> list = radiationProcessList.stream().map(v -> new TimeRange(v.getRadiationStartTime(), v.getRadiationEndTime()))
|
||||
.collect(Collectors.toList());
|
||||
Date earliestTime = DateUtils.findEarliestTime(list);
|
||||
Date latestTime = DateUtils.findLatestTime(list);
|
||||
List<ExperimentIrradiationBoard> irradiationBoardList = experimentIrradiationBoardService.getByExperimentId(
|
||||
experimentRadiationProcess.getExperimentId());
|
||||
String mv = DateUtils.formatDate(earliestTime, "yyyy-MM-dd") + "至" + DateUtils.formatDate(latestTime, "yyyy-MM-dd");
|
||||
irradiationBoardList.forEach(experimentIrradiationBoard -> {
|
||||
experimentIrradiationBoard.setMeasurementValidity(mv);
|
||||
experimentIrradiationBoardService.saveOrUpdate(experimentIrradiationBoard);
|
||||
});
|
||||
}
|
||||
|
||||
experimentRadiationProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ","));
|
||||
saveOrUpdate(experimentRadiationProcess);
|
||||
|
||||
Reference in New Issue
Block a user