diff --git a/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV1.java b/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV1.java index da09521dc..926c4dafb 100644 --- a/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV1.java +++ b/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV1.java @@ -25,7 +25,7 @@ public record FirstLegLoadingPlanCompletedV1( BigDecimal grossWeightKg, BigDecimal netWeightKg, BigDecimal volumeCbm, BigDecimal volumeWeightKg, List items, String customerId, String customerName, String orderType, List pallets, - String destinationType) { + String destinationType, String lxCode) { public Order { items = items == null ? List.of() : items; if (customerId == null || customerId.isBlank()) { @@ -49,7 +49,7 @@ public record FirstLegLoadingPlanCompletedV1( inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, null, items, customerId, customerName, - orderType, pallets, null); + orderType, pallets, null, null); } public Order(String sourceInboundId, String rootInboundId, String sourceOrderId, String sourceOrderNo, String rootOrderId, @@ -63,7 +63,21 @@ public record FirstLegLoadingPlanCompletedV1( inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, null, items, customerId, customerName, - orderType, pallets, destinationType); + orderType, pallets, destinationType, null); + } + + public Order(String sourceInboundId, String rootInboundId, + String sourceOrderId, String sourceOrderNo, String rootOrderId, + String inboundCode, String destinationWarehouseId, + String destinationWarehouseCode, String destinationWarehouseName, + int packageCount, Integer productQuantity, Integer palletCount, + BigDecimal grossWeightKg, BigDecimal netWeightKg, BigDecimal volumeCbm, + BigDecimal volumeWeightKg, List items, String customerId, String customerName, + String orderType, List pallets, String destinationType) { + this(sourceInboundId, rootInboundId, sourceOrderId, sourceOrderNo, rootOrderId, + inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, + packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, + volumeWeightKg, items, customerId, customerName, orderType, pallets, destinationType, null); } } diff --git a/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java b/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java index a1936915e..2c28423eb 100644 --- a/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java +++ b/common-event-contract/src/main/java/com/baiyue/common/event/FirstLegLoadingPlanCompletedV2.java @@ -43,7 +43,7 @@ public record FirstLegLoadingPlanCompletedV2( BigDecimal volumeWeightKg, List items, String customerId, String customerName, String orderType, List pallets, /** 目的类型:FBA 可按箱数收货,OVERSEAS 必须逐箱扫码。 */ - String destinationType) { + String destinationType, String lxCode) { public Order { items = items == null ? List.of() : items; if (customerId == null || customerId.isBlank()) { @@ -73,7 +73,7 @@ public record FirstLegLoadingPlanCompletedV2( inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, null, items, customerId, customerName, - orderType, pallets, null); + orderType, pallets, null, null); } public Order(String sourceInboundId, String rootInboundId, @@ -88,7 +88,21 @@ public record FirstLegLoadingPlanCompletedV2( inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, null, items, customerId, customerName, - orderType, pallets, destinationType); + orderType, pallets, destinationType, null); + } + + public Order(String sourceInboundId, String rootInboundId, + String sourceOrderId, String sourceOrderNo, String rootOrderId, + String inboundCode, String destinationWarehouseId, + String destinationWarehouseCode, String destinationWarehouseName, + int packageCount, Integer productQuantity, Integer palletCount, + BigDecimal grossWeightKg, BigDecimal netWeightKg, BigDecimal volumeCbm, + BigDecimal volumeWeightKg, List items, String customerId, String customerName, + String orderType, List pallets, String destinationType) { + this(sourceInboundId, rootInboundId, sourceOrderId, sourceOrderNo, rootOrderId, + inboundCode, destinationWarehouseId, destinationWarehouseCode, destinationWarehouseName, + packageCount, productQuantity, palletCount, grossWeightKg, netWeightKg, volumeCbm, + volumeWeightKg, items, customerId, customerName, orderType, pallets, destinationType, null); } } diff --git a/deploy/sql/头程数据库统一增量-MySQL8.sql b/deploy/sql/头程数据库统一增量-MySQL8.sql index fbea23673..ffa0cb239 100644 --- a/deploy/sql/头程数据库统一增量-MySQL8.sql +++ b/deploy/sql/头程数据库统一增量-MySQL8.sql @@ -585,6 +585,7 @@ CREATE TABLE IF NOT EXISTS ord_order ( customs_inspection TINYINT(1) NULL COMMENT '是否需要商检:0否、1是', destination_type VARCHAR(24) NULL COMMENT '目的仓类型:FBA亚马逊仓、OVERSEAS海外仓、PRIVATE私人地址', fulfillment_type VARCHAR(32) NOT NULL DEFAULT 'STANDARD' COMMENT '履约类型:STANDARD普通头程、ONE_CLICK_DROPSHIP一键代发', + lx_code VARCHAR(128) NULL COMMENT '一件代发领星入库单代码', amazon_warehouse_code VARCHAR(32) NULL COMMENT 'Amazon目的仓编码', shipment_id VARCHAR(64) NULL COMMENT '订单级Amazon Shipment ID', reference_id VARCHAR(64) NULL COMMENT '订单级Amazon Reference ID', @@ -2545,6 +2546,7 @@ CREATE TABLE IF NOT EXISTS fl_inbound_order ( delivery_warehouse_name VARCHAR(128) NULL COMMENT '交货仓名称快照', business_type VARCHAR(32) NOT NULL COMMENT '业务类型', fulfillment_type VARCHAR(32) NOT NULL DEFAULT 'STANDARD' COMMENT '履约类型:STANDARD普通头程、ONE_CLICK_DROPSHIP一键代发', + lx_code VARCHAR(128) NULL COMMENT '一件代发领星入库单代码', channel_code VARCHAR(64) NULL COMMENT '渠道编码', channel_name VARCHAR(128) NULL COMMENT '渠道名称快照', carrier_id BIGINT UNSIGNED NULL COMMENT '计费船司逻辑ID', @@ -17911,3 +17913,10 @@ CREATE TABLE IF NOT EXISTS fin_wallet_event_outbox ( UNIQUE KEY uk_fin_wallet_event_key (event_key), KEY idx_fin_wallet_event_publish (status,next_retry_at,created_at) ) ENGINE=InnoDB COMMENT='国内Finance到海外资金结果可靠发送箱'; + +SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='baiyue_order' AND table_name='ord_order' AND column_name='lx_code'), 'SELECT 1', 'ALTER TABLE baiyue_order.ord_order ADD COLUMN lx_code VARCHAR(128) NULL COMMENT ''一件代发领星入库单代码'' AFTER fulfillment_type')); +PREPARE lx_order_ddl FROM @ddl; EXECUTE lx_order_ddl; DEALLOCATE PREPARE lx_order_ddl; +SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='baiyue_firstleg' AND table_name='fl_inbound_order' AND column_name='lx_code'), 'SELECT 1', 'ALTER TABLE baiyue_firstleg.fl_inbound_order ADD COLUMN lx_code VARCHAR(128) NULL COMMENT ''一件代发领星入库单代码'' AFTER fulfillment_type')); +PREPARE lx_inbound_ddl FROM @ddl; EXECUTE lx_inbound_ddl; DEALLOCATE PREPARE lx_inbound_ddl; +SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema='baiyue_lastleg' AND table_name='ll_outbound_order' AND column_name='lx_codes'), 'SELECT 1', 'ALTER TABLE baiyue_lastleg.ll_outbound_order ADD COLUMN lx_codes VARCHAR(1000) NULL COMMENT ''关联一件代发领星入库单代码汇总'' AFTER outbound_type')); +PREPARE lx_outbound_ddl FROM @ddl; EXECUTE lx_outbound_ddl; DEALLOCATE PREPARE lx_outbound_ddl; diff --git a/firstleg/src/main/java/com/baiyue/firstleg/dto/InboundOrderSummary.java b/firstleg/src/main/java/com/baiyue/firstleg/dto/InboundOrderSummary.java index e9071df30..c1ec62054 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/dto/InboundOrderSummary.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/dto/InboundOrderSummary.java @@ -17,7 +17,7 @@ public record InboundOrderSummary( Long customerId, String customerName, Long companyId, String companyName, Long warehouseId, String warehouseName, Long deliveryWarehouseId, String deliveryWarehouseName, - String businessType, String fulfillmentType, String channelCode, String channelName, + String businessType, String fulfillmentType, String lxCode, String channelCode, String channelName, String taxMode, String pricingTaxMode, String containerMode, Boolean customsInspection, String destinationType, Long destinationWarehouseId, String destinationCode, String destinationName, Boolean holdFlag, String currentHoldReason, @@ -57,6 +57,7 @@ public record InboundOrderSummary( order.getCompanyId(), order.getCompanyName(), order.getWarehouseId(), order.getWarehouseName(), order.getDeliveryWarehouseId(), order.getDeliveryWarehouseName(), order.getBusinessType(), order.getFulfillmentType(), + order.getLxCode(), order.getChannelCode(), order.getChannelName(), order.getTaxMode(), order.getPricingTaxMode(), order.getContainerMode(), order.getCustomsInspection(), order.getDestinationType(), order.getDestinationWarehouseId(), diff --git a/firstleg/src/main/java/com/baiyue/firstleg/dto/OrderApprovedInboundCommand.java b/firstleg/src/main/java/com/baiyue/firstleg/dto/OrderApprovedInboundCommand.java index 2f39754c9..5abaaa531 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/dto/OrderApprovedInboundCommand.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/dto/OrderApprovedInboundCommand.java @@ -34,7 +34,7 @@ public record OrderApprovedInboundCommand( Integer totalPackageCount, String pickupMethod, LocalDateTime requestedPickupAt, - String fulfillmentType, String lxCodes + String fulfillmentType, String lxCode ) { public OrderApprovedInboundCommand( long tenantId, long orderId, String orderNo, String inboundCode, Long customerId, String customerName, diff --git a/firstleg/src/main/java/com/baiyue/firstleg/entity/InboundOrderEntity.java b/firstleg/src/main/java/com/baiyue/firstleg/entity/InboundOrderEntity.java index f02add72e..6eb8842a7 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/entity/InboundOrderEntity.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/entity/InboundOrderEntity.java @@ -39,7 +39,7 @@ public class InboundOrderEntity extends BaseEntity { private String deliveryWarehouseName; private String businessType; private String fulfillmentType; - private String lxCodes; + private String lxCode; private String channelCode; private String channelName; private Long carrierId; diff --git a/firstleg/src/main/java/com/baiyue/firstleg/mapper/LoadingCompletedEventMapper.java b/firstleg/src/main/java/com/baiyue/firstleg/mapper/LoadingCompletedEventMapper.java index 60f52f5a7..dc62041cb 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/mapper/LoadingCompletedEventMapper.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/mapper/LoadingCompletedEventMapper.java @@ -23,7 +23,7 @@ public interface LoadingCompletedEventMapper { COALESCE(o.root_inbound_id, o.id) AS root_inbound_id, o.order_id AS source_order_id, o.order_no AS source_order_no, COALESCE(root_order.order_id, o.order_id) AS root_order_id, - o.inbound_code, o.business_type, o.fulfillment_type, o.destination_type, o.destination_warehouse_id, o.destination_code AS destination_warehouse_code, + o.inbound_code, o.business_type, o.fulfillment_type, o.lx_code, o.destination_type, o.destination_warehouse_id, o.destination_code AS destination_warehouse_code, o.destination_name AS destination_warehouse_name, i.id AS loading_plan_item_id, i.inbound_detail_id AS source_inbound_detail_id, i.sku_code, i.product_name_zh, i.product_name_en, i.package_count, i.product_quantity, @@ -127,7 +127,7 @@ public interface LoadingCompletedEventMapper { private Integer productQuantity; private Integer palletCount; private BigDecimal grossWeightKg; private BigDecimal netWeightKg; private BigDecimal dimensionalWeightKg; private BigDecimal volumeCbm; private String fbaTrackingNo; private String shipmentNo; private String shippingMark; - private String businessType; private String fulfillmentType; private String destinationType; + private String businessType; private String fulfillmentType; private String lxCode; private String destinationType; private String customerRemark; private String internalRemark; private String warehouseRemark; } diff --git a/firstleg/src/main/java/com/baiyue/firstleg/service/InboundOrderCreationService.java b/firstleg/src/main/java/com/baiyue/firstleg/service/InboundOrderCreationService.java index 4cd372692..e0db31b88 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/service/InboundOrderCreationService.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/service/InboundOrderCreationService.java @@ -69,7 +69,7 @@ public class InboundOrderCreationService { inbound.setDeliveryWarehouseName(command.deliveryWarehouseName()); inbound.setBusinessType(command.businessType()); inbound.setFulfillmentType(fulfillmentType(command.fulfillmentType())); - inbound.setLxCodes("ONE_CLICK_DROPSHIP".equals(inbound.getFulfillmentType()) ? command.lxCodes() : null); + inbound.setLxCode("ONE_CLICK_DROPSHIP".equals(inbound.getFulfillmentType()) ? command.lxCode() : null); inbound.setChannelCode(command.channelCode()); inbound.setChannelName(command.channelName()); inbound.setCarrierId(command.carrierId()); @@ -222,7 +222,7 @@ public class InboundOrderCreationService { inbound.setDeliveryWarehouseName(command.deliveryWarehouseName()); inbound.setBusinessType(command.businessType()); inbound.setFulfillmentType(fulfillmentType(command.fulfillmentType())); - inbound.setLxCodes("ONE_CLICK_DROPSHIP".equals(inbound.getFulfillmentType()) ? command.lxCodes() : null); + inbound.setLxCode("ONE_CLICK_DROPSHIP".equals(inbound.getFulfillmentType()) ? command.lxCode() : null); inbound.setChannelCode(command.channelCode()); inbound.setChannelName(command.channelName()); inbound.setCarrierId(command.carrierId()); diff --git a/firstleg/src/main/java/com/baiyue/firstleg/service/LoadingCompletedOutboxService.java b/firstleg/src/main/java/com/baiyue/firstleg/service/LoadingCompletedOutboxService.java index c99cdddc7..78d3eb0f2 100644 --- a/firstleg/src/main/java/com/baiyue/firstleg/service/LoadingCompletedOutboxService.java +++ b/firstleg/src/main/java/com/baiyue/firstleg/service/LoadingCompletedOutboxService.java @@ -141,7 +141,7 @@ public class LoadingCompletedOutboxService { sum(sorted, Row::getGrossWeightKg), sum(sorted, Row::getNetWeightKg), sum(sorted, Row::getVolumeCbm), sum(sorted, Row::getDimensionalWeightKg), items, string(first.getAccountId()), first.getCustomerName().trim(), orderType, pallets, - destinationType(sorted)); + destinationType(sorted), first.getLxCode()); } /** 只按 Warehouse 已分配的物理 palletId 计数;无分配事实时保持 null。 */ diff --git a/firstleg/src/main/resources/db/phase2-inbound-schema.sql b/firstleg/src/main/resources/db/phase2-inbound-schema.sql index cff43caec..cd8e62e7c 100644 --- a/firstleg/src/main/resources/db/phase2-inbound-schema.sql +++ b/firstleg/src/main/resources/db/phase2-inbound-schema.sql @@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS fl_inbound_order ( delivery_warehouse_name VARCHAR(128) NULL COMMENT '交货仓名称快照', business_type VARCHAR(32) NOT NULL COMMENT '业务类型', fulfillment_type VARCHAR(32) NOT NULL DEFAULT 'STANDARD' COMMENT '履约类型:STANDARD普通头程、ONE_CLICK_DROPSHIP一键代发', + lx_code VARCHAR(128) NULL COMMENT '一件代发领星入库单代码', channel_code VARCHAR(64) NULL COMMENT '渠道编码', channel_name VARCHAR(128) NULL COMMENT '渠道名称快照', carrier_id BIGINT UNSIGNED NULL COMMENT '计费船司逻辑ID', @@ -100,6 +101,15 @@ ALTER TABLE fl_inbound_order MODIFY COLUMN fulfillment_type VARCHAR(32) NOT NULL DEFAULT 'STANDARD' COMMENT '履约类型:STANDARD普通头程、ONE_CLICK_DROPSHIP一键代发'; +SET @inbound_lx_code_sql = IF( + EXISTS(SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='fl_inbound_order' AND column_name='lx_code'), + 'SELECT 1', + 'ALTER TABLE fl_inbound_order ADD COLUMN lx_code VARCHAR(128) NULL COMMENT ''一件代发领星入库单代码'' AFTER fulfillment_type' +); +PREPARE inbound_lx_code_stmt FROM @inbound_lx_code_sql; +EXECUTE inbound_lx_code_stmt; +DEALLOCATE PREPARE inbound_lx_code_stmt; + -- 既有开发库若存在跨客户重复码则严格失败,禁止自动覆盖或改写入仓码。 SET @inbound_global_code_index_sql = IF( NOT EXISTS( diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryRequests.java b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryRequests.java index 78b133d04..29bb07ab8 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryRequests.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryRequests.java @@ -36,11 +36,17 @@ public final class DeliveryRequests { @Size(max = 500) String remark) {} public record Query(@Min(1) long page, @Min(1) @Max(200) long size, - String documentNo, String warehouseId, String status, + String documentNo, String lxCode, String warehouseId, String status, String dispatchNo, String waybillNo, String vehiclePlate, String driverName, String deliveryMethod, LocalDateTime plannedFrom, LocalDateTime plannedTo) { public Query { if (page == 0) page = 1; if (size == 0) size = 20; } + public Query(long page, long size, String documentNo, String warehouseId, String status, + String dispatchNo, String waybillNo, String vehiclePlate, String driverName, + String deliveryMethod, LocalDateTime plannedFrom, LocalDateTime plannedTo) { + this(page, size, documentNo, null, warehouseId, status, dispatchNo, waybillNo, vehiclePlate, + driverName, deliveryMethod, plannedFrom, plannedTo); + } } public record PalletQuery(@Min(1) long page, @Min(1) @Max(200) long size, diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryResponses.java b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryResponses.java index ec83a3c31..0ec6b6c33 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryResponses.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/dto/DeliveryResponses.java @@ -11,7 +11,7 @@ public final class DeliveryResponses { String deliveryNo, String deliveryStatus, int palletCount, int packageCount, boolean replayed) {} - public record OutboundRow(Long id, String outboundNo, String dispatchNo, String overseasWarehouseId, + public record OutboundRow(Long id, String outboundNo, String dispatchNo, String overseasWarehouseId, String lxCodes, String status, int palletCount, int packageCount, LocalDateTime createdAt) {} public record DeliveryRow(Long id, String customerId, String customerName, String deliveryNo, diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/entity/OutboundOrder.java b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/entity/OutboundOrder.java index 1df985dac..aa3b792a6 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/entity/OutboundOrder.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/entity/OutboundOrder.java @@ -19,6 +19,7 @@ public class OutboundOrder { private String dispatchNo; private String overseasWarehouseId; private String outboundType; + private String lxCodes; private String recipientInfo; private String status; private Integer packageCount; diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/service/DeliveryTransferService.java b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/service/DeliveryTransferService.java index 59f1001b9..2d139ea87 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/service/DeliveryTransferService.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/delivery/service/DeliveryTransferService.java @@ -128,6 +128,7 @@ public class DeliveryTransferService { outbound.setOutboundNo(orderNoGenerator.next("OUTBOUND", dispatch.getOverseasWarehouseId(), outbound.getId())); outbound.setDispatchOrderId(dispatch.getId()); outbound.setDispatchNo(dispatch.getDispatchNo()); outbound.setOverseasWarehouseId(dispatch.getOverseasWarehouseId()); outbound.setStatus("WAIT_OUTBOUND"); outbound.setOutboundType("DISPATCH_DELIVERY"); + outbound.setLxCodes(items.stream().map(DispatchItem::getInboundCode).filter(StringUtils::hasText).map(code -> tailOrders.selectOne(new LambdaQueryWrapper().eq(LastlegOrder::getCustomerId, customerId).eq(LastlegOrder::getInboundCode, code))).filter(Objects::nonNull).map(LastlegOrder::getLxCode).filter(StringUtils::hasText).distinct().collect(java.util.stream.Collectors.joining(","))); outbound.setPackageCount(items.stream().map(DispatchItem::getPackageCount).filter(Objects::nonNull).mapToInt(Integer::intValue).sum()); outbound.setPalletCount(items.size()); outbound.setIdempotencyKey(request.idempotencyKey().trim()); outbound.setCreatedBy(operatorId); outbound.setCreatedAt(now); outbound.setUpdatedAt(now); @@ -467,6 +468,7 @@ public class DeliveryTransferService { Page page = outboundOrders.selectPage(new Page<>(query.page(), query.size()), new LambdaQueryWrapper().eq(StringUtils.hasText(customerId), OutboundOrder::getCustomerId, customerId) .like(StringUtils.hasText(query.documentNo()), OutboundOrder::getOutboundNo, query.documentNo()) + .like(StringUtils.hasText(query.lxCode()), OutboundOrder::getLxCodes, query.lxCode()) .eq(StringUtils.hasText(query.warehouseId()), OutboundOrder::getOverseasWarehouseId, query.warehouseId()) .eq(StringUtils.hasText(query.status()), OutboundOrder::getStatus, query.status()) .orderByDesc(OutboundOrder::getCreatedAt)); @@ -553,7 +555,7 @@ public class DeliveryTransferService { return new DeliveryResponses.TransferResult(o.getDispatchNo(), o.getOutboundNo(), o.getStatus(), d.getDeliveryNo(), d.getStatus(), o.getPalletCount(), o.getPackageCount(), replayed); } - private DeliveryResponses.OutboundRow outboundRow(OutboundOrder o) { return new DeliveryResponses.OutboundRow(o.getId(), o.getOutboundNo(), o.getDispatchNo(), o.getOverseasWarehouseId(), o.getStatus(), o.getPalletCount(), o.getPackageCount(), o.getCreatedAt()); } + private DeliveryResponses.OutboundRow outboundRow(OutboundOrder o) { return new DeliveryResponses.OutboundRow(o.getId(), o.getOutboundNo(), o.getDispatchNo(), o.getOverseasWarehouseId(), o.getLxCodes(), o.getStatus(), o.getPalletCount(), o.getPackageCount(), o.getCreatedAt()); } private DeliveryResponses.DeliveryRow deliveryRow(DeliveryOrder d) { return new DeliveryResponses.DeliveryRow(d.getId(), d.getCustomerId(), d.getCustomerName(), d.getDeliveryNo(), d.getOutboundNo(), d.getDispatchNo(), d.getOverseasWarehouseId(), d.getOverseasWarehouseName(), d.getStatus(), d.getWaybillNo(), d.getDeliveryMethod(), d.getCarrierName(), d.getPickupMethod(), d.getLoadingType(), d.getVehicleType(), d.getVehicleSize(), d.getVehiclePlate(), d.getDriverName(), d.getDriverPhone(), d.getAppointmentAccount(), d.getSellerName(), value(d.getPalletCount()), value(d.getPackageCount()), d.getTotalWeightKg(), d.getTotalVolumeCbm(), d.getPlannedDeliveryAt(), d.getDispatchedAt(), d.getExpectedArrivalAt(), d.getSignedAt(), d.getRemark(), d.getCreatedAt()); } private DeliveryResponses.DeliverySku sku(LastlegOrderDetail d, LastlegOrder order) { return new DeliveryResponses.DeliverySku(order == null ? null : order.getInboundCode(), order == null ? null : order.getCustomerName(), d.getDestinationWarehouseCode(), null, d.getShipmentNo(), d.getFbaTrackingNo(), d.getSkuCode(), firstText(d.getProductNameZh(), d.getProductNameEn()), value(d.getPackageCount()), d.getGrossWeightKg(), d.getVolumeCbm()); } private DeliveryResponses.DeliveryFeeRow feeRow(DeliveryFee f) { return new DeliveryResponses.DeliveryFeeRow(f.getId(), f.getFeeDirection(), f.getFeeType(), f.getCurrency(), f.getAmount(), f.getRemark()); } diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderRequests.java b/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderRequests.java index 9292e841f..604d581c9 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderRequests.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderRequests.java @@ -23,6 +23,7 @@ public final class LastlegOrderRequests { String orderNo, String orderType, String inboundCode, + String lxCode, String sourceOrderNo, String containerNo, String currentStatus, diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderSummary.java b/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderSummary.java index 6384a8b69..74f5b8425 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderSummary.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderSummary.java @@ -16,6 +16,7 @@ public record LastlegOrderSummary( String destinationType, String sourceInboundId, String inboundCode, + String lxCode, String sourceOrderNo, String customerId, String customerName, diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegInboundOrder.java b/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegInboundOrder.java index 7c7ce0bd6..0e00e7a44 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegInboundOrder.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegInboundOrder.java @@ -21,6 +21,7 @@ public class LastlegInboundOrder { private String sourceOrderNo; private String rootOrderId; private String inboundCode; + private String lxCode; private String destinationWarehouseId; private String destinationWarehouseCode; private String destinationWarehouseName; diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegOrder.java b/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegOrder.java index 4f48bb76c..360cf1313 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegOrder.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/entity/LastlegOrder.java @@ -15,6 +15,7 @@ public class LastlegOrder { private String orderNo; private String customerId; private String orderType; + private String lxCode; private String destinationType; private String inboundCode; private String sourceRegion; diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanListResponse.java b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanListResponse.java index d59689a19..87a48969b 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanListResponse.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanListResponse.java @@ -10,6 +10,7 @@ public record InboundPlanListResponse( String customerId, Long orderId, String inboundCode, + String lxCode, String orderType, String warehouseId, String warehouseCode, @@ -37,7 +38,7 @@ public record InboundPlanListResponse( String appointmentNo, String appointmentStatus, LocalDateTime appointmentAt, LocalDateTime expectedLoadingAt, String dispatchStatus, LocalDateTime createdAt) { - this(lineId, planId, planNo, customerId, orderId, inboundCode, orderType, warehouseId, + this(lineId, planId, planNo, customerId, orderId, inboundCode, null, orderType, warehouseId, warehouseCode, warehouseName, fbaWarehouseCode, customerName, packageCount, 0, volumeCbm, palletCount, status, appointmentNo, appointmentStatus, appointmentAt, expectedLoadingAt, dispatchStatus, createdAt, 0); diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanRequests.java b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanRequests.java index ae1024497..7e36da893 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanRequests.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/dto/InboundPlanRequests.java @@ -15,6 +15,7 @@ public final class InboundPlanRequests { @Min(1) @Max(200) long size, String planNo, String inboundCode, + String lxCode, String status, String overseasWarehouseId, String destinationWarehouseCode, @@ -27,6 +28,15 @@ public final class InboundPlanRequests { LocalDateTime createdFrom, LocalDateTime createdTo ) { + public Query(long page, long size, String planNo, String inboundCode, String status, + String overseasWarehouseId, String destinationWarehouseCode, String warehouse, + String fbaWarehouseCode, String appointmentStatus, String dispatchStatus, + LocalDateTime createdFrom, LocalDateTime createdTo) { + this(page, size, planNo, inboundCode, null, status, overseasWarehouseId, + destinationWarehouseCode, warehouse, fbaWarehouseCode, appointmentStatus, + dispatchStatus, createdFrom, createdTo); + } + public Query { if (page == 0) page = 1; if (size == 0) size = 20; diff --git a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/mapper/InboundPlanQueryMapper.java b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/mapper/InboundPlanQueryMapper.java index effaff3e2..7ee4ee6fb 100644 --- a/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/mapper/InboundPlanQueryMapper.java +++ b/lastleg-service/src/main/java/com/baiyue/lastleg/inboundplan/mapper/InboundPlanQueryMapper.java @@ -23,6 +23,7 @@ public interface InboundPlanQueryMapper { " WHERE 1=1" + " AND p.plan_no LIKE CONCAT('%',#{q.planNo},'%')" + " AND l.inbound_code LIKE CONCAT('%',#{q.inboundCode},'%')" + + " AND o.lx_code LIKE CONCAT('%',#{q.lxCode},'%')" + " AND p.status=#{q.status}" + " AND l.destination_warehouse_id=#{q.overseasWarehouseId}" + " AND l.destination_warehouse_code=#{q.destinationWarehouseCode}" + @@ -36,7 +37,7 @@ public interface InboundPlanQueryMapper { " AND p.created_at <=#{q.createdTo}"; @Select("