208 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			208 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using Mysqlx.Crud;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace MasaBlazorApp3.Pojo
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    [Serializable]
							 | 
						|||
| 
								 | 
							
								    public class Premission
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public Premission Parent { get; set; } = null;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public void AddChild(Premission item)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            item.Parent = this;
							 | 
						|||
| 
								 | 
							
								            this.Items = this.Items.Concat(new Premission[] { item });
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public int Id { get; set; }
							 | 
						|||
| 
								 | 
							
								        public string PremissionName { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 菜单路径 
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        public string PremissionPath { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public IEnumerable<Premission> Items { get; set; } = Enumerable.Empty<Premission>();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public List<Premission> getAdminPremission()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var list = new List<Premission>();
							 | 
						|||
| 
								 | 
							
								            Premission q = new Premission
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 1,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "出库",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "take"
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            q.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 11,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "处方取药",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/take/order"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            q.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 12,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "调拨取药",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/take/invoice"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            q.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 13,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "抽屉取药",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/take/drawer"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            q.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 14,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "自选取药",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/take/self"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            q.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 15,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "取药记录",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/take/record/2"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            Premission j = new Premission
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 2,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "入库",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "add"
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								            j.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 21,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "调拨入库",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/add/invoice"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            //j.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            //{
							 | 
						|||
| 
								 | 
							
								            //    Id = 22,
							 | 
						|||
| 
								 | 
							
								            //    PremissionName = "请领入库",
							 | 
						|||
| 
								 | 
							
								            //    PremissionPath = "/add/apply"
							 | 
						|||
| 
								 | 
							
								            //});
							 | 
						|||
| 
								 | 
							
								            j.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 23,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "抽屉入库",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/add/drawer"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            j.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 24,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "入库记录",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/add/record/1"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            Premission h = new Premission
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 3,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "return"
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            h.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 31,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还药品(处方)",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/return/order"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            h.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 32,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还药品(记录)",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/return/byRecord"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            h.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 33,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还空瓶",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/return/empty"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            h.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 34,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还记录(药品)",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/return/record1/31"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            h.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 35,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "归还记录(空瓶)",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/return/record2/32"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            Premission k = new Premission
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 4,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "库存管理",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "stock"
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 41,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "库存列表",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/list"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 42,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "库位绑定",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/binding"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 43,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "库存盘点",
							 | 
						|||
| 
								 | 
							
								                //PremissionName = "盘点交接",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/check"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 44,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "盘点记录",
							 | 
						|||
| 
								 | 
							
								                //PremissionPath = "/stock/checkRecord"
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/record/4"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 45,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "药品信息",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/drug"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            k.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 46,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "药品标定",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/stock/biaoDing"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            Premission x = new Premission
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 5,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "系统管理",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "manage"
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								            x.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 51,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "用户管理",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/manage/user"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            x.AddChild(new Premission()
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Id = 52,
							 | 
						|||
| 
								 | 
							
								                PremissionName = "权限管理",
							 | 
						|||
| 
								 | 
							
								                PremissionPath = "/manage/role"
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								            list.Add(q);
							 | 
						|||
| 
								 | 
							
								            list.Add(j);
							 | 
						|||
| 
								 | 
							
								            list.Add(h);
							 | 
						|||
| 
								 | 
							
								            list.Add(k);
							 | 
						|||
| 
								 | 
							
								            list.Add(x);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            return list;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |