yusm 7 часов назад
Родитель
Сommit
37eebe9a1d

+ 67 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java

@@ -2884,7 +2884,7 @@ public class UserCorpwxTimeController {
             c2.setCellValue(weekList != null && i < weekList.size() ? weekList.get(i) : "");
             c2.setCellValue(weekList != null && i < weekList.size() ? weekList.get(i) : "");
             col++;
             col++;
         }
         }
-        String[] tailHeaders = isCorpTime ? new String[]{"法定假/天", "年休假/天", "婚假/天", "陪产假/天", "产假/天", "丧假/天", "调休假/天", "病假/天", "事假/天", "迟到", "缺卡", "本月应出勤天数", "本月实际出勤天数"} : new String[]{"本月请假工时(h)"};
+        String[] tailHeaders = isCorpTime ? new String[]{"法定假/天", "年休假/天", "婚假/天", "陪产假/天", "产假/天", "丧假/天", "调休假/天", "病假/天", "事假/天", "迟到", "缺卡", "本月应出勤天数", "本月实际出勤天数"} : new String[]{"调休(h)", "病假(h)", "年假(h)", "其他(h)", "本月请假工时(h)"};
         for (String tailHeader : tailHeaders) {
         for (String tailHeader : tailHeaders) {
             Cell c1 = header1.createCell(col);
             Cell c1 = header1.createCell(col);
             c1.setCellStyle(headStyle);
             c1.setCellStyle(headStyle);
@@ -2923,8 +2923,11 @@ public class UserCorpwxTimeController {
                     setCell(dataRow, c++, v == null ? "0" : String.valueOf(v), cellStyle);
                     setCell(dataRow, c++, v == null ? "0" : String.valueOf(v), cellStyle);
                 }
                 }
             } else {
             } else {
-                Object v = row.get("holidayCount");
-                setCell(dataRow, c++, v == null ? "0" : String.valueOf(v), cellStyle);
+                String[] leaveSummaryKeys = new String[]{"transferLeaveHours", "sickLeaveHours", "annualLeaveHours", "otherLeaveHours", "holidayCount"};
+                for (String key : leaveSummaryKeys) {
+                    Object v = row.get(key);
+                    setCell(dataRow, c++, v == null ? "0" : String.valueOf(v), cellStyle);
+                }
             }
             }
         }
         }
 
 
@@ -3056,6 +3059,7 @@ public class UserCorpwxTimeController {
                 }
                 }
                 row.put("fictitiousAttendanceArray", attendanceArray);
                 row.put("fictitiousAttendanceArray", attendanceArray);
                 row.put("holidayCount", holidayCount);
                 row.put("holidayCount", holidayCount);
+                sumFictitiousLeaveHoursByCategory(userTimes, row);
                 attendanceList.add(row);
                 attendanceList.add(row);
             }
             }
             int total = (int) userPage.getTotal();
             int total = (int) userPage.getTotal();
@@ -3081,4 +3085,64 @@ public class UserCorpwxTimeController {
         }
         }
         return httpRespMsg;
         return httpRespMsg;
     }
     }
+
+    private enum FictitiousLeaveCategory {
+        TRANSFER, SICK, ANNUAL, OTHER
+    }
+
+    private FictitiousLeaveCategory classifyFictitiousLeaveType(String askLeaveType) {
+        if (askLeaveType == null) {
+            return FictitiousLeaveCategory.OTHER;
+        }
+        String type = askLeaveType.trim();
+        if (type.isEmpty()) {
+            return FictitiousLeaveCategory.OTHER;
+        }
+        if ("T".equalsIgnoreCase(type) || "调休假".equals(type) || "调休".equals(type)) {
+            return FictitiousLeaveCategory.TRANSFER;
+        }
+        if ("B".equalsIgnoreCase(type) || "病假".equals(type)) {
+            return FictitiousLeaveCategory.SICK;
+        }
+        if ("年假".equals(type) || "年休假".equals(type)) {
+            return FictitiousLeaveCategory.ANNUAL;
+        }
+        return FictitiousLeaveCategory.OTHER;
+    }
+
+    private void sumFictitiousLeaveHoursByCategory(List<UserCorpwxTime> userTimes, Map<String, Object> row) {
+        double transferLeaveHours = 0;
+        double sickLeaveHours = 0;
+        double annualLeaveHours = 0;
+        double otherLeaveHours = 0;
+        for (UserCorpwxTime time : userTimes) {
+            double leaveTime = time.getAskLeaveTime() == null ? 0D : time.getAskLeaveTime();
+            if (leaveTime <= 0) {
+                continue;
+            }
+            String leaveType = time.getAskLeaveType() == null ? "" : String.valueOf(time.getAskLeaveType()).trim();
+            switch (classifyFictitiousLeaveType(leaveType)) {
+                case TRANSFER:
+                    transferLeaveHours += leaveTime;
+                    break;
+                case SICK:
+                    sickLeaveHours += leaveTime;
+                    break;
+                case ANNUAL:
+                    annualLeaveHours += leaveTime;
+                    break;
+                default:
+                    otherLeaveHours += leaveTime;
+                    break;
+            }
+        }
+        row.put("transferLeaveHours", roundLeaveHours(transferLeaveHours));
+        row.put("sickLeaveHours", roundLeaveHours(sickLeaveHours));
+        row.put("annualLeaveHours", roundLeaveHours(annualLeaveHours));
+        row.put("otherLeaveHours", roundLeaveHours(otherLeaveHours));
+    }
+
+    private double roundLeaveHours(double hours) {
+        return Math.round(hours * 100.0) / 100.0;
+    }
 }
 }

+ 70 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -6461,12 +6461,60 @@
                     </div>
                     </div>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
+                <el-table-column
+                  prop="transferLeaveHours"
+                  label="调休(h)"
+                  width="60"
+                  min-width="60"
+                  :resizable="false"
+                  fixed="right"
+                  align="center"
+                  class-name="employee-holiday-summary-column"
+                  label-class-name="employee-holiday-summary-header"
+                ></el-table-column>
+                <el-table-column
+                  prop="sickLeaveHours"
+                  label="病假(h)"
+                  width="60"
+                  min-width="60"
+                  :resizable="false"
+                  fixed="right"
+                  align="center"
+                  class-name="employee-holiday-summary-column"
+                  label-class-name="employee-holiday-summary-header"
+                ></el-table-column>
+                <el-table-column
+                  prop="annualLeaveHours"
+                  label="年假(h)"
+                  width="60"
+                  min-width="60"
+                  :resizable="false"
+                  fixed="right"
+                  align="center"
+                  class-name="employee-holiday-summary-column"
+                  label-class-name="employee-holiday-summary-header"
+                ></el-table-column>
+                <el-table-column
+                  prop="otherLeaveHours"
+                  label="其他(h)"
+                  width="60"
+                  min-width="60"
+                  :resizable="false"
+                  fixed="right"
+                  align="center"
+                  class-name="employee-holiday-summary-column"
+                  label-class-name="employee-holiday-summary-header"
+                ></el-table-column>
                 <el-table-column
                 <el-table-column
                   prop="holidayCount"
                   prop="holidayCount"
                   label="本月请假工时(h)"
                   label="本月请假工时(h)"
-                  width="180"
+                  width="140"
+                  min-width="140"
+                  :resizable="false"
                   fixed="right"
                   fixed="right"
                   align="center"
                   align="center"
+                  class-name="employee-holiday-summary-column employee-holiday-summary-column--total"
+                  label-class-name="employee-holiday-summary-header employee-holiday-summary-header--total"
                 ></el-table-column>
                 ></el-table-column>
               </el-table>
               </el-table>
             </template>
             </template>
@@ -13133,4 +13181,25 @@ export default {
     flex: 1;
     flex: 1;
   }
   }
 }
 }
+
+::v-deep .employee-holiday-summary-header,
+::v-deep .employee-holiday-summary-column {
+  width: 60px !important;
+  min-width: 60px !important;
+  max-width: 60px !important;
+}
+
+::v-deep .employee-holiday-summary-header--total,
+::v-deep .employee-holiday-summary-column--total {
+  width: 140px !important;
+  min-width: 140px !important;
+  max-width: 140px !important;
+}
+
+::v-deep .employee-holiday-summary-header .cell,
+::v-deep .employee-holiday-summary-column .cell {
+  padding: 0 4px !important;
+  white-space: nowrap;
+  text-align: center;
+}
 </style>
 </style>