fix container customer snapshot schema migration

This commit is contained in:
2026-08-24 13:36:38 +08:00
committed by liuyihe
parent fe4eb0b593
commit b72dd54b80
23 changed files with 368 additions and 49 deletions
@@ -156,7 +156,9 @@ public class LoadingCompletedConsumer {
order.setOverseasWarehouseId(payload.warehouseId()); order.setOverseasWarehouseName(payload.warehouseName());
order.setFbaWarehouseCode(source.destinationWarehouseCode()); order.setContainerNo(payload.containerNo());
order.setContainerStatus("待转柜"); order.setAbnormal(false); order.setDetained(false);
order.setPackageCount(source.packageCount()); order.setPalletCount(dropshipPallets.size());
order.setPackageCount(source.packageCount());
order.setPalletCount("ONE_CLICK_DROPSHIP".equals(orderType)
? dropshipPallets.size() : Objects.requireNonNullElse(source.palletCount(), 0));
order.setProductQuantity(source.productQuantity()); order.setVolumeCbm(source.volumeCbm());
order.setVolumeWeightKg(source.items().stream().map(FirstLegLoadingPlanCompletedV1.Item::dimensionalWeightKg)
.filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
@@ -192,7 +194,11 @@ public class LoadingCompletedConsumer {
history.setOrderId(order.getId()); history.setToStatus("PENDING_ASSIGNMENT"); history.setEventId(event.eventId());
history.setRemark("头程装柜完成自动生成"); history.setCreatedAt(LocalDateTime.now()); historyMapper.insert(history);
if ("FIRST_LEG".equals(orderType)) {
InboundPlanResponse plan = inboundPlans.convert(customerId, order.getId());
List<String> sourcePalletNos = source.pallets() == null ? List.of() : source.pallets().stream()
.map(FirstLegLoadingPlanCompletedV1.PalletSnapshot::palletNo).filter(Objects::nonNull).toList();
InboundPlanResponse plan = sourcePalletNos.isEmpty()
? inboundPlans.convert(customerId, order.getId())
: inboundPlans.convert(customerId, order.getId(), sourcePalletNos);
registerInTransit(event, payload, source, order, plan.planNo());
}
if ("ONE_CLICK_DROPSHIP".equals(orderType)) {