Commit ebef7e6a authored by cq990612's avatar cq990612

优化代码结构

parent 74a6c5ab
......@@ -203,7 +203,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
List<WorkTimeOrderDto> workTimeOrders = createWorkOrderDto.getWorkTimeOrders();
Date date = new Date();
WorkSubmitAdopt workSubmitAdopt = workSubmitAdoptService.getById(1);
Integer autoExamine = workSubmitAdopt.getAutoExamine();
Integer submitTime = workSubmitAdopt.getSubmitTime();
// 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() > autoExamine * 24 * 60 * 60 * 1000) {
if (date.getTime() - dto.getWorkDay().getTime() > submitTime * 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() > autoExamine * 24 * 60 * 60 * 1000) {
if (date.getTime() - modifyTime.getTime() > submitTime * 24 * 60 * 60 * 1000) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.WORK_DAY_THAN_DATE);
}
}
......@@ -358,6 +358,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if (null == projectId && null == type) {
return null;
}
if (0 != user.getLevel()) {
QueryWrapper<WorkTimeOrder> wrapper = new QueryWrapper<>();
wrapper.in("status", COMPLETED, RE_SUBMIT);
......
......@@ -77,7 +77,7 @@ public class Trigger implements SchedulingConfigurer {
, triggerContext -> {
Integer autoAdopt = workSubmitAdoptService.getById(1).getAutoAdopt();
String time = "0 0 0 */" + autoAdopt + " * ?";
String time = "0 30 17 */" + autoAdopt + " * ?";
//返回执行的周期
return new CronTrigger(time).nextExecutionTime(triggerContext);
});
......
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