From 51ec98113c6d49d0f7eec4e3c030e55e337e97db Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 26 五月 2025 15:47:16 +0800
Subject: [PATCH] 芯导软件(江苏)有限公司  delete

---
 performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java |  247 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 182 insertions(+), 65 deletions(-)

diff --git a/performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java b/performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java
index e6fa72e..8d6978e 100644
--- a/performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java
+++ b/performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java
@@ -3,22 +3,26 @@
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.common.GetLook;
 import com.yuanchu.mom.dto.PerformanceShiftAddDto;
 import com.yuanchu.mom.dto.PerformanceShiftMapDto;
 import com.yuanchu.mom.mapper.PerformanceShiftMapper;
+import com.yuanchu.mom.mapper.UserMapper;
 import com.yuanchu.mom.pojo.Enums;
 import com.yuanchu.mom.pojo.PerformanceShift;
+import com.yuanchu.mom.pojo.User;
 import com.yuanchu.mom.service.EnumService;
 import com.yuanchu.mom.service.PerformanceShiftService;
 import com.yuanchu.mom.utils.JackSonUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -41,40 +45,59 @@
     @Autowired
     private EnumService enumService;
 
-    public List<PerformanceShift> list = new ArrayList<>();
+    @Autowired
+    GetLook getLook;
+
+    @Autowired
+    UserMapper userMapper;
 
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto) {
+        List<PerformanceShift> list = new ArrayList<>();
+        LocalDateTime startWeek = performanceShiftAddDto.getStartWeek();
+        LocalDateTime endWeek = performanceShiftAddDto.getEndWeek();
+
+
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         String formattedDateTime = performanceShiftAddDto.getStartWeek().format(formatter);
         String[] splitUserId = performanceShiftAddDto.getUserId().split(",");
         for (String userId : splitUserId) {
-            boolean exists = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery()
-                    .eq(PerformanceShift::getWorkTime, formattedDateTime)
-                    .eq(PerformanceShift::getUserId, userId));
-            // 濡傛灉涓嶅瓨鍦ㄦ坊鍔犳暟鎹�
-            if (!exists) {
-                LocalDate firstDayOfMonth = performanceShiftAddDto.getEndWeek().toLocalDate().withDayOfMonth(1);
-                LocalDate lastDayOfMonth = performanceShiftAddDto.getEndWeek().toLocalDate().with(TemporalAdjusters.lastDayOfMonth());
-                List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay());
-                localDateTimesBetween.forEach(i -> {
-                    for (String s : splitUserId) {
-                        PerformanceShift performanceShift = new PerformanceShift();
-                        performanceShift.setUserId(Integer.valueOf(s));
-                        performanceShift.setWorkTime(i);
-                        performanceShift.setShift("");
-                        list.add(performanceShift);
-                    }
-                    if (list.size() >= 1000) {
-                        baseMapper.insertBatchSomeColumn(list);
-                        list.clear();
-                    }
-                });
-                if (!list.isEmpty()) {
-                    baseMapper.insertBatchSomeColumn(list);
+            //鍒ゆ柇鏄惁璺ㄦ湀
+            boolean isMonth = startWeek.getMonthValue() != endWeek.getMonthValue();
+            if (isMonth){
+                //濡傛灉璺ㄦ湀,鍒欎袱涓湀閮藉垽鏂竴涓嬬湅鏁版嵁搴撴槸鍝釜鏈堜唤鐨勬暟鎹病鏈�
+                boolean exists1 = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery()
+                        .eq(PerformanceShift::getWorkTime, startWeek)
+                        .eq(PerformanceShift::getUserId, userId));
+                boolean exists2 = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery()
+                        .eq(PerformanceShift::getWorkTime, endWeek)
+                        .eq(PerformanceShift::getUserId, userId));
+                if (!exists1 && !exists2){
+                    //涓や釜鏈堥兘涓嶅瓨鍦ㄦ暟鎹�
+                    list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list);
+                    list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list);
+                }else if (!exists1 && exists2){
+                    //寮�濮嬬殑鏈堜唤涓嶅瓨鍦ㄦ暟鎹�
+                    list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list);
+                }else if (exists1 && !exists2){
+                    //缁撴潫鐨勬湀浠戒笉瀛樺湪鏁版嵁
+                    list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list);
+                }
+            }else {
+                //涓嶈法鏈�
+                boolean exists = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery()
+                        .in(PerformanceShift::getWorkTime, formattedDateTime)
+                        .eq(PerformanceShift::getUserId, userId));
+                // 濡傛灉涓嶅瓨鍦ㄦ坊鍔犳暟鎹�
+                if (!exists) {
+                    list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list);
                 }
             }
