Commit 1191b4cb authored by cq990612's avatar cq990612

优化代码结构

parent 66526362
......@@ -203,7 +203,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
List<WorkTimeOrderDto> workTimeOrders = createWorkOrderDto.getWorkTimeOrders();
Date date = new Date();
WorkSubmitAdopt workSubmitAdopt = workSubmitAdoptService.getById(1);
Integer submitTime = workSubmitAdopt.getSubmitTime();
Integer autoExamine = workSubmitAdopt.getAutoExamine();
// 1.判断是否重复填报
isRepeat(workTimeOrders);
......@@ -259,14 +259,14 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
for (WorkTimeOrder dto : addList) {
// 4、默认设置超过系统默认3天(包括驳回3天)未填报的工时将不能填报
if (!REJECTED.equals(dto.getStatus()) && !RE_SUBMIT.equals(dto.getStatus())) {
if (date.getTime() - dto.getWorkDay().getTime() > submitTime * 24 * 60 * 60 * 1000) {
if (date.getTime() - dto.getWorkDay().getTime() > autoExamine * 24 * 60 * 60 * 1000) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.WORK_DAY_THAN_DATE);
}
}
if (REJECTED.equals(dto.getStatus()) || RE_SUBMIT.equals(dto.getStatus())) {
Date modifyTime = DateUtil.convertStrToDate(DateUtil.convertDateToStr(workTimeOrderMapper.selectById(dto.getWorkId()).getModifyTime(), "yyyy-MM-dd"), "yyyy-MM-dd");
System.out.println(modifyTime);
if (date.getTime() - modifyTime.getTime() > submitTime * 24 * 60 * 60 * 1000) {
if (date.getTime() - modifyTime.getTime() > autoExamine * 24 * 60 * 60 * 1000) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.WORK_DAY_THAN_DATE);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment