using DS.Module.Core.Extensions;
using FluentValidation;
namespace DS.WMS.Core.WmsModule.Dtos;
public class WmsOutPlanDetailInput
{
public Guid? WMSOUTDETAILID { get; set; }
///
///
///
public Guid? WMSPLANID { get; set; }
///
///
///
public Guid? WMSID { get; set; }
///
///
///
public string MBLNO { get; set; }= "";
///
///
///
public string CNTRNO { get; set; }= "";
///
///
///
public string MATERIALNO { get; set; }= "";
///
///
///
public string GOODSCODE { get; set; }= "";
///
///
///
public string GOODSNAME { get; set; }= "";
///
///
///
public string GOODSHSCODE { get; set; } = "";
///
///
///
public decimal? KGS { get; set; } = 0;
///
///
///
public decimal? PKGS { get; set; }= 0;
///
///
///
public decimal? CBM { get; set; }= 0;
///
///
///
public string KINDPKGS { get; set; }= "";
///
///
///
public string STORAGEUNIT { get; set; } = "";
///
///
///
public decimal? STORAGEUNITCOUNT { get; set; }= 0;
///
///
///
public string RULEUNIT { get; set; } = "";
///
///
///
public decimal? RULEUNITCOUNT { get; set; }= 0;
///
///
///
public Guid? WMSPHYSICSID { get; set; }
///
///
///
public decimal? NETWEIGHT { get; set; } = 0;
///
///
///
public string CUSTOMNO { get; set; }= "";
///
///
///
public Guid? PLAN_BEFORE_DETAIL_GID { get; set; }
///
///
///
public string CUSTOMNO_OUT { get; set; }= "";
///
///
///
public string HZQDBH { get; set; }= "";
///
///
///
public DateTime? SBRQ { get; set; }
///
///
///
public decimal? RULEPRICE { get; set; }= 0;
///
///
///
public decimal? RULEAMOUNT { get; set; }= 0;
///
///
///
public Guid? OP { get; set; }
///
///
///
public string CUSTNO_OUT { get; set; }= "";
///
///
///
public decimal? SMALLPKGS { get; set; } = 0;
///
///
///
public decimal? MINPKGS { get; set; }= 0;
public string AREACODE{ get; set; }
///
///
///
public string GOODSMODEL { get; set; }= "";
///
///
///
public string TRUCKNO { get; set; }= "";
}
///
/// 验证
///
public class WmsOutPlanDetailInputValidator : AbstractValidator
{
///
/// 构造函数
///
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("件数必须为正整数!");
// }
//
// }
// });
}
}