| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/mdc/service/impl/EfficiencyAnalysisServiceImpl.class */ |
| | | public class EfficiencyAnalysisServiceImpl implements IEfficiencyAnalysisService { |
| | | private static final Logger log = LoggerFactory.getLogger(EfficiencyAnalysisServiceImpl.class); |
| | | private static final String ZERO = "0.00%"; |
| | |
| | | this.statisticsService = statisticsService; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.mdc.service.IEfficiencyAnalysisService |
| | | @Override |
| | | public StatisticsVO efficiencyAnalysis(StatisticsAnalysisQueryVO statisticsAnalysisQueryVO, Query query) { |
| | | List<SuperAggregateState> superAggregateStates; |
| | | 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());*/ |
| | | } |
| | | IPage<WorkstationVO> workstationVOPage = this.workstationMapper.queryWorkstationAndGroup(Condition.getPage(query), Func.toLongList(workStationIdList)); |
| | | IPage<Workstation> workstationPage = WorkstationConvert.INSTANCE.convert(workstationVOPage); |
| | | List<Long> workstationIds = workstationPage.getRecords().stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | List<Long> workstationIds = workstationPage.getRecords().stream().map(Workstation::getId).collect(Collectors.toList()); |
| | | List<IntervalDateDto> intervalDates = LocalDateTimeUtils.getIntervalDate(statisticsAnalysisQueryVO.getStartDate(), statisticsAnalysisQueryVO.getEndDate()); |
| | | if (statisticsAnalysisQueryVO.getProductivityType() == ProductivityTypeEnum.OEE) { |
| | | superAggregateStates = this.superAggregateStateService.getStatusDataWithFeedback(workstationIds, statisticsAnalysisQueryVO.getStatisticalMethod(), statisticsAnalysisQueryVO.getStartDate(), statisticsAnalysisQueryVO.getEndDate()); |
| | |
| | | superAggregateStates = this.superAggregateStateService.getStatusData(workstationIds, statisticsAnalysisQueryVO.getStatisticalMethod(), statisticsAnalysisQueryVO.getStartDate(), statisticsAnalysisQueryVO.getEndDate()); |
| | | } |
| | | List<SuperAggregate> superAggregateList = superAggregateStates.stream().filter(x -> { |
| | | return x.getWcs().intValue() > 0; |
| | | return x.getWcs() > 0; |
| | | }).collect(Collectors.toList()); |
| | | StatisticsWrapperDto statisticsWrapperDto = new StatisticsWrapperDto(superAggregateList, statisticsAnalysisQueryVO, intervalDates, workstationPage, MdcConstant.STATE); |
| | | return this.wrapper.entityVO(statisticsWrapperDto); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.mdc.service.IEfficiencyAnalysisService |
| | | @Override |
| | | public List<ColumnInfoVO> getIntervalDate(QueryIntervalDateVO queryIntervalDateVO) { |
| | | List<IntervalDateDto> intervalDate = LocalDateTimeUtils.getIntervalDate(queryIntervalDateVO.getStartDate(), queryIntervalDateVO.getEndDate()); |
| | | List<ColumnInfoVO> columnInfoVOList = new ArrayList<>(); |
| | |
| | | return columnInfoVOList; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.mdc.service.IEfficiencyAnalysisService |
| | | @Override |
| | | public BladeFile exportEfficiencyAnalysis(StatisticsAnalysisQueryVO statisticsAnalysisQueryVO, HttpServletResponse response) { |
| | | List<SuperAggregateState> superAggregateStates; |
| | | List<String> workStationIdList = statisticsAnalysisQueryVO.getWorkStationIdList(); |