|
@@ -638,12 +638,15 @@ public class RequestForLeaveInfoServiceImpl implements RequestForLeaveInfoServic
|
|
|
|
|
|
Date start = requestForLeaveInfo.getStartTime();
|
|
|
Date end = requestForLeaveInfo.getEndTime();
|
|
|
+ Date now = new Date();
|
|
|
+
|
|
|
|
|
|
- if (start.compareTo(new Date()) <=0){
|
|
|
- if (end.compareTo(new Date()) >0){
|
|
|
+ if (start.compareTo(now) <=0){
|
|
|
+ //start<=now<=end
|
|
|
+ if (end.compareTo(now) >0){
|
|
|
personInfo.setWorkStatus("4");
|
|
|
personInfoService.update(personInfo);
|
|
|
- Long millisecond = DateUtil.betweenMs(DateUtil.date(),end);
|
|
|
+ Long millisecond = DateUtil.betweenMs(DateUtil.date(),end) + 60000;
|
|
|
|
|
|
rabbitTemplate.convertAndSend("requestForLeaveDelayExchange", "submit",
|
|
|
requestForLeaveInfo.getId(), (message)->{
|
|
@@ -652,21 +655,25 @@ public class RequestForLeaveInfoServiceImpl implements RequestForLeaveInfoServic
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (end.compareTo(new Date()) <=0){
|
|
|
+ //now>=end
|
|
|
+ if (end.compareTo(now) <=0){
|
|
|
personInfo.setWorkStatus("1");
|
|
|
personInfoService.update(personInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (start.compareTo(new Date()) >0){
|
|
|
+ //start>now
|
|
|
+ if (start.compareTo(now) >0){
|
|
|
Long millisecond = DateUtil.betweenMs(DateUtil.date(),start);
|
|
|
|
|
|
+ //请假开始后设置状态为请假
|
|
|
rabbitTemplate.convertAndSend("requestForLeaveDelayExchange", "submit",
|
|
|
requestForLeaveInfo.getId(), (message)->{
|
|
|
message.getMessageProperties().setHeader("x-delay",millisecond);
|
|
|
return message;
|
|
|
});
|
|
|
|
|
|
+ //请假结束后设置状态为工作
|
|
|
Long millisecond2 = DateUtil.betweenMs(DateUtil.date(),end)+60000;
|
|
|
rabbitTemplate.convertAndSend("requestForLeaveDelayExchange", "submit",
|
|
|
requestForLeaveInfo.getId(), (message)->{
|
|
@@ -675,9 +682,9 @@ public class RequestForLeaveInfoServiceImpl implements RequestForLeaveInfoServic
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- Date now = new Date();
|
|
|
-
|
|
|
- if (requestForLeaveInfo.getStartTime().before(now)) {
|
|
|
+ //start<now
|
|
|
+ if (start.before(now)) {
|
|
|
+ //补请假则更新考勤记录
|
|
|
UpdatePersonAttendanceDTO updatePersonAttendanceDTO = new UpdatePersonAttendanceDTO(
|
|
|
personInfo.getId(), requestForLeaveInfo.getStartTime(),requestForLeaveInfo.getEndTime());
|
|
|
|