提交 74317a4a 编写于 作者: zc's avatar zc

update:报表构建支持构建时间偏移量(hour,day)

上级 a7b97bf9
......@@ -37,6 +37,8 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import java.io.File;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.util.*;
......@@ -125,8 +127,22 @@ public class DABuildExService extends DABuildServiceImpl {
public DABuild run(DABuild et) {
if(!StringUtils.isEmpty(et.getBuildId()))
{
Object timeHour = et.get("hour");
Object timeDay = et.get("day");
CachedBeanCopier.copy(get(et.getBuildId()), et);
if (!StringUtils.isEmpty(timeHour) || !StringUtils.isEmpty(timeDay)) {
Calendar c = Calendar.getInstance();
c.setTime(et.getLastRuntime());
if (!StringUtils.isEmpty(timeHour)) {
Integer hour = Integer.parseInt(String.valueOf(timeHour));
c.add(Calendar.HOUR, hour);
}
if (!StringUtils.isEmpty(timeDay)) {
Integer day = Integer.parseInt(String.valueOf(timeDay));
c.add(Calendar.DAY_OF_MONTH, day);
}
et.setLastRuntime(new Timestamp(c.getTime().getTime()));
}
if("RUNNING".equalsIgnoreCase(et.getState()))
throw new BadRequestAlertException("构建正在执行中,不能重复执行","DABuild",et.getBuildId());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册