TaskEntity.cs 4.18 KB
using HHECS.Model.Common;
using HHECS.Model.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HHECS.Model.Entities
{
    /// <summary>
    /// 任务实体类,不继承basemodel
    /// </summary>
    [Table("task")]
    public class TaskEntity
    {
        private int id;

        private int warehouseId;

        private String warehouseCode;

        private int? companyId;

        private int priority;

        private int type;

        private int? station;

        private string port;

        private int? containerId;

        private String containerCode;

        private String roadway;

        private String sourceLocation;

        private String destinationLocation;

        private int lastStatus;

        private DateTime? created;

        private String createdBy;

        private DateTime? beginTime;

        private DateTime? endTime;

        private DateTime? lastUpdated;

        private String lastUpdatedBy;

        private String userDef1;

        private String userDef2;

        private String userDef3;

        public int Id { get => id; set => id = value; }
        public int WarehouseId { get => warehouseId; set => warehouseId = value; }
        public string WarehouseCode { get => warehouseCode; set => warehouseCode = value; }
        public int? CompanyId { get => companyId; set => companyId = value; }
        public int Priority { get => priority; set => priority = value; }
        public int Type { get => type; set => type = value; }
        public int? Station { get => station; set => station = value; }
        [NotMapped]
        public string Port { get => port; set => port = value; }
        public int? ContainerId { get => containerId; set => containerId = value; }
        public string ContainerCode { get => containerCode; set => containerCode = value; }
        public string Roadway { get => roadway; set => roadway = value; }        
        public string SourceLocation { get => sourceLocation; set => sourceLocation = value; }
        public string DestinationLocation { get => destinationLocation; set => destinationLocation = value; }
        public int LastStatus { get => lastStatus; set => lastStatus = value; }
        public DateTime? Created { get => created; set => created = value; }
        public string CreatedBy { get => createdBy; set => createdBy = value; }
        public DateTime? BeginTime { get => beginTime; set => beginTime = value; }
        public DateTime? EndTime { get => endTime; set => endTime = value; }
        public DateTime? LastUpdated { get => lastUpdated; set => lastUpdated = value; }
        public string LastUpdatedBy { get => lastUpdatedBy; set => lastUpdatedBy = value; }
        public string UserDef1 { get => userDef1; set => userDef1 = value; }
        public string UserDef2 { get => userDef2; set => userDef2 = value; }
        public string UserDef3 { get => userDef3; set => userDef3 = value; }

        /// <summary>
        /// 指示这条任务是否重入
        /// </summary>
        public int IsDoubleIn { get; set; }

        /// <summary>
        /// 如果重入,则代表重新选择的库位
        /// </summary>
        public string SecondDestinationLocation { get; set; }

        public int FirstStatus { get; set; }

        public int SendAgain { get; set; }

        #region 自定义属性

        /// <summary>
        /// 首状态描述
        /// </summary>
        [Editable(false)]
        public string FirstStatusDesc
        {
            get { return typeof(TaskEntityStatus).GetDescriptionString(FirstStatus); }
        }

        /// <summary>
        /// 首状态描述
        /// </summary>
        [Editable(false)]
        public string LastStatusDesc
        {
            get { return typeof(TaskEntityStatus).GetDescriptionString(LastStatus); }
        }

        /// <summary>
        /// 任务类型描述
        /// </summary>
        [Editable(false)]
        public string TaskTypeDesc
        {
            get { return typeof(TaskType).GetDescriptionString(type); }
        }

        #endregion
    }
}