123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- 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
- {
-
-
-
- public class GoodsDto
- {
- }
- #region 物品 DTO
-
-
-
- public class GoodsListDto : DtoBase
- {
-
-
-
-
-
- public string TypeIds { get; set; }
- public string GoodsName { get; set; }
- }
-
-
-
- public class GoodsOpDto
- {
-
-
-
-
- public int Id { get; set; }
-
-
-
- public string Name { get; set; }
-
-
-
- public int Type { get; set; }
-
-
-
- public string Remark { get; set; }
- }
-
-
-
-
- public class GoodsOPDTOValidator : AbstractValidator<GoodsOpDto>
- {
-
-
-
- public GoodsOPDTOValidator()
- {
-
- RuleFor(x => x.Name).NotEmpty().WithMessage("物品名称为空!");
- RuleFor(x => x.Type).Must(x => x > 0).WithMessage("物品所属类型未选择!");
- }
- }
- #endregion
- #region 物品入库 DTO
-
-
-
- public class GoodsStorageListDto : DtoBase
- {
-
-
-
- public int GoodsId { get; set; }
-
-
-
- public string? BatchNo { get; set; }
- }
-
-
-
- public class GoodsStorageOpDto
- {
-
-
-
-
- public int Id { get; set; }
-
-
-
- public int GoodsId { get; set; }
-
-
-
- public decimal Quantity { get; set; }
-
-
-
- public decimal UnitPrice { get; set; }
-
-
-
- public decimal TotalPrice { get; set; }
-
-
-
- public string? SupplierName { get; set; }
-
-
-
- public string? SupplierTel { get; set; }
-
-
-
- public string? SupplierAddress { get; set; }
-
-
-
- public string? SupplierSource { get; set; }
-
-
-
- public int StorageUserId { get; set; }
-
-
-
-
-
- public string? StorageTime { get; set; }
-
-
-
- public string? Remark { get; set; }
- }
-
-
-
-
- public class GoodsStorageOpDtoValidator : AbstractValidator<GoodsStorageOpDto>
- {
-
-
-
- public GoodsStorageOpDtoValidator()
- {
-
- 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 物品领用
-
-
-
- public class GoodsReceiveListDTO : DtoBase
- {
-
-
-
- public int GoodsId { get; set; }
-
-
-
- public int CurrUserId { get; set; }
- }
-
-
-
- public class GoodsReceiveOpDto
- {
-
-
-
-
- public int Id { get; set; }
-
-
-
-
- public int GroupId { get; set; }
-
-
-
-
- public int GoodsId { get; set; }
-
-
-
- public decimal Quantity { get; set; }
-
-
-
- public string? Reason { get; set; }
-
-
-
- public string? Remark { get; set; }
- }
-
-
-
-
- public class GoodsReceiveOpDtoValidator : AbstractValidator<GoodsReceiveOpDto>
- {
-
-
-
- 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("请填写领用原由!");
- }
- }
-
-
-
- public class GoodsReceiveAuditDTO
- {
-
-
-
-
- public string Label { get; set; }
-
-
-
- public GoodsAuditEnum AuditEnum { get; set; }
- }
-
-
-
-
- public class GoodsReceiveAuditDTOValidator : AbstractValidator<GoodsReceiveAuditDTO>
- {
-
-
-
- public GoodsReceiveAuditDTOValidator()
- {
- RuleFor(x => x.Label).NotEmpty().WithMessage("数据ID字符串为空!");
- }
- }
- #endregion
- }
|