using DS.Module.Core; using FluentValidation; namespace DS.WMS.Core.Code.Dtos; /// /// 基础编码规则请求实体 /// public class CodeSequenceRuleReq { /// /// 主键Id /// public long Id { get; set; } /// /// 单据Id /// public long SequenceId { get; set; } /// /// 取规则类别,timestamp、const、number /// public string RuleType { get; set; } /// /// 规则参数,如 YYMMDD /// public string RuleValue { get; set; } /// /// 补齐方向,left或right /// public string PaddingSide { get; set; } /// /// 补齐宽度 /// public int PaddingWidth { get; set; } /// /// 填充字符 /// public string PaddingChar { get; set; } /// /// 排序 /// public int? OrderNo { get; set; } = 100; /// /// 状态 0 启用 1 禁用 /// public StatusEnum? Status { get; set; } = StatusEnum.Enable; /// /// 备注 /// public string Note { get; set; } = ""; } /// /// 验证 /// public class CodeSequenceRuleReqValidator : AbstractValidator { /// /// 构造函数 /// public CodeSequenceRuleReqValidator() { this.RuleFor(o => o.RuleType) .NotEmpty().WithName("取规则类别"); this.RuleFor(o => o.RuleValue) .NotEmpty().WithName("规则参数"); } }