From 989615dc2901a36046099e644d833cd723cc742e Mon Sep 17 00:00:00 2001
From: yaozc <unbelievers@yeah.net>
Date: Wed, 15 Mar 2023 03:28:18 +0000
Subject: [PATCH] BUG改修

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java
index 9bc9549..13b9b08 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceMonthServiceImpl.java
@@ -231,6 +231,20 @@
             }
             String isAdmit = attendanceMonth.getIsAdmit() != null ? dictDetailRepository.findByDictNameAndValue(Constant.APPROVE_STATUS_ACKNOWLEDGED, attendanceMonth.getIsAdmit()).getLabel() : "";
             String isP = attendanceMonth.getIsPublicity() != null ? dictDetailRepository.findByDictNameAndValue(Constant.PUBLICITY_STATUS_YES, attendanceMonth.getIsPublicity()).getLabel() : "";
+
+            Double annualLeave = 0.0D;
+            Double compassionateLeave = 0.0D;
+            List<AttendanceMonthLeave> attendanceMonthLeaves = attendanceMonthLeaveRepository.findByAttendanceMonthId(attendanceMonth.getId());
+            if(attendanceMonthLeaves.size() != 0){
+                for(AttendanceMonthLeave attendanceMonthLeave : attendanceMonthLeaves){
+                	if(attendanceMonthLeave.getLeaveType().equals(Constant.LEAVE_TYPE_COMPASSIONATE_LEAVE) || attendanceMonthLeave.getLeaveType().equals(Constant.LEAVE_TYPE_SICK_LEAVE)){
+                		compassionateLeave += attendanceMonthLeave.getLeaveTime();
+                    } else {
+                    	annualLeave += attendanceMonthLeave.getLeaveTime();
+                    }
+                }
+            }
+
             Map<String,Object> map = new LinkedHashMap<>();
             map.put("统计年月", attendanceMonth.getAttendanceDate());
             map.put("用户", user.getNickName());
@@ -249,6 +263,8 @@
             map.put("外出时长", attendanceMonth.getGoOutTime());
             map.put("出差次数", attendanceMonth.getBussNumber());
             map.put("出差时长", attendanceMonth.getBussTime());
+            map.put("年假", annualLeave);
+            map.put("事假", compassionateLeave);
             map.put("上班缺卡次数", attendanceMonth.getOnCardNumber());
             map.put("下班缺卡次数", attendanceMonth.getOffCardNumber());
             map.put("公示状态", attendanceMonth.getIsPublicity());

--
Gitblit v1.9.3