修改提交

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
@@ -60,7 +60,7 @@ public interface FirstlegInboundClient {
Boolean customsInspection, String destinationType, Long destinationWarehouseId,
String destinationCode, String destinationName, String publicRemark,
String expressCompanyName, String expressTrackingNo, Integer totalPackageCount,
String pickupMethod, LocalDateTime requestedPickupAt, String fulfillmentType, String lxCodes
String pickupMethod, LocalDateTime requestedPickupAt, String fulfillmentType, String lxCode
) {
}
}
@@ -77,7 +77,7 @@ public final class OrderRequests {
@Schema(description = "Fulfillment type; omitted means STANDARD / 履约类型;省略时为普通头程", allowableValues = {"STANDARD", "ONE_CLICK_DROPSHIP"}, defaultValue = "STANDARD")
@Pattern(regexp = "STANDARD|ONE_CLICK_DROPSHIP") String fulfillmentType,
@Schema(description = "Lingxing inbound codes for one-click dropship; multiple values separated by comma, space or newline", maxLength = 1000)
@Size(max = 1000) String lxCodes,
@Size(max = 128) String lxCode,
@Schema(description = "Selected customer pickup address ID; required for PICKUP / 已选客户取货地址 ID;PICKUP 时必填")
@Min(1) Long senderAddressId,
@Schema(description = "Selected private destination address ID; required for PRIVATE / 已选私人目的仓地址 ID;PRIVATE 时必填")
@@ -52,7 +52,7 @@ public class OrderEntity extends BaseEntity {
private Boolean customsInspection;
private String destinationType;
private String fulfillmentType;
private String lxCodes;
private String lxCode;
private String amazonWarehouseCode;
private String shipmentId;
private String referenceId;
@@ -488,7 +488,7 @@ public class OrderApplicationService {
order.setContainerMode(request.containerMode()); order.setCustomsInspection(request.customsInspection());
order.setDestinationType(request.destinationType());
order.setFulfillmentType(fulfillmentType(request.fulfillmentType()));
order.setLxCodes("ONE_CLICK_DROPSHIP".equals(order.getFulfillmentType()) ? normalizeLxCodes(request.lxCodes()) : null);
order.setLxCode("ONE_CLICK_DROPSHIP".equals(order.getFulfillmentType()) ? normalizeLxCode(request.lxCode()) : null);
order.setAmazonWarehouseCode("FBA".equals(request.destinationType()) && snapshots.destination() != null
? snapshots.destination().warehouse().warehouseCode() : request.amazonWarehouseCode());
order.setShipmentId(request.shipmentId()); order.setReferenceId(request.referenceId());
@@ -520,10 +520,8 @@ public class OrderApplicationService {
throw new BizException(ResultCode.VALIDATION_FAILED,
"履约类型必须为 STANDARD 或 ONE_CLICK_DROPSHIP");
}
private static String normalizeLxCodes(String value) {
if (value == null || value.isBlank()) return null;
return java.util.Arrays.stream(value.trim().split("[,,\\s]+"))
.map(String::trim).filter(item -> !item.isEmpty()).distinct().collect(java.util.stream.Collectors.joining(","));
private static String normalizeLxCode(String value) {
return value == null || value.isBlank() ? null : value.trim();
}
private boolean legacyManualMode() {
return inboundCodeModeProvider.legacyManual();
@@ -689,7 +687,7 @@ public class OrderApplicationService {
order.getDestinationWarehouseId(), order.getAmazonWarehouseCode(), order.getDestinationWarehouseName(),
order.getCustomerRemark(), order.getExpressCompany(), order.getExpressTrackingNo(), totalPackageCount,
order.getPickupMethod(), order.getRequestedPickupAt(),
order.getFulfillmentType() == null ? "STANDARD" : order.getFulfillmentType(), order.getLxCodes());
order.getFulfillmentType() == null ? "STANDARD" : order.getFulfillmentType(), order.getLxCode());
}
private void prepareDraftInbound(OrderEntity order, OrderRequests.SaveRequest request) {
FirstlegInboundClient client = firstlegProvider == null ? null : firstlegProvider.getIfAvailable();
+1
View File
@@ -39,6 +39,7 @@ CREATE TABLE IF NOT EXISTS ord_order (
customs_inspection TINYINT(1) NULL COMMENT '是否商检',
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 '亚马逊仓库编码',
shipment_id VARCHAR(64) NULL COMMENT '订单级Amazon Shipment ID',
reference_id VARCHAR(64) NULL COMMENT '订单级Amazon Reference ID',
@@ -959,6 +959,11 @@ components:
fulfillmentType:
type: string
enum: [STANDARD, ONE_CLICK_DROPSHIP]
lxCode:
type: string
nullable: true
maxLength: 128
description: 一件代发绑定的领星入库单 LX 代码
default: STANDARD
description: 独立履约类型;省略为普通头程,不复用业务/计费 businessType
inboundCode: