yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/OutputStatisticsServiceImpl.java
@@ -80,19 +80,13 @@
    }
    
    @Override
    public StatisticsVO outputStatistics(StatisticsAnalysisQueryVO statisticsAnalysisQueryVO, Query query) {
        List<String> workStationIdList = statisticsAnalysisQueryVO.getWorkStationIdList();
        if (Func.isEmpty(workStationIdList)) {
           workStationIdList = this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode())
                 .eq(Workstation::getStatus, CommonConstant.ENABLE)).stream().map(s -> Func.toStr(s.getId())).collect(Collectors.toList());
           /*
            workStationIdList = (List) this.workstationService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> {
                return v0.getType();
            }, WorkstationTypeEnum.MACHINE.getCode())).eq((v0) -> {
                return v0.getStatus();
            }, CommonConstant.ENABLE)).stream().map(s -> {
                return Func.toStr(s.getId());
            }).collect(Collectors.toList());*/
                 .eq(Workstation::getStatus, CommonConstant.ENABLE)).stream().map(s -> Func.toStr(s.getId())).collect(Collectors.toList());
        }
        IPage<WorkstationVO> workstationVOPage = this.workstationMapper.queryWorkstationAndGroup(Condition.getPage(query), Func.toLongList(workStationIdList));
        IPage<Workstation> workstationPage = WorkstationConvert.INSTANCE.convert(workstationVOPage);
@@ -101,12 +95,13 @@
        }).collect(Collectors.toList());
        List<IntervalDateDto> intervalDates = LocalDateTimeUtils.getIntervalDate(statisticsAnalysisQueryVO.getStartDate(), statisticsAnalysisQueryVO.getEndDate());
        List<SuperAggregateOutput> superAggregateOutputByNaturalDate = this.superAggregateOutputService.getOutputData(workstationIds, statisticsAnalysisQueryVO.getStatisticalMethod(), statisticsAnalysisQueryVO.getStartDate(), statisticsAnalysisQueryVO.getEndDate());
        List<SuperAggregateOutput> superAggregateList = FilterOffUtils.filterOffDay(superAggregateOutputByNaturalDate, OpenTypeEnums.OUT_PUT);
        StatisticsWrapperDto statisticsWrapperDto = new StatisticsWrapperDto(superAggregateList, statisticsAnalysisQueryVO, intervalDates, workstationPage, MdcConstant.OUTPUT);
        return this.wrapper.entityVO(statisticsWrapperDto);
    }
    @Override
    public BladeFile export(StatisticsAnalysisQueryVO analysisQueryVO) {
        StatisticalMethodEnum statisticalMethod = analysisQueryVO.getStatisticalMethod();
        List<String> workStationIdList = analysisQueryVO.getWorkStationIdList();