SysMenuSeedData.cs 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. // Ai-DOP 业务规划菜单种子(由 ai-dop-platform/tools/gen_aidop_menu.py 生成)
  2. namespace Admin.NET.Plugin.AiDOP;
  3. /// <summary>
  4. /// Ai-DOP 规划菜单;类名须为 SysMenuSeedData,以便租户默认菜单聚合所有程序集种子。
  5. /// </summary>
  6. [IncreSeed]
  7. public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
  8. {
  9. private const long AidopRootId = 1320990000101L;
  10. /// <inheritdoc />
  11. public IEnumerable<SysMenu> HasData()
  12. {
  13. var ct = DateTime.Parse("2022-02-10 00:00:00");
  14. var list = new List<SysMenu>
  15. {
  16. new()
  17. {
  18. Id = AidopRootId,
  19. Pid = 0,
  20. Title = "Ai-DOP",
  21. Path = "/aidop",
  22. Name = "aidopRoot",
  23. Component = "Layout",
  24. Icon = "ele-Grid",
  25. Type = MenuTypeEnum.Dir,
  26. CreateTime = ct,
  27. OrderNo = 250,
  28. Remark = "Ai-DOP 主菜单(规划项,叶子为占位页)"
  29. }
  30. };
  31. var dirSeq = 0;
  32. var menuSeq = 0;
  33. foreach (var mod in ModuleDefinitions)
  34. {
  35. dirSeq++;
  36. var dirId = 1321000000000L + dirSeq * 1000L;
  37. var modCode = mod.Code;
  38. var codeLower = mod.Code.ToLowerInvariant();
  39. list.Add(new SysMenu
  40. {
  41. Id = dirId,
  42. Pid = AidopRootId,
  43. Title = mod.L1,
  44. Path = $"/aidop/{codeLower}",
  45. Name = $"aidopDir{mod.Code}",
  46. Component = "Layout",
  47. Icon = "ele-Folder",
  48. Type = MenuTypeEnum.Dir,
  49. CreateTime = ct,
  50. OrderNo = 260 + dirSeq
  51. });
  52. var subOrder = 100;
  53. var idx = 0;
  54. foreach (var leaf in mod.Leaves)
  55. {
  56. menuSeq++;
  57. idx++;
  58. var isDir = DirOverrides.Contains((modCode, idx));
  59. var component = isDir ? "Layout" : ResolveComponent(modCode, idx);
  60. var menuType = isDir ? MenuTypeEnum.Dir : MenuTypeEnum.Menu;
  61. var path = PathOverrides.TryGetValue((modCode, idx), out var pathOv) ? pathOv : $"/aidop/{codeLower}/{idx:000}";
  62. var routeName = NameOverrides.TryGetValue((modCode, idx), out var nameOv) ? nameOv : $"aidop{mod.Code}{idx:000}";
  63. list.Add(new SysMenu
  64. {
  65. Id = 1322000000000L + menuSeq,
  66. Pid = dirId,
  67. Title = leaf.Title,
  68. Path = path,
  69. Name = routeName,
  70. Component = component,
  71. Type = menuType,
  72. CreateTime = ct,
  73. OrderNo = subOrder++,
  74. Icon = isDir ? "ele-Folder" : "ele-Document",
  75. Remark = BuildRemark(mod.Code, leaf)
  76. });
  77. }
  78. }
  79. foreach (var m in BuildAidopSmartOpsSeedMenus(ct))
  80. list.Add(m);
  81. foreach (var m in BuildS0SalesMenus(ct))
  82. list.Add(m);
  83. foreach (var m in BuildS0SupplyMenus(ct))
  84. list.Add(m);
  85. foreach (var m in BuildS0ManufacturingMenus(ct))
  86. list.Add(m);
  87. foreach (var m in BuildS0QualityMenus(ct))
  88. list.Add(m);
  89. foreach (var m in BuildS0WarehouseMenus(ct))
  90. list.Add(m);
  91. foreach (var m in BuildS1OrderWorkOrderMenus(ct))
  92. list.Add(m);
  93. foreach (var m in BuildS2ManufacturingCollaborationMenus(ct))
  94. list.Add(m);
  95. foreach (var m in BuildS3SupplyMenus(ct))
  96. list.Add(m);
  97. foreach (var m in BuildS1SalesKanbanMenus(ct))
  98. list.Add(m);
  99. foreach (var m in BuildS8CollaborationMenus(ct))
  100. list.Add(m);
  101. // 产销协同看板改为目录后,访问 /aidop/s1/SalesKanBan 默认进入指标看板子页
  102. var salesKanBanDir = list.FirstOrDefault(x => x.Id == 1322000000005L);
  103. if (salesKanBanDir != null)
  104. salesKanBanDir.Redirect = "/aidop/s1/SalesKanBan/kanban";
  105. // S2:生产排程 / 作业计划 / 制造协同看板 为目录,默认进入各自首子页
  106. var s2ProdSched = list.FirstOrDefault(x => x.Id == 1322000000006L);
  107. if (s2ProdSched != null)
  108. s2ProdSched.Redirect = "/aidop/s2/production-scheduling/work-order-scheduling";
  109. var s2OpPlan = list.FirstOrDefault(x => x.Id == 1322000000007L);
  110. if (s2OpPlan != null)
  111. s2OpPlan.Redirect = "/aidop/s2/operation-plan/executable-daily-plan";
  112. var s2MfgKanban = list.FirstOrDefault(x => x.Id == 1322000000008L);
  113. if (s2MfgKanban != null)
  114. s2MfgKanban.Redirect = "/aidop/s2/collaboration-kanban/work-order-progress";
  115. var s3MaterialPlan = list.FirstOrDefault(x => x.Id == 1322000000009L);
  116. if (s3MaterialPlan != null)
  117. s3MaterialPlan.Redirect = "/aidop/s3/material-plan/demand-schedule";
  118. var s3Procurement = list.FirstOrDefault(x => x.Id == 1322000000010L);
  119. if (s3Procurement != null)
  120. {
  121. s3Procurement.Title = "采购管理";
  122. s3Procurement.Path = "/aidop/s3/procurement";
  123. s3Procurement.Name = "aidopS3Procurement";
  124. s3Procurement.Component = "Layout";
  125. s3Procurement.Icon = "ele-Folder";
  126. s3Procurement.Type = MenuTypeEnum.Dir;
  127. s3Procurement.Redirect = "/aidop/s3/procurement/purchase-request";
  128. s3Procurement.Remark = "S3 采购管理";
  129. }
  130. // S8:复用自动生成的首项菜单位,直接作为「异常监控看板」页,避免再出现中间层「异常管理」目录
  131. var s8Dashboard = list.FirstOrDefault(x => x.Id == 1322000000027L);
  132. if (s8Dashboard != null)
  133. {
  134. s8Dashboard.Title = "异常监控看板";
  135. s8Dashboard.Path = "/aidop/s8/dashboard";
  136. s8Dashboard.Name = "aidopS8Dashboard";
  137. s8Dashboard.Component = "/aidop/s8/dashboard/S8DashboardPage";
  138. s8Dashboard.Icon = "ele-DataBoard";
  139. s8Dashboard.Type = MenuTypeEnum.Menu;
  140. s8Dashboard.Redirect = null;
  141. s8Dashboard.Remark = "S8 异常监控看板";
  142. }
  143. return list;
  144. }
  145. /// <summary>
  146. /// 智慧诊断 + 智慧运营看板(入库,便于平台「菜单管理」配置;勿在 Web aidopMenuDisplay 再注入整段菜单)。
  147. /// </summary>
  148. private static IEnumerable<SysMenu> BuildAidopSmartOpsSeedMenus(DateTime ct)
  149. {
  150. const long smartOpsDirId = 1320990000200L;
  151. yield return new SysMenu
  152. {
  153. Id = 1320990000201L,
  154. Pid = AidopRootId,
  155. Title = "智慧诊断",
  156. Path = "/aidop/smart-diagnosis",
  157. Name = "aidopSmartDiagnosis",
  158. Component = "/aidop/diagnosis/index",
  159. Icon = "ele-TrendCharts",
  160. Type = MenuTypeEnum.Menu,
  161. CreateTime = ct,
  162. OrderNo = 251,
  163. Remark = "Ai-DOP 智慧诊断"
  164. };
  165. yield return new SysMenu
  166. {
  167. Id = smartOpsDirId,
  168. Pid = AidopRootId,
  169. Title = "智慧运营看板",
  170. Path = "/aidop/smart-ops",
  171. Name = "aidopSmartOpsRoot",
  172. Component = "Layout",
  173. Icon = "ele-DataBoard",
  174. Type = MenuTypeEnum.Dir,
  175. CreateTime = ct,
  176. OrderNo = 252,
  177. Remark = "Ai-DOP 智慧运营看板分组"
  178. };
  179. // OrderNo:建模紧接九宫格之后,避免在侧栏最底部不易发现;已落库环境需在菜单管理调序或改库
  180. var children = new (long Id, string Path, string Name, string Title, string Component, int Order)[]
  181. {
  182. (1320990000301L, "/aidop/smart-ops/grid", "aidopSmartOpsGrid", "九宫格智慧运营看板", "/dashboard/home", 100),
  183. (1320990000311L, "/aidop/smart-ops/modeling", "aidopSmartOpsModeling", "运营指标建模", "/aidop/kanban/s0", 105),
  184. (1320990000312L, "/aidop/smart-ops/kpi-master", "aidopSmartOpsKpiMaster", "运营指标主数据", "/aidop/kanban/kpiMaster", 106),
  185. (1320990000313L, "/aidop/smart-ops/business-fact", "aidopSmartOpsBusinessFact", "业务事实字典", "/aidop/kanban/businessFact", 107),
  186. (1320990000302L, "/aidop/smart-ops/s1", "aidopSmartOpsS1", "S1产销协同看板", "/aidop/kanban/s1", 110),
  187. (1320990000303L, "/aidop/smart-ops/s2", "aidopSmartOpsS2", "S2制造协同看板", "/aidop/kanban/s2", 120),
  188. (1320990000304L, "/aidop/smart-ops/s3", "aidopSmartOpsS3", "S3供应协同看板", "/aidop/kanban/s3", 130),
  189. (1320990000305L, "/aidop/smart-ops/s4", "aidopSmartOpsS4", "S4采购执行看板", "/aidop/kanban/s4", 140),
  190. (1320990000306L, "/aidop/smart-ops/s5", "aidopSmartOpsS5", "S5物料仓储看板", "/aidop/kanban/s5", 150),
  191. (1320990000307L, "/aidop/smart-ops/s6", "aidopSmartOpsS6", "S6生产执行看板", "/aidop/kanban/s6", 160),
  192. (1320990000308L, "/aidop/smart-ops/s7", "aidopSmartOpsS7", "S7成品仓储看板", "/aidop/kanban/s7", 170),
  193. (1320990000309L, "/aidop/smart-ops/s8", "aidopSmartOpsS8", "S8异常监控看板", "/aidop/kanban/s8", 180),
  194. (1320990000310L, "/aidop/smart-ops/s9", "aidopSmartOpsS9", "S9运营指标看板", "/aidop/kanban/s9", 190),
  195. };
  196. foreach (var (id, path, name, title, component, order) in children)
  197. {
  198. yield return new SysMenu
  199. {
  200. Id = id,
  201. Pid = smartOpsDirId,
  202. Title = title,
  203. Path = path,
  204. Name = name,
  205. Component = component,
  206. Icon = "ele-DataAnalysis",
  207. Type = MenuTypeEnum.Menu,
  208. CreateTime = ct,
  209. OrderNo = order,
  210. Remark = title
  211. };
  212. }
  213. }
  214. private static string ResolveComponent(string modCode, int leafIndex) =>
  215. ComponentOverrides.TryGetValue((modCode, leafIndex), out var c) ? c : "/aidop/planning/index";
  216. private static readonly Dictionary<(string Mod, int Leaf), string> ComponentOverrides = new()
  217. {
  218. { ("S1", 3), "/aidop/kanban/s1" },
  219. };
  220. /// <summary>S1 等模块下叶子菜单 path 覆盖(目录化后使用语义路径)。</summary>
  221. private static readonly Dictionary<(string Mod, int Leaf), string> PathOverrides = new()
  222. {
  223. { ("S1", 1), "/aidop/s1/order-mgmt" },
  224. { ("S1", 2), "/aidop/s1/workorder-mgmt" },
  225. { ("S1", 3), "/aidop/s1/SalesKanBan" },
  226. { ("S2", 1), "/aidop/s2/production-scheduling" },
  227. { ("S2", 2), "/aidop/s2/operation-plan" },
  228. { ("S2", 3), "/aidop/s2/collaboration-kanban" },
  229. { ("S3", 1), "/aidop/s3/material-plan" },
  230. };
  231. /// <summary>S1 等模块下叶子菜单 route name 覆盖。</summary>
  232. private static readonly Dictionary<(string Mod, int Leaf), string> NameOverrides = new()
  233. {
  234. { ("S1", 1), "aidopS1OrderMgmt" },
  235. { ("S1", 2), "aidopS1WorkOrderMgmt" },
  236. { ("S2", 1), "aidopS2ProductionScheduling" },
  237. { ("S2", 2), "aidopS2OperationPlan" },
  238. { ("S2", 3), "aidopS2CollaborationKanban" },
  239. { ("S3", 1), "aidopS3MaterialPlan" },
  240. };
  241. /// <summary>
  242. /// 需要从 Menu 提升为 Dir(目录)的叶子节点;用于承载子级菜单。
  243. /// </summary>
  244. private static readonly HashSet<(string Mod, int Leaf)> DirOverrides = new()
  245. {
  246. { ("S0", 1) }, // 数据建模 → 目录,产销建模挂在其下
  247. { ("S1", 1) }, // 订单管理 → 目录(销售订单、合同评审)
  248. { ("S1", 2) }, // 工单管理 → 目录(工单列表、工单下达)
  249. { ("S1", 3) }, // 产销协同看板 → 目录(指标看板、需求明细核验)
  250. { ("S2", 1) }, // 生产排程 → 目录(工单工序排程、排产异常记录)
  251. { ("S2", 2) }, // 作业计划 → 目录(可执行日计划、产线日历等)
  252. { ("S2", 3) }, // 制造协同看板 → 目录(工单执行进度看板)
  253. { ("S3", 1) }, // 物料计划 → 目录(物料需求计划)
  254. };
  255. private static string BuildRemark(string code, (string Title, string Desc, string Complexity, string Days, string Note) leaf)
  256. {
  257. var notePart = string.IsNullOrWhiteSpace(leaf.Note) ? "" : $" | {leaf.Note}";
  258. var s = $"[{code}|{leaf.Complexity}|{leaf.Days}人天] {leaf.Desc}{notePart}";
  259. return s.Length <= 256 ? s : s[..256];
  260. }
  261. private static IEnumerable<SysMenu> BuildS0SalesMenus(DateTime ct)
  262. {
  263. // 与 ModuleDefinitions 中 S0 首项「数据建模」的生成 Id 一致(全局 menuSeq=1 → 1322000000001)
  264. const long s0DataModelingMenuId = 1322000000001L;
  265. const long subDirId = 1329002000000L;
  266. yield return new SysMenu
  267. {
  268. Id = subDirId,
  269. Pid = s0DataModelingMenuId,
  270. Title = "产销建模",
  271. Path = "/aidop/s0/sales",
  272. Name = "aidopS0Sales",
  273. Component = "Layout",
  274. Icon = "ele-ShoppingCart",
  275. Type = MenuTypeEnum.Dir,
  276. CreateTime = ct,
  277. OrderNo = 20,
  278. Remark = "S0 产销建模"
  279. };
  280. yield return new SysMenu
  281. {
  282. Id = subDirId + 1,
  283. Pid = subDirId,
  284. Title = "客户管理",
  285. Path = "/aidop/s0/sales/customer",
  286. Name = "aidopS0SalesCustomer",
  287. Component = "/aidop/s0/sales/CustomerList",
  288. Icon = "ele-User",
  289. Type = MenuTypeEnum.Menu,
  290. CreateTime = ct,
  291. OrderNo = 1,
  292. Remark = "S0 客户管理"
  293. };
  294. yield return new SysMenu
  295. {
  296. Id = subDirId + 2,
  297. Pid = subDirId,
  298. Title = "物料管理",
  299. Path = "/aidop/s0/sales/material",
  300. Name = "aidopS0SalesMaterial",
  301. Component = "/aidop/s0/sales/MaterialList",
  302. Icon = "ele-Box",
  303. Type = MenuTypeEnum.Menu,
  304. CreateTime = ct,
  305. OrderNo = 2,
  306. Remark = "S0 物料管理"
  307. };
  308. yield return new SysMenu
  309. {
  310. Id = subDirId + 3,
  311. Pid = subDirId,
  312. Title = "订单优先规则",
  313. Path = "/aidop/s0/sales/order-priority-rule",
  314. Name = "aidopS0SalesOrderPriorityRule",
  315. Component = "/aidop/s0/sales/OrderPriorityRuleList",
  316. Icon = "ele-Sort",
  317. Type = MenuTypeEnum.Menu,
  318. CreateTime = ct,
  319. OrderNo = 3,
  320. Remark = "S0 订单优先规则"
  321. };
  322. yield return new SysMenu
  323. {
  324. Id = subDirId + 4,
  325. Pid = subDirId,
  326. Title = "合同评审周期",
  327. Path = "/aidop/s0/sales/contract-review-cycle",
  328. Name = "aidopS0SalesContractReviewCycle",
  329. Component = "/aidop/s0/sales/ContractReviewCycleList",
  330. Icon = "ele-Clock",
  331. Type = MenuTypeEnum.Menu,
  332. CreateTime = ct,
  333. OrderNo = 4,
  334. Remark = "S0 合同评审周期标准配置"
  335. };
  336. yield return new SysMenu
  337. {
  338. Id = subDirId + 5,
  339. Pid = subDirId,
  340. Title = "产品设计周期",
  341. Path = "/aidop/s0/sales/product-design-cycle",
  342. Name = "aidopS0SalesProductDesignCycle",
  343. Component = "/aidop/s0/sales/ProductDesignCycleList",
  344. Icon = "ele-Timer",
  345. Type = MenuTypeEnum.Menu,
  346. CreateTime = ct,
  347. OrderNo = 5,
  348. Remark = "S0 产品设计周期标准配置"
  349. };
  350. yield return new SysMenu
  351. {
  352. Id = subDirId + 6,
  353. Pid = subDirId,
  354. Title = "订单评审周期",
  355. Path = "/aidop/s0/sales/order-review-cycle",
  356. Name = "aidopS0SalesOrderReviewCycle",
  357. Component = "/aidop/s0/sales/OrderReviewCycleList",
  358. Icon = "ele-AlarmClock",
  359. Type = MenuTypeEnum.Menu,
  360. CreateTime = ct,
  361. OrderNo = 6,
  362. Remark = "S0 订单评审周期标准配置"
  363. };
  364. }
  365. private static IEnumerable<SysMenu> BuildS0ManufacturingMenus(DateTime ct)
  366. {
  367. const long s0DataModelingMenuId = 1322000000001L;
  368. const long subDirId = 1329003000000L;
  369. yield return new SysMenu
  370. {
  371. Id = subDirId,
  372. Pid = s0DataModelingMenuId,
  373. Title = "制造建模",
  374. Path = "/aidop/s0/manufacturing",
  375. Name = "aidopS0Manufacturing",
  376. Component = "Layout",
  377. Icon = "ele-SetUp",
  378. Type = MenuTypeEnum.Dir,
  379. CreateTime = ct,
  380. OrderNo = 30,
  381. Remark = "S0 制造建模"
  382. };
  383. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  384. {
  385. (1, "/aidop/s0/manufacturing/standard-bom", "aidopS0MfgStandardBom", "标准 BOM", "/aidop/s0/manufacturing/StandardBomManagement", 10),
  386. (2, "/aidop/s0/manufacturing/standard-operation", "aidopS0MfgStandardOperation", "标准工序", "/aidop/s0/manufacturing/StandardProcessList", 20),
  387. (3, "/aidop/s0/manufacturing/production-line", "aidopS0MfgProductionLine", "产线", "/aidop/s0/manufacturing/ProductionLineList", 30),
  388. (4, "/aidop/s0/manufacturing/routing", "aidopS0MfgRouting", "工艺路线", "/aidop/s0/manufacturing/RoutingList", 40),
  389. (5, "/aidop/s0/manufacturing/material-substitution", "aidopS0MfgMaterialSubstitution", "物料替代", "/aidop/s0/manufacturing/MaterialSubstitutionList", 50),
  390. (6, "/aidop/s0/manufacturing/work-order-control", "aidopS0MfgWorkOrderControl", "工单控制参数", "/aidop/s0/manufacturing/WorkOrderControlParams", 60),
  391. (7, "/aidop/s0/manufacturing/person-skill", "aidopS0MfgPersonSkill", "人员技能", "/aidop/s0/manufacturing/PersonnelSkillList", 70),
  392. (8, "/aidop/s0/manufacturing/person-skill-assignment", "aidopS0MfgPersonSkillAssignment", "人员技能维护", "/aidop/s0/manufacturing/PersonSkillAssignmentList", 80),
  393. (9, "/aidop/s0/manufacturing/line-post", "aidopS0MfgLinePost", "产线岗位维护", "/aidop/s0/manufacturing/LinePostList", 90),
  394. (10, "/aidop/s0/manufacturing/work-center", "aidopS0MfgWorkCenter", "工作中心", "/aidop/s0/manufacturing/WorkCenterList", 100),
  395. (11, "/aidop/s0/manufacturing/line-material", "aidopS0MfgLineMaterial", "线边物料", "/aidop/s0/manufacturing/LineMaterialList", 110),
  396. (12, "/aidop/s0/manufacturing/element-param-production", "aidopS0MfgElementParamProduction", "生产要素参数", "/aidop/s0/manufacturing/ProductionElementParamList", 120),
  397. (13, "/aidop/s0/manufacturing/material-process-element", "aidopS0MfgMaterialProcessElement", "物料工艺要素", "/aidop/s0/manufacturing/MaterialProcessElementList", 130),
  398. (14, "/aidop/s0/manufacturing/preprocess-element", "aidopS0MfgPreprocessElement", "前处理要素", "/aidop/s0/manufacturing/PreprocessElementList", 140),
  399. (15, "/aidop/s0/manufacturing/preprocess-element-param", "aidopS0MfgElementParamPreprocess", "前处理要素参数", "/aidop/s0/manufacturing/PreprocessElementParamList", 150),
  400. (16, "/aidop/s0/manufacturing/sop-file-type", "aidopS0MfgSopFileType", "SOP 文件类型", "/aidop/s0/manufacturing/SopFileTypeList", 160),
  401. (17, "/aidop/s0/manufacturing/sop-document", "aidopS0MfgSopDocument", "SOP 维护", "/aidop/s0/manufacturing/SopMaintenanceList", 170),
  402. };
  403. foreach (var (idOff, path, name, title, component, order) in leaves)
  404. {
  405. yield return new SysMenu
  406. {
  407. Id = subDirId + idOff,
  408. Pid = subDirId,
  409. Title = title,
  410. Path = path,
  411. Name = name,
  412. Component = component,
  413. Icon = "ele-Document",
  414. Type = MenuTypeEnum.Menu,
  415. CreateTime = ct,
  416. OrderNo = order,
  417. Remark = $"S0 {title}"
  418. };
  419. }
  420. yield return new SysMenu
  421. {
  422. Id = subDirId + 18,
  423. Pid = subDirId,
  424. Title = "选择替代方案",
  425. Path = "/aidop/s0/manufacturing/substitute-scheme-select",
  426. Name = "aidopS0MfgSubstituteSchemeSelect",
  427. Component = "/aidop/s0/manufacturing/SubstituteSchemeSelectList",
  428. Icon = "ele-List",
  429. Type = MenuTypeEnum.Menu,
  430. CreateTime = ct,
  431. OrderNo = 18,
  432. Remark = "S0 选择替代方案(只读查询)"
  433. };
  434. yield return new SysMenu
  435. {
  436. Id = subDirId + 19,
  437. Pid = subDirId,
  438. Title = "工序流转卡",
  439. Path = "/aidop/s0/manufacturing/process-flow-card",
  440. Name = "aidopS0MfgProcessFlowCard",
  441. Component = "/aidop/s0/manufacturing/ProcessFlowCardList",
  442. Icon = "ele-Tickets",
  443. Type = MenuTypeEnum.Menu,
  444. CreateTime = ct,
  445. OrderNo = 180,
  446. Remark = "S0 工序流转卡主数据"
  447. };
  448. yield return new SysMenu
  449. {
  450. Id = subDirId + 20,
  451. Pid = subDirId,
  452. Title = "订单排程周期",
  453. Path = "/aidop/s0/manufacturing/order-schedule-cycle",
  454. Name = "aidopS0MfgOrderScheduleCycle",
  455. Component = "/aidop/s0/manufacturing/OrderScheduleCycleList",
  456. Icon = "ele-Calendar",
  457. Type = MenuTypeEnum.Menu,
  458. CreateTime = ct,
  459. OrderNo = 190,
  460. Remark = "S0 订单排程周期标准"
  461. };
  462. }
  463. private static IEnumerable<SysMenu> BuildS0SupplyMenus(DateTime ct)
  464. {
  465. const long s0DataModelingMenuId = 1322000000001L;
  466. const long subDirId = 1329004000000L;
  467. yield return new SysMenu
  468. {
  469. Id = subDirId,
  470. Pid = s0DataModelingMenuId,
  471. Title = "供应建模",
  472. Path = "/aidop/s0/supply",
  473. Name = "aidopS0Supply",
  474. Component = "Layout",
  475. Icon = "ele-Ship",
  476. Type = MenuTypeEnum.Dir,
  477. CreateTime = ct,
  478. OrderNo = 40,
  479. Remark = "S0 供应建模"
  480. };
  481. yield return new SysMenu
  482. {
  483. Id = subDirId + 1,
  484. Pid = subDirId,
  485. Title = "供应商维护",
  486. Path = "/aidop/s0/supply/supplier",
  487. Name = "aidopS0SupplySupplier",
  488. Component = "/aidop/s0/supply/SupplierList",
  489. Icon = "ele-UserFilled",
  490. Type = MenuTypeEnum.Menu,
  491. CreateTime = ct,
  492. OrderNo = 1,
  493. Remark = "S0 供应商维护"
  494. };
  495. yield return new SysMenu
  496. {
  497. Id = subDirId + 2,
  498. Pid = subDirId,
  499. Title = "货源清单",
  500. Path = "/aidop/s0/supply/sourcing-item",
  501. Name = "aidopS0SupplySourcingItem",
  502. Component = "/aidop/s0/supply/SourcingList",
  503. Icon = "ele-List",
  504. Type = MenuTypeEnum.Menu,
  505. CreateTime = ct,
  506. OrderNo = 2,
  507. Remark = "S0 货源清单(srm_purchase)"
  508. };
  509. yield return new SysMenu
  510. {
  511. Id = subDirId + 3,
  512. Pid = subDirId,
  513. Title = "品类采购前置期",
  514. Path = "/aidop/s0/supply/category-lead-time",
  515. Name = "aidopS0SupplyCategoryLeadTime",
  516. Component = "/aidop/s0/supply/CategoryLeadTimeList",
  517. Icon = "ele-Clock",
  518. Type = MenuTypeEnum.Menu,
  519. CreateTime = ct,
  520. OrderNo = 3,
  521. Remark = "S0 品类采购前置期主数据"
  522. };
  523. yield return new SysMenu
  524. {
  525. Id = subDirId + 4,
  526. Pid = subDirId,
  527. Title = "物料计划周期",
  528. Path = "/aidop/s0/supply/material-plan-cycle",
  529. Name = "aidopS0SupplyMaterialPlanCycle",
  530. Component = "/aidop/s0/supply/MaterialPlanCycleList",
  531. Icon = "ele-Timer",
  532. Type = MenuTypeEnum.Menu,
  533. CreateTime = ct,
  534. OrderNo = 4,
  535. Remark = "S0 物料计划周期标准(小时),与 S3 指标对比需约定换算"
  536. };
  537. }
  538. private static IEnumerable<SysMenu> BuildS0QualityMenus(DateTime ct)
  539. {
  540. const long s0DataModelingMenuId = 1322000000001L;
  541. const long subDirId = 1329004500000L;
  542. yield return new SysMenu
  543. {
  544. Id = subDirId,
  545. Pid = s0DataModelingMenuId,
  546. Title = "质量建模",
  547. Path = "/aidop/s0/quality",
  548. Name = "aidopS0Quality",
  549. Component = "Layout",
  550. Icon = "ele-DataAnalysis",
  551. Type = MenuTypeEnum.Dir,
  552. CreateTime = ct,
  553. OrderNo = 45,
  554. Remark = "S0 质量建模"
  555. };
  556. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  557. {
  558. (1, "/aidop/s0/quality/dictionary", "aidopS0QlyDictionary", "质量基础", "/aidop/s0/quality/QualityDictionaryPage", 10),
  559. (2, "/aidop/s0/quality/raw-whitelist", "aidopS0QlyRawWhitelist", "原材料白名单", "/aidop/s0/quality/RawWhitelistList", 20),
  560. (3, "/aidop/s0/quality/sampling-scheme", "aidopS0QlySamplingScheme", "抽样方案", "/aidop/s0/quality/SamplingSchemeList", 30),
  561. (4, "/aidop/s0/quality/instrument", "aidopS0QlyInstrument", "检验仪器", "/aidop/s0/quality/InspectionInstrumentList", 40),
  562. (13, "/aidop/s0/quality/gauge-instrument", "aidopS0QlyGaugeInstrument", "计量器具", "/aidop/s0/quality/InspectionInstrumentList", 45),
  563. (5, "/aidop/s0/quality/inspection-method", "aidopS0QlyInspectionMethod", "检验方法", "/aidop/s0/quality/InspectionMethodList", 50),
  564. (6, "/aidop/s0/quality/inspection-basis", "aidopS0QlyInspectionBasis", "检验依据", "/aidop/s0/quality/InspectionBasisList", 60),
  565. (7, "/aidop/s0/quality/inspection-standard", "aidopS0QlyInspectionStandard", "检验标准", "/aidop/s0/quality/InspectionStandardList", 70),
  566. (8, "/aidop/s0/quality/inspection-item", "aidopS0QlyInspectionItem", "检验项目", "/aidop/s0/quality/InspectionItemList", 80),
  567. (9, "/aidop/s0/quality/inspection-frequency", "aidopS0QlyInspectionFrequency", "检验频率", "/aidop/s0/quality/InspectionFrequencyList", 90),
  568. (10, "/aidop/s0/quality/inspection-plan", "aidopS0QlyInspectionPlan", "检验方案", "/aidop/s0/quality/InspectionPlanList", 100),
  569. (11, "/aidop/s0/quality/raw-inspection-spec", "aidopS0QlyRawInspectionSpec", "原材料检验规范", "/aidop/s0/quality/RawInspectionSpecList", 110),
  570. (12, "/aidop/s0/quality/process-inspection-spec", "aidopS0QlyProcessInspectionSpec", "过程检验规范", "/aidop/s0/quality/ProcessInspectionSpecList", 120),
  571. (14, "/aidop/s0/quality/fqc-inspection-spec", "aidopS0QlyFqcInspectionSpec", "FQC检验规范", "/aidop/s0/quality/FqcInspectionSpecList", 130),
  572. (15, "/aidop/s0/quality/oqc-inspection-spec", "aidopS0QlyOqcInspectionSpec", "OQC检验规范", "/aidop/s0/quality/OqcInspectionSpecList", 140),
  573. };
  574. foreach (var (idOff, path, name, title, component, order) in leaves)
  575. {
  576. yield return new SysMenu
  577. {
  578. Id = subDirId + idOff,
  579. Pid = subDirId,
  580. Title = title,
  581. Path = path,
  582. Name = name,
  583. Component = component,
  584. Icon = "ele-Document",
  585. Type = MenuTypeEnum.Menu,
  586. CreateTime = ct,
  587. OrderNo = order,
  588. Remark = $"S0 {title}"
  589. };
  590. }
  591. }
  592. /// <summary>
  593. /// S8 异常协同:直接挂在「S8 异常监控」目录下,不再经过中间层「异常管理」。
  594. /// </summary>
  595. private static IEnumerable<SysMenu> BuildS8CollaborationMenus(DateTime ct)
  596. {
  597. const long s8DirId = 1321000009000L;
  598. const long baseId = 1329008000000L;
  599. const long s8MonitoringDirId = 1329008000020L;
  600. // 异常监控子模块(专题大屏占位,后续接业务数据)
  601. yield return new SysMenu
  602. {
  603. Id = s8MonitoringDirId,
  604. Pid = s8DirId,
  605. Title = "异常监控",
  606. Path = "/aidop/s8/monitoring",
  607. Name = "aidopS8MonitoringDir",
  608. Component = "Layout",
  609. Redirect = "/aidop/s8/monitoring/overview",
  610. Icon = "ele-Monitor",
  611. Type = MenuTypeEnum.Dir,
  612. CreateTime = ct,
  613. OrderNo = 8,
  614. Remark = "S8 异常监控子模块"
  615. };
  616. yield return new SysMenu
  617. {
  618. Id = s8MonitoringDirId + 1,
  619. Pid = s8MonitoringDirId,
  620. Title = "异常监控大屏",
  621. Path = "/aidop/s8/monitoring/overview",
  622. Name = "aidopS8MonitoringOverview",
  623. Component = "/aidop/s8/monitoring/S8MonitoringOverviewPage",
  624. Icon = "ele-DataBoard",
  625. Type = MenuTypeEnum.Menu,
  626. CreateTime = ct,
  627. OrderNo = 10,
  628. Remark = "S8 异常监控大屏(占位)"
  629. };
  630. yield return new SysMenu
  631. {
  632. Id = s8MonitoringDirId + 2,
  633. Pid = s8MonitoringDirId,
  634. Title = "交付异常大屏",
  635. Path = "/aidop/s8/monitoring/delivery",
  636. Name = "aidopS8MonitoringDelivery",
  637. Component = "/aidop/s8/monitoring/S8MonitoringDeliveryPage",
  638. Icon = "ele-Position",
  639. Type = MenuTypeEnum.Menu,
  640. CreateTime = ct,
  641. OrderNo = 11,
  642. Remark = "S8 交付异常大屏(占位)"
  643. };
  644. yield return new SysMenu
  645. {
  646. Id = s8MonitoringDirId + 3,
  647. Pid = s8MonitoringDirId,
  648. Title = "生产异常大屏",
  649. Path = "/aidop/s8/monitoring/production",
  650. Name = "aidopS8MonitoringProduction",
  651. Component = "/aidop/s8/monitoring/S8MonitoringProductionPage",
  652. Icon = "ele-Cpu",
  653. Type = MenuTypeEnum.Menu,
  654. CreateTime = ct,
  655. OrderNo = 12,
  656. Remark = "S8 生产异常大屏(占位)"
  657. };
  658. yield return new SysMenu
  659. {
  660. Id = s8MonitoringDirId + 4,
  661. Pid = s8MonitoringDirId,
  662. Title = "供应异常大屏",
  663. Path = "/aidop/s8/monitoring/supply",
  664. Name = "aidopS8MonitoringSupply",
  665. Component = "/aidop/s8/monitoring/S8MonitoringSupplyPage",
  666. Icon = "ele-Box",
  667. Type = MenuTypeEnum.Menu,
  668. CreateTime = ct,
  669. OrderNo = 13,
  670. Remark = "S8 供应异常大屏(占位)"
  671. };
  672. // 可见业务页(「异常监控看板」复用自动生成的 1322000000027 菜单位)
  673. yield return new SysMenu
  674. {
  675. Id = baseId + 2,
  676. Pid = s8DirId,
  677. Title = "异常列表",
  678. Path = "/aidop/s8/exceptions",
  679. Name = "aidopS8ExceptionList",
  680. Component = "/aidop/s8/exceptions/S8ExceptionListPage",
  681. Icon = "ele-List",
  682. Type = MenuTypeEnum.Menu,
  683. CreateTime = ct,
  684. OrderNo = 20,
  685. Remark = "S8 异常列表"
  686. };
  687. yield return new SysMenu
  688. {
  689. Id = baseId + 3,
  690. Pid = s8DirId,
  691. Title = "主动提报",
  692. Path = "/aidop/s8/report",
  693. Name = "aidopS8ManualReport",
  694. Component = "/aidop/s8/report/S8ManualReportPage",
  695. Icon = "ele-EditPen",
  696. Type = MenuTypeEnum.Menu,
  697. CreateTime = ct,
  698. OrderNo = 30,
  699. Remark = "S8 主动提报"
  700. };
  701. yield return new SysMenu
  702. {
  703. Id = baseId + 4,
  704. Pid = s8DirId,
  705. Title = "配置中心",
  706. Path = "/aidop/s8/config",
  707. Name = "aidopS8ConfigHub",
  708. Component = "/aidop/s8/config/S8ConfigHubPage",
  709. Icon = "ele-Setting",
  710. Type = MenuTypeEnum.Menu,
  711. CreateTime = ct,
  712. OrderNo = 40,
  713. Remark = "S8 配置中心"
  714. };
  715. // 隐藏路由(不出侧栏,需参与动态路由注册)
  716. yield return new SysMenu
  717. {
  718. Id = baseId + 10,
  719. Pid = s8DirId,
  720. Title = "任务详情",
  721. Path = "/aidop/s8/exceptions/:id",
  722. Name = "aidopS8TaskDetail",
  723. Component = "/aidop/s8/exceptions/S8TaskDetailPage",
  724. Icon = "ele-Document",
  725. Type = MenuTypeEnum.Menu,
  726. CreateTime = ct,
  727. OrderNo = 90,
  728. IsHide = true,
  729. Remark = "S8 任务详情"
  730. };
  731. var cfg = new (long Off, string Path, string Name, string Title, string Component)[]
  732. {
  733. (11, "/aidop/s8/config/scenes", "aidopS8ScenarioConfig", "场景基础配置", "/aidop/s8/config/S8ScenarioConfigPage"),
  734. (12, "/aidop/s8/config/notifications", "aidopS8NotificationLayerConfig", "通知分层配置", "/aidop/s8/config/S8NotificationLayerPage"),
  735. (13, "/aidop/s8/config/roles", "aidopS8RolePermissionConfig", "角色权限配置", "/aidop/s8/config/S8RolePermissionConfigPage"),
  736. (14, "/aidop/s8/config/alert-rules", "aidopS8AlertRulesConfig", "报警规则配置", "/aidop/s8/config/S8AlertRulesPage"),
  737. (15, "/aidop/s8/config/data-sources", "aidopS8DataSourceConfig", "数据源配置", "/aidop/s8/config/S8DataSourceConfigPage"),
  738. (16, "/aidop/s8/config/watch-rules", "aidopS8WatchRuleConfig", "监视规则配置", "/aidop/s8/config/S8WatchRuleConfigPage"),
  739. (17, "/aidop/s8/config/exception-types", "aidopS8ExceptionTypeConfig", "异常类型配置", "/aidop/s8/config/S8ExceptionTypeConfigPage"),
  740. (18, "/aidop/s8/config/dashboard-cells", "aidopS8DashboardCellConfig", "大屏卡片配置", "/aidop/s8/config/S8DashboardCellConfigPage"),
  741. };
  742. foreach (var (off, path, name, title, component) in cfg)
  743. {
  744. yield return new SysMenu
  745. {
  746. Id = baseId + off,
  747. Pid = s8DirId,
  748. Title = title,
  749. Path = path,
  750. Name = name,
  751. Component = component,
  752. Icon = "ele-Document",
  753. Type = MenuTypeEnum.Menu,
  754. CreateTime = ct,
  755. OrderNo = 100 + (int)off,
  756. IsHide = true,
  757. Remark = $"S8 {title}"
  758. };
  759. }
  760. // ── S8 权限点(Btn):与 S8PermissionCatalog 同源,命名 s8:<resource>:<action>
  761. // Btn ID 段:baseId + 100..114(不与现有 Dir/Menu 冲突)。
  762. const long s8DashboardId = 1322000000027L; // 见上文「S8:复用自动生成的首项菜单位…」
  763. const long btnIdBase = baseId + 100;
  764. const string btnNamePrefix = "aidopS8Btn";
  765. var btns = new (long IdOff, long Pid, string Permission, string Title, int Order)[]
  766. {
  767. // 异常列表 / 任务详情
  768. (0, baseId + 2, "s8:exception:read", "查看异常", 10),
  769. (1, baseId + 3, "s8:exception:create", "主动提报", 20),
  770. (2, baseId + 10, "s8:exception:assign", "分派异常", 30),
  771. (3, baseId + 10, "s8:exception:claim", "认领异常", 40),
  772. (4, baseId + 10, "s8:exception:start", "开始处理", 50),
  773. (5, baseId + 10, "s8:exception:reject", "驳回异常", 60),
  774. (6, baseId + 10, "s8:exception:upgrade", "升级异常", 70),
  775. (7, baseId + 10, "s8:exception:close", "关闭异常", 80),
  776. (8, baseId + 10, "s8:verification:submit", "提交复检", 110),
  777. (9, baseId + 10, "s8:verification:approve", "检验通过", 120),
  778. (10, baseId + 10, "s8:verification:reject", "检验退回", 130),
  779. // 配置中心
  780. (11, baseId + 4, "s8:config:read", "查看配置", 210),
  781. (12, baseId + 13, "s8:config:operator:bind", "维护操作员绑定", 220),
  782. (13, baseId + 13, "s8:config:role:write", "维护角色权限", 230),
  783. // 看板
  784. (14, s8DashboardId, "s8:dashboard:read", "查看看板", 310),
  785. };
  786. foreach (var (off, pid, perm, title, order) in btns)
  787. {
  788. yield return new SysMenu
  789. {
  790. Id = btnIdBase + off,
  791. Pid = pid,
  792. Title = title,
  793. Permission = perm,
  794. Name = $"{btnNamePrefix}{off:00}",
  795. Type = MenuTypeEnum.Btn,
  796. CreateTime = ct,
  797. OrderNo = order,
  798. Remark = $"S8 权限点 {perm}"
  799. };
  800. }
  801. }
  802. private static IEnumerable<SysMenu> BuildS0WarehouseMenus(DateTime ct)
  803. {
  804. const long s0DataModelingMenuId = 1322000000001L;
  805. const long subDirId = 1329005000000L;
  806. yield return new SysMenu
  807. {
  808. Id = subDirId,
  809. Pid = s0DataModelingMenuId,
  810. Title = "仓储建模",
  811. Path = "/aidop/s0/warehouse",
  812. Name = "aidopS0Warehouse",
  813. Component = "Layout",
  814. Icon = "ele-OfficeBuilding",
  815. Type = MenuTypeEnum.Dir,
  816. CreateTime = ct,
  817. OrderNo = 50,
  818. Remark = "S0 仓储建模"
  819. };
  820. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  821. {
  822. (1, "/aidop/s0/warehouse/department", "aidopS0WhDepartment", "部门维护", "/aidop/s0/warehouse/DepartmentList", 10),
  823. (2, "/aidop/s0/warehouse/employee", "aidopS0WhEmployee", "雇员列表", "/aidop/s0/warehouse/EmployeeList", 20),
  824. (3, "/aidop/s0/warehouse/cost-center", "aidopS0WhCostCenter", "成本中心", "/aidop/s0/warehouse/CostCenterList", 30),
  825. (4, "/aidop/s0/warehouse/location", "aidopS0WhLocation", "库位维护", "/aidop/s0/warehouse/LocationList", 40),
  826. (5, "/aidop/s0/warehouse/location-shelf", "aidopS0WhLocationShelf", "货架列表", "/aidop/s0/warehouse/LocationShelfList", 50),
  827. (6, "/aidop/s0/warehouse/barcode-rule", "aidopS0WhBarcodeRule", "条码规则", "/aidop/s0/warehouse/BarcodeRuleList", 60),
  828. (7, "/aidop/s0/warehouse/label-type", "aidopS0WhLabelType", "标签格式", "/aidop/s0/warehouse/LabelTypeList", 70),
  829. (8, "/aidop/s0/warehouse/nbr-type", "aidopS0WhNbrType", "单号类型", "/aidop/s0/warehouse/NbrTypeList", 80),
  830. (9, "/aidop/s0/warehouse/nbr-control", "aidopS0WhNbrControl", "单号规则维护", "/aidop/s0/warehouse/NbrControlList", 90),
  831. (10, "/aidop/s0/warehouse/item-pack", "aidopS0WhItemPack", "零件包装规格", "/aidop/s0/warehouse/ItemPackList", 100),
  832. (11, "/aidop/s0/warehouse/emp-work-duty", "aidopS0WhEmpWorkDuty", "物料职责维护", "/aidop/s0/warehouse/EmpWorkDutyList", 110),
  833. (12, "/aidop/s0/warehouse/task-assignment", "aidopS0WhTaskAssignment", "物料状态任务指派", "/aidop/s0/warehouse/TaskAssignmentList", 120),
  834. };
  835. foreach (var (idOff, path, name, title, component, order) in leaves)
  836. {
  837. yield return new SysMenu
  838. {
  839. Id = subDirId + idOff,
  840. Pid = subDirId,
  841. Title = title,
  842. Path = path,
  843. Name = name,
  844. Component = component,
  845. Icon = "ele-Document",
  846. Type = MenuTypeEnum.Menu,
  847. CreateTime = ct,
  848. OrderNo = order,
  849. Remark = $"S0 {title}"
  850. };
  851. }
  852. }
  853. /// <summary>
  854. /// S1「产销协同看板」目录(Id=1322000000005)下的子菜单:指标看板、需求明细核验、计划联动看板。
  855. /// </summary>
  856. private static IEnumerable<SysMenu> BuildS1SalesKanbanMenus(DateTime ct)
  857. {
  858. const long salesKanBanDirId = 1322000000005L;
  859. yield return new SysMenu
  860. {
  861. Id = 1322000000201L,
  862. Pid = salesKanBanDirId,
  863. Title = "产销协同指标看板",
  864. Path = "/aidop/s1/SalesKanBan/kanban",
  865. Name = "aidopS1SalesKanBanKanban",
  866. Component = "/aidop/kanban/s1",
  867. Icon = "ele-DataAnalysis",
  868. Type = MenuTypeEnum.Menu,
  869. CreateTime = ct,
  870. OrderNo = 10,
  871. Remark = "S1 产销协同看板(指标)"
  872. };
  873. yield return new SysMenu
  874. {
  875. Id = 1322000000202L,
  876. Pid = salesKanBanDirId,
  877. Title = "需求明细核验",
  878. Path = "/aidop/s1/SalesKanBan/requirement-examine-detail",
  879. Name = "aidopS1RequirementExamineDetail",
  880. Component = "/aidop/s1/sales-kanban/RequirementExamineDetailList",
  881. Icon = "ele-List",
  882. Type = MenuTypeEnum.Menu,
  883. CreateTime = ct,
  884. OrderNo = 20,
  885. Remark = "S1 需求明细核验"
  886. };
  887. yield return new SysMenu
  888. {
  889. Id = 1322000000107L,
  890. Pid = salesKanBanDirId,
  891. Title = "计划联动看板",
  892. Path = "/aidop/s1/SalesKanBan/linkage-plan",
  893. Name = "aidopS1LinkagePlan",
  894. Component = "/aidop/business/linkagePlanList",
  895. Icon = "ele-DataBoard",
  896. Type = MenuTypeEnum.Menu,
  897. CreateTime = ct,
  898. OrderNo = 30,
  899. Remark = "S1 计划联动看板(LinkagePlan)"
  900. };
  901. }
  902. /// <summary>
  903. /// S1「订单管理」「工单管理」目录化后的子菜单:销售订单、合同评审、产品设计、工单下达等。
  904. /// 父级 Id:订单管理=1322000000003,工单管理=1322000000004(menuSeq 与 ModuleDefinitions 中 S1 叶子顺序一致)。
  905. /// 产销协同看板=1322000000005,路径 /aidop/s1/SalesKanBan(勿与工单管理目录混淆)。
  906. /// 订单管理下扩展子菜单 Id:1322000000101~0105;计划联动看板 Id=1322000000107 挂在产销协同看板目录下。
  907. /// </summary>
  908. private static IEnumerable<SysMenu> BuildS1OrderWorkOrderMenus(DateTime ct)
  909. {
  910. const long orderMgmtDirId = 1322000000003L;
  911. const long workOrderMgmtDirId = 1322000000004L;
  912. yield return new SysMenu
  913. {
  914. Id = 1322000000101L,
  915. Pid = orderMgmtDirId,
  916. Title = "合同评审",
  917. Path = "/aidop/s1/order-mgmt/contract-review",
  918. Name = "aidopS1ContractReview",
  919. Component = "/aidop/business/contractReviewList",
  920. Icon = "ele-Edit",
  921. Type = MenuTypeEnum.Menu,
  922. CreateTime = ct,
  923. OrderNo = 10,
  924. Remark = "S1 合同评审"
  925. };
  926. yield return new SysMenu
  927. {
  928. Id = 1322000000102L,
  929. Pid = orderMgmtDirId,
  930. Title = "产品设计",
  931. Path = "/aidop/s1/order-mgmt/product-design",
  932. Name = "aidopS1ProductDesign",
  933. Component = "/aidop/business/productDesignList",
  934. Icon = "ele-Edit",
  935. Type = MenuTypeEnum.Menu,
  936. CreateTime = ct,
  937. OrderNo = 20,
  938. Remark = "S1 产品设计"
  939. };
  940. yield return new SysMenu
  941. {
  942. Id = 1322000000103L,
  943. Pid = orderMgmtDirId,
  944. Title = "订单评审",
  945. Path = "/aidop/s1/order-mgmt/order",
  946. Name = "aidopS1SalesOrder",
  947. Component = "/aidop/business/orderList",
  948. Icon = "ele-Document",
  949. Type = MenuTypeEnum.Menu,
  950. CreateTime = ct,
  951. OrderNo = 30,
  952. Remark = "S1 销售订单(原订单管理入口)"
  953. };
  954. yield return new SysMenu
  955. {
  956. Id = 1322000000104L,
  957. Pid = orderMgmtDirId,
  958. Title = "订单交付",
  959. Path = "/aidop/s1/order-mgmt/orderDelivery",
  960. Name = "aidopS1OrderDelivery",
  961. Component = "/aidop/business/orderDeliveryList",
  962. Icon = "ele-Document",
  963. Type = MenuTypeEnum.Menu,
  964. CreateTime = ct,
  965. OrderNo = 40,
  966. Remark = "S1 订单交付"
  967. };
  968. yield return new SysMenu
  969. {
  970. Id = 1322000000105L,
  971. Pid = orderMgmtDirId,
  972. Title = "订单发货",
  973. Path = "/aidop/s1/order-mgmt/asnShipper",
  974. Name = "aidopS1AsnShipper",
  975. Component = "/aidop/business/asnShipperList",
  976. Icon = "ele-Document",
  977. Type = MenuTypeEnum.Menu,
  978. CreateTime = ct,
  979. OrderNo = 50,
  980. Remark = "S1 订单发货"
  981. };
  982. yield return new SysMenu
  983. {
  984. Id = 1322000000106L,
  985. Pid = workOrderMgmtDirId,
  986. Title = "工单下达",
  987. Path = "/aidop/s1/workorder-mgmt/dispatch",
  988. Name = "aidopS1WorkOrderDispatch",
  989. Component = "/aidop/business/workOrderDispatchList",
  990. Icon = "ele-Position",
  991. Type = MenuTypeEnum.Menu,
  992. CreateTime = ct,
  993. OrderNo = 10,
  994. Remark = "S1 工单池下达"
  995. };
  996. }
  997. /// <summary>
  998. /// S2「制造协同」三级结构:生产排程 / 作业计划 / 制造协同看板 为目录(与 ModuleDefinitions 中 S2 三项 Id 一致:0006~0008)。
  999. /// 「工单工序排程」Id=1322000000108 自 S1 迁入「生产排程」下;其余子页占位。
  1000. /// </summary>
  1001. private static IEnumerable<SysMenu> BuildS2ManufacturingCollaborationMenus(DateTime ct)
  1002. {
  1003. const long s2ProductionSchedulingDirId = 1322000000006L;
  1004. const long s2OperationPlanDirId = 1322000000007L;
  1005. const long s2CollaborationKanbanDirId = 1322000000008L;
  1006. // ── 生产排程 ──
  1007. yield return new SysMenu
  1008. {
  1009. Id = 1322000000108L,
  1010. Pid = s2ProductionSchedulingDirId,
  1011. Title = "工单工序排程",
  1012. Path = "/aidop/s2/production-scheduling/work-order-scheduling",
  1013. Name = "aidopS2WorkOrderScheduling",
  1014. Component = "/aidop/production/workOrderSchedulingList",
  1015. Icon = "ele-Operation",
  1016. Type = MenuTypeEnum.Menu,
  1017. CreateTime = ct,
  1018. OrderNo = 10,
  1019. Remark = "S2 工单工序排程"
  1020. };
  1021. yield return new SysMenu
  1022. {
  1023. Id = 1329002100001L,
  1024. Pid = s2ProductionSchedulingDirId,
  1025. Title = "排产异常记录",
  1026. Path = "/aidop/s2/production-scheduling/scheduling-exception",
  1027. Name = "aidopS2SchedulingException",
  1028. Component = "/aidop/production/scheduleExceptionList",
  1029. Icon = "ele-Warning",
  1030. Type = MenuTypeEnum.Menu,
  1031. CreateTime = ct,
  1032. OrderNo = 20,
  1033. Remark = "S2 排产异常记录"
  1034. };
  1035. // ── 作业计划 ──
  1036. yield return new SysMenu
  1037. {
  1038. Id = 1329002100011L,
  1039. Pid = s2OperationPlanDirId,
  1040. Title = "可执行日计划",
  1041. Path = "/aidop/s2/operation-plan/executable-daily-plan",
  1042. Name = "aidopS2ExecutableDailyPlan",
  1043. Component = "/aidop/production/executableDailyPlanList",
  1044. Icon = "ele-Calendar",
  1045. Type = MenuTypeEnum.Menu,
  1046. CreateTime = ct,
  1047. OrderNo = 10,
  1048. Remark = "S2 可执行生产日计划"
  1049. };
  1050. yield return new SysMenu
  1051. {
  1052. Id = 1329002100012L,
  1053. Pid = s2OperationPlanDirId,
  1054. Title = "产线工作日历管理",
  1055. Path = "/aidop/s2/operation-plan/line-work-calendar",
  1056. Name = "aidopS2LineWorkCalendar",
  1057. Component = "/aidop/production/shopCalendarWorkCtrList",
  1058. Icon = "ele-Notebook",
  1059. Type = MenuTypeEnum.Menu,
  1060. CreateTime = ct,
  1061. OrderNo = 20,
  1062. Remark = "S2 产线工作日历"
  1063. };
  1064. yield return new SysMenu
  1065. {
  1066. Id = 1329002100013L,
  1067. Pid = s2OperationPlanDirId,
  1068. Title = "产线休息时间管理",
  1069. Path = "/aidop/s2/operation-plan/line-rest-time",
  1070. Name = "aidopS2LineRestTime",
  1071. Component = "/aidop/production/qualityLineRestDetailList",
  1072. Icon = "ele-CoffeeCup",
  1073. Type = MenuTypeEnum.Menu,
  1074. CreateTime = ct,
  1075. OrderNo = 30,
  1076. Remark = "S2 产线休息时间"
  1077. };
  1078. yield return new SysMenu
  1079. {
  1080. Id = 1329002100014L,
  1081. Pid = s2OperationPlanDirId,
  1082. Title = "产线节假日管理",
  1083. Path = "/aidop/s2/operation-plan/line-holiday",
  1084. Name = "aidopS2LineHoliday",
  1085. Component = "/aidop/production/holidayMasterList",
  1086. Icon = "ele-Flag",
  1087. Type = MenuTypeEnum.Menu,
  1088. CreateTime = ct,
  1089. OrderNo = 40,
  1090. Remark = "S2 产线节假日"
  1091. };
  1092. yield return new SysMenu
  1093. {
  1094. Id = 1329002100015L,
  1095. Pid = s2OperationPlanDirId,
  1096. Title = "产线加班管理",
  1097. Path = "/aidop/s2/operation-plan/line-overtime",
  1098. Name = "aidopS2LineOvertime",
  1099. Component = "/aidop/production/lineOvertimeList",
  1100. Icon = "ele-Timer",
  1101. Type = MenuTypeEnum.Menu,
  1102. CreateTime = ct,
  1103. OrderNo = 50,
  1104. Remark = "S2 产线加班"
  1105. };
  1106. // ── 制造协同看板 ──
  1107. yield return new SysMenu
  1108. {
  1109. Id = 1329002100021L,
  1110. Pid = s2CollaborationKanbanDirId,
  1111. Title = "工单执行进度看板",
  1112. Path = "/aidop/s2/collaboration-kanban/work-order-progress",
  1113. Name = "aidopS2WorkOrderProgressKanban",
  1114. Component = "/aidop/production/workOrderProgressDashboardList",
  1115. Icon = "ele-DataBoard",
  1116. Type = MenuTypeEnum.Menu,
  1117. CreateTime = ct,
  1118. OrderNo = 10,
  1119. Remark = "S2 工单执行进度看板(列表)"
  1120. };
  1121. }
  1122. /// <summary>
  1123. /// S3「物料计划」三级结构:将自动生成的 S3 首项(Id=1322000000009)目录化,挂载「物料需求计划」。
  1124. /// </summary>
  1125. private static IEnumerable<SysMenu> BuildS3SupplyMenus(DateTime ct)
  1126. {
  1127. const long s3MaterialPlanDirId = 1322000000009L;
  1128. const long s3ProcurementDirId = 1322000000010L;
  1129. const long s3RootDirId = 1321000003000L;
  1130. yield return new SysMenu
  1131. {
  1132. Id = 1329003100001L,
  1133. Pid = s3MaterialPlanDirId,
  1134. Title = "物料需求计划",
  1135. Path = "/aidop/s3/material-plan/demand-schedule",
  1136. Name = "aidopS3DemandSchedule",
  1137. Component = "/aidop/s3/supply/demandScheduleList",
  1138. Icon = "ele-Calendar",
  1139. Type = MenuTypeEnum.Menu,
  1140. CreateTime = ct,
  1141. OrderNo = 10,
  1142. Remark = "S3 物料需求计划(ic_demandschedule)"
  1143. };
  1144. yield return new SysMenu
  1145. {
  1146. Id = 1329003100002L,
  1147. Pid = s3MaterialPlanDirId,
  1148. Title = "物料交货计划",
  1149. Path = "/aidop/s3/material-plan/delivery-schedule",
  1150. Name = "aidopS3DeliverySchedule",
  1151. Component = "/aidop/s3/supply/deliveryScheduleList",
  1152. Icon = "ele-Document",
  1153. Type = MenuTypeEnum.Menu,
  1154. CreateTime = ct,
  1155. OrderNo = 20,
  1156. Remark = "S3 物料交货计划(srm_polist_ds)"
  1157. };
  1158. yield return new SysMenu
  1159. {
  1160. Id = 1329003100003L,
  1161. Pid = s3MaterialPlanDirId,
  1162. Title = "交货单异常记录",
  1163. Path = "/aidop/s3/material-plan/delivery-exception",
  1164. Name = "aidopS3DeliveryException",
  1165. Component = "/aidop/s3/supply/deliveryExceptionList",
  1166. Icon = "ele-Warning",
  1167. Type = MenuTypeEnum.Menu,
  1168. CreateTime = ct,
  1169. OrderNo = 30,
  1170. Remark = "S3 交货单异常记录(DeliveryExceptionMaster)"
  1171. };
  1172. yield return new SysMenu
  1173. {
  1174. Id = 1329003100011L,
  1175. Pid = s3ProcurementDirId,
  1176. Title = "物料采购申请",
  1177. Path = "/aidop/s3/procurement/purchase-request",
  1178. Name = "aidopS3PurchaseRequest",
  1179. Component = "/aidop/s3/supply/purchaseRequestList",
  1180. Icon = "ele-Document",
  1181. Type = MenuTypeEnum.Menu,
  1182. CreateTime = ct,
  1183. OrderNo = 10,
  1184. Remark = "S3 物料采购申请(srm_pr_main)"
  1185. };
  1186. yield return new SysMenu
  1187. {
  1188. Id = 1329003100010L,
  1189. Pid = s3RootDirId,
  1190. Title = "供应协同看板",
  1191. Path = "/aidop/s3/supply-kanban",
  1192. Name = "aidopS3SupplyKanban",
  1193. Component = "/aidop/kanban/s3",
  1194. Icon = "ele-DataBoard",
  1195. Type = MenuTypeEnum.Menu,
  1196. CreateTime = ct,
  1197. OrderNo = 102,
  1198. Remark = "S3 供应协同看板"
  1199. };
  1200. }
  1201. private static readonly (string Code, string L1, (string Title, string Desc, string Complexity, string Days, string Note)[] Leaves)[] ModuleDefinitions =
  1202. {
  1203. ("S0", "S0 运营建模", new[]
  1204. {
  1205. ("数据建模", "支持数据库表结构设计与建模", "高", "5", "核心基础功能"),
  1206. ("业务建模", "支持业务流程建模与配置", "高", "5", "核心基础功能"),
  1207. }),
  1208. ("S1", "S1 产销协同", new[]
  1209. {
  1210. ("订单管理", "销售订单录入、查询、编辑、删除", "中", "3", ""),
  1211. ("工单管理", "工单创建、分配、跟踪", "中", "3", ""),
  1212. ("产销协同看板", "订单与生产协同数据可视化", "高", "5", "数据看板类"),
  1213. }),
  1214. ("S2", "S2 制造协同", new[]
  1215. {
  1216. ("生产排程", "生产任务排程与调度", "高", "5", ""),
  1217. ("作业计划", "车间作业计划管理", "中", "3", ""),
  1218. ("制造协同看板", "制造过程协同数据展示", "高", "5", "数据看板类"),
  1219. }),
  1220. ("S3", "S3 供应协同", new[]
  1221. {
  1222. ("物料计划", "物料需求计划(MRP)计算", "高", "7", "核心算法"),
  1223. ("供应协同看板", "供应商协同数据可视化", "中", "4", "数据看板类"),
  1224. }),
  1225. ("S4", "S4 采购执行", new[]
  1226. {
  1227. ("采购管理", "采购申请、订单、合同管理", "中", "4", ""),
  1228. ("交货管理", "供应商交货跟踪与验收", "中", "3", ""),
  1229. ("退货管理", "采购退货流程处理", "低", "2", ""),
  1230. ("采购执行看板", "采购执行数据可视化", "中", "4", "数据看板类"),
  1231. }),
  1232. ("S5", "S5 物料仓储", new[]
  1233. {
  1234. ("来料检验", "IQC来料质量检验", "中", "3", ""),
  1235. ("仓储管理", "仓库入库、出库、调拨", "中", "4", ""),
  1236. ("库存数据", "库存查询、盘点、调整", "中", "3", ""),
  1237. ("物料仓储看板", "仓储数据可视化分析", "中", "4", "数据看板类"),
  1238. }),
  1239. ("S6", "S6 生产执行", new[]
  1240. {
  1241. ("生产记录管理", "生产过程数据记录", "中", "3", ""),
  1242. ("过程质量管理", "IPQC过程质量检验", "中", "4", ""),
  1243. ("设备工装管理", "设备台账、保养、维修", "中", "4", ""),
  1244. ("生产执行看板", "生产执行数据可视化", "高", "5", "数据看板类"),
  1245. }),
  1246. ("S7", "S7 成品仓储", new[]
  1247. {
  1248. ("成品质量管理", "OQC成品质量检验", "中", "3", ""),
  1249. ("生产入库管理", "成品入库流程", "低", "2", ""),
  1250. ("成品出库管理", "成品出库发货流程", "低", "2", ""),
  1251. ("成品库存管理", "成品库存查询与管理", "中", "3", ""),
  1252. }),
  1253. ("S8", "S8 异常监控", new[]
  1254. {
  1255. ("异常监控看板", "生产异常监控、处理、跟踪", "中", "4", ""),
  1256. }),
  1257. ("S9", "S9 运营指标", new[]
  1258. {
  1259. ("ERP同步", "与外部ERP系统数据同步", "高", "7", "接口集成"),
  1260. ("日志查询", "系统操作日志查询", "低", "2", ""),
  1261. ("ERP事务", "ERP相关事务处理", "中", "3", ""),
  1262. }),
  1263. ("M11", "系统管理", new[]
  1264. {
  1265. ("组织架构", "部门、岗位、人员管理", "中", "3", "与框架系统管理对应,后续可映射具体页"),
  1266. ("菜单管理", "系统菜单权限配置", "中", "3", ""),
  1267. }),
  1268. ("M12", "流程平台", new[]
  1269. {
  1270. ("流程管理", "工作流流程定义与配置", "高", "7", "核心引擎"),
  1271. ("表单管理", "流程表单设计与配置", "高", "5", ""),
  1272. ("应用设计", "业务应用快速设计", "高", "5", ""),
  1273. ("数据资源配置", "数据资源连接配置", "中", "4", ""),
  1274. ("格式化JSON", "JSON数据格式化工具", "低", "1", "工具类"),
  1275. ("模板管理", "流程模板管理", "中", "3", ""),
  1276. ("系统按钮", "系统按钮权限配置", "低", "2", ""),
  1277. ("流程按钮", "流程操作按钮配置", "低", "2", ""),
  1278. ("应用程序", "外部应用集成管理", "中", "4", ""),
  1279. ("接口系统", "API接口配置管理", "高", "5", ""),
  1280. }),
  1281. ("M13", "系统工具", new[]
  1282. {
  1283. ("数据字典", "系统字典数据管理", "低", "2", ""),
  1284. ("数据连接", "数据库连接配置", "中", "3", ""),
  1285. ("首页设置", "系统首页个性化配置", "低", "2", ""),
  1286. ("日志查询", "系统运行日志查询", "低", "2", ""),
  1287. ("流水号管理", "业务流水号规则配置", "低", "2", ""),
  1288. ("工作日设置", "工作日历配置", "低", "1", ""),
  1289. ("图标库", "系统图标资源管理", "低", "1", ""),
  1290. ("在线用户", "在线用户监控", "低", "2", ""),
  1291. ("周库存统计", "库存周期统计报表", "中", "3", "报表类"),
  1292. ("数据导入", "批量数据导入工具", "中", "3", ""),
  1293. }),
  1294. ("M14", "流程中心", new[]
  1295. {
  1296. ("发起流程", "新建并发起工作流程", "中", "3", ""),
  1297. ("待办事项", "个人待办任务处理", "中", "3", ""),
  1298. ("待办批量处理", "待办任务批量操作", "中", "3", ""),
  1299. ("已办事项", "已办任务查询", "低", "2", ""),
  1300. ("我的流程", "我发起的流程跟踪", "中", "3", ""),
  1301. ("已委托事项", "委托他人处理的事项", "低", "2", ""),
  1302. ("流程委托", "流程任务委托配置", "低", "2", ""),
  1303. ("流程意见", "流程审批意见管理", "低", "2", ""),
  1304. }),
  1305. ("M15", "个人设置", new[]
  1306. {
  1307. ("个人信息", "个人资料维护", "低", "1", ""),
  1308. ("头像设置", "个人头像上传", "低", "1", ""),
  1309. ("修改密码", "密码修改功能", "低", "1", ""),
  1310. ("签章管理", "个人电子签章管理", "中", "3", ""),
  1311. ("文件管理", "个人文件存储管理", "中", "3", ""),
  1312. ("快捷菜单", "个人快捷方式配置", "低", "1", ""),
  1313. }),
  1314. ("M16", "系统首页", new[]
  1315. {
  1316. ("系统首页", "系统门户首页", "中", "3", "门户类"),
  1317. ("发起流程(快捷)", "首页快捷发起流程", "低", "1", ""),
  1318. ("我的流程(快捷)", "首页流程快捷入口", "低", "1", ""),
  1319. ("待办事项(快捷)", "首页待办快捷入口", "低", "1", ""),
  1320. }),
  1321. };
  1322. }