using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; using WMS.Web.Core; using WMS.Web.Domain.Values; namespace WMS.Web.Domain.Entitys { /// /// 文件下载类型 /// [Serializable] [Table("t_wms_file_down_manager")] public class FileDownManager : EntityBase { public FileDownManager() { } public FileDownManager(int userId, int companyId, FileDownLoadOrderType type, string path, int? supplierId = null) { this.UserId = userId; this.CompanyId = companyId; this.Type = type; this.FilePath = path; this.SupplierId = supplierId; } /// /// 主键 订单编号 /// [Column("Id")] public override int Id { get; set; } /// /// 日期 /// [Column("Date")] public DateTime? Date { get; set; } = DateTime.Now; /// /// 单据类型(任务类型) /// [Column("Type")] public FileDownLoadOrderType Type { get; set; } = FileDownLoadOrderType.OutStockTask; /// /// 状态 /// [Column("Status")] public ExportStatus Status { get; set; } = ExportStatus.Ing; /// /// 公司Id /// [Column("CompanyId")] public int CompanyId { get; set; } /// /// 文件地址 /// [Column("FilePath")] public string FilePath { get; set; } /// /// 操作人 /// [Column("UserId")] public int UserId { get; set; } /// /// 失败原因 /// [Column("Reason")] public string Reason { get; set; } /// /// 是否供应商用户 /// [Column("SupplierId")] public int? SupplierId { get; set; } public void Finish(bool IsSuccess, string reson) { if (IsSuccess) this.Status = ExportStatus.Success; else { this.Status = ExportStatus.Fail; this.Reason = reson; } } } }