1.06 #10
3
db.sql
3
db.sql
@ -432,6 +432,9 @@ CREATE TABLE `t_order_declaration` (
|
||||
`ImHsCode` VARCHAR(50) NULL COMMENT '进口HsCode',
|
||||
`ExHsCode` VARCHAR(50) NULL COMMENT '出口HsCode',
|
||||
`DeclareElement` VARCHAR(255) NULL COMMENT '出口申报要素',
|
||||
`ProductId` VARCHAR(100) NULL COMMENT '产品标识编码',
|
||||
`NonStdProductId` VARCHAR(100) NULL COMMENT '非标产品标识编码',
|
||||
`StdProductId` VARCHAR(100) NULL COMMENT '标准产品标识编码',
|
||||
`SkuImage` VARCHAR(512) NULL COMMENT '图片(存 storage key 或短 URL)',
|
||||
`Category` VARCHAR(20) NULL COMMENT '类别',
|
||||
`Brand` VARCHAR(50) NULL COMMENT '品牌',
|
||||
|
||||
55
sql/migrate_order_declaration_product_ids_20261019.sql
Normal file
55
sql/migrate_order_declaration_product_ids_20261019.sql
Normal file
@ -0,0 +1,55 @@
|
||||
-- 申报明细:新增产品标识编码 / 非标产品标识编码 / 标准产品标识编码。
|
||||
-- 可重复执行。
|
||||
|
||||
SET @db := DATABASE();
|
||||
|
||||
-- t_order_declaration.ProductId
|
||||
SET @exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = @db
|
||||
AND TABLE_NAME = 't_order_declaration'
|
||||
AND COLUMN_NAME = 'ProductId'
|
||||
);
|
||||
SET @sql := IF(
|
||||
@exists = 0,
|
||||
'ALTER TABLE `t_order_declaration` ADD COLUMN `ProductId` VARCHAR(100) NULL COMMENT ''产品标识编码'' AFTER `DeclareElement`',
|
||||
'SELECT ''t_order_declaration.ProductId already exists'' AS info'
|
||||
);
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- t_order_declaration.NonStdProductId
|
||||
SET @exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = @db
|
||||
AND TABLE_NAME = 't_order_declaration'
|
||||
AND COLUMN_NAME = 'NonStdProductId'
|
||||
);
|
||||
SET @sql := IF(
|
||||
@exists = 0,
|
||||
'ALTER TABLE `t_order_declaration` ADD COLUMN `NonStdProductId` VARCHAR(100) NULL COMMENT ''非标产品标识编码'' AFTER `ProductId`',
|
||||
'SELECT ''t_order_declaration.NonStdProductId already exists'' AS info'
|
||||
);
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- t_order_declaration.StdProductId
|
||||
SET @exists := (
|
||||
SELECT COUNT(1)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = @db
|
||||
AND TABLE_NAME = 't_order_declaration'
|
||||
AND COLUMN_NAME = 'StdProductId'
|
||||
);
|
||||
SET @sql := IF(
|
||||
@exists = 0,
|
||||
'ALTER TABLE `t_order_declaration` ADD COLUMN `StdProductId` VARCHAR(100) NULL COMMENT ''标准产品标识编码'' AFTER `NonStdProductId`',
|
||||
'SELECT ''t_order_declaration.StdProductId already exists'' AS info'
|
||||
);
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
@ -70,6 +70,21 @@ public class OrderItemOutput
|
||||
/// </summary>
|
||||
public string? DeclareElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品标识编码。
|
||||
/// </summary>
|
||||
public string? ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 非标产品标识编码。
|
||||
/// </summary>
|
||||
public string? NonStdProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准产品标识编码。
|
||||
/// </summary>
|
||||
public string? StdProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SKU 图片。
|
||||
/// </summary>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Oms.Application.Dtos.Orders;
|
||||
|
||||
/// <summary>
|
||||
@ -65,6 +67,24 @@ public class OrderParcelItemInput
|
||||
/// </summary>
|
||||
public string? DeclareElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品标识编码(选填)。
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string? ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 非标产品标识编码(选填)。
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string? NonStdProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准产品标识编码(选填)。
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string? StdProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SKU 图片。
|
||||
/// </summary>
|
||||
|
||||
@ -199,6 +199,9 @@ public static class AutoTriggerFormulaMeta
|
||||
yield return ("进口HS编码", "t_order_declaration", "ImHsCode", FormulaValueType.String, false);
|
||||
yield return ("出口HS编码", "t_order_declaration", "ExHsCode", FormulaValueType.String, false);
|
||||
yield return ("出口申报要素", "t_order_declaration", "DeclareElement", FormulaValueType.String, false);
|
||||
yield return ("产品标识编码", "t_order_declaration", "ProductId", FormulaValueType.String, false);
|
||||
yield return ("非标产品标识编码", "t_order_declaration", "NonStdProductId", FormulaValueType.String, false);
|
||||
yield return ("标准产品标识编码", "t_order_declaration", "StdProductId", FormulaValueType.String, false);
|
||||
yield return ("申报类别", "t_order_declaration", "Category", FormulaValueType.String, false);
|
||||
yield return ("品牌", "t_order_declaration", "Brand", FormulaValueType.String, false);
|
||||
yield return ("品牌类型", "t_order_declaration", "BrandType", FormulaValueType.String, false);
|
||||
|
||||
@ -817,6 +817,9 @@ public partial class OrderService
|
||||
ImHsCode = x.ImHsCode ?? x.HsCode,
|
||||
ExHsCode = x.ExHsCode ?? x.HsCode,
|
||||
DeclareElement = x.DeclareElement,
|
||||
ProductId = x.ProductId,
|
||||
NonStdProductId = x.NonStdProductId,
|
||||
StdProductId = x.StdProductId,
|
||||
SkuImage = FileStorage.GetPublicUrl(x.SkuImage),
|
||||
Category = x.Category,
|
||||
Brand = x.Brand,
|
||||
|
||||
@ -1360,6 +1360,9 @@ public partial class OrderService
|
||||
ImHsCode = x.ImHsCode,
|
||||
ExHsCode = x.ExHsCode ?? x.ImHsCode,
|
||||
DeclareElement = x.DeclareElement,
|
||||
ProductId = x.ProductId?.Trim(),
|
||||
NonStdProductId = x.NonStdProductId?.Trim(),
|
||||
StdProductId = x.StdProductId?.Trim(),
|
||||
SkuImage = OmsObjectStorageExtensions.ToStorageKey(x.SkuImage),
|
||||
Category = x.Category,
|
||||
Brand = x.Brand,
|
||||
|
||||
@ -2213,6 +2213,9 @@ public partial class OrderService
|
||||
ImHsCode = x.ImHsCode,
|
||||
ExHsCode = x.ExHsCode,
|
||||
DeclareElement = x.DeclareElement,
|
||||
ProductId = x.ProductId?.Trim(),
|
||||
NonStdProductId = x.NonStdProductId?.Trim(),
|
||||
StdProductId = x.StdProductId?.Trim(),
|
||||
SkuImage = OmsObjectStorageExtensions.ToStorageKey(x.SkuImage),
|
||||
Category = x.Category,
|
||||
Brand = x.Brand,
|
||||
|
||||
@ -215,6 +215,9 @@ public static class OrderTemplateFieldRegistry
|
||||
Add("items[0].weight", "总重量(kg)", false, "number", group: "declaration", example: "自动计算", hint: "不填=单重×数量");
|
||||
Add("items[0].imHsCode", "进口HsCode", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].exHsCode", "出口HsCode", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].productId", "产品标识编码", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].nonStdProductId", "非标产品标识编码", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].stdProductId", "标准产品标识编码", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].skuImage", "商品图片URL", false, group: "declaration", hint: "选填");
|
||||
Add("items[0].category", "类别", false, group: "declaration", example: "Accessories", hint: "选填");
|
||||
Add("items[0].brand", "品牌", false, group: "declaration", example: "DemoBrand", hint: "选填");
|
||||
|
||||
@ -20,6 +20,7 @@ public static class OrderTemplateRowMapper
|
||||
"sender.countryCode", "sender.province", "sender.city", "sender.zipCode", "sender.streetAddress1",
|
||||
"sender.streetAddress2", "sender.streetAddress3", "sender.houseNumber", "items[0].cnName", "items[0].enName",
|
||||
"items[0].sku", "items[0].unit", "items[0].imHsCode", "items[0].exHsCode", "items[0].skuImage",
|
||||
"items[0].productId", "items[0].nonStdProductId", "items[0].stdProductId",
|
||||
"items[0].category", "items[0].brand", "items[0].brandType", "items[0].distribution", "items[0].material",
|
||||
"items[0].enMaterial", "items[0].purpose", "items[0].attributes", "items[0].originCountry", "items[0].salesLink",
|
||||
"items[0].model", "items[0].specifications", "items[0].comment"
|
||||
|
||||
@ -201,6 +201,9 @@ public static class OrderDownstreamCreateOneBodyBuilder
|
||||
ImHsCode = x.ImHsCode,
|
||||
ExHsCode = x.ExHsCode ?? x.HsCode,
|
||||
DeclareElement = x.DeclareElement,
|
||||
ProductId = x.ProductId,
|
||||
NonStdProductId = x.NonStdProductId,
|
||||
StdProductId = x.StdProductId,
|
||||
SkuImage = fileStorage?.GetPublicUrl(x.SkuImage) ?? x.SkuImage,
|
||||
Category = x.Category,
|
||||
Brand = x.Brand,
|
||||
|
||||
@ -37,6 +37,21 @@ public class OrderDeclaration : OmsAuditedEntity
|
||||
/// </summary>
|
||||
public string? DeclareElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品标识编码。
|
||||
/// </summary>
|
||||
public string? ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 非标产品标识编码。
|
||||
/// </summary>
|
||||
public string? NonStdProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准产品标识编码。
|
||||
/// </summary>
|
||||
public string? StdProductId { get; set; }
|
||||
|
||||
public string? SkuImage { get; set; }
|
||||
|
||||
public string? Category { get; set; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user