| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | 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<>(); |