| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- using Muchinfo.MTPClient.Data.Helper;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Muchinfo.MTPClient.Data.Enums
- {
- // <summary>
- // 菜单总集合及ResourceCode
- // </summary>
- public class eSystemMenuValue
- {
- private volatile static eSystemMenuValue _instance = null;
- private static readonly object lockHelper = new object();
- // <summary>
- // The menu
- // </summary>
- public Dictionary<MenuCommandType, string> menu;
- // <summary>
- // The fixed menu list
- // </summary>
- public List<SysMenuItem> fixedMenuList;
- private List<SysMenuItem> _serviceMenus;
- /// <summary>
- /// 私有构造函数,初始化功能菜单
- /// </summary>
- private eSystemMenuValue()
- {
- //初始化本地菜单配置
- InitLocalFixedMenus();
- //初始化服务端菜单配置
- InitServiceMenus();
- //根据本地菜单及服务端菜单初始化全部菜单字典
- InitAllMenus();
- }
- #region MTP2.0
- /// <summary>
- /// 初始化本地固定菜单-根据资管菜单配置
- /// </summary>
- private void InitLocalFixedMenus()
- {
- //交易-本地固定菜单使用L开头
- var tradeMenuCode = "L00100000000";
- //公告通知-本地固定菜单使用M开头
- var noticeInfoMenuCode = "L00200000000";
- fixedMenuList = new List<SysMenuItem>()
- {
- new SysMenuItem("交易", MenuCommandType.Trade)// : 界面改版后。这里的买入卖出不需要了
- {
- FuncMenuCode = tradeMenuCode,
- SortId = -9999,
- Children = new List<SysMenuItem>()
- {
- new SysMenuItem("买入", MenuCommandType.BuyIn){ParentFuncMenuCode =tradeMenuCode , FuncMenuCode ="L00100010000"},
- new SysMenuItem("卖出", MenuCommandType.Sellout){ParentFuncMenuCode =tradeMenuCode , FuncMenuCode ="L00100020000"},
- new SysMenuItem("撤单", MenuCommandType.Cancel){ParentFuncMenuCode =tradeMenuCode , FuncMenuCode ="L00100030000"},
- }
- },
- //new SysMenuItem("公告通知", MenuCommandType.NoticeInform)
- //{
- // FuncMenuCode = noticeInfoMenuCode,
- // SortId = 9999,
- // Children = new List<SysMenuItem>()
- // {
- // new SysMenuItem("公告", MenuCommandType.Notice){ParentFuncMenuCode =tradeMenuCode , FuncMenuCode ="L00200010000"},
- // }
- //},
- };
- }
- /// <summary>
- /// 初始化服务端配置菜单-根据资管菜单配置
- /// </summary>
- private void InitServiceMenus()
- {
- //查询-服务配置菜单使用T开头
- var queryMenuCode = "T00500000000";
- //报表-服务配置菜单使用T开头
- var reportMenuCode = "T01500000000";
- _serviceMenus = new List<SysMenuItem>()
- {
- new SysMenuItem("查询", MenuCommandType.Query)
- {
- FuncMenuCode = queryMenuCode,
- Children = new List<SysMenuItem>()
- {
- new SysMenuItem("交易汇总", MenuCommandType.TradeSum){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500110000"},
- new SysMenuItem("账户资金", MenuCommandType.AccountInfo){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500120000"},
- new SysMenuItem("资金流水", MenuCommandType.QueryAmountLog){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500160000"},
- new SysMenuItem("委托单", MenuCommandType.EntrustOrder){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500130000"},
- new SysMenuItem("成交明细", MenuCommandType.TransactionOrder){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500140000"},
- new SysMenuItem("持仓汇总", MenuCommandType.Position){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500150000"},
- //new SysMenuItem("止盈止损", MenuCommandType.SPSLOrder){ParentFuncMenuCode =queryMenuCode , FuncMenuCode ="T00500170000"},
- }
- },
- //new SysMenuItem("报表", MenuCommandType.Report)
- //{
- // FuncMenuCode = reportMenuCode,
- // Children = new List<SysMenuItem>()
- // {
- // new SysMenuItem("结算单", MenuCommandType.ReckonReport){ParentFuncMenuCode =reportMenuCode , FuncMenuCode ="T01500010000"},
- // }
- //},
- };
- }
- /// <summary>
- /// 根据本地菜单及服务端菜单初始化全部菜单字典
- /// </summary>
- private void InitAllMenus()
- {
- menu = new Dictionary<MenuCommandType, string>();
- foreach (var item in fixedMenuList)
- {
- menu.Add(item.SysCommandType, item.FuncMenuCode);
- if (item.Children == null) continue;
- foreach (var subItem in item.Children)
- {
- menu.Add(subItem.SysCommandType, subItem.FuncMenuCode);
- }
- }
- foreach (var item in _serviceMenus)
- {
- menu.Add(item.SysCommandType, item.FuncMenuCode);
- if (item.Children == null) continue;
- foreach (var subItem in item.Children)
- {
- menu.Add(subItem.SysCommandType, subItem.FuncMenuCode);
- }
- }
- }
- #endregion
- #region MTP1.0
- private void InitMenus()
- {
- #region ///交易
- menu.Add(MenuCommandType.Trade, "T00100000000");
- var tradeMenu = new SysMenuItem("交易", MenuCommandType.Trade)
- {
- FuncMenuCode = "T00100000000",
- Children = new List<SysMenuItem>()
- };
- ///买入
- menu.Add(MenuCommandType.BuyIn, "T00100010000");
- var buyinMenu = new SysMenuItem("买入", MenuCommandType.BuyIn)
- {
- ParentFuncMenuCode = "T00100000000",
- FuncMenuCode = "T00100010000",
- Children = new List<SysMenuItem>()
- };
- tradeMenu.Children.Add(buyinMenu);
- ///卖出
- menu.Add(MenuCommandType.Sellout, "T00100020000");
- var selloutMenu = new SysMenuItem("卖出", MenuCommandType.Sellout)
- {
- ParentFuncMenuCode = "T00100000000",
- FuncMenuCode = "T00100020000",
- Children = new List<SysMenuItem>()
- };
- tradeMenu.Children.Add(selloutMenu);
- ///撤单
- menu.Add(MenuCommandType.Cancel, "T00100030000");
- var cancelMenu = new SysMenuItem("撤单", MenuCommandType.Cancel)
- {
- ParentFuncMenuCode = "T00100000000",
- FuncMenuCode = "T00100030000",
- Children = new List<SysMenuItem>()
- };
- tradeMenu.Children.Add(cancelMenu);
- ///协议转让
- menu.Add(MenuCommandType.DealClose, "T00100040000");
- fixedMenuList.Add(tradeMenu);
- #endregion
- #region ///查询
- menu.Add(MenuCommandType.Query, "T00200000000");
- var queryMenu = new SysMenuItem("查询", MenuCommandType.Query)
- {
- FuncMenuCode = "T00200000000",
- Children = new List<SysMenuItem>()
- };
- /// 交易汇总
- menu.Add(MenuCommandType.TradeSum, "T00200010001");
- var TradeSumMenu = new SysMenuItem("交易汇总", MenuCommandType.TradeSum)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200010001",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(TradeSumMenu);
- ///资金信息
- menu.Add(MenuCommandType.AccountInfo, "T00200010000");
- var accountInfoMenu = new SysMenuItem("资金信息", MenuCommandType.AccountInfo)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200010000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(accountInfoMenu);
- ///委托单
- menu.Add(MenuCommandType.EntrustOrder, "T00200020000");
- var entrustOrderMenu = new SysMenuItem("委托单", MenuCommandType.EntrustOrder)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200020000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(entrustOrderMenu);
- ///持仓汇总
- menu.Add(MenuCommandType.Position, "T00200030000");
- var holdDetailsMenu = new SysMenuItem("持仓汇总", MenuCommandType.Position)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200030000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(holdDetailsMenu);
- ///预埋单
- menu.Add(MenuCommandType.PrePostOrder, "T00200040000");
- ///成交明细
- menu.Add(MenuCommandType.TransactionOrder, "T00200050000");
- var transactionOrderMenu = new SysMenuItem("成交明细", MenuCommandType.TransactionOrder)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200050000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(transactionOrderMenu);
- ///资金流水
- menu.Add(MenuCommandType.QueryAmountLog, "T00200060000");
- var queryAmountLogMenu = new SysMenuItem("资金流水", MenuCommandType.QueryAmountLog)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200060000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(queryAmountLogMenu);
- //日报表
- menu.Add(MenuCommandType.DayReport, "T00200070000");
- var dayReportMenu = new SysMenuItem("日报表", MenuCommandType.DayReport)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200070000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(dayReportMenu);
- ///操作日志
- menu.Add(MenuCommandType.OperationLog, "T00200080000");
- var operationLogMenu = new SysMenuItem("操作日志", MenuCommandType.OperationLog)
- {
- ParentFuncMenuCode = "T00200000000",
- FuncMenuCode = "T00200080000",
- Children = new List<SysMenuItem>()
- };
- queryMenu.Children.Add(operationLogMenu);
- fixedMenuList.Add(queryMenu);
- #endregion
- #region ///仓单管理
- menu.Add(MenuCommandType.WarehouseManagement, "T00300000000");
- ///仓单
- menu.Add(MenuCommandType.WarehouseSearch, "T00300010000");
- ///提货单
- menu.Add(MenuCommandType.TakaDeliveryGoodsQuery, "T00300020000");
- #endregion
- #region ///交割管理
- menu.Add(MenuCommandType.DeliveryManage, "T00800000000");
- ///申报单
- menu.Add(MenuCommandType.DeliveryDeclarationSearch, "T00800010000");
- ///购销合同
- menu.Add(MenuCommandType.DeliveryOrderSearch, "T00800020000");
- #endregion
- #region ///公告通知
- menu.Add(MenuCommandType.NoticeInform, "T00500000000");
- var noticeInformMenu = new SysMenuItem("公告通知", MenuCommandType.NoticeInform)
- {
- FuncMenuCode = "T00500000000",
- Children = new List<SysMenuItem>()
- };
- ///公告
- menu.Add(MenuCommandType.Notice, "T00500010000");
- var noticeMenu = new SysMenuItem("公告", MenuCommandType.Notice)
- {
- ParentFuncMenuCode = "T00500000000",
- FuncMenuCode = "T00500010000",
- Children = new List<SysMenuItem>()
- };
- noticeInformMenu.Children.Add(noticeMenu);
- fixedMenuList.Add(noticeInformMenu);
- #endregion
- #region ///银行业务
- menu.Add(MenuCommandType.Apply, "T00600000000");
- var applyMenu = new SysMenuItem("银行业务", MenuCommandType.Apply)
- {
- FuncMenuCode = "T00600000000",
- Children = new List<SysMenuItem>()
- };
- ///出金申请
- menu.Add(MenuCommandType.AmountOutApply, "T00600010000");
- var amountOutApplyMenu = new SysMenuItem("出金申请", MenuCommandType.AmountOutApply)
- {
- ParentFuncMenuCode = "T00600000000",
- FuncMenuCode = "T00600010000",
- Children = new List<SysMenuItem>()
- };
- applyMenu.Children.Add(amountOutApplyMenu);
- ///入金申请
- menu.Add(MenuCommandType.AmountInApply, "T00600020000");
- var amountInApplyMenu = new SysMenuItem("入金申请", MenuCommandType.AmountInApply)
- {
- ParentFuncMenuCode = "T00600000000",
- FuncMenuCode = "T00600020000",
- Children = new List<SysMenuItem>()
- };
- applyMenu.Children.Add(amountInApplyMenu);
- ///出入金查询
- menu.Add(MenuCommandType.AmountQuety, "T00600030000");
- var amountQuetyMenu = new SysMenuItem("出入金查询", MenuCommandType.AmountQuety)
- {
- ParentFuncMenuCode = "T00600000000",
- FuncMenuCode = "T00600030000",
- Children = new List<SysMenuItem>()
- };
- applyMenu.Children.Add(amountQuetyMenu);
- ///签约信息/银行签约
- menu.Add(MenuCommandType.BankSign, "T00600040000");
- var bankSignMenu = new SysMenuItem("签约信息", MenuCommandType.BankSign)
- {
- ParentFuncMenuCode = "T00600000000",
- FuncMenuCode = "T00600040000",
- Children = new List<SysMenuItem>()
- };
- applyMenu.Children.Add(bankSignMenu);
- ///银行解约
- menu.Add(MenuCommandType.BankBreak, "T00600050000");
- var bankBreakMenu = new SysMenuItem("银行解约", MenuCommandType.BankBreak)
- {
- ParentFuncMenuCode = "T00600000000",
- FuncMenuCode = "T00600050000",
- Children = new List<SysMenuItem>()
- };
- applyMenu.Children.Add(bankBreakMenu);
- //资管注释“银行业务”
- fixedMenuList.Add(applyMenu);
- #endregion
- }
-
- #endregion
- /// <summary>
- /// 单例实例
- /// </summary>
- /// <returns>eSystemMenuValue.</returns>
- public static eSystemMenuValue CreateInstance()
- {
- if (_instance == null)
- {
- lock (lockHelper)
- {
- if (_instance == null)
- {
- _instance = new eSystemMenuValue();
- }
- }
- }
- return _instance;
- }
- }
- }
|