From 23eb9c9a21afc8ed065706f0e6494ee998a217b5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 04 三月 2026 16:35:27 +0800
Subject: [PATCH] fix:1.班次页面:月度统计时间调整为上月26到本月25;班次支持右键添加批注 2.外购下单:KJNS域订单免检自动更新批次属性;外购下单-全部页新增【更新IFS批次属性】按钮,支持更新已提交订单的批次属性 3.资源要求-设备:设备核查计划:核查负责人回显问题修复;设备使用授权:检验项目导出数据错误问题修复

---
 performance-server/src/main/java/com/ruoyi/performance/service/impl/PerformanceShiftServiceImpl.java |   61 +++++++++++++++++-------------
 1 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/performance-server/src/main/java/com/ruoyi/performance/service/impl/PerformanceShiftServiceImpl.java b/performance-server/src/main/java/com/ruoyi/performance/service/impl/PerformanceShiftServiceImpl.java
index 966317f..507af3f 100644
--- a/performance-server/src/main/java/com/ruoyi/performance/service/impl/PerformanceShiftServiceImpl.java
+++ b/performance-server/src/main/java/com/ruoyi/performance/service/impl/PerformanceShiftServiceImpl.java
@@ -147,7 +147,16 @@
                 laboratory = departLims;
             }
         }
-        IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory);
+        // 鑾峰彇header鏃堕棿
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        // 灏嗗瓧绗︿覆鏃堕棿杞崲涓� LocalDateTime 绫诲瀷鏃堕棿
+        LocalDateTime localDateTime = LocalDateTime.parse(time, formatters);
+        //鐝鏃堕棿鑼冨洿涓轰笂涓湀鐨�26鍙峰埌鏈湀鐨�25鍙�
+        LocalDate firstDayOfMonth = localDateTime.toLocalDate().minusMonths(1L).withDayOfMonth(26);
+        LocalDate lastDayOfMonth = localDateTime.toLocalDate().withDayOfMonth(25);
+
+        IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, firstDayOfMonth,lastDayOfMonth, userName, laboratory);
 
         List<SysDictData> shiftType = dictTypeService.selectDictDataByName("鐝绫诲瀷");
         List<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYearPage(time, userName, laboratory);
@@ -168,22 +177,23 @@
                         i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("1")));
                     }
                     // 鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
-                    if (shiftTimeAndShift[1].equals("5") && enums.getDictValue().equals("0")) {
-                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString());
-                        i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5")));
-                    }
+//                    if (shiftTimeAndShift[1].equals("5") && enums.getDictValue().equals("0")) {
+//                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString());
+//                        i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5")));
+//                    }
                 }
                 // 鏃╋紝涓紝澶滐紝宸�
-                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) {
+                if (shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("3") || shiftTimeAndShift[1].equals("4")) {
                     i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1);
                 }
                 // 鍗�
-                if (shiftTimeAndShift[1].equals("5")) {
-                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
-                }
-                hashMap.put("id", shiftTimeAndShift[2]);
+//                if (shiftTimeAndShift[1].equals("5")) {
+//                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
+//                }
+                hashMap.put("id", shiftTimeAndShift[3]);
                 hashMap.put("shift", shiftTimeAndShift[1]);
                 hashMap.put("time", shiftTimeAndShift[0]);
+                hashMap.put("annotationText", shiftTimeAndShift[2]);
                 map.add(hashMap);
             }
             double totalYearAttendance = 0;
@@ -199,31 +209,24 @@
                             hashMap.put(enums.getDictLabel(), num.add(new BigDecimal("1")));
                         }
                         // 鍗婏紝鍙﹀鍗婂ぉ绠楃粰鏃�
-                        if (record.get("shift").equals("5") && enums.getDictValue().equals("0")) {
-                            BigDecimal bigDecimal = new BigDecimal(hashMap.get(enums.getDictLabel()).toString());
-                            hashMap.put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5")));
-                        }
+//                        if (record.get("shift").equals("5") && enums.getDictValue().equals("0")) {
+//                            BigDecimal bigDecimal = new BigDecimal(hashMap.get(enums.getDictLabel()).toString());
+//                            hashMap.put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5")));
+//                        }
                     }
-                    if (record.get("shift").equals("1") || record.get("shift").equals("2") || record.get("shift").equals("0") || record.get("shift").equals("6")) {
+                    if (record.get("shift").equals("2") || record.get("shift").equals("3") || record.get("shift").equals("4")) {
                         hashMap.put("totalAttendance", totalYearAttendance += 1);
                     }
                     // 鍗�
-                    if (record.get("shift").equals("5")) {
-                        hashMap.put("totalAttendance", totalYearAttendance += 0.5);
-                    }
+//                    if (record.get("shift").equals("5")) {
+//                        hashMap.put("totalAttendance", totalYearAttendance += 0.5);
+//                    }
                 }
             }
             i.setSidebarAnnualAttendance(hashMap);
             i.setList(map);
             i.setShiftTime(null);
         });
-        // 鑾峰彇header鏃堕棿
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        // 灏嗗瓧绗︿覆鏃堕棿杞崲涓� LocalDateTime 绫诲瀷鏃堕棿
-        LocalDateTime localDateTime = LocalDateTime.parse(time, formatters);
-        LocalDate firstDayOfMonth = localDateTime.toLocalDate().withDayOfMonth(1);
-        LocalDate lastDayOfMonth = localDateTime.toLocalDate().with(TemporalAdjusters.lastDayOfMonth());
         List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay());
         List<Object> list1 = new ArrayList<>();
         for (LocalDateTime dateTime : localDateTimesBetween) {
@@ -409,9 +412,10 @@
                 if (shiftTimeAndShift[1].equals("5")) {
                     i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
                 }
-                hashMap.put("id", shiftTimeAndShift[2]);
+                hashMap.put("id", shiftTimeAndShift[3]);
                 hashMap.put("shift", shiftTimeAndShift[1]);
                 hashMap.put("time", shiftTimeAndShift[0]);
+                hashMap.put("annotationText", shiftTimeAndShift[2]);
                 map.add(hashMap);
             }
             i.setList(map);
@@ -427,6 +431,11 @@
         return map;
     }
 
+    @Override
+    public boolean editAnnotationText(PerformanceShift performanceShift) {
+        return this.updateById(performanceShift);
+    }
+
     // 鑾峰彇涓や釜localDateTime鐨勬瘡涓�澶�
     public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) {
         List<LocalDateTime> localDateTimes = new ArrayList<>();

--
Gitblit v1.9.3