You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
3 months ago
|
using FluentValidation;
|
||
|
using Kean.Domain.Order.Models;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Kean.Domain.Order.Commands
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 创建订单命令
|
||
|
/// </summary>
|
||
|
public class CreateOrderCommand : CommandValidator<CreateOrderCommand>, ICommand
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 类型
|
||
|
/// </summary>
|
||
|
public int Type { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 工作流
|
||
|
/// </summary>
|
||
|
public int Flow { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 单号
|
||
|
/// </summary>
|
||
|
public string No { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 制单人
|
||
|
/// </summary>
|
||
|
public string Creater { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 制单时间
|
||
|
/// </summary>
|
||
|
public DateTime? CreateTime { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 订单行
|
||
|
/// </summary>
|
||
|
public IEnumerable<OrderLine> Lines { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 验证项
|
||
|
/// </summary>
|
||
|
protected override void Validation()
|
||
|
{
|
||
|
RuleFor(r => r.Type).NotEmpty().WithMessage("类型不允许空");
|
||
|
//RuleFor(r => r.Flow).NotEmpty().WithMessage("工作流不允许空");
|
||
|
RuleFor(r => r.Lines).NotEmpty().WithMessage("订单行不允许空");
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 标识
|
||
|
/// </summary>
|
||
|
[Output]
|
||
|
public int Id { get; private set; }
|
||
|
}
|
||
|
}
|