yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java
@@ -91,7 +91,7 @@
        List<StatusRecordDateVO> result = new ArrayList<>();
        List<WorkstationInfoVO> workstationList = statusRecordDateSelectVO.getWorkstationInfoList();
        if (Func.isEmpty(workstationList)) {
           workstationList = (List<WorkstationInfoVO>)this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()).eq(BaseEntity::getStatus, CommonConstant.ENABLE)).stream().map(s -> {
           workstationList = this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()).eq(BaseEntity::getStatus, CommonConstant.ENABLE)).stream().map(s -> {
                WorkstationInfoVO workstationInfoVO = new WorkstationInfoVO();
                workstationInfoVO.setId(s.getId());
                workstationInfoVO.setName(s.getName());
@@ -113,13 +113,10 @@
        }
        page.setTotal(workstationList.size());
        List<WorkstationInfoVO> workstationList2 = workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList());
        List<Long> workstationIdList = workstationList2.stream().map((v0) -> {
            return v0.getId();
        }).collect(Collectors.toList());
        List<Long> workstationIdList = workstationList2.stream().map(WorkstationInfoVO::getId).collect(Collectors.toList());
        List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(workstationIdList, null, statusRecordDateSelectVO.getDate(), statusRecordDateSelectVO.getDate());
        Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> {
            return v0.getWorkstationId();
        }));
        Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy(SuperAggregateState::getWorkstationId));
        workstationList2.forEach(x -> {
            StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert(workstationStatusMap.get(x.getId())));
            result.add(statusRecord);
@@ -227,7 +224,7 @@
                HashMap<String, String> hashMap = new HashMap<>(16);
                hashMap.put("shiftIndex", x.getShiftIndex() + "");
                hashMap.put("shiftIndexName", x.getShiftIndexName());
                List<SuperAggregateState> shiftIndexStatusList = shiftIndexStatusMap.get(x.getShiftIndex());
                List<SuperAggregateState> shiftIndexStatusList = shiftIndexStatusMap.get(x.getShiftIndex());//null
                if (Func.isNotEmpty(shiftIndexStatusList)) {
                    hashMap.put("oee", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.OEE) + "");
                    hashMap.put("fault", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.ALARM) + "");