+        }
+        if (!list.isEmpty()) {
+            baseMapper.insertBatchSomeColumn(list);
+            list.clear();
         }
         // 鍐嶆鏇存柊
         List<LocalDateTime> datesBetween = getLocalDateTimesBetween(performanceShiftAddDto.getStartWeek(), performanceShiftAddDto.getEndWeek());
@@ -93,14 +116,46 @@
         }
     }
 
+    private List<PerformanceShift>   saveMonth (LocalDateTime week,String userId,List<PerformanceShift> list){
+        LocalDate firstDayOfMonth = week.toLocalDate().withDayOfMonth(1);
+        LocalDate lastDayOfMonth = week.toLocalDate().with(TemporalAdjusters.lastDayOfMonth());
+        List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay());
+        localDateTimesBetween.forEach(i -> {
+            PerformanceShift performanceShift = new PerformanceShift();
+            performanceShift.setUserId(Integer.valueOf(userId));
+            performanceShift.setWorkTime(i);
+            performanceShift.setShift("");
+            list.add(performanceShift);
+            if (list.size() >= 1000) {
+                baseMapper.insertBatchSomeColumn(list);
+                list.clear();
+            }
+        });
+        return list;
+    }
+
     @Override
     public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) {
+        //鏌ヨ褰撳墠鐧诲綍浜哄憳鐨勬灦鏋�
+        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
+        //鍒ゆ柇鍏ㄩ儴,涓汉,缁勭粐鐨勬潈闄�
+        User user = userMapper.selectById(userId);//褰撳墠鐧诲綍鐨勪汉
+        //鑾峰彇褰撳墠浜烘墍灞炲疄楠屽id
+        String departLimsId = user.getDepartLimsId();
+        if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) {
+            String[] split = departLimsId.split(",");
+            //鏌ヨ瀵瑰簲鏋舵瀯鍚嶇О(閫氫俊瀹為獙瀹�,鐢靛姏瀹為獙瀹�,妫�娴嬪姙)
+            String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1]));
+            if (departLims.contains("瀹為獙瀹�")) {
+                laboratory = departLims;
+            }
+        }
         IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory);
         List<Enums> shiftType = enumService.selectEnumByCategory("鐝绫诲瀷");
         List<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYearPage(time, userName, laboratory);
         mapIPage.getRecords().forEach(i -> {
             String[] shiftTimes = i.getShiftTime().split(";");
-            int totalAttendance = 0;
+            double totalAttendance = 0;
             List<Map<String, Object>> map = new ArrayList<>();
             // 鍒嗗壊鏃ユ湡
             for (String shiftTime : shiftTimes) {
@@ -111,19 +166,29 @@
                         i.getMonthlyAttendance().put(enums.getLabel(), 0);
                     }
                     if (enums.getValue().equals(shiftTimeAndShift[1])) {
-                        Integer num = (Integer) i.getMonthlyAttendance().get(enums.getLabel());
-                        i.getMonthlyAttendance().put(enums.getLabel(), num += 1);
+                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
+                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("1")));
+                    }
+                    // 鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
+                    if (shiftTimeAndShift[1].equals("5") && enums.getValue().equals("0")) {
+                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
+                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("0.5")));
                     }
                 }
-                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0")) {
+                // 鏃╋紝涓紝澶滐紝宸�
+                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) {
                     i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1);
+                }
+                // 鍗�
+                if (shiftTimeAndShift[1].equals("5")) {
+                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
                 }
                 hashMap.put("id", shiftTimeAndShift[2]);
                 hashMap.put("shift", shiftTimeAndShift[1]);
                 hashMap.put("time", shiftTimeAndShift[0]);
                 map.add(hashMap);
             }
