| | |
| | | import com.ruoyi.collaborativeApproval.mapper.NoticeMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.Notice; |
| | | import com.ruoyi.common.enums.ApproveTypeEnum; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<processDataProductionStatisticsDto> processDataProductionStatistics(Integer type, List<Long> processIds) { |
| | | public List<processDataProductionStatisticsDto> processDataProductionStatistics(Integer type, List<Long> processTypes) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long userId = SecurityUtils.isAdmin(loginUser.getUserId()) ? null : loginUser.getUserId(); |
| | | |
| | |
| | | LocalDateTime startDateTime = startDate.atStartOfDay(); |
| | | LocalDateTime endDateTime = endDate.atTime(LocalTime.MAX); |
| | | |
| | | return productProcessMapper.calculateProductionStatistics(startDateTime, endDateTime, userId, processIds); |
| | | List<processDataProductionStatisticsDto> result = productProcessMapper.calculateProductionStatistics(startDateTime, endDateTime, userId, processTypes); |
| | | if (!ObjectUtils.isEmpty(result)) { |
| | | result.forEach(dto -> { |
| | | if (dto == null) { |
| | | return; |
| | | } |
| | | Integer processType = dto.getProcessType(); |
| | | String dictLabel = null; |
| | | if (processType != null) { |
| | | dictLabel = DictUtils.getDictLabel("product_process_type", String.valueOf(processType)); |
| | | } |
| | | if (StringUtils.isEmpty(dictLabel)) { |
| | | dictLabel = "其他"; |
| | | } |
| | | dto.setProcessName(dictLabel); |
| | | }); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |