新增专线小包标准模板生成、自定义列映射 API,并将 /order/upload 改为按映射解析 Excel 后走 CreateParcelCoreAsync;列表查询时自动补齐标准模板种子数据。 Co-authored-by: Cursor <cursoragent@cursor.com>
111 lines
2.8 KiB
C#
111 lines
2.8 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using Oms.Application.Services.Orders.Templates;
|
|
|
|
namespace Oms.Application.Dtos.Orders;
|
|
|
|
public class OrderTemplateFieldSchemaOutput
|
|
{
|
|
public string TemplateKey { get; set; } = string.Empty;
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
|
|
|
public List<OrderTemplateFieldSchemaItemOutput> Fields { get; set; } = [];
|
|
}
|
|
|
|
public class OrderTemplateFieldSchemaItemOutput
|
|
{
|
|
public string FieldKey { get; set; } = string.Empty;
|
|
|
|
public string Label { get; set; } = string.Empty;
|
|
|
|
public bool Required { get; set; }
|
|
|
|
public string DataType { get; set; } = "string";
|
|
|
|
public string? DictType { get; set; }
|
|
|
|
public string Group { get; set; } = string.Empty;
|
|
|
|
public string Example { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class OrderTemplateDictOptionsOutput
|
|
{
|
|
public List<OrderTemplateDictOptionOutput> Items { get; set; } = [];
|
|
}
|
|
|
|
public class OrderTemplateDictOptionOutput
|
|
{
|
|
public string DictType { get; set; } = string.Empty;
|
|
|
|
public string Code { get; set; } = string.Empty;
|
|
|
|
public string Label { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class OrderTemplateCustomUploadInput
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
public IFormFile File { get; set; } = null!;
|
|
}
|
|
|
|
public class OrderTemplateCustomUploadOutput
|
|
{
|
|
public int TemplateId { get; set; }
|
|
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
public string MappingStatus { get; set; } = OrderTemplateMappingStatus.Draft;
|
|
|
|
public List<string> SourceHeaders { get; set; } = [];
|
|
}
|
|
|
|
public class OrderTemplateCustomDetailOutput
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
public string Type { get; set; } = string.Empty;
|
|
|
|
public string? StandardTemplateKey { get; set; }
|
|
|
|
public string MappingStatus { get; set; } = OrderTemplateMappingStatus.Draft;
|
|
|
|
public string? SourceFileName { get; set; }
|
|
|
|
public List<string> SourceHeaders { get; set; } = [];
|
|
|
|
public OrderTemplateColumnMappingDocument? Mapping { get; set; }
|
|
|
|
public List<OrderTemplateFieldSchemaItemOutput> StandardFields { get; set; } = [];
|
|
}
|
|
|
|
public class OrderTemplateSaveMappingInput
|
|
{
|
|
public int TemplateId { get; set; }
|
|
|
|
public int HeaderRowIndex { get; set; } = 1;
|
|
|
|
public int DataStartRowIndex { get; set; } = 2;
|
|
|
|
public List<OrderTemplateSaveMappingItemInput> Mappings { get; set; } = [];
|
|
}
|
|
|
|
public class OrderTemplateSaveMappingItemInput
|
|
{
|
|
public string StandardFieldKey { get; set; } = string.Empty;
|
|
|
|
public string SourceColumn { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class OrderTemplateSaveMappingOutput
|
|
{
|
|
public int TemplateId { get; set; }
|
|
|
|
public string MappingStatus { get; set; } = OrderTemplateMappingStatus.Ready;
|
|
|
|
public List<string> MissingRequiredFields { get; set; } = [];
|
|
}
|