SysMenuSeedData.cs 58 KB

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