费用提交

This commit is contained in:
2026-10-26 13:41:43 +08:00
parent 0fe1d10566
commit 761fe3686e
171 changed files with 8750 additions and 386 deletions
@@ -22,6 +22,8 @@ import java.util.*;
/** Runs in customer confirmation's transaction; preserves original selections and follows actual pallet moves. */
@Service
public class WarehouseTransferRelabelCompletionService {
@jakarta.annotation.Resource private com.baiyue.lastleg.storagerent.service.StorageRentService storageRent;
@Resource private WarehouseTransferInventoryAllocationMapper allocations;
@Resource private WarehouseTransferRelabelBindingMapper bindings;
@Resource private InventoryCommandMapper inventoryRows;
@@ -86,7 +88,11 @@ public class WarehouseTransferRelabelCompletionService {
balance.getProductNameZh(), balance.getProductNameEn(), current.getPalletId(), current.getPalletNo(),
key + ":OUTPUT", current.getWarehouseLocationId(), current.getWarehouseLocationCode(), count,
transfer.getTransferNo(), key, key + ":TARGET", "本票换标新SKU转入"));
current = inventoryRows.lockPosition(customer, output.positionId());
// 变更 SKU 后搬移原计租份额,原入库时间和免费期不变。
var rentTarget = inventoryRows.lockPosition(customer, output.positionId());
storageRent.moveStockShares(customer, balance.getOverseasWarehouseId(), balance.getId(), current.getBatchNo(),
output.balanceId(), rentTarget.getBatchNo(), count);
current = rentTarget;
balance = inventoryRows.lockBalance(customer, output.balanceId());
if (current == null || balance == null || !Objects.equals(current.getBalanceId(), balance.getId())
|| !Objects.equals(balance.getInboundOrderId(), allocation.getInboundOrderId()))
@@ -92,6 +92,8 @@ import java.util.stream.Collectors;
@Service
public class WarehouseTransferService {
@jakarta.annotation.Resource private com.baiyue.lastleg.storagerent.service.StorageRentService storageRent;
@Resource private TransferQuantityService transferQuantityService;
@Resource private com.baiyue.lastleg.fleet.pickup.FleetPickupService pickupService;
@Resource private com.baiyue.lastleg.dispatch.transport.TransportTaskService transportTaskService;
@@ -1344,6 +1346,11 @@ public class WarehouseTransferService {
receipt.setInventoryBalanceId(result.balanceId()); receipt.setInventoryPositionId(result.positionId());
receipt.setInventoryOperationKey(operationKey); receipt.setReceivedAt(now); receipt.setCreatedAt(now);
stockReceipts.insert(receipt);
// 外来货进入自有海外仓后立即计租;按该实托实际体积分到原 SKU 箱数。
storageRent.registerTransfer(receipt, transfer,
pallet.getVolumeCbm()!=null&&pallet.getVolumeCbm().signum()>0&&pallet.getCartonCount()!=null&&pallet.getCartonCount()>0
?pallet.getVolumeCbm().multiply(java.math.BigDecimal.valueOf(row.getPackageCount()))
.divide(java.math.BigDecimal.valueOf(pallet.getCartonCount()), 12, java.math.RoundingMode.HALF_UP):null, warehouse.warehouseName());
}
}
}
@@ -1543,6 +1550,7 @@ public class WarehouseTransferService {
LocalDateTime now = LocalDateTime.now();
for (WarehouseTransferInventoryAllocation allocation : allocations) {
if (!"RESERVED".equals(allocation.getStatus())) throw conflict("Warehouse transfer allocation was already processed");
storageRent.requirePdaOutbound(customerId,transfer.getOperatingWarehouseId(),allocation.getInventoryPositionId());
String keyBase = "WAREHOUSE_TRANSFER:" + transferNo + ":" + allocation.getInventoryPositionId();
InventoryCommandRequests.Move move = new InventoryCommandRequests.Move(
allocation.getInventoryPositionId(), allocation.getPackageCount(), transferNo, transferNo,