|
|
|
@ -60,6 +60,8 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
|
|
|
|
|
|
|
|
|
|
//调整加班计时间段的打卡
|
|
|
|
|
scheduleResult = adjustWorkOverTimeClock(scheduleResult,analysisDate);
|
|
|
|
|
//调整请假出差时间段的打卡
|
|
|
|
|
askForLeaveAndEvctionScheduleList = adjustAskforSchedule(scheduleResult,analysisDate,askForLeaveAndEvctionScheduleList);
|
|
|
|
|
log.debug("经过adjustWorkOverTimeClock 加班调整过后的 的scheduleResult: [{}]",scheduleResult);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -629,6 +631,43 @@ public class GetClockInPointCmd extends AbstractCommonCommand<Map<String, Object
|
|
|
|
|
|
|
|
|
|
return newList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 请假出差碰到休息时段时调整打卡
|
|
|
|
|
* @param scheduleResult
|
|
|
|
|
* @param analysisDate
|
|
|
|
|
* @param askForLeaveAndEvctionScheduleList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Map<String, Object>> adjustAskforSchedule(List<Map<String, Object>> scheduleResult,String analysisDate,List<Map<String, Object>> askForLeaveAndEvctionScheduleList){
|
|
|
|
|
List<Map<String, Object>> restscheduleList = scheduleResult.stream().filter(e->Utils.ifRestClassSegment(e.get("bdlx").toString())).collect(Collectors.toList());
|
|
|
|
|
List<Map<String, Object>> newList = Lists.newArrayList();
|
|
|
|
|
if (askForLeaveAndEvctionScheduleList.size()>1){
|
|
|
|
|
askForLeaveAndEvctionScheduleList = askForLeaveAndEvctionScheduleList.stream().sorted(Comparator.comparing(e->DateUtil.getTime(Utils.getkssjTime(e,analysisDate)).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < askForLeaveAndEvctionScheduleList.size() - 1; i++) {
|
|
|
|
|
String beforeDtkssj = Utils.getkssjTime(askForLeaveAndEvctionScheduleList.get(i),analysisDate);
|
|
|
|
|
String beforeDtjssj = Utils.getjssjTime(askForLeaveAndEvctionScheduleList.get(i),analysisDate);
|
|
|
|
|
|
|
|
|
|
String afterDtkssj = Utils.getkssjTime(askForLeaveAndEvctionScheduleList.get(i+1),analysisDate);
|
|
|
|
|
String afterDtjssj= Utils.getkssjTime(askForLeaveAndEvctionScheduleList.get(i+1),analysisDate);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> occupyRestSchedule = restscheduleList.stream().filter(e->DateUtil.getTime(Utils.getkssjTime(e,analysisDate)).compareTo(DateUtil.getTime(beforeDtjssj))<=0 &&
|
|
|
|
|
DateUtil.getTime(Utils.getjssjTime(e,analysisDate)).compareTo(DateUtil.getTime(beforeDtjssj)) >= 0).collect(Collectors.toList());
|
|
|
|
|
if (occupyRestSchedule.size() > 0 && DateUtil.getTime(Utils.getjssjTime(occupyRestSchedule.get(0),analysisDate)).compareTo(DateUtil.getTime(afterDtkssj)) >=0){
|
|
|
|
|
askForLeaveAndEvctionScheduleList.get(i).put("jsdk",CheckBoxEnum.UNCHECKED.getKey());
|
|
|
|
|
askForLeaveAndEvctionScheduleList.get(i+1).put("ksdk",CheckBoxEnum.UNCHECKED.getKey());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
newList=askForLeaveAndEvctionScheduleList;
|
|
|
|
|
}else {
|
|
|
|
|
newList = askForLeaveAndEvctionScheduleList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 早晚上下班弹性
|
|
|
|
|
*/
|
|
|
|
|