Crunchy
2024-05-09 fb7bc35a49bac34373ee2ac93dc850d0b0f4444f
2024-5-9 绩效管理-班次后端开发调整月份完成
已修改4个文件
64 ■■■■ 文件已修改
framework/src/main/java/com/yuanchu/mom/service/impl/InformationNotificationServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/dto/PerformanceShiftMapDto.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/PerformanceShiftService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/service/impl/InformationNotificationServiceImpl.java
@@ -51,13 +51,18 @@
    @Override
    public Boolean checkForUnreadData() {
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderParameter");
        List<InformationNotification> informationNotifications = baseMapper.selectList(
                Wrappers.<InformationNotification>lambdaQuery()
                        .eq(InformationNotification::getConsigneeId, map1.get("userId"))
                        .eq(InformationNotification::getViewStatus, false)
                        .last("limit 1"));
        return !informationNotifications.isEmpty();
        Map<String, Integer> map1 = null;
        try {
            map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderParameter");
            List<InformationNotification> informationNotifications = baseMapper.selectList(
                    Wrappers.<InformationNotification>lambdaQuery()
                            .eq(InformationNotification::getConsigneeId, map1.get("userId"))
                            .eq(InformationNotification::getViewStatus, false)
                            .last("limit 1"));
            return !informationNotifications.isEmpty();
        } catch (Exception e) {
        }
        return false;
    }
    @Override
performance-server/src/main/java/com/yuanchu/mom/dto/PerformanceShiftMapDto.java
@@ -20,4 +20,6 @@
    private Map<String, Object> sidebarAnnualAttendance = new HashMap<>();;
    private List<?> list = new ArrayList<>();
    private List<Map<Object, Object>> headerList = new ArrayList<>();
}
performance-server/src/main/java/com/yuanchu/mom/service/PerformanceShiftService.java
@@ -1,11 +1,11 @@
package com.yuanchu.mom.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.dto.PerformanceShiftAddDto;
import com.yuanchu.mom.dto.PerformanceShiftMapDto;
import com.yuanchu.mom.pojo.PerformanceShift;
import java.util.Map;
/**
 * <p>
@@ -19,7 +19,7 @@
    void performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto);
    IPage<PerformanceShiftMapDto> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory);
    Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory);
    void performanceShiftUpdate(PerformanceShift performanceShift);
}
performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java
@@ -91,7 +91,7 @@
    }
    @Override
    public IPage<PerformanceShiftMapDto> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) {
    public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) {
        IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory);
        List<Enums> shiftType = enumService.selectEnumByCategory("班次类型");
        List<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYearPage(time, userName, laboratory);
@@ -117,10 +117,7 @@
                }
                hashMap.put("id", shiftTimeAndShift[2]);
                hashMap.put("shift", shiftTimeAndShift[1]);
                DateTime parse = DateUtil.parse(shiftTimeAndShift[0]);
                hashMap.put("weekly", DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1)));
                hashMap.put("time", shiftTimeAndShift[0]);
                hashMap.put("headerTime", getWeek(shiftTimeAndShift[0]));
                map.add(hashMap);
            }
            int totalYearAttendance = 0;
@@ -145,7 +142,26 @@
            i.setList(map);
            i.setShiftTime(null);
        });
        return mapIPage;
        // 获取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) {
            Map<Object, Object> hashMap = new HashMap<>();
            DateTime parse = DateUtil.parse(dateTime.format(formatter));
            hashMap.put("weekly", DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1)));
            hashMap.put("headerTime", getWeek(dateTime.format(formatters)));
            list1.add(hashMap);
        }
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("page", mapIPage);
        resultMap.put("headerList", list1);
        return resultMap;
    }
    @Override
@@ -155,6 +171,17 @@
                .set(PerformanceShift::getShift, performanceShift.getShift()));
    }
//    public static void main(String[] args) {
//        String dateStr = "2023-09-15 12:30:45";
//        LocalDateTime localDateTime = convertToLocalDateTime(dateStr);
//        System.out.println(localDateTime);
//    }
//
//    public static LocalDateTime convertToLocalDateTime(String dateStr) {
//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        return LocalDateTime.parse(dateStr, formatter);
//    }
    // 获取两个localDateTime的每一天
    public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) {
        List<LocalDateTime> localDateTimes = new ArrayList<>();