-            int totalYearAttendance = 0;
+            double totalYearAttendance = 0;
             Map<String, Object> hashMap = new HashMap<>();
             for (Map<String, Object> record : mapYearIPage) {
                 if (record.get("user_id").toString().equals(i.getUserId())) {
@@ -132,12 +197,21 @@
                             hashMap.put(enums.getLabel(), 0);
                         }
                         if (enums.getValue().equals(record.get("shift"))) {
-                            Integer num = (Integer) hashMap.get(enums.getLabel());
-                            hashMap.put(enums.getLabel(), num += 1);
+                            BigDecimal num = new BigDecimal(hashMap.get(enums.getLabel()).toString());
+                            hashMap.put(enums.getLabel(), num.add(new BigDecimal("1")));
+                        }
+                        // 鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
+                        if (record.get("shift").equals("5") && enums.getValue().equals("0")) {
+                            BigDecimal bigDecimal = new BigDecimal(hashMap.get(enums.getLabel()).toString());
+                            hashMap.put(enums.getLabel(), bigDecimal.add(new BigDecimal("0.5")));
                         }
                     }
-                    if (record.get("shift").equals("1") || record.get("shift").equals("2") || record.get("shift").equals("0")) {
+                    if (record.get("shift").equals("1") || record.get("shift").equals("2") || record.get("shift").equals("0") || record.get("shift").equals("6")) {
                         hashMap.put("totalAttendance", totalYearAttendance += 1);
+                    }
+                    // 鍗�
+                    if (record.get("shift").equals("5")) {
+                        hashMap.put("totalAttendance", totalYearAttendance += 0.5);
                     }
                 }
             }
@@ -176,6 +250,20 @@
 
     @Override
     public IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, String laboratory) {
+        //鏌ヨ褰撳墠鐧诲綍浜哄憳鐨勬灦鏋�
+        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
+        //鍒ゆ柇鍏ㄩ儴,涓汉,缁勭粐鐨勬潈闄�
+        User user = userMapper.selectById(userId);//褰撳墠鐧诲綍鐨勪汉
+        //鑾峰彇褰撳墠浜烘墍灞炲疄楠屽id
+        String departLimsId = user.getDepartLimsId();
+        if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) {
+            String[] split = departLimsId.split(",");
+            //鏌ヨ瀵瑰簲鏋舵瀯鍚嶇О(閫氫俊瀹為獙瀹�,鐢靛姏瀹為獙瀹�,妫�娴嬪姙)
+            String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1]));
+            if (departLims.contains("瀹為獙瀹�")) {
+                laboratory = departLims;
+            }
+        }
         IPage<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYear(page, time, userName, laboratory);
         List<Enums> shiftType = enumService.selectEnumByCategory("鐝绫诲瀷");
         mapYearIPage.setRecords(annualAttendanceProcessing(mapYearIPage.getRecords(), shiftType));
@@ -183,34 +271,44 @@
     }
 
     // 骞村垎椤典笌瀵煎嚭鍏卞悓浣跨敤
