| | |
| | | |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | | // 获取订单主表 |
| | | OrderPakout orderPakOut = orderPakOutService.selectByNo(orderDetlPakouts.get(0).getOrderNo()); |
| | |
| | | List<String> collect = basStations.stream().map(BasStation::getDevNo).collect(Collectors.toList()); |
| | | locDto.setAgvStaNos(collect); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | locDto.setSuppCode(orderDetl.getSuppCode()); |
| | | |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDtos.add(locDto); |
| | | |
| | | |
| | | locDetlUsage.put(detlId, used + currentIssue); |
| | | // 剩余待出数量递减 |
| | | issued = issued - currentIssue; |
| | |
| | | for (LocDto locDto : locDtos) { |
| | | if (locDto.isLack()) { continue; } |
| | | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getAgvStaNo(), locDto); |
| | | if (TaskDto.has(taskDtos, taskDto)) { |
| | | TaskDto dto = TaskDto.find(taskDtos, taskDto); |
| | | if (TaskDto.hasAgv(taskDtos, taskDto)) { |
| | | TaskDto dto = TaskDto.findAgv(taskDtos, taskDto); |
| | | assert dto != null; |
| | | dto.getLocDtos().addAll(taskDto.getLocDtos()); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | // ----------------------------------------------------------------------------------------------- |
| | | for (TaskDto taskDto : taskDtos) { |
| | | // BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .in("loc_sts", Arrays.asList(LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_O.type)) |
| | | .eq("dev_no", taskDto.getAgvStaNo())); |
| | | if (Objects.isNull(station)) { throw new CoolException("数据错误,站点不存在或已使用!!"); } |
| | | workService.agvStockOut(station, taskDto, getUserId()); |
| | | } |
| | | Map<String, List<TaskDto>> listMap = taskDtos.stream().collect(Collectors.groupingBy(TaskDto::getLocNo)); |
| | | listMap.keySet().forEach(locNo -> { |
| | | listMap.get(locNo).forEach(taskDto -> { |
| | | BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | .in("loc_sts", Arrays.asList(LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_O.type)) |
| | | .eq("dev_no", taskDto.getAgvStaNo())); |
| | | if (Objects.isNull(station)) { throw new CoolException("数据错误,站点不存在或已使用!!"); } |
| | | workService.agvStockOut(station, taskDto, getUserId()); |
| | | }); |
| | | }); |
| | | // for (TaskDto taskDto : taskDtos) { |
| | | //// BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); |
| | | // BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>() |
| | | // .in("loc_sts", Arrays.asList(LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_O.type)) |
| | | // .eq("dev_no", taskDto.getAgvStaNo())); |
| | | // if (Objects.isNull(station)) { throw new CoolException("数据错误,站点不存在或已使用!!"); } |
| | | // workService.agvStockOut(station, taskDto, getUserId()); |
| | | // } |
| | | return R.ok(); |
| | | } |
| | | |