fix 修复 流程重新提交报错问题

This commit is contained in:
疯狂的狮子Li 2025-08-19 17:59:29 +08:00
parent d98d11ae2d
commit 9742b1b596

View File

@ -107,10 +107,10 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
long day = DateUtil.betweenDay(bo.getStartDate(), bo.getEndDate(), true);
// 截止日期也算一天
bo.setLeaveDays((int) day + 1);
bo.setApplyCode(System.currentTimeMillis() + StrUtil.EMPTY);
TestLeave add = MapstructUtils.convert(bo, TestLeave.class);
if (StringUtils.isBlank(add.getStatus())) {
add.setStatus(BusinessStatusEnum.DRAFT.getStatus());
add.setApplyCode(System.currentTimeMillis() + StrUtil.EMPTY);
}
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
@ -125,6 +125,9 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
long day = DateUtil.betweenDay(bo.getStartDate(), bo.getEndDate(), true);
// 截止日期也算一天
bo.setLeaveDays((int) day + 1);
if (ObjectUtil.isNull(bo.getId())) {
bo.setApplyCode(System.currentTimeMillis() + StrUtil.EMPTY);
}
TestLeave leave = MapstructUtils.convert(bo, TestLeave.class);
boolean flag = baseMapper.insertOrUpdate(leave);
if (flag) {