-    public List<Map<String, Object>> annualAttendanceProcessing(List<Map<String, Object>> mapYearList, List<Enums> shiftType){
+    public List<Map<String, Object>> annualAttendanceProcessing(List<Map<String, Object>> mapYearList, List<Enums> shiftType) {
         for (Map<String, Object> map : mapYearList) {
             Map<String, Object> resultMap = new LinkedHashMap<>();
             Map<String, Object> hashMapYear = new LinkedHashMap<>();
-            int totalYearAttendance = 0;
+            double totalYearAttendance = 0;
             // 涓�骞�12涓湀
             for (int i = 1; i < 13; i++) {
                 Map<String, Object> hashMapMonth = new LinkedHashMap<>();
-                int totalMonthAttendance = 0;
-                for (Enums enums : shiftType) {
-                    if (!hashMapYear.containsKey(enums.getLabel())) {
-                        hashMapYear.put(enums.getLabel(), 0);
+                double totalMonthAttendance = 0;
+                for (Enums shift : shiftType) {
+                    // 鍒濆鍖栬祴鍊�
+                    if (!hashMapYear.containsKey(shift.getLabel())) {
+                        hashMapYear.put(shift.getLabel(), 0);
                     }
                     // 鏈�
-                    if (ObjectUtils.isNotEmpty(map.get("month_str")) && map.get("work_time").equals(i)) {
+                    if (!ObjectUtils.isEmpty(map.get("month_str"))) {
                         String charArray = map.get("month_str").toString();
-                        int count = countOccurrences(charArray, i + "锛�" + enums.getValue());
-                        hashMapMonth.put(enums.getLabel(), count);
-                        hashMapYear.put(enums.getLabel(), Integer.parseInt(hashMapYear.get(enums.getLabel()).toString()) + count );
-                        if (enums.getValue().equals("0") || enums.getValue().equals("1") || enums.getValue().equals("2")) {
+                        int count = countOccurrences(charArray, i + "锛�" + shift.getValue());
+                        hashMapMonth.put(shift.getLabel(), count);
+                        hashMapYear.put(shift.getLabel(), new BigDecimal(hashMapYear.get(shift.getLabel()).toString()).add(new BigDecimal(count)));
+                        // 鏃╋紝涓紝澶滐紝宸�
+                        if (shift.getValue().equals("0") || shift.getValue().equals("1") || shift.getValue().equals("2") || shift.getValue().equals("6")) {
                             totalMonthAttendance += count;
                             totalYearAttendance += count;
+                        }
+//                      鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
+                        if (shift.getValue().equals("5")) {
+                            BigDecimal multiply = new BigDecimal("0.5").multiply(new BigDecimal(count)).setScale(1, BigDecimal.ROUND_CEILING);
+                            hashMapMonth.put(shiftType.get(0).getLabel(), new BigDecimal(hashMapMonth.get(shiftType.get(0).getLabel()).toString()).add(multiply));
+                            hashMapYear.put(shiftType.get(0).getLabel(), new BigDecimal(hashMapYear.get(shiftType.get(0).getLabel()).toString()).add(multiply));
+                            totalMonthAttendance += multiply.doubleValue();
+                            totalYearAttendance += multiply.doubleValue();
                         }
                     }
                     // 绌烘暟鎹�
                     else {
                         map.put("work_time", i);
-                        hashMapMonth.put(enums.getLabel(), 0);
+                        hashMapMonth.put(shift.getLabel(), 0);
                     }
                 }
                 hashMapMonth.put("totalMonthAttendance", totalMonthAttendance);
@@ -228,7 +326,7 @@
     public static int countOccurrences(String str, String target) {
         int count = 0;
         int index = 0;
-        while ((index = str.indexOf(target, index))!= -1) {
+        while ((index = str.indexOf(target, index)) != -1) {
             count++;
             index += target.length();
         }
@@ -245,14 +343,18 @@
             Map<String, Object> year = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("year")), Map.class);
             excelRowList.add(year.get("totalYearAttendance"));
             enums.forEach(j -> {
-                excelRowList.add(year.get(j.getLabel()));
+                if (!j.getValue().equals("5")) {
+                    excelRowList.add(year.get(j.getLabel()));
+                }
             });
             Map<String, Map<String, Object>> month = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("month")), Map.class);
             for (int j = 1; j < 13; j++) {
                 Object totalMonthAttendance = month.get(j + "").get("totalMonthAttendance");
                 excelRowList.add(totalMonthAttendance);
                 for (Enums anEnum : enums) {
-                    excelRowList.add(month.get(j + "").get(anEnum.getLabel()));
+                    if (!anEnum.getValue().equals("5")) {
+                        excelRowList.add(month.get(j + "").get(anEnum.getLabel()));
+                    }
                 }
             }
             data.add(excelRowList);
@@ -281,7 +383,7 @@
         List<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftList(time, userName, laboratory);
         mapIPage.forEach(i -> {
             String[] shiftTimes = i.getShiftTime().split(";");
-            int totalAttendance = 0;
+            double totalAttendance = 0;
             List<Map<String, Object>> map = new ArrayList<>();
             // 鍒嗗壊鏃ユ湡
             for (String shiftTime : shiftTimes) {
@@ -292,12 +394,22 @@
                         i.getMonthlyAttendance().put(enums.getLabel(), 0);
                     }
                     if (enums.getValue().equals(shiftTimeAndShift[1])) {
-                        Integer num = (Integer) i.getMonthlyAttendance().get(enums.getLabel());
-                        i.getMonthlyAttendance().put(enums.getLabel(), num += 1);
+                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
+                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("1")));
+                    }
+                    // 鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
+                    if (shiftTimeAndShift[1].equals("5") && enums.getValue().equals("0")) {
+                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
+                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("0.5")));
                     }
                 }
-                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0")) {
+                // 鏃╋紝涓紝澶滐紝宸�
+                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) {
                     i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1);
+                }
+                // 鍗�
+                if (shiftTimeAndShift[1].equals("5")) {
+                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
                 }
                 hashMap.put("id", shiftTimeAndShift[2]);
                 hashMap.put("shift", shiftTimeAndShift[1]);
@@ -368,12 +480,13 @@
 
     /**
      * 杩斿洖琛ㄥご
-     *
+     * <p>
      * 澶栧眰List浠h〃琛屽唴灞� List浠h〃鍒�  鐩稿悓鐨勫垪鏁版嵁浼氳涓诲姩鍚堝苟
      * 鏋勯�犲弻鍒楄〃澶�
-     * @return List<List<String>>
+     *
+     * @return List<List < String>>
      */
-    private static List<List<String>> getYearHeader(String year, List<Enums> enums){
+    private static List<List<String>> getYearHeader(String year, List<Enums> enums) {
         List<List<String>> line = new ArrayList<>();
         line.add(Arrays.asList("鑰冨嫟姹囨��", "搴忓彿", "搴忓彿"));
         line.add(Arrays.asList("鑰冨嫟姹囨��", "宸ュ彿", "宸ュ彿"));
@@ -381,19 +494,23 @@
         line.add(Arrays.asList("鍑哄嫟璇︽儏", year, "鍑哄嫟"));
         // 骞� header
         for (Enums anEnum : enums) {
-            line.add(Arrays.asList("鑰冨嫟姹囨��", year, anEnum.getLabel()));
+            if (!anEnum.getValue().equals("5")) {
+                line.add(Arrays.asList("鑰冨嫟姹囨��", year, anEnum.getLabel()));
+            }
         }
         // 鏈坔eader
         for (int i = 1; i < 13; i++) {
             line.add(Arrays.asList("鍑哄嫟璇︽儏", i + " 鏈�", "鍑哄嫟"));
             for (Enums anEnum : enums) {
-                line.add(Arrays.asList("鍑哄嫟璇︽儏", i + " 鏈�", anEnum.getLabel()));
+                if (!anEnum.getValue().equals("5")) {
+                    line.add(Arrays.asList("鍑哄嫟璇︽儏", i + " 鏈�", anEnum.getLabel()));
+                }
             }
         }
         return line;
     }
 
-    private static List<List<String>> getMonthHeader(LocalDateTime localDateTimeYear, List<Enums> enums){
+    private static List<List<String>> getMonthHeader(LocalDateTime localDateTimeYear, List<Enums> enums) {
         String year = localDateTimeYear.getYear() + " 骞翠汉鍛樼彮娆�";
         List<List<String>> line = new ArrayList<>();
         line.add(Arrays.asList(year, "搴忓彿", "搴忓彿", "搴忓彿"));
@@ -426,12 +543,12 @@
             excelRowList.add(list.get(i).getName());
             excelRowList.add(list.get(i).getDepartment());
             excelRowList.add(list.get(i).getMonthlyAttendance().get("totalAttendance"));
-            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(3).getLabel()));
-            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(4).getLabel()));
-            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(0).getLabel()));
-            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(1).getLabel()));
-            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(2).getLabel()));
-            excelRowList.add(0); // 鍑哄樊
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(3).getLabel())); // 浼�
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(4).getLabel())); // 鍋�
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(0).getLabel())); // 鏃�
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(1).getLabel())); // 涓�
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(2).getLabel())); // 澶�
+            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(6).getLabel())); // 宸�
             for (Map<String, Object> o : list.get(i).getList()) {
                 String enumLabel = "";
                 for (Enums anEnum : enums) {
@@ -439,7 +556,7 @@
                         enumLabel = anEnum.getLabel();
                     }
                 }
-                excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "鏃�" : enumLabel);
+                excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "-" : enumLabel);
             }
             data.add(excelRowList);
         }

--
Gitblit v1.9.3