You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
4.9 KiB
C#

using DS.Module.Core.Extensions;
using FluentValidation;
namespace DS.WMS.Core.WmsModule.Dtos;
public class WmsOutPlanDetailInput
{
public Guid? WMSOUTDETAILID { get; set; }
/// <summary>
///
/// </summary>
public Guid? WMSPLANID { get; set; }
/// <summary>
///
/// </summary>
public Guid? WMSID { get; set; }
/// <summary>
///
/// </summary>
public string MBLNO { get; set; }= "";
/// <summary>
///
/// </summary>
public string CNTRNO { get; set; }= "";
/// <summary>
///
/// </summary>
public string MATERIALNO { get; set; }= "";
public string GoodsId { get; set; } = "";
/// <summary>
///
/// </summary>
public string GOODSCODE { get; set; }= "";
/// <summary>
///
/// </summary>
public string GOODSNAME { get; set; }= "";
/// <summary>
///
/// </summary>
public string GOODSHSCODE { get; set; } = "";
/// <summary>
///
/// </summary>
public decimal? KGS { get; set; } = 0;
/// <summary>
///
/// </summary>
public decimal? PKGS { get; set; }= 0;
/// <summary>
///
/// </summary>
public decimal? CBM { get; set; }= 0;
/// <summary>
///
/// </summary>
public string KINDPKGS { get; set; }= "";
/// <summary>
///
/// </summary>
public string STORAGEUNIT { get; set; } = "";
/// <summary>
///
/// </summary>
public decimal? STORAGEUNITCOUNT { get; set; }= 0;
/// <summary>
///
/// </summary>
public string RULEUNIT { get; set; } = "";
/// <summary>
///
/// </summary>
public decimal? RULEUNITCOUNT { get; set; }= 0;
/// <summary>
///
/// </summary>
public Guid? WMSPHYSICSID { get; set; }
/// <summary>
///
/// </summary>
public decimal? NETWEIGHT { get; set; } = 0;
/// <summary>
///
/// </summary>
public string CUSTOMNO { get; set; }= "";
/// <summary>
///
/// </summary>
public Guid? PLAN_BEFORE_DETAIL_GID { get; set; }
/// <summary>
///
/// </summary>
public string CUSTOMNO_OUT { get; set; }= "";
/// <summary>
///
/// </summary>
public string HZQDBH { get; set; }= "";
/// <summary>
///
/// </summary>
public DateTime? SBRQ { get; set; }
/// <summary>
///
/// </summary>
public decimal? RULEPRICE { get; set; }= 0;
/// <summary>
///
/// </summary>
public decimal? RULEAMOUNT { get; set; }= 0;
/// <summary>
///
/// </summary>
public Guid? OP { get; set; }
/// <summary>
///
/// </summary>
public string CUSTNO_OUT { get; set; }= "";
/// <summary>
///
/// </summary>
public decimal? SMALLPKGS { get; set; } = 0;
/// <summary>
///
/// </summary>
public decimal? MINPKGS { get; set; }= 0;
public string AREACODE{ get; set; }
/// <summary>
///
/// </summary>
public string GOODSMODEL { get; set; }= "";
/// <summary>
///
/// </summary>
public string TRUCKNO { get; set; }= "";
}
/// <summary>
/// 验证
/// </summary>
public class WmsOutPlanDetailInputValidator : AbstractValidator<WmsOutPlanDetailInput>
{
/// <summary>
/// 构造函数
/// </summary>
public WmsOutPlanDetailInputValidator()
{
this.RuleFor(o => o.PKGS)
.Custom((pkgs, context) => {
if (pkgs.IsNotNull())
{
if (pkgs.ToString().IsInt())
{
// if (weight.ToDecimal()<0)
// {
// context.AddFailure("车重必须为正整数!");
// }
}
else
{
context.AddFailure("件数必须为正整数!");
}
}
});
// this.RuleFor(o => o.STORAGEUNITCOUNT)
// .Custom((count, context) => {
// if (count.IsNotNull())
// {
// if (count.ToString().IsInt())
// {
// // if (weight.ToDecimal()<0)
// // {
// // context.AddFailure("车重必须为正整数!");
// // }
// }
// else
// {
// context.AddFailure("件数必须为正整数!");
// }
//
// }
// });
}
}