| | |
| | | @Autowired |
| | | private OutStockItemService outStockItemService; |
| | | |
| | | @Autowired |
| | | private CheckOrderItemService checkOrderItemService; |
| | | @Autowired |
| | | private CheckOrderService checkOrderService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized R generateAGVTasks(WaitPakin pakins, String locCode, String orgSta, Long loginUserId) { |
| | |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) { |
| | | throw new CoolException("源库位状态修改失败!!"); |
| | | } |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()).set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type))) { |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getCode, task.getTargLoc()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type))) { |
| | | throw new CoolException("移库目标库位状态修改失败!!"); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)) { |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getTaskId, Arrays.asList(ids))); |
| | | if (!taskItems.isEmpty()) { |
| | | taskItems.forEach(taskItem -> { |
| | | if (!checkOrderItemService.update(new LambdaUpdateWrapper<WkOrderItem>() |
| | | .eq(WkOrderItem::getId, taskItem.getOrderItemId()) |
| | | .setSql("work_qty = work_qty - " + taskItem.getAnfme()))) { |
| | | throw new CoolException("明细数量修改失败!!"); |
| | | } |
| | | |
| | | if (!checkOrderService.update(new LambdaUpdateWrapper<WkOrder>() |
| | | .eq(WkOrder::getId, taskItem.getOrderId()) |
| | | .setSql("work_qty = work_qty - " + taskItem.getAnfme()))) { |
| | | throw new CoolException("盘点单执行数量修改失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) { |
| | |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("数据错误:库位信息不存在!!"); |
| | | } |
| | | loc.setUseStatus(LocStsType.LOC_STS_TYPE_F.type).setBarcode(task.getBarcode()).setUpdateBy(loginUserId).setUpdateTime(new Date()); |
| | | loc.setUseStatus(LocStsType.LOC_STS_TYPE_F.type) |
| | | .setBarcode(task.getBarcode()) |
| | | .setUpdateBy(loginUserId) |
| | | .setUpdateTime(new Date()); |
| | | if (!locService.updateById(loc)) { |
| | | throw new CoolException("库位信息修改失败!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTaskType() < TaskStsType.UPDATED_IN.id ? task.getTargLoc() : task.getOrgLoc())); |
| | | if (null != loc && (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type))) { |
| | | if (null != loc && (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) |
| | | || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type))) { |
| | | loc.setUseStatus(LocStsType.LOC_STS_TYPE_O.type); |
| | | if (!locService.updateById(loc)) { |
| | | throw new CoolException("更新库位状态失败!!"); |