修改提交

This commit is contained in:
2026-09-06 16:02:11 +08:00
parent 3ae8964fe5
commit 9d213b3843
38 changed files with 177 additions and 44 deletions
@@ -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(),
@@ -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,
@@ -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;
@@ -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;
}
@@ -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());
@@ -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。 */
@@ -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(