| | |
| | | |
| | | TaskItem taskItem = taskItems.stream().findFirst().get(); |
| | | //保存入出库流水 |
| | | saveStockItems(taskItems, null, null, taskItem.getWkType(), taskItem.getOrderType()); |
| | | saveStockItems(taskItems, task, null, null, taskItem.getWkType(), taskItem.getOrderType()); |
| | | |
| | | |
| | | if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) { |
| | |
| | | /**修改为库位状态为O.空库*/ |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .set(Loc::getBarcode, null) |
| | | .eq(Loc::getId, loc.getId()))) { |
| | | throw new CoolException("库位状态修改失败!!"); |
| | | } |
| | |
| | | List<TaskItem> items = orderMap.get(key); |
| | | try { |
| | | //保存库存明细 |
| | | saveStockItems(items, pakinItem.getId(), pakinItem.getAsnCode(), pakinItem.getWkType(), pakinItem.getType()); |
| | | saveStockItems(items, task, pakinItem.getId(), pakinItem.getAsnCode(), pakinItem.getWkType(), pakinItem.getType()); |
| | | //移出收货区库存, 修改组托状态 |
| | | removeReceiptStock(pakinItem); |
| | | } catch (Exception e) { |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveStockItems(List<TaskItem> items, Long id, String code, Short wkType, String type) throws |
| | | public void saveStockItems(List<TaskItem> items, Task task, Long id, String code, Short wkType, String type) throws |
| | | Exception { |
| | | Stock stock = new Stock(); |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | |
| | | .setSourceCode(code) |
| | | .setAnfme(sum) |
| | | .setWkType(wkType) |
| | | .setBarcode(task.getBarcode()) |
| | | .setType(type); |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) ) { |
| | | stock.setLocCode(task.getTargLoc()); |
| | | } else { |
| | | stock.setLocCode(task.getOrgLoc()); |
| | | } |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | |
| | | BeanUtils.copyProperties(item, stockItem); |
| | | stockItem.setSourceItemId(item.getOrderItemId()) |
| | | .setStockCode(stock.getCode()) |
| | | .setBarcode(task.getBarcode()) |
| | | .setSourceItemId(item.getOrderItemId()) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |