| | |
| | | // 条码生成规则示例:刀具ID + 序号(4位) + 随机数 |
| | | return cuttingId + String.format("%04d", index + 1) + (int) (Math.random() * 10000); |
| | | } |
| | | |
| | | /** |
| | | * 提交入库单 |
| | | * |
| | | * @param orderId 入库单ID |
| | | * @return 提交结果 |
| | | */ |
| | | @Override |
| | | @Timed(value = "cutting.inbound.submit", description = "刀具入库提交耗时") |
| | | public synchronized Result<?> submit(String orderId) { |
| | |
| | | CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | cuttingInventory.setInventoryStatus("正常"); |
| | | cuttingInventory.setInventoryStatus("在库"); |
| | | cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | inventoryList.add(cuttingInventory); |
| | | } |
| | |
| | | return Result.error("提交失败: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |