| | |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.MdcEfficiencyReportQueryVo; |
| | | import org.jeecg.modules.mdc.vo.MdcEfficiencyReportShiftQueryVo; |
| | | import org.jeecg.modules.mdc.vo.MdcEfficiencyShiftVo; |
| | | import org.jeecg.modules.mdc.vo.MdcEfficiencyVo; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MdcEfficiencyVo efficiencyShiftList(String userId, MdcEfficiencyReportShiftQueryVo vo) { |
| | | return null; |
| | | public MdcEfficiencyShiftVo efficiencyShiftList(String userId, MdcEfficiencyReportShiftQueryVo vo) { |
| | | MdcEfficiencyShiftVo result = new MdcEfficiencyShiftVo(); |
| | | List<MdcEfficiencyShiftListDto> listDtos = new ArrayList<>(); |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(vo.getParentId()) && StringUtils.isEmpty(vo.getEquipmentId())) { |
| | | if ("2".equals(vo.getTypeTree())) { |
| | | // 部门层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, vo.getParentId()); |
| | | } else { |
| | | // 产线层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, vo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(vo.getEquipmentId())) { |
| | | // 单台设备信息 |
| | | vo.setEquipmentIdList(Collections.singletonList(vo.getEquipmentId())); |
| | | } else { |
| | | // 查询用户拥有的所有设备信息 |
| | | if ("2".equals(vo.getTypeTree())) { |
| | | // 部门层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | // 产线层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) { |
| | | vo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | |
| | | List<String> dates = DateUtils.getDatesStringList2(DateUtils.getShortDate2(vo.getStartTime()), DateUtils.getShortDate2(vo.getEndTime())); |
| | | result.setDates(dates); |
| | | |
| | | if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) { |
| | | result.setMdcEfficiencyList(listDtos); |
| | | } else { |
| | | // 班次利用率等级 |
| | | List<MdcUtilizationRate> mdcUtilizationRateList = mdcUtilizationRateService.listByType("kdl"); |
| | | |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private MdcEfficiencyResultDto efficiencyRate(List<MdcEfficiencyDto> efficiencyList, String date, String equipmentId, List<MdcUtilizationRate> mdcUtilizationRateList) { |