|
@@ -2629,10 +2629,13 @@ public class UserCorpwxTimeController {
|
|
|
}
|
|
}
|
|
|
monthQuery.orderByAsc("create_date", "name");
|
|
monthQuery.orderByAsc("create_date", "name");
|
|
|
List<UserCorpwxTime> monthList = userCorpwxTimeMapper.selectList(monthQuery);
|
|
List<UserCorpwxTime> monthList = userCorpwxTimeMapper.selectList(monthQuery);
|
|
|
- List<LocalDate> restDayDates = WorkDayCalculateUtils.getNonWorkDaysListInRange(
|
|
|
|
|
|
|
+ List<LocalDate> allRestDayDates = WorkDayCalculateUtils.getNonWorkDaysListInRange(
|
|
|
monthStart.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),
|
|
monthStart.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),
|
|
|
monthEnd.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
|
|
monthEnd.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
|
|
|
);
|
|
);
|
|
|
|
|
+ List<String> allRestDayList = allRestDayDates.stream().map(d -> d.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).collect(Collectors.toList());
|
|
|
|
|
+ //todo 法定三倍工资工作日 法定节假日
|
|
|
|
|
+ List<LocalDate> restDayDates = TriplePayDayChecker.getTriplePayDaysInRange(monthStart,monthEnd);
|
|
|
List<String> restDayList = restDayDates.stream().map(d -> d.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).collect(Collectors.toList());
|
|
List<String> restDayList = restDayDates.stream().map(d -> d.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).collect(Collectors.toList());
|
|
|
|
|
|
|
|
Map<String, List<UserCorpwxTime>> grouped = monthList.stream()
|
|
Map<String, List<UserCorpwxTime>> grouped = monthList.stream()
|
|
@@ -2655,19 +2658,19 @@ public class UserCorpwxTimeController {
|
|
|
Map<String, UserCorpwxTime> dayMap = userTimes.stream()
|
|
Map<String, UserCorpwxTime> dayMap = userTimes.stream()
|
|
|
.collect(Collectors.toMap(t -> t.getCreateDate().format(df), t -> t, (a, b) -> a));
|
|
.collect(Collectors.toMap(t -> t.getCreateDate().format(df), t -> t, (a, b) -> a));
|
|
|
List<String> attendanceArray = new ArrayList<>();
|
|
List<String> attendanceArray = new ArrayList<>();
|
|
|
- double legalHolidayCount = 0D;
|
|
|
|
|
- double yearLeaveCount = 0D;
|
|
|
|
|
- double marriageLeaveCount = 0D;
|
|
|
|
|
- double paternityLeaveCount = 0D;
|
|
|
|
|
- double maternityLeaveCount = 0D;
|
|
|
|
|
- double bereavementLeaveCount = 0D;
|
|
|
|
|
- double transferLeaveCount = 0D;
|
|
|
|
|
- double sickLeaveCount = 0D;
|
|
|
|
|
- double personalLeaveCount = 0D;
|
|
|
|
|
|
|
+ BigDecimal legalHolidayCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal yearLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal marriageLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal paternityLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal maternityLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal bereavementLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal transferLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal sickLeaveCount = new BigDecimal(0);
|
|
|
|
|
+ BigDecimal personalLeaveCount = new BigDecimal(0);
|
|
|
int lateCount = 0;
|
|
int lateCount = 0;
|
|
|
int missingCardCount = 0;
|
|
int missingCardCount = 0;
|
|
|
Set<String> nonWorkDaySet = new HashSet<>(restDayList);
|
|
Set<String> nonWorkDaySet = new HashSet<>(restDayList);
|
|
|
- legalHolidayCount=nonWorkDaySet.size();
|
|
|
|
|
|
|
+ legalHolidayCount=new BigDecimal(nonWorkDaySet.size());
|
|
|
for (int i = 1; i <= daysInMonth; i++) {
|
|
for (int i = 1; i <= daysInMonth; i++) {
|
|
|
LocalDate date = monthStart.withDayOfMonth(i);
|
|
LocalDate date = monthStart.withDayOfMonth(i);
|
|
|
String dateStr = date.format(df);
|
|
String dateStr = date.format(df);
|
|
@@ -2676,29 +2679,37 @@ public class UserCorpwxTimeController {
|
|
|
if (time != null) {
|
|
if (time != null) {
|
|
|
String leaveType = StringUtils.hasText(time.getAskLeaveType()) ? time.getAskLeaveType().trim() : "";
|
|
String leaveType = StringUtils.hasText(time.getAskLeaveType()) ? time.getAskLeaveType().trim() : "";
|
|
|
if (time.getAskLeaveTime() != null && time.getAskLeaveTime() > 0) {
|
|
if (time.getAskLeaveTime() != null && time.getAskLeaveTime() > 0) {
|
|
|
- if ("年假".equals(leaveType)) {
|
|
|
|
|
- yearLeaveCount +=1;
|
|
|
|
|
- } else if ("婚假".equals(leaveType)) {
|
|
|
|
|
- marriageLeaveCount +=1;
|
|
|
|
|
- } else if ("陪产假".equals(leaveType)) {
|
|
|
|
|
- paternityLeaveCount +=1;
|
|
|
|
|
- } else if ("产假".equals(leaveType)) {
|
|
|
|
|
- maternityLeaveCount +=1;
|
|
|
|
|
- } else if ("丧假".equals(leaveType)) {
|
|
|
|
|
- bereavementLeaveCount +=1;
|
|
|
|
|
- } else if ("T".equals(leaveType)) {
|
|
|
|
|
- transferLeaveCount +=1;
|
|
|
|
|
- } else if ("B".equals(leaveType)) {
|
|
|
|
|
- sickLeaveCount +=1;
|
|
|
|
|
- } else if ("事假".equals(leaveType)) {
|
|
|
|
|
- personalLeaveCount +=1;
|
|
|
|
|
|
|
+ //如果不是工作日 排除掉计算
|
|
|
|
|
+ if(WorkDayCalculateUtils.isWorkDay(date)){
|
|
|
|
|
+ Double askLeaveTime = time.getAskLeaveTime();
|
|
|
|
|
+ BigDecimal decimal = new BigDecimal(askLeaveTime);
|
|
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(8);
|
|
|
|
|
+ BigDecimal divide = decimal.divide(bigDecimal, 3,RoundingMode.HALF_UP);
|
|
|
|
|
+ if ("年假".equals(leaveType)) {
|
|
|
|
|
+ yearLeaveCount=yearLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("婚假".equals(leaveType)) {
|
|
|
|
|
+ marriageLeaveCount=marriageLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("陪产假".equals(leaveType)) {
|
|
|
|
|
+ paternityLeaveCount=paternityLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("产假".equals(leaveType)) {
|
|
|
|
|
+ maternityLeaveCount=maternityLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("丧假".equals(leaveType)) {
|
|
|
|
|
+ bereavementLeaveCount=bereavementLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("T".equals(leaveType)) {
|
|
|
|
|
+ transferLeaveCount=transferLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("B".equals(leaveType)) {
|
|
|
|
|
+ sickLeaveCount=sickLeaveCount.add(divide);
|
|
|
|
|
+ } else if ("事假".equals(leaveType)) {
|
|
|
|
|
+ personalLeaveCount=personalLeaveCount.add(divide);
|
|
|
|
|
+ }
|
|
|
|
|
+ value = leaveType+askLeaveTime;
|
|
|
}
|
|
}
|
|
|
- value = leaveType+time.getAskLeaveTime();
|
|
|
|
|
} else if (time.getWorkHours() != null && time.getWorkHours() > 0) {
|
|
} else if (time.getWorkHours() != null && time.getWorkHours() > 0) {
|
|
|
value ="√";
|
|
value ="√";
|
|
|
- } else if (time.getCardTime() != null && time.getCardTime() > 0) {
|
|
|
|
|
- value = String.valueOf(time.getCardTime());
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+// else if (time.getCardTime() != null && time.getCardTime() > 0) {
|
|
|
|
|
+// value = String.valueOf(time.getCardTime());
|
|
|
|
|
+// }
|
|
|
if (time.getOtStatus() != null && time.getOtStatus() == 2) {
|
|
if (time.getOtStatus() != null && time.getOtStatus() == 2) {
|
|
|
missingCardCount += 1;
|
|
missingCardCount += 1;
|
|
|
}
|
|
}
|
|
@@ -2708,19 +2719,29 @@ public class UserCorpwxTimeController {
|
|
|
}
|
|
}
|
|
|
attendanceArray.add(value);
|
|
attendanceArray.add(value);
|
|
|
}
|
|
}
|
|
|
|
|
+ legalHolidayCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ yearLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ marriageLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ paternityLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ maternityLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ bereavementLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ transferLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ sickLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+ personalLeaveCount.setScale(3,RoundingMode.HALF_UP);
|
|
|
|
|
+
|
|
|
row.put("attendanceArray", attendanceArray);
|
|
row.put("attendanceArray", attendanceArray);
|
|
|
- row.put("legalHolidayCount", legalHolidayCount);
|
|
|
|
|
- row.put("yearLeaveCount", yearLeaveCount);
|
|
|
|
|
- row.put("marriageLeaveCount", marriageLeaveCount);
|
|
|
|
|
- row.put("paternityLeaveCount", paternityLeaveCount);
|
|
|
|
|
- row.put("maternityLeaveCount", maternityLeaveCount);
|
|
|
|
|
- row.put("bereavementLeaveCount", bereavementLeaveCount);
|
|
|
|
|
- row.put("transferLeaveCount", transferLeaveCount);
|
|
|
|
|
- row.put("sickLeaveCount", sickLeaveCount);
|
|
|
|
|
- row.put("personalLeaveCount", personalLeaveCount);
|
|
|
|
|
|
|
+ row.put("legalHolidayCount", legalHolidayCount.doubleValue());
|
|
|
|
|
+ row.put("yearLeaveCount", yearLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("marriageLeaveCount", marriageLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("paternityLeaveCount", paternityLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("maternityLeaveCount", maternityLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("bereavementLeaveCount", bereavementLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("transferLeaveCount", transferLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("sickLeaveCount", sickLeaveCount.doubleValue());
|
|
|
|
|
+ row.put("personalLeaveCount", personalLeaveCount.doubleValue());
|
|
|
row.put("lateCount", lateCount);
|
|
row.put("lateCount", lateCount);
|
|
|
row.put("missingCardCount", missingCardCount);
|
|
row.put("missingCardCount", missingCardCount);
|
|
|
- row.put("shouldAttendCount", daysInMonth - restDayList.size());
|
|
|
|
|
|
|
+ row.put("shouldAttendCount", daysInMonth - allRestDayDates.size());
|
|
|
row.put("actualAttendanceCount", attendanceArray.stream().filter(s -> s != null && !s.isEmpty() && "√".equals(s)).count());
|
|
row.put("actualAttendanceCount", attendanceArray.stream().filter(s -> s != null && !s.isEmpty() && "√".equals(s)).count());
|
|
|
row.put("daysCount", daysInMonth);
|
|
row.put("daysCount", daysInMonth);
|
|
|
attendanceList.add(row);
|
|
attendanceList.add(row);
|
|
@@ -2745,7 +2766,7 @@ public class UserCorpwxTimeController {
|
|
|
}
|
|
}
|
|
|
result.put("dateList", dateList);
|
|
result.put("dateList", dateList);
|
|
|
result.put("weekList", weekList);
|
|
result.put("weekList", weekList);
|
|
|
- result.put("restDayList", restDayList);
|
|
|
|
|
|
|
+ result.put("restDayList", allRestDayList);
|
|
|
result.put("list", attendanceList);
|
|
result.put("list", attendanceList);
|
|
|
result.put("records", attendanceList);
|
|
result.put("records", attendanceList);
|
|
|
result.put("total", userPage.getTotal());
|
|
result.put("total", userPage.getTotal());
|