using System.Runtime.Serialization;
using DS.Module.Core.Data;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Info.Entity;
using SqlSugar;
namespace DS.WMS.Core.Application.Entity
{
///
/// 申请相关业务基类
///
public abstract class ApplicationBase : BaseOrgModelV2
{
///
/// 申请单编号
///
[SugarColumn(ColumnDescription = "申请单编号", Length = 50, IsNullable = false)]
public string ApplicationNO { get; set; } = string.Empty;
///
/// 申请单状态
///
[SugarColumn(ColumnDescription = "申请单状态", IsNullable = false)]
public virtual int Status { get; set; }
///
/// 客户ID
///
[SugarColumn(ColumnDescription = "客户ID", IsNullable = false)]
public long CustomerId { get; set; }
///
/// 客户
///
[Navigate(NavigateType.OneToOne, nameof(CustomerId))]
public InfoClient? Customer { get; set; }
///
/// 客户名称
///
[SugarColumn(ColumnDescription = "客户名称", Length = 200)]
public string? CustomerName { get; set; }
///
/// 客户银行账号ID
///
[SugarColumn(ColumnDescription = "客户银行账号ID", IsNullable = true)]
public long? CustomerBankId { get; set; }
///
/// 客户银行账号
///
[Navigate(NavigateType.OneToOne, nameof(CustomerBankId))]
public InfoClientBank? CustomerBank { get; set; }
///
/// 币别
///
[SugarColumn(ColumnDescription = "币别", IsNullable = true, Length = 3)]
public string? Currency { get; set; }
///
/// 所属分部
///
[SugarColumn(ColumnDescription = "所属分部", IsNullable = true)]
public long? SaleDeptId { get; set; }
///
/// 费用明细
///
[Navigate(NavigateType.OneToMany, nameof(ApplicationDetail.ApplicationId))]
public List Details { get; set; } = [];
[IgnoreDataMember, SugarColumn(IsIgnore = true)]
public int DetailCount { get; set; }
///
/// 提交类型
///
[IgnoreDataMember, SugarColumn(IsIgnore = true)]
public BuildOption BuildOption { get; set; } = BuildOption.Create;
}
///
/// 申请单扩展基类
///
public class ApplicationForm : ApplicationBase
{
///
/// 审核人
///
[SugarColumn(ColumnDescription = "审核人", IsNullable = true)]
public long? AuditerId { get; set; }
///
/// 审核人名称
///
[SugarColumn(ColumnDescription = "审核人名称", IsNullable = true)]
public string? AuditerName { get; set; }
///
/// 审核时间
///
[SugarColumn(ColumnDescription = "审核时间", IsNullable = true)]
public DateTime? AuditTime { get; set; }
///
/// 审核备注
///
[SugarColumn(ColumnDescription = "审核备注", Length = 200, IsNullable = true)]
public string? AuditRemark { get; set; }
///
/// 驳回原因
///
[SugarColumn(ColumnDescription = "驳回原因", Length = 200, IsNullable = true)]
public string? Reason { get; set; }
///
/// 是否已打印
///
[SugarColumn(ColumnDescription = "是否已打印", DefaultValue = "0")]
public bool IsPrinted { get; set; }
///
/// 打印次数
///
[SugarColumn(ColumnDescription = "打印次数", DefaultValue = "0")]
public int PrintTimes { get; set; }
///
/// 打印人
///
[SugarColumn(ColumnDescription = "打印人", IsNullable = true)]
public long? PrinterId { get; set; }
///
/// 打印人名称
///
[SugarColumn(ColumnDescription = "打印人名称", IsNullable = true)]
public string? PrinterName { get; set; }
///
/// 打印时间
///
[SugarColumn(ColumnDescription = "打印时间", IsNullable = true)]
public DateTime? PrintTime { get; set; }
///
/// 发票号
///
[SugarColumn(ColumnDescription = "发票号")]
public string? InvoiceNO { get; set; }
///
/// 发票日期
///
[SugarColumn(ColumnDescription = "发票日期")]
public DateTime? InvoiceDate { get; set; }
///
/// 开票金额
///
[SugarColumn(ColumnDescription = "开票金额")]
public decimal? InvoiceAmount { get; set; }
}
}