| | |
| | | if (!taskService.updateById(task)) {
|
| | | throw new CoolException("库存更新失败");
|
| | | } else {
|
| | | //CacheSite 释放已被占用的通道
|
| | | List<TaskDetl> detls = taskDetlService.list(new LambdaQueryWrapper<TaskDetl>().eq(TaskDetl::getTaskId, task.getId()));
|
| | | if (!Collections.isEmpty(detls)) {
|
| | | List<Long> waveIds = detls.stream().map(TaskDetl::getWaveId).collect(Collectors.toList());
|
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getWaveId, waveIds));
|
| | | List<Long> orderIds = orders.stream().map(Order::getId).collect(Collectors.toList());
|
| | | cacheSiteService.update(new LambdaUpdateWrapper<CacheSite>()
|
| | | .in(CacheSite::getOrderId, orderIds)
|
| | | .set(CacheSite::getSiteStatus, 0)
|
| | | .set(CacheSite::getOrderId, null)
|
| | | .set(CacheSite::getOrderNo, null));
|
| | | }
|
| | | //CacheSite 释放已被占用的通道 //fixme 播种功能完成后,需要将这里注释掉
|
| | | // List<TaskDetl> detls = taskDetlService.list(new LambdaQueryWrapper<TaskDetl>().eq(TaskDetl::getTaskId, task.getId()));
|
| | | // if (!Collections.isEmpty(detls)) {
|
| | | // List<Long> waveIds = detls.stream().map(TaskDetl::getWaveId).collect(Collectors.toList());
|
| | | // List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getWaveId, waveIds));
|
| | | // List<Long> orderIds = orders.stream().map(Order::getId).collect(Collectors.toList());
|
| | | // cacheSiteService.update(new LambdaUpdateWrapper<CacheSite>()
|
| | | // .in(CacheSite::getOrderId, orderIds)
|
| | | // .set(CacheSite::getSiteStatus, 0)
|
| | | // .set(CacheSite::getOrderId, null)
|
| | | // .set(CacheSite::getOrderNo, null));
|
| | | // }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | //入库
|
| | | private void executeTask1(Task task) {
|
| | | Long hostId = task.getHostId();
|
| | | //fixme 暂时关闭HOSTID
|
| | | // Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc()).eq(Loc::getHostId, hostId));
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc()));
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc()).eq(Loc::getHostId, hostId));
|
| | | if (loc == null) {
|
| | | log.info("库位不存在" + "=======>" + task.getTargetLoc());
|
| | | throw new CoolException("库位不存在");
|
| | | }
|
| | |
|
| | |
| | | for (WaitPakin waitPakin : waitPakins) {
|
| | | WaitPakinLog waitPakinLog = new WaitPakinLog();
|
| | | waitPakinLog.sync(waitPakin);
|
| | | waitPakinLog.setId(null);
|
| | | if (!waitPakinLogService.save(waitPakinLog)) {
|
| | | throw new CoolException("组托通知档转历史档失败");
|
| | | }
|