This commit is contained in:
parent
bff00b7b4a
commit
da0ba9aa0a
@ -253,20 +253,7 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断排班日期是单个日期还是从此日期开始循环有效还是从此日期开始有效
|
judgeDate(bo, add);
|
||||||
//1.单个日期
|
|
||||||
if (bo.getDateType().equals(StatusConstant.SINGLE)) {
|
|
||||||
add.setEndDate(null);
|
|
||||||
}
|
|
||||||
//2.从此日期开始长期有效
|
|
||||||
if (bo.getDateType().equals(StatusConstant.LONGTIME)) {
|
|
||||||
//设置长期时间为2099年12月31日
|
|
||||||
LocalDate longTimeEndDate = LocalDate.of(2099, 12, 31);
|
|
||||||
add.setEndDate(Date.from(longTimeEndDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
|
||||||
}
|
|
||||||
if (bo.getDateType().equals(StatusConstant.SHORTTIME)){
|
|
||||||
add.setEndDate(bo.getEndDate());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//取出当前新增的排班的id
|
//取出当前新增的排班的id
|
||||||
@ -282,6 +269,23 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void judgeDate(AttendanceArrangementBo bo, AttendanceArrangement add) {
|
||||||
|
//判断排班日期是单个日期还是从此日期开始循环有效还是从此日期开始有效
|
||||||
|
//1.单个日期
|
||||||
|
if (bo.getDateType().equals(StatusConstant.SINGLE)) {
|
||||||
|
add.setEndDate(null);
|
||||||
|
}
|
||||||
|
//2.从此日期开始长期有效
|
||||||
|
if (bo.getDateType().equals(StatusConstant.LONGTIME)) {
|
||||||
|
//设置长期时间为2099年12月31日
|
||||||
|
LocalDate longTimeEndDate = LocalDate.of(2099, 12, 31);
|
||||||
|
add.setEndDate(Date.from(longTimeEndDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||||
|
}
|
||||||
|
if (bo.getDateType().equals(StatusConstant.SHORTTIME)){
|
||||||
|
add.setEndDate(bo.getEndDate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改排班
|
* 修改排班
|
||||||
*
|
*
|
||||||
@ -293,6 +297,8 @@ public class AttendanceArrangementServiceImpl implements IAttendanceArrangementS
|
|||||||
AttendanceArrangement update = MapstructUtils.convert(bo, AttendanceArrangement.class);
|
AttendanceArrangement update = MapstructUtils.convert(bo, AttendanceArrangement.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
|
|
||||||
|
judgeDate(bo, update);
|
||||||
|
|
||||||
//取出当前排班的id
|
//取出当前排班的id
|
||||||
Long ArrangementId = update.getId();
|
Long ArrangementId = update.getId();
|
||||||
//用获取到的排班id向attendanceUserGroup表中更新数据
|
//用获取到的排班id向attendanceUserGroup表中更新数据
|
||||||
|
Loading…
Reference in New Issue
Block a user