All checks were successful
Build and Deploy / deploy (push) Successful in 1m16s
支持按模板批量出签,并补齐件重尺等字段与设计器预览字段。 Co-authored-by: Cursor <cursoragent@cursor.com>
207 lines
7.5 KiB
C#
207 lines
7.5 KiB
C#
namespace Oms.Application.Labeling;
|
|
|
|
/// <summary>
|
|
/// 设计器字段字典(与 PrintData camelCase 对齐)。
|
|
/// </summary>
|
|
public static class LabelFieldDictionary
|
|
{
|
|
public static IReadOnlyList<LabelFieldGroup> GetGroups() =>
|
|
[
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "numbers",
|
|
Title = "单号",
|
|
Fields =
|
|
[
|
|
// 按标题字符数升序:运单号/跟踪号/请求号(3) → 客户单号(4)
|
|
Field("serviceNo", "运单号"),
|
|
Field("trackNo", "跟踪号"),
|
|
Field("requestId", "请求号"),
|
|
Field("clientNo", "客户单号")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "product",
|
|
Title = "产品 / 渠道 / 仓库",
|
|
Fields =
|
|
[
|
|
Field("productCode", "产品编码"),
|
|
Field("salesProductName", "销售产品"),
|
|
Field("channelCode", "渠道编码"),
|
|
Field("channelName", "渠道名称"),
|
|
Field("warehouseName", "仓库"),
|
|
Field("customerCode", "客户编码"),
|
|
Field("customerName", "客户名称")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "recipient",
|
|
Title = "收件人",
|
|
Fields =
|
|
[
|
|
Field("recipientName", "收件人"),
|
|
Field("recipientCompany", "收件公司"),
|
|
Field("recipientPhone", "收件电话"),
|
|
Field("recipientEmail", "收件邮箱"),
|
|
Field("recipientZip", "邮编"),
|
|
Field("recipientCountry", "国家代码"),
|
|
Field("recipientCountryName", "国家名称"),
|
|
Field("recipientProvince", "省/州"),
|
|
Field("recipientCity", "城市"),
|
|
Field("recipientStreet1", "街道1"),
|
|
Field("recipientStreet2", "街道2"),
|
|
Field("recipientStreet3", "街道3"),
|
|
Field("recipientAddressFull", "完整地址"),
|
|
Field("recipientTaxNo", "税号"),
|
|
Field("vatNo", "VAT"),
|
|
Field("eori", "EORI")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "weight",
|
|
Title = "重量尺寸",
|
|
Fields =
|
|
[
|
|
Field("actualWeight", "实重"),
|
|
Field("volumetricWeight", "体积重"),
|
|
Field("chargeableWeight", "计费重"),
|
|
Field("length", "长"),
|
|
Field("width", "宽"),
|
|
Field("height", "高"),
|
|
Field("weightUnit", "重量单位"),
|
|
Field("dimUnit", "尺寸单位")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "inboundBox",
|
|
Title = "入库箱唛",
|
|
Fields =
|
|
[
|
|
Field("noticeNo", "预报单号"),
|
|
Field("markReference", "唛头参考"),
|
|
Field("markBoxNo", "箱唛号"),
|
|
Field("boxSeqNo", "箱序号"),
|
|
Field("boxCount", "箱子总数"),
|
|
Field("barcode", "条码内容"),
|
|
Field("boxIndexText", "箱序页码"),
|
|
Field("skuSummary", "SKU 摘要"),
|
|
Field("skuCode", "首 SKU 编码"),
|
|
Field("skuName", "首 SKU 名称"),
|
|
Field("skuQty", "首 SKU 数量"),
|
|
Field("weightG", "箱重量(g)"),
|
|
Field("lengthCm", "箱长(cm)"),
|
|
Field("widthCm", "箱宽(cm)"),
|
|
Field("heightCm", "箱高(cm)")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "warehouseSku",
|
|
Title = "库内 SKU",
|
|
Fields =
|
|
[
|
|
Field("skuCode", "SKU 编码"),
|
|
Field("skuName", "SKU 名称"),
|
|
Field("skuNameEn", "SKU 英文名"),
|
|
Field("barcode", "条码内容"),
|
|
Field("unitPrice", "单价"),
|
|
Field("exHsCode", "出口海关编码"),
|
|
Field("imHsCode", "进口海关编码"),
|
|
Field("declareElement", "申报要素"),
|
|
Field("weightG", "重量(g)"),
|
|
Field("lengthCm", "长(cm)"),
|
|
Field("widthCm", "宽(cm)"),
|
|
Field("heightCm", "高(cm)"),
|
|
Field("dimensions", "尺寸摘要"),
|
|
Field("remark", "备注")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "shipBag",
|
|
Title = "出库大包",
|
|
Fields =
|
|
[
|
|
Field("bagNo", "大包号"),
|
|
Field("bagType", "袋型编码"),
|
|
Field("bagTypeName", "袋型名称"),
|
|
Field("status", "状态"),
|
|
Field("barcode", "条码内容"),
|
|
Field("destinationCountry", "目的国"),
|
|
Field("destinationPort", "目的口岸"),
|
|
Field("channelCode", "渠道编码"),
|
|
Field("parcelCount", "件数"),
|
|
Field("weight", "重量(kg)"),
|
|
Field("length", "长(cm)"),
|
|
Field("width", "宽(cm)"),
|
|
Field("height", "高(cm)"),
|
|
Field("weightUnit", "重量单位"),
|
|
Field("dimUnit", "尺寸单位"),
|
|
Field("dimensions", "尺寸摘要"),
|
|
Field("warehouseName", "仓库"),
|
|
Field("sealTime", "封袋时间"),
|
|
Field("remark", "备注")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "shipMaster",
|
|
Title = "内部主单",
|
|
Fields =
|
|
[
|
|
Field("masterNo", "内部主单号"),
|
|
Field("externalMawb", "外部MAWB"),
|
|
Field("barcode", "条码内容"),
|
|
Field("status", "状态"),
|
|
Field("destinationCountry", "目的国"),
|
|
Field("destinationPort", "目的口岸"),
|
|
Field("flightOrVoyage", "航班/航次"),
|
|
Field("bagCount", "大包数"),
|
|
Field("parcelCount", "小包数"),
|
|
Field("weight", "重量(kg)"),
|
|
Field("length", "长(cm)"),
|
|
Field("width", "宽(cm)"),
|
|
Field("height", "高(cm)"),
|
|
Field("weightUnit", "重量单位"),
|
|
Field("dimUnit", "尺寸单位"),
|
|
Field("dimensions", "尺寸摘要"),
|
|
Field("warehouseName", "仓库"),
|
|
Field("sealTime", "封板时间"),
|
|
Field("handTime", "交运时间"),
|
|
Field("remark", "备注")
|
|
]
|
|
},
|
|
new LabelFieldGroup
|
|
{
|
|
Code = "system",
|
|
Title = "系统",
|
|
Fields =
|
|
[
|
|
Field("printTime", "打印时间"),
|
|
Field("operatorName", "操作人"),
|
|
Field("pageIndex", "页码"),
|
|
Field("pageCount", "总页数")
|
|
]
|
|
}
|
|
];
|
|
|
|
private static LabelFieldItem Field(string field, string title) => new() { Field = field, Title = title };
|
|
}
|
|
|
|
public sealed class LabelFieldGroup
|
|
{
|
|
public string Code { get; init; } = string.Empty;
|
|
public string Title { get; init; } = string.Empty;
|
|
public List<LabelFieldItem> Fields { get; init; } = [];
|
|
}
|
|
|
|
public sealed class LabelFieldItem
|
|
{
|
|
public string Field { get; init; } = string.Empty;
|
|
public string Title { get; init; } = string.Empty;
|
|
}
|