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
{
///
/// 物品DTO
///
public class GoodsDto
{
}
#region 物品 DTO
///
/// 物品List DTO
///
public class GoodsListDto : DtoBase
{
///
/// 类型Id
/// 全部类型:""
/// 其他类型:"1,2,3,4,5"
///
public string TypeIds { get; set; }
public string GoodsName { get; set; }
}
///
/// 物品 OP DTO
///
public class GoodsOpDto
{
///
/// ID编号
/// ID > 0 Edit
/// ID < 1 Add
///
public int Id { get; set; }
///
/// 物品名称
///
public string Name { get; set; }
///
/// 类型
///
public int Type { get; set; }
///
/// 物品单位
///
public string Unit { get; set; }
///
/// 备注
///
public string Remark { get; set; }
}
///
/// 物品 OP DTO
/// Validator
///
public class GoodsOPDTOValidator : AbstractValidator
{
///
/// 初始化
///
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
///
/// 物品入库List DTO
///
public class GoodsStorageListDto : DtoBase
{
///
/// 物品Id
///
public int GoodsId { get; set; }
///
/// 入库批次号
///
public string? BatchNo { get; set; }
}
///
/// 物品入库 操作(Create Or Edit)
///
public class GoodsStorageOpDto
{
///
/// ID编号
/// ID > 0 Edit
/// ID < 1 Add
///
public int Id { get; set; }
///
/// 商品Id
///
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; }
///
/// 入库时间
/// eg:2024-10-01 15:00:00
///
public string? StorageTime { get; set; }
///
/// 备注
///
public string? Remark { get; set; }
}
///
/// 物品入库 操作(Create Or Edit)
/// Validator
///
public class GoodsStorageOpDtoValidator : AbstractValidator
{
///
/// 初始化
///
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 物品领用
///
/// 物品领用List DTO
///
public class GoodsReceiveListDTO : DtoBase
{
///
/// 物品Id
///
public int GoodsId { get; set; }
///
/// 物品Name
///
public string GoodsName { get; set; }
///
/// 开始时间
///
public string BeginDt { get; set; }
///
/// 结束时间
///
public string EndDt { get; set; }
///
/// 团组Ids
///
public string? GroupLabel { get; set; }
///
/// 类型Ids
///
public string? TypeLabel { get; set; }
///
/// UserIds
///
public string? UserLabel { get; set; }
///
/// AuditIds
///
public string AuditLabel { get; set; }
}
///
/// 物品领用 OP DTO
///
public class GoodsReceiveOpDto
{
///
/// ID
/// Id > 0 修改
/// Id < 1 添加
///
public int Id { get; set; }
///
/// 团组Id
/// Grp_DelegationInfo Id
///
public int GroupId { get; set; }
///
/// 商品Id
/// Pm_GoodsInfo Id
///
public int GoodsId { get; set; }
///
/// 领用数量
///
public decimal Quantity { get; set; }
///
/// 领用原因
///
public string? Reason { get; set; }
///
/// 备注
///
public string? Remark { get; set; }
}
///
/// 物品领用 OP
/// Validator
///
public class GoodsReceiveOpDtoValidator : AbstractValidator
{
///
/// 初始化
///
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("请填写领用原由!");
}
}
///
/// 物品领用 Audit DTO
///
public class GoodsReceiveAuditDTO
{
///
/// 数据ID string
/// 1,2,3,4
///
public string Label { get; set; }
///
/// 审核状态
///
public GoodsAuditEnum AuditEnum { get; set; }
}
///
/// 物品领用 Audit
/// Validator
///
public class GoodsReceiveAuditDTOValidator : AbstractValidator
{
///
/// 初始化
///
public GoodsReceiveAuditDTOValidator()
{
RuleFor(x => x.Label).NotEmpty().WithMessage("数据ID字符串为空!");
}
}
#endregion
}