| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 | using OASystem.Domain.Entities.PersonnelModule;using OASystem.Domain.Enums;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace OASystem.Domain.ViewModels.PersonnelModule{    /// <summary>    /// 物品详细信息 View    /// </summary>    public class GoodsInfoView:Pm_GoodsInfo    {    }    #region 物品领用List    [SugarTable(tableName: "Pm_GoodsInfo", tableDescription: "物品信息表")]    public class GoodsListView    {        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        public string Name { get; set; }        public int Type { get; set; }        [SugarColumn(IsIgnore = true)]        public string TypeName { get; set; }        public decimal StockQuantity { get; set; }        public string Unit { get; set; }        //SugarColumn(IsIgnore = true),        [Navigate(NavigateType.OneToMany, nameof(GoodsListReceiveView.GoodsId))]        //[Navigate(NavigateType.OneToMany, nameof(GoodsListReceiveView.GoodsId), nameof(Id))]        public List<GoodsListReceiveView> Receives { get; set; }//注意禁止给books手动赋值        [SugarColumn(IsIgnore = true)]        public decimal WaitAuditQuantity        {            get            {                var quantity = 0.00M;                if (Receives.Count > 0)                {                    quantity = Receives.Sum(x => x.Quantity);                }                return quantity;            }        }        [SugarColumn(IsIgnore = true)]        public string StockQuantityLabel        {            get            {                return $"物品待审核数量:{WaitAuditQuantity.ToString("#0.00")}";            }        }        public int LastUpdateUserId { get; set; }        [Navigate(NavigateType.OneToOne, nameof(Type))]        public GoodsListSetDataView TypeData { get; set; }        [Navigate(NavigateType.OneToOne, nameof(LastUpdateUserId))]        public GoodsListUsersView UserData { get; set; }        public DateTime LastUpdateTime { get; set; }        public string Remark { get; set; }        public int IsDel { get; set; }    }    [SugarTable(tableName: "Pm_GoodsReceive", tableDescription: "物品领用表")]    public class GoodsListReceiveView    {        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        /// <summary>        /// 商品Id        /// Pm_GoodsInfo Id        /// </summary>        public int GoodsId { get; set; }        /// <summary>        /// 领用数量        /// </summary>        public decimal Quantity { get; set; }        /// <summary>        /// 审核状态        /// </summary>        public GoodsAuditEnum AuditStatus { get; set; } = GoodsAuditEnum.Pending;        public int IsDel { get; set; }    }    [SugarTable(tableName: "Sys_SetData", tableDescription: "")]    public class GoodsListSetDataView    {        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        /// <summary>        ///         /// </summary>        public string Name { get; set; }    }    [SugarTable(tableName: "Sys_Users", tableDescription: "")]    public class GoodsListUsersView    {        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        /// <summary>        ///         /// </summary>        public string CnName { get; set; }    }    #endregion    /// <summary>    /// 物品类型View    /// </summary>    [SugarTable("Sys_SetDataType")]    public class GoodsTypeView    {        /// <summary>        /// 物品类型Id        /// </summary>        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        public string Name { get; set; }        [Navigate(NavigateType.OneToMany, nameof(GoodsSubTypeView.STid))]        public List<GoodsSubTypeView> SubTypeItems { get; set; }        public string Remark { get; set; }                public int IsDel { get; set; }    }    /// <summary>    /// 物品Sub类型    /// View    /// </summary>    [SugarTable("Sys_SetData")]    public class GoodsSubTypeView    {        /// <summary>        /// 物品类型Id        /// </summary>        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]        public int Id { get; set; }        public int STid { get; set; }        public string Name { get; set; }        public int IsDel { get; set; }    }    public class GoodsReceiveView    {        public int Id { get; set; }        public int GroupId { get; set; }        public string GroupName { get; set; }        public int GoodsId { get; set; }        public string GoodsName { get; set; }        public decimal Quantity { get; set; }        public string Unit { get; set; }        public string Reason { get; set; }        public string Remark { get; set; }        public GoodsAuditEnum AuditStatus { get; set; }        public string AuditStatusText { get { return AuditStatus.GetEnumDescription(); } }        public string StatusDesc { get; set; }        public int AuditUserId { get; set; }        public string AuditUserName { get; set; }        public DateTime AuditTime { get; set; }        public string CreateUserName { get; set; }        public DateTime CreateTime { get; set; }    }    /// <summary>    ///     /// </summary>    public class GoodsReceiveListView: GoodsReceiveView    {        public string GoodsType { get; set; }        public string GoodsDetails { get; set; }        public GoodsStorageAuditPerView[] AuditPers { get; set; }        /// <summary>        /// 审核权限        /// true:有        /// false:无        /// </summary>        public bool IsAuditPer { get; set; } = false;    }    public class GoodsReceiveListMobileView : GoodsReceiveListView    {        public int GoodsTypeId { get; set; }        /// <summary>        /// 是否贵重物品        /// true:贵重物品        /// false:非贵重物品        /// </summary>        public bool IsValuable { get; set; } = false;        //public GoodsStorageAuditPerView[] AuditPers { get; set; }        /// <summary>        /// 审核权限        /// true:有        /// false:无        /// </summary>        public bool IsAuditPer { get; set; } = false;    }    /// <summary>    ///     /// </summary>    public class GoodsReceiveInfoView : GoodsReceiveView    {        public string GoodsStorageInfo { get; set; }        public object? QuantityInfos { get; set; }        public object? GoodsStorageInfoStr { get; set; }        public string GoodsType { get; set; }    }    public class GoodsReceiveInfoMobileView : GoodsReceiveInfoView    {        public string GroupName { get; set; }    }    /// <summary>    ///     /// </summary>    public class GoodsReceiveLinkStorageView    {        public int StorageId { get; set; }        public decimal Quantity { get; set; }    }    public class GoodsStorageExcelDownloadView    {        public int Id { get; set; }        public string Name { get; set; }        /// <summary>        /// 开始库存        /// </summary>        public decimal SQ_Total { get; set; }        /// <summary>        /// 入库库存        /// </summary>        public decimal SQ_Total1 { get; set; }        public string StorageLabel { get; set; }        public decimal OQ_Total { get; set; }        public string ReceiveLabel { get; set; }        public decimal StockQuantity { get; set; }        public string Unit { get; set; }    }    public class GoodsStorageListView    {        public int Id { get; set; }        public int GoodsId { get; set; }        public int GoodsType { get; set; }        public string GoodsName { get; set; }        public string BatchNo { 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 string StorageUserName { get; set; }        public string StorageTime { get; set; }        public string CreateUserName { get; set; }        public GoodsConfirmEnum ConfirmStatus { get; set; }        public string ConfirmStatusText        {            get            {                return ConfirmStatus.GetEnumDescription();            }        }        public string StatusDesc { get; set; }        public DateTime CreateTime { get; set; }        public string Remark { get; set; }        public GoodsStorageAuditPerView[] AuditPers { get; set; }    }    public class GoodsStorageAuditPerView    {        public bool AuditPer { get; set; }        public GoodsAuditDepEnum AuditDep { get; set; }        public string ButtonText { get; set; }    }    #region 审核部门View    public class GoodsAuditDepView    {        public GoodsAuditDepEnum AuditDep { get; set; }        public int[] AuditorIds { get; set; }    }    #endregion}
 |