yangys
2024-03-29 e7aaa62a5c499747275a78ed6157024f15b9ab1e
smart-man-boot/src/main/java/com/qianwen/smartman/modules/report/utils/CommonUtil.java
@@ -63,14 +63,14 @@
        List<WorkstationShiftDTO> workstationShifts = new ArrayList<>();
        workstationData.forEach(workstation -> {
            Boolean isBlendShiftModel = isBlendShiftModel(shiftInfoDtoList, workstation.getWorkstationId());
            List<ShiftInfoDTO> collect = (List) shiftInfoDtoList.parallelStream().filter(shift -> {
            List<ShiftInfoDTO> collect = shiftInfoDtoList.parallelStream().filter(shift -> {
                return shift.getWorkstationId().equals(workstation.getWorkstationId());
            }).collect(Collectors.collectingAndThen(Collectors.toCollection(() -> {
                return new TreeSet(Comparator.comparing((v0) -> {
                return new TreeSet<>(Comparator.comparing((v0) -> {
                    return v0.getShiftIndex();
                }));
            }), (v1) -> {
                return new ArrayList(v1);
                return new ArrayList<>(v1);
            }));
            collect.forEach(c -> {
                WorkstationShiftDTO workstationShiftDTO = WorkstationShiftDTO.of(c.getShiftIndex()).setShiftName(buildShiftName(c.getShiftIndex(), isBlendShiftModel, c.getIndexName()));
@@ -83,21 +83,21 @@
    }
    public static Boolean isBlendShiftModel(List<ShiftInfoDTO> shiftInfos, Long workstationId) {
        int size = ((ArrayList) shiftInfos.parallelStream().filter(s -> {
        int size = ( shiftInfos.parallelStream().filter(s -> {
            return s.getWorkstationId().equals(workstationId);
        }).collect(Collectors.collectingAndThen(Collectors.toCollection(() -> {
            return new TreeSet(Comparator.comparing((v0) -> {
            return new TreeSet<>(Comparator.comparing((v0) -> {
                return v0.getModelId();
            }));
        }), (v1) -> {
            return new ArrayList(v1);
            return new ArrayList<>(v1);
        }))).size();
        return Boolean.valueOf(size >= 2);
    }
    public static List<WorkstationShiftDTO> fillShift(List<ShiftInfoDTO> collect, WorkstationDataDTO workstationDataDTO) {
        if (collect.size() == 4) {
            return new ArrayList();
            return new ArrayList<>();
        }
        List<WorkstationShiftDTO> result = new ArrayList<>();
        if (CollectionUtil.isEmpty(collect)) {
@@ -123,7 +123,7 @@
    }
    public static void fillWorkStationGroup(IPage<WorkstationDataDTO> source) {
        List<WorkstationDataDTO> list = (List) source.getRecords().parallelStream().peek(w -> {
        List<WorkstationDataDTO> list = source.getRecords().parallelStream().peek(w -> {
            if (StrUtil.isEmpty(w.getWorkstationGroup())) {
                w.setWorkstationGroup(CommonGroupConstant.DEFAULT_NAME);
            }
@@ -142,7 +142,7 @@
    }
    public static HttpServletRequest getRequest() {
        ServletRequestAttributes attributes = RequestContextHolder.getRequestAttributes();
        ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
        if (attributes != null) {
            HttpServletRequest request = attributes.getRequest();
            return request;