| | |
| | | public class OutController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | private OrderPakoutService orderPakoutService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | private OrderDetlPakoutService orderDetlPakoutService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | |
| | | @ManagerAuth |
| | | public R pakoutOrderDetlIds(@RequestParam Long orderId) throws InterruptedException { |
| | | Thread.sleep(200); |
| | | return R.ok().add(orderDetlService.selectByOrderId(orderId).stream().map(OrderDetlPakout::getId).distinct().collect(Collectors.toList())); |
| | | return R.ok().add(orderDetlPakoutService.selectByOrderId(orderId).stream().map(OrderDetlPakout::getId).distinct().collect(Collectors.toList())); |
| | | } |
| | | |
| | | @PostMapping("/out/pakout/OrderOutGetLoc/auth") |
| | |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | // 获取订单明细并处理 |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | Set<String> processedLocs = new HashSet<>(); // 已处理货位缓存 |
| | | Set<ExistDto> processedStock = new HashSet<>(); // 已处理库存缓存 |
| | | List<LocDto> result = new ArrayList<>(); |
| | |
| | | |
| | | |
| | | // 获取订单明细并处理 |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | Set<String> processedLocs = new HashSet<>(); // 已处理货位缓存 |
| | | Set<ExistDto> processedStock = new HashSet<>(); // 已处理库存缓存 |
| | | List<LocDto> result = new ArrayList<>(); |
| | |
| | | /** |
| | | * 处理单个订单明细的货位分配 |
| | | * |
| | | * @param orderDetlPakout 订单明细 |
| | | * @param requiredAmount 需求出库量 |
| | | * @param processedLocs 已处理的货位集合(用于去重) |
| | | * @param processedStock 已处理的库存记录集合(用于去重) |
| | | * @param orderDetlPakout 订单明细 |
| | | * @param requiredAmount 需求出库量 |
| | | * @param processedLocs 已处理的货位集合(用于去重) |
| | | * @param processedStock 已处理的库存记录集合(用于去重) |
| | | */ |
| | | private List<LocDto> processOrderDetl(OrderDetlPakout orderDetlPakout, Double requiredAmount, |
| | | Set<String> processedLocs, Set<ExistDto> processedStock) { |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | |
| | | if (Cools.isEmpty(ids)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlService.selectBatchIds(ids); |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectBatchIds(ids); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |