fix: materialize container pallet plans

This commit is contained in:
2026-09-10 15:40:55 +08:00
parent a5db6fbbb6
commit f0b8514890
8 changed files with 321 additions and 25 deletions
@@ -38,6 +38,9 @@ import java.util.Set;
@Service
public class WarehousePalletBatchService {
private static final String BUSINESS_TYPE = "INBOUND_PLAN_AUTO";
private static final BigDecimal AUTO_PALLET_CAPACITY_CBM = new BigDecimal("2.0000");
private static final BigDecimal AUTO_PALLET_UNIT_PRICE_USD = new BigDecimal("5.00");
private static final String AUTO_PALLET_REMARK = "自动生成";
@Resource private WarehousePalletBatchMapper batches;
@Resource private WarehousePalletBatchItemMapper items;
@@ -80,8 +83,8 @@ public class WarehousePalletBatchService {
List<WarehousePalletBatchItemEntity> created = new ArrayList<>();
for (WarehousePalletBatchRequests.Item requested : normalized.items()) {
Long palletId = resources.createPallet(WarehouseResourceService.PUBLIC_RESOURCE_SCOPE,
normalized.warehouseId(), new PalletRequests.SaveRequest(requested.palletCode(), requested.palletType(), null,
BigDecimal.ZERO, "IDLE", null, "Auto-created for inbound plan " + requested.inboundPlanNo(),
normalized.warehouseId(), new PalletRequests.SaveRequest(requested.palletCode(), "WOOD",
AUTO_PALLET_CAPACITY_CBM, AUTO_PALLET_UNIT_PRICE_USD, "IDLE", null, AUTO_PALLET_REMARK,
requested.fbaWarehouseCode()));
WarehousePalletEntity pallet = resources.pallet(WarehouseResourceService.PUBLIC_RESOURCE_SCOPE,
normalized.warehouseId(), palletId);