update
This commit is contained in:
@@ -1,21 +1,15 @@
|
|||||||
package org.jeecg.common.util;
|
package org.jeecg.common.util;
|
||||||
|
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
|
import org.jeecg.common.util.date.TimeRange;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.DateFormat;
|
import java.text.*;
|
||||||
import java.text.ParseException;
|
import java.time.*;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Calendar;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类描述:时间操作定义类
|
* 类描述:时间操作定义类
|
||||||
@@ -26,25 +20,25 @@ import java.util.GregorianCalendar;
|
|||||||
*/
|
*/
|
||||||
public class DateUtils extends PropertyEditorSupport {
|
public class DateUtils extends PropertyEditorSupport {
|
||||||
|
|
||||||
public static ThreadLocal<SimpleDateFormat> date_sdf = new ThreadLocal<SimpleDateFormat>() {
|
public static ThreadLocal<SimpleDateFormat> date_sdf = new ThreadLocal<SimpleDateFormat>() {
|
||||||
@Override
|
@Override
|
||||||
protected SimpleDateFormat initialValue() {
|
protected SimpleDateFormat initialValue() {
|
||||||
return new SimpleDateFormat("yyyy-MM-dd");
|
return new SimpleDateFormat("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static ThreadLocal<SimpleDateFormat> yyyyMMdd = new ThreadLocal<SimpleDateFormat>() {
|
public static ThreadLocal<SimpleDateFormat> yyyyMMdd = new ThreadLocal<SimpleDateFormat>() {
|
||||||
@Override
|
@Override
|
||||||
protected SimpleDateFormat initialValue() {
|
protected SimpleDateFormat initialValue() {
|
||||||
return new SimpleDateFormat("yyyyMMdd");
|
return new SimpleDateFormat("yyyyMMdd");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static ThreadLocal<SimpleDateFormat> date_sdf_wz = new ThreadLocal<SimpleDateFormat>() {
|
public static ThreadLocal<SimpleDateFormat> date_sdf_wz = new ThreadLocal<SimpleDateFormat>() {
|
||||||
@Override
|
@Override
|
||||||
protected SimpleDateFormat initialValue() {
|
protected SimpleDateFormat initialValue() {
|
||||||
return new SimpleDateFormat("yyyy年MM月dd日");
|
return new SimpleDateFormat("yyyy年MM月dd日");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static ThreadLocal<SimpleDateFormat> time_sdf = new ThreadLocal<SimpleDateFormat>() {
|
public static ThreadLocal<SimpleDateFormat> time_sdf = new ThreadLocal<SimpleDateFormat>() {
|
||||||
@Override
|
@Override
|
||||||
protected SimpleDateFormat initialValue() {
|
protected SimpleDateFormat initialValue() {
|
||||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
@@ -72,8 +66,8 @@ public class DateUtils extends PropertyEditorSupport {
|
|||||||
/**
|
/**
|
||||||
* 以毫秒表示的时间
|
* 以毫秒表示的时间
|
||||||
*/
|
*/
|
||||||
private static final long DAY_IN_MILLIS = 24 * 3600 * 1000;
|
private static final long DAY_IN_MILLIS = 24 * 3600 * 1000;
|
||||||
private static final long HOUR_IN_MILLIS = 3600 * 1000;
|
private static final long HOUR_IN_MILLIS = 3600 * 1000;
|
||||||
private static final long MINUTE_IN_MILLIS = 60 * 1000;
|
private static final long MINUTE_IN_MILLIS = 60 * 1000;
|
||||||
private static final long SECOND_IN_MILLIS = 1000;
|
private static final long SECOND_IN_MILLIS = 1000;
|
||||||
|
|
||||||
@@ -123,7 +117,6 @@ public class DateUtils extends PropertyEditorSupport {
|
|||||||
return new Date();
|
return new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前日期
|
* 当前日期
|
||||||
*
|
*
|
||||||
@@ -816,4 +809,57 @@ public class DateUtils extends PropertyEditorSupport {
|
|||||||
return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR);
|
return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找出列表中最早的时间,比较开始时间和结束时间,返回最早的
|
||||||
|
*
|
||||||
|
* @param timeRanges
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date findEarliestTime(List<TimeRange> timeRanges) {
|
||||||
|
if (timeRanges == null || timeRanges.isEmpty()) {
|
||||||
|
return null; // 处理空列表的情况
|
||||||
|
}
|
||||||
|
return timeRanges.stream()
|
||||||
|
//过滤掉start或end为null 的数据
|
||||||
|
.filter(timeRange -> timeRange.getStartTime() != null || timeRange.getEndTime() != null)
|
||||||
|
.flatMap(timeRange -> {
|
||||||
|
List<Date> dates = new ArrayList<>();
|
||||||
|
if (timeRange.getStartTime() != null) {
|
||||||
|
dates.add(timeRange.getStartTime());
|
||||||
|
}
|
||||||
|
if (timeRange.getEndTime() != null) {
|
||||||
|
dates.add(timeRange.getEndTime());
|
||||||
|
}
|
||||||
|
return dates.stream();
|
||||||
|
})
|
||||||
|
.min(Date::compareTo)
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找出列表中最晚的时间,比较开始时间和结束时间,返回最晚的
|
||||||
|
*
|
||||||
|
* @param timeRanges
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date findLatestTime(List<TimeRange> timeRanges) {
|
||||||
|
if (timeRanges == null || timeRanges.isEmpty()) {
|
||||||
|
return null; // 处理空列表的情况
|
||||||
|
}
|
||||||
|
return timeRanges.stream()
|
||||||
|
//过滤掉start或end为null 的数据
|
||||||
|
.filter(timeRange -> timeRange.getStartTime() != null || timeRange.getEndTime() != null)
|
||||||
|
.flatMap(timeRange -> {
|
||||||
|
List<Date> dates = new ArrayList<>();
|
||||||
|
if (timeRange.getStartTime() != null) {
|
||||||
|
dates.add(timeRange.getStartTime());
|
||||||
|
}
|
||||||
|
if (timeRange.getEndTime() != null) {
|
||||||
|
dates.add(timeRange.getEndTime());
|
||||||
|
}
|
||||||
|
return dates.stream();
|
||||||
|
})
|
||||||
|
.max(Date::compareTo)
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Ant Group
|
||||||
|
* Copyright (c) 2004-2024 All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package org.jeecg.common.util.date;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lise
|
||||||
|
* @version TimeRange.java, v 0.1 2024年12月23日 14:21 lise
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TimeRange {
|
||||||
|
private Date startTime;
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,82 +1,47 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration debug="false">
|
<configuration>
|
||||||
<!--定义日志文件的存储地址 -->
|
<!-- 定义日志输出的颜色,用于控制台美化 -->
|
||||||
<property name="LOG_HOME" value="./logs" />
|
<property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p %-30.30thread %-40.40logger{36} : %msg%n"/>
|
||||||
|
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p %-30.30thread %-40.40logger{36} : %msg%n"/>
|
||||||
|
|
||||||
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
<!-- 日志文件存储路径,可根据实际项目调整 -->
|
||||||
<!-- 控制台输出 -->
|
<property name="LOG_FILE_PATH" value="./logs"/>
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<property name="LOG_FILE_NAME" value="application.log"/>
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
<property name="LOG_ARCHIVE_PATH" value="${LOG_FILE_PATH}/archive"/>
|
||||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
|
<!-- 定义控制台 appender -->
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n</pattern>
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 按照每天生成日志文件 -->
|
<!-- 定义文件 appender,用于输出到 application.log 文件,并按日期滚动 -->
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<file>${LOG_FILE_PATH}/${LOG_FILE_NAME}</file>
|
||||||
<!--日志文件输出的文件名 -->
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<FileNamePattern>${LOG_HOME}/physical-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
<fileNamePattern>${LOG_ARCHIVE_PATH}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
<!--日志文件保留天数 -->
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
<MaxHistory>30</MaxHistory>
|
<maxFileSize>100MB</maxFileSize>
|
||||||
<maxFileSize>10MB</maxFileSize>
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>30</maxHistory> <!-- 最多保留30天的日志文件 -->
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
<encoder>
|
||||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
|
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<!-- 生成 error html格式日志开始 -->
|
<!-- 定义 spring boot 特定日志记录器,针对框架内部日志输出 -->
|
||||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
<logger name="org.springframework" level="INFO" />
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<!--设置日志级别,过滤掉info日志,只输入error日志-->
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<!--日志文件输出的文件名 -->
|
|
||||||
<FileNamePattern>${LOG_HOME}/physical-error-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
|
||||||
<!--日志文件保留天数 -->
|
|
||||||
<MaxHistory>30</MaxHistory>
|
|
||||||
<maxFileSize>10MB</maxFileSize>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
|
||||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
<!-- 生成 error html格式日志结束 -->
|
|
||||||
|
|
||||||
<!-- 每天生成一个html格式的日志开始 -->
|
<!-- 定义 mybatis 日志记录器,可以单独控制 sql 日志的输出级别 -->
|
||||||
<appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<logger name="org.mybatis" level="DEBUG" />
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<logger name="com.example.mapper" level="DEBUG" />
|
||||||
<!--日志文件输出的文件名 -->
|
|
||||||
<FileNamePattern>${LOG_HOME}/physical-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
|
|
||||||
<!--日志文件保留天数 -->
|
|
||||||
<MaxHistory>30</MaxHistory>
|
|
||||||
<MaxFileSize>10MB</MaxFileSize>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
|
||||||
<layout class="ch.qos.logback.classic.html.HTMLLayout">
|
|
||||||
<pattern>%p%d%msg%M%F{32}%L</pattern>
|
|
||||||
</layout>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
<!-- 每天生成一个html格式的日志结束 -->
|
|
||||||
|
|
||||||
<!--myibatis log configure -->
|
<!-- 定义所有其他日志记录器 -->
|
||||||
<logger name="com.apache.ibatis" level="TRACE" />
|
|
||||||
<logger name="java.sql.Connection" level="DEBUG" />
|
|
||||||
<logger name="java.sql.Statement" level="DEBUG" />
|
|
||||||
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
|
||||||
|
|
||||||
<!-- 日志输出级别 -->
|
|
||||||
<root level="INFO">
|
<root level="INFO">
|
||||||
<appender-ref ref="STDOUT" />
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="FILE" />
|
<appender-ref ref="FILE"/>
|
||||||
<appender-ref ref="HTML" />
|
|
||||||
<appender-ref ref="FILE_HTML" />
|
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -129,33 +129,33 @@ public class Experiment implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 样品信息
|
* 样品信息
|
||||||
*/
|
*/
|
||||||
@Excel(name = "样品信息", width = 15)
|
//@Excel(name = "样品信息", width = 15)
|
||||||
@Schema(description = "样品信息")
|
//@Schema(description = "样品信息")
|
||||||
private String sampleInfo;
|
//private String sampleInfo;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<ExperimentSampleInfo> sampleInfoList;
|
private List<ExperimentSampleInfo> sampleInfoList;
|
||||||
/**
|
/**
|
||||||
* 辐照板
|
* 辐照板
|
||||||
*/
|
*/
|
||||||
@Excel(name = "辐照板", width = 15)
|
//@Excel(name = "辐照板", width = 15)
|
||||||
@Schema(description = "辐照板")
|
//@Schema(description = "辐照板")
|
||||||
private String irradiationBoard;
|
//private String irradiationBoard;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<ExperimentIrradiationBoard> irradiationBoardList;
|
private List<ExperimentIrradiationBoard> irradiationBoardList;
|
||||||
/**
|
/**
|
||||||
* 偏置条件
|
* 偏置条件
|
||||||
*/
|
*/
|
||||||
@Excel(name = "偏置条件", width = 15)
|
//@Excel(name = "偏置条件", width = 15)
|
||||||
@Schema(description = "偏置条件")
|
//@Schema(description = "偏置条件")
|
||||||
private String deviationCondition;
|
//private String deviationCondition;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<ExperimentDeviationCondition> deviationConditionList;
|
private List<ExperimentDeviationCondition> deviationConditionList;
|
||||||
/**
|
/**
|
||||||
* 加偏设备
|
* 加偏设备
|
||||||
*/
|
*/
|
||||||
@Excel(name = "加偏设备", width = 15)
|
//@Excel(name = "加偏设备", width = 15)
|
||||||
@Schema(description = "加偏设备")
|
//@Schema(description = "加偏设备")
|
||||||
private String deviationEquipment;
|
//private String deviationEquipment;
|
||||||
/**
|
/**
|
||||||
* 加偏设备
|
* 加偏设备
|
||||||
*/
|
*/
|
||||||
@@ -170,7 +170,7 @@ public class Experiment implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 试验文件
|
* 试验文件
|
||||||
*/
|
*/
|
||||||
@Excel(name = "试验文件", width = 15)
|
//@Excel(name = "试验文件", width = 15)
|
||||||
@Schema(description = "试验文件")
|
@Schema(description = "试验文件")
|
||||||
private String files;
|
private String files;
|
||||||
|
|
||||||
@@ -185,6 +185,7 @@ public class Experiment implements Serializable {
|
|||||||
* 试验负责人
|
* 试验负责人
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "试验负责人", width = 15)
|
||||||
private String supervisorName;
|
private String supervisorName;
|
||||||
/**
|
/**
|
||||||
* 试验人员
|
* 试验人员
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package org.jeecg.modules.database.service.impl;
|
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.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;
|
||||||
import org.jeecg.modules.database.entity.ExperimentRadiationProcess;
|
import org.jeecg.common.util.DateUtils;
|
||||||
import org.jeecg.modules.database.entity.ExperimentSampleInfo;
|
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.mapper.ExperimentRadiationProcessMapper;
|
||||||
import org.jeecg.modules.database.service.IExperimentRadiationProcessService;
|
import org.jeecg.modules.database.service.*;
|
||||||
import org.jeecg.modules.database.service.IExperimentSampleInfoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -25,7 +26,9 @@ import java.util.stream.Collectors;
|
|||||||
public class ExperimentRadiationProcessServiceImpl extends ServiceImpl<ExperimentRadiationProcessMapper, ExperimentRadiationProcess>
|
public class ExperimentRadiationProcessServiceImpl extends ServiceImpl<ExperimentRadiationProcessMapper, ExperimentRadiationProcess>
|
||||||
implements IExperimentRadiationProcessService {
|
implements IExperimentRadiationProcessService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExperimentSampleInfoService experimentSampleInfoService;
|
private IExperimentSampleInfoService experimentSampleInfoService;
|
||||||
|
@Autowired
|
||||||
|
private IExperimentIrradiationBoardService experimentIrradiationBoardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ExperimentRadiationProcess> getByExperimentId(String experimentId) {
|
public List<ExperimentRadiationProcess> getByExperimentId(String experimentId) {
|
||||||
@@ -68,6 +71,20 @@ public class ExperimentRadiationProcessServiceImpl extends ServiceImpl<Experimen
|
|||||||
sampleInfoIds.add(sampleInfo.getId());
|
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, ","));
|
experimentRadiationProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ","));
|
||||||
saveOrUpdate(experimentRadiationProcess);
|
saveOrUpdate(experimentRadiationProcess);
|
||||||
|
|||||||
Reference in New Issue
Block a user