123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- using FluentValidation;
- using OASystem.Domain.Enums;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OASystem.Domain.Dtos.PersonnelModule
- {
- /// <summary>
- /// 物品DTO
- /// </summary>
- public class GoodsDto
- {
- }
- #region 物品 DTO
- /// <summary>
- /// 物品List DTO
- /// </summary>
- public class GoodsListDto : DtoBase
- {
- /// <summary>
- /// 类型Id
- /// 全部类型:""
- /// 其他类型:"1,2,3,4,5"
- /// </summary>
- public string TypeIds { get; set; }
- public string GoodsName { get; set; }
- }
- /// <summary>
- /// 物品 OP DTO
- /// </summary>
- public class GoodsOpDto
- {
- /// <summary>
- /// ID编号
- /// ID > 0 Edit
- /// ID < 1 Add
- /// </summary>
- public int Id { get; set; }
- /// <summary>
- /// 物品名称
- /// </summary>
- public string Name { get; set; }
- /// <summary>
- /// 类型
- /// </summary>
- public int Type { get; set; }
- /// <summary>
- /// 物品单位
- /// </summary>
- public string Unit { get; set; }
- /// <summary>
- /// 备注
- /// </summary>
- public string Remark { get; set; }
- }
- /// <summary>
- /// 物品 OP DTO
- /// Validator
- /// </summary>
- public class GoodsOPDTOValidator : AbstractValidator<GoodsOpDto>
- {
- /// <summary>
- /// 初始化
- /// </summary>
- public GoodsOPDTOValidator()
- {
- //RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
- RuleFor(x => x.Name).NotEmpty().WithMessage("物品名称为空!");
- RuleFor(x => x.Type).Must(x => x > 0).WithMessage("物品所属类型未选择!");
- }
- }
- #endregion
- #region 物品入库 DTO
- /// <summary>
- /// 物品入库List DTO
- /// </summary>
- public class GoodsStorageListDto : DtoBase
- {
- /// <summary>
- /// 物品Id
- /// </summary>
- public int GoodsId { get; set; }
- /// <summary>
- /// 入库批次号
- /// </summary>
- public string? BatchNo { get; set; }
- }
- /// <summary>
- /// 物品入库 操作(Create Or Edit)
- /// </summary>
- public class GoodsStorageOpDto
- {
- /// <summary>
- /// ID编号
- /// ID > 0 Edit
- /// ID < 1 Add
- /// </summary>
- public int Id { get; set; }
- /// <summary>
- /// 商品Id
- /// </summary>
- public int GoodsId { get; set; }
- /// <summary>
- /// 此次入库数量
- /// </summary>
- public decimal Quantity { get; set; }
- /// <summary>
- /// 此次物品单价
- /// </summary>
- public decimal UnitPrice { get; set; }
- /// <summary>
- /// 此次物品总价
- /// </summary>
- public decimal TotalPrice { get; set; }
- /// <summary>
- /// 此次供应商名称
- /// </summary>
- public string? SupplierName { get; set; }
- /// <summary>
- /// 此次供应商电话
- /// </summary>
- public string? SupplierTel { get; set; }
- /// <summary>
- /// 此次供应商地址
- /// </summary>
- public string? SupplierAddress { get; set; }
- /// <summary>
- /// 此次供应商来源
- /// </summary>
- public string? SupplierSource { get; set; }
- /// <summary>
- /// 入库人
- /// </summary>
- public int StorageUserId { get; set; }
-
- /// <summary>
- /// 入库时间
- /// eg:2024-10-01 15:00:00
- /// </summary>
- public string? StorageTime { get; set; }
- /// <summary>
- /// 备注
- /// </summary>
- public string? Remark { get; set; }
- }
- /// <summary>
- /// 物品入库 操作(Create Or Edit)
- /// Validator
- /// </summary>
- public class GoodsStorageOpDtoValidator : AbstractValidator<GoodsStorageOpDto>
- {
- /// <summary>
- /// 初始化
- /// </summary>
- public GoodsStorageOpDtoValidator()
- {
- //RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
- RuleFor(x => x.GoodsId).Must(x => x > 0).WithMessage("请传入有效的物品Id!");
- RuleFor(x => x.Quantity).Must(x => x > 0).WithMessage("请传入有效的物品数量!");
- RuleFor(x => x.UnitPrice).Must(x => x > 0).WithMessage("请传入有效的物品单价!");
- RuleFor(x => x.TotalPrice).Must(x => x > 0).WithMessage("请传入有效的物品价格合计!");
- RuleFor(x => x.StorageUserId).Must(x => x > 0).WithMessage("请传入有效用户Id!");
- RuleFor(x => x.StorageTime).NotEmpty().WithMessage("请传入有效的入库时间!");
- }
- }
- #endregion
- #region 物品领用
- /// <summary>
- /// 物品领用List DTO
- /// </summary>
- public class GoodsReceiveListDTO : DtoBase
- {
- /// <summary>
- /// 物品Id
- /// </summary>
- public int GoodsId { get; set; }
- /// <summary>
- /// 物品Name
- /// </summary>
- public string GoodsName { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- public string BeginDt { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- public string EndDt { get; set; }
- /// <summary>
- /// 团组Ids
- /// </summary>
- public string? GroupLabel { get; set; }
- /// <summary>
- /// 类型Ids
- /// </summary>
- public string? TypeLabel { get; set; }
- /// <summary>
- /// UserIds
- /// </summary>
- public string? UserLabel { get; set; }
- /// <summary>
- /// AuditIds
- /// </summary>
- public string AuditLabel { get; set; }
- }
- /// <summary>
- /// 物品领用 OP DTO
- /// </summary>
- public class GoodsReceiveOpDto
- {
- /// <summary>
- /// ID
- /// Id > 0 修改
- /// Id < 1 添加
- /// </summary>
- public int Id { get; set; }
- /// <summary>
- /// 团组Id
- /// Grp_DelegationInfo Id
- /// </summary>
- public int GroupId { get; set; }
- /// <summary>
- /// 商品Id
- /// Pm_GoodsInfo Id
- /// </summary>
- public int GoodsId { get; set; }
- /// <summary>
- /// 领用数量
- /// </summary>
- public decimal Quantity { get; set; }
- /// <summary>
- /// 领用原因
- /// </summary>
- public string? Reason { get; set; }
- /// <summary>
- /// 备注
- /// </summary>
- public string? Remark { get; set; }
- }
- /// <summary>
- /// 物品领用 OP
- /// Validator
- /// </summary>
- public class GoodsReceiveOpDtoValidator : AbstractValidator<GoodsReceiveOpDto>
- {
- /// <summary>
- /// 初始化
- /// </summary>
- public GoodsReceiveOpDtoValidator()
- {
- RuleFor(x => x.GoodsId).Must(x => x > 0).WithMessage("请传入有效的物品Id!");
- RuleFor(x => x.Quantity).Must(x => x > 0).WithMessage("请传入有效的物品数量!");
- RuleFor(x => x.Reason).NotEmpty().WithMessage("请填写领用原由!");
- }
- }
- /// <summary>
- /// 物品领用 Audit DTO
- /// </summary>
- public class GoodsReceiveAuditDTO
- {
- /// <summary>
- /// 数据ID string
- /// 1,2,3,4
- /// </summary>
- public string Label { get; set; }
- /// <summary>
- /// 审核状态
- /// </summary>
- public GoodsAuditEnum AuditEnum { get; set; }
- }
- /// <summary>
- /// 物品领用 Audit
- /// Validator
- /// </summary>
- public class GoodsReceiveAuditDTOValidator : AbstractValidator<GoodsReceiveAuditDTO>
- {
- /// <summary>
- /// 初始化
- /// </summary>
- public GoodsReceiveAuditDTOValidator()
- {
- RuleFor(x => x.Label).NotEmpty().WithMessage("数据ID字符串为空!");
- }
- }
- #endregion
- }
|