| | |
| | | if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) { |
| | | result.setMdcEfficiencyList(listDtos); |
| | | } else { |
| | | |
| | | |
| | | List<String> equipmentIdList = mdcEquipmentService.listEquipmentId(vo); |
| | | if (equipmentIdList != null && !equipmentIdList.isEmpty()) { |
| | | vo.setEquipmentIdList(equipmentIdList); |
| | |
| | | return mdcEfficiencyReportMapper.getEfficiencyRate(equipmentId, date); |
| | | } |
| | | |
| | | /** |
| | | * 班组各设备综合利用率 |
| | | * |
| | | * @param teamEquEffVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> teamEquipmentEfficiencyAnalyze(TeamEquEffVo teamEquEffVo) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | List<String> mdcProductionIds = new ArrayList<>(); |
| | | if (StringUtils.isEmpty(teamEquEffVo.getProductionIds())) { |
| | | mdcProductionIds.add(teamEquEffVo.getProductionId()); |
| | | } else { |
| | | mdcProductionIds.addAll(Arrays.asList(teamEquEffVo.getProductionIds().split(","))); |
| | | } |
| | | List<String> allProductionIds = mdcProductionService.findChildren(mdcProductionIds); |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.findByProductionIds(allProductionIds); |
| | | if (equipmentList != null && !equipmentList.isEmpty()) { |
| | | List<String> equipmentIdList = equipmentList.stream().map(MdcEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | List<TeamEquipmentEfficiencyAnalyzeDto> dataList = mdcEfficiencyReportMapper.teamEquipmentEfficiencyAnalyze(equipmentIdList, teamEquEffVo.getMonth()); |
| | | result.put("dataList", dataList); |
| | | List<String> equipmentNameList = dataList.stream().map(TeamEquipmentEfficiencyAnalyzeDto::getEquipmentName).collect(Collectors.toList()); |
| | | result.put("equipmentNameList", equipmentNameList); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private MdcUtilizationResultDto utilizationRate(String equipmentId, String equipmentName, String equipmentType, Date startTime, Date endTime, String date, List<MdcUtilizationRate> mdcUtilizationRateList) { |
| | | MdcUtilizationResultDto dto = new MdcUtilizationResultDto(); |
| | | dto.setEquipmentId(equipmentId); |