|
@@ -112,6 +112,9 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
Optional<ApplyForm> first = applyFormList.stream().filter(a -> !a.getStartTime().toLocalDate().isAfter(date)
|
|
|
&& !a.getEndTime().toLocalDate().isBefore(date)&&a.getApplyId().equals(jobNumber)).findFirst();
|
|
|
|
|
|
+ List<ApplyForm> applyForms = applyFormList.stream().filter(a -> !a.getStartTime().toLocalDate().isAfter(date.plusDays(2))
|
|
|
+ && !a.getStartTime().toLocalDate().isBefore(date.plusDays(-1))&&a.getApplyId().equals(jobNumber)&&a.getType()==6).collect(Collectors.toList());
|
|
|
+
|
|
|
if (first.isPresent()&&first.get().getType()!=6) {
|
|
|
ApplyForm applyForm = first.get();
|
|
|
//请假
|
|
@@ -242,20 +245,16 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- else if (first.isPresent()&&first.get().getType()==6) {
|
|
|
- List<ApplyForm> collect = applyFormList.stream().filter(a -> !a.getStartTime().toLocalDate().isAfter(date)
|
|
|
- && !a.getEndTime().toLocalDate().isBefore(date) && a.getApplyId().equals(jobNumber))
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (!collect.isEmpty()) {
|
|
|
- for (ApplyForm applyForm : collect) {
|
|
|
- Attendance a1 = new Attendance();
|
|
|
- a1.setClockTime(applyForm.getStartTime());
|
|
|
- attendances.add(a1);
|
|
|
- }
|
|
|
- attendances = attendances.stream()
|
|
|
- .sorted(Comparator.comparing(Attendance::getClockTime))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ //考勤证明
|
|
|
+ if (!applyForms.isEmpty()) {
|
|
|
+ for (ApplyForm applyForm : applyForms) {
|
|
|
+ Attendance a1 = new Attendance();
|
|
|
+ a1.setClockTime(applyForm.getStartTime());
|
|
|
+ attendances.add(a1);
|
|
|
}
|
|
|
+ attendances = attendances.stream()
|
|
|
+ .sorted(Comparator.comparing(Attendance::getClockTime))
|
|
|
+ .collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
AttendanceRule baiBanRule = ruleList.get(0);
|
|
@@ -671,6 +670,7 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
LocalDate clockDate = staff.getClockDate();
|
|
|
String format = clockDate.format(formatter1);
|
|
|
List<ApplyForm> applyFormList= applyFormService.getListByDate(format,userId==null|| StringUtils.isEmpty(userId)?request.getHeader("Token"):userId);
|
|
|
+ List<ApplyForm> applyFormTypeList= applyFormService.getListByTypeDate(format,userId==null|| StringUtils.isEmpty(userId)?request.getHeader("Token"):userId);
|
|
|
|
|
|
LocalDateTime clockStartTime = staff.getClockStartTime();
|
|
|
LocalDateTime clockEndTime = staff.getClockEndTime();
|
|
@@ -1166,8 +1166,9 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
staff.setAttendanceTypeName("异常小夜班2");
|
|
|
}
|
|
|
if (!maplist.isEmpty()) {
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
if (!applyFormList.isEmpty()){
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
for (ApplyForm applyForm : applyFormList) {
|
|
|
if (applyForm.getType()==3) {
|
|
|
stringBuilder
|
|
@@ -1176,7 +1177,7 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
.append(applyForm.getApplyBillName())
|
|
|
.append(" 时长")
|
|
|
.append(applyForm.getSumTime()).append("小时");
|
|
|
- }else {
|
|
|
+ }else if (applyForm.getType()!=6){
|
|
|
stringBuilder
|
|
|
.append(applyForm.getStartTime().format(formatter2))
|
|
|
.append("-").append(applyForm.getEndTime().format(formatter2))
|
|
@@ -1185,18 +1186,30 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
.append(applyForm.getSumTime()).append("小时");
|
|
|
}
|
|
|
}
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
+ }
|
|
|
+ if (!applyFormTypeList.isEmpty()){
|
|
|
+ for (ApplyForm applyForm : applyFormTypeList) {
|
|
|
+ if (applyForm.getStartTime().toLocalDate().isEqual(clockDate)&&applyForm.getStartTime().toLocalTime().isAfter(LocalTime.of(4,0))) {
|
|
|
+ stringBuilder
|
|
|
+ .append(applyForm.getStartTime().format(formatter2))
|
|
|
+ .append(applyForm.getTypeName());
|
|
|
+ } else if (applyForm.getStartTime().toLocalDate().isAfter(clockDate)&&applyForm.getStartTime().toLocalTime().isBefore(LocalTime.of(4,0))) {
|
|
|
+ stringBuilder
|
|
|
+ .append(applyForm.getStartTime().format(formatter2))
|
|
|
+ .append(applyForm.getTypeName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stringBuilder.length()>0) {
|
|
|
map.put("res", stringBuilder.toString());
|
|
|
map.put("color","#F56C6C");
|
|
|
- /*for (HashMap<String, Object> hashMap : maplist) {
|
|
|
- hashMap.put("res","正常");
|
|
|
- }*/
|
|
|
maplist.add(1,map);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
else {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
if (!applyFormList.isEmpty()){
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
for (ApplyForm applyForm : applyFormList) {
|
|
|
if (applyForm.getType()==3) {
|
|
|
stringBuilder
|
|
@@ -1205,7 +1218,7 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
.append(applyForm.getApplyBillName())
|
|
|
.append(" 时长")
|
|
|
.append(applyForm.getSumTime()).append("小时");
|
|
|
- }else {
|
|
|
+ }else if (applyForm.getType()!=6){
|
|
|
stringBuilder
|
|
|
.append(applyForm.getStartTime().format(formatter2))
|
|
|
.append("-").append(applyForm.getEndTime().format(formatter2))
|
|
@@ -1214,7 +1227,22 @@ public class AttendanceStaffServiceImpl extends ServiceImpl<AttendanceStaffMappe
|
|
|
.append(applyForm.getSumTime()).append("小时");
|
|
|
}
|
|
|
}
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
+ }
|
|
|
+ if (!applyFormTypeList.isEmpty()){
|
|
|
+ for (ApplyForm applyForm : applyFormTypeList) {
|
|
|
+ if (applyForm.getStartTime().toLocalDate().isEqual(clockDate)&&applyForm.getStartTime().toLocalTime().isAfter(LocalTime.of(4,0))) {
|
|
|
+ stringBuilder
|
|
|
+ .append(applyForm.getStartTime().format(formatter2))
|
|
|
+ .append(applyForm.getTypeName());
|
|
|
+ } else if (applyForm.getStartTime().toLocalDate().isAfter(clockDate)&&applyForm.getStartTime().toLocalTime().isBefore(LocalTime.of(4,0))) {
|
|
|
+ stringBuilder
|
|
|
+ .append(applyForm.getStartTime().format(formatter2))
|
|
|
+ .append(applyForm.getTypeName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ if(stringBuilder.length()>0) {
|
|
|
map.put("res", stringBuilder.toString());
|
|
|
map.put("color","#F56C6C");
|
|
|
maplist.add(map);
|