SysMenuSeedData.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  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 BuildS1SalesKanbanMenus(ct))
  94. list.Add(m);
  95. foreach (var m in BuildS8CollaborationMenus(ct))
  96. list.Add(m);
  97. // 产销协同看板改为目录后,访问 /aidop/s1/SalesKanBan 默认进入指标看板子页
  98. var salesKanBanDir = list.FirstOrDefault(x => x.Id == 1322000000005L);
  99. if (salesKanBanDir != null)
  100. salesKanBanDir.Redirect = "/aidop/s1/SalesKanBan/kanban";
  101. // S8:复用自动生成的首项菜单位,直接作为「异常监控看板」页,避免再出现中间层「异常管理」目录
  102. var s8Dashboard = list.FirstOrDefault(x => x.Id == 1322000000028L);
  103. if (s8Dashboard != null)
  104. {
  105. s8Dashboard.Title = "异常监控看板";
  106. s8Dashboard.Path = "/aidop/s8/dashboard";
  107. s8Dashboard.Name = "aidopS8Dashboard";
  108. s8Dashboard.Component = "/aidop/s8/dashboard/S8DashboardPage";
  109. s8Dashboard.Icon = "ele-DataBoard";
  110. s8Dashboard.Type = MenuTypeEnum.Menu;
  111. s8Dashboard.Redirect = null;
  112. s8Dashboard.Remark = "S8 异常监控看板";
  113. }
  114. return list;
  115. }
  116. /// <summary>
  117. /// 智慧诊断 + 智慧运营看板(入库,便于平台「菜单管理」配置;勿在 Web aidopMenuDisplay 再注入整段菜单)。
  118. /// </summary>
  119. private static IEnumerable<SysMenu> BuildAidopSmartOpsSeedMenus(DateTime ct)
  120. {
  121. const long smartOpsDirId = 1320990000200L;
  122. yield return new SysMenu
  123. {
  124. Id = 1320990000201L,
  125. Pid = AidopRootId,
  126. Title = "智慧诊断",
  127. Path = "/aidop/smart-diagnosis",
  128. Name = "aidopSmartDiagnosis",
  129. Component = "/aidop/diagnosis/index",
  130. Icon = "ele-TrendCharts",
  131. Type = MenuTypeEnum.Menu,
  132. CreateTime = ct,
  133. OrderNo = 251,
  134. Remark = "Ai-DOP 智慧诊断"
  135. };
  136. yield return new SysMenu
  137. {
  138. Id = smartOpsDirId,
  139. Pid = AidopRootId,
  140. Title = "智慧运营看板",
  141. Path = "/aidop/smart-ops",
  142. Name = "aidopSmartOpsRoot",
  143. Component = "Layout",
  144. Icon = "ele-DataBoard",
  145. Type = MenuTypeEnum.Dir,
  146. CreateTime = ct,
  147. OrderNo = 252,
  148. Remark = "Ai-DOP 智慧运营看板分组"
  149. };
  150. // OrderNo:建模紧接九宫格之后,避免在侧栏最底部不易发现;已落库环境需在菜单管理调序或改库
  151. var children = new (long Id, string Path, string Name, string Title, string Component, int Order)[]
  152. {
  153. (1320990000301L, "/aidop/smart-ops/grid", "aidopSmartOpsGrid", "九宫格智慧运营看板", "/dashboard/home", 100),
  154. (1320990000311L, "/aidop/smart-ops/modeling", "aidopSmartOpsModeling", "运营指标建模", "/aidop/kanban/s0", 105),
  155. (1320990000312L, "/aidop/smart-ops/kpi-master", "aidopSmartOpsKpiMaster", "运营指标主数据", "/aidop/kanban/kpiMaster", 106),
  156. (1320990000302L, "/aidop/smart-ops/s1", "aidopSmartOpsS1", "S1产销协同看板", "/aidop/kanban/s1", 110),
  157. (1320990000303L, "/aidop/smart-ops/s2", "aidopSmartOpsS2", "S2制造协同看板", "/aidop/kanban/s2", 120),
  158. (1320990000304L, "/aidop/smart-ops/s3", "aidopSmartOpsS3", "S3供应协同看板", "/aidop/kanban/s3", 130),
  159. (1320990000305L, "/aidop/smart-ops/s4", "aidopSmartOpsS4", "S4采购执行看板", "/aidop/kanban/s4", 140),
  160. (1320990000306L, "/aidop/smart-ops/s5", "aidopSmartOpsS5", "S5物料仓储看板", "/aidop/kanban/s5", 150),
  161. (1320990000307L, "/aidop/smart-ops/s6", "aidopSmartOpsS6", "S6生产执行看板", "/aidop/kanban/s6", 160),
  162. (1320990000308L, "/aidop/smart-ops/s7", "aidopSmartOpsS7", "S7成品仓储看板", "/aidop/kanban/s7", 170),
  163. (1320990000309L, "/aidop/smart-ops/s8", "aidopSmartOpsS8", "S8异常监控看板", "/aidop/kanban/s8", 180),
  164. (1320990000310L, "/aidop/smart-ops/s9", "aidopSmartOpsS9", "S9运营指标看板", "/aidop/kanban/s9", 190),
  165. };
  166. foreach (var (id, path, name, title, component, order) in children)
  167. {
  168. yield return new SysMenu
  169. {
  170. Id = id,
  171. Pid = smartOpsDirId,
  172. Title = title,
  173. Path = path,
  174. Name = name,
  175. Component = component,
  176. Icon = "ele-DataAnalysis",
  177. Type = MenuTypeEnum.Menu,
  178. CreateTime = ct,
  179. OrderNo = order,
  180. Remark = title
  181. };
  182. }
  183. }
  184. private static string ResolveComponent(string modCode, int leafIndex) =>
  185. ComponentOverrides.TryGetValue((modCode, leafIndex), out var c) ? c : "/aidop/planning/index";
  186. private static readonly Dictionary<(string Mod, int Leaf), string> ComponentOverrides = new()
  187. {
  188. { ("S1", 3), "/aidop/kanban/s1" },
  189. };
  190. /// <summary>S1 等模块下叶子菜单 path 覆盖(目录化后使用语义路径)。</summary>
  191. private static readonly Dictionary<(string Mod, int Leaf), string> PathOverrides = new()
  192. {
  193. { ("S1", 1), "/aidop/s1/order-mgmt" },
  194. { ("S1", 2), "/aidop/s1/workorder-mgmt" },
  195. { ("S1", 3), "/aidop/s1/SalesKanBan" },
  196. };
  197. /// <summary>S1 等模块下叶子菜单 route name 覆盖。</summary>
  198. private static readonly Dictionary<(string Mod, int Leaf), string> NameOverrides = new()
  199. {
  200. { ("S1", 1), "aidopS1OrderMgmt" },
  201. { ("S1", 2), "aidopS1WorkOrderMgmt" },
  202. };
  203. /// <summary>
  204. /// 需要从 Menu 提升为 Dir(目录)的叶子节点;用于承载子级菜单。
  205. /// </summary>
  206. private static readonly HashSet<(string Mod, int Leaf)> DirOverrides = new()
  207. {
  208. { ("S0", 1) }, // 数据建模 → 目录,产销建模挂在其下
  209. { ("S1", 1) }, // 订单管理 → 目录(销售订单、合同评审)
  210. { ("S1", 2) }, // 工单管理 → 目录(工单列表、工单下达)
  211. { ("S1", 3) }, // 产销协同看板 → 目录(指标看板、需求明细核验)
  212. };
  213. private static string BuildRemark(string code, (string Title, string Desc, string Complexity, string Days, string Note) leaf)
  214. {
  215. var notePart = string.IsNullOrWhiteSpace(leaf.Note) ? "" : $" | {leaf.Note}";
  216. var s = $"[{code}|{leaf.Complexity}|{leaf.Days}人天] {leaf.Desc}{notePart}";
  217. return s.Length <= 256 ? s : s[..256];
  218. }
  219. private static IEnumerable<SysMenu> BuildS0SalesMenus(DateTime ct)
  220. {
  221. // 与 ModuleDefinitions 中 S0 首项「数据建模」的生成 Id 一致(全局 menuSeq=1 → 1322000000001)
  222. const long s0DataModelingMenuId = 1322000000001L;
  223. const long subDirId = 1329002000000L;
  224. yield return new SysMenu
  225. {
  226. Id = subDirId,
  227. Pid = s0DataModelingMenuId,
  228. Title = "产销建模",
  229. Path = "/aidop/s0/sales",
  230. Name = "aidopS0Sales",
  231. Component = "Layout",
  232. Icon = "ele-ShoppingCart",
  233. Type = MenuTypeEnum.Dir,
  234. CreateTime = ct,
  235. OrderNo = 20,
  236. Remark = "S0 产销建模"
  237. };
  238. yield return new SysMenu
  239. {
  240. Id = subDirId + 1,
  241. Pid = subDirId,
  242. Title = "客户管理",
  243. Path = "/aidop/s0/sales/customer",
  244. Name = "aidopS0SalesCustomer",
  245. Component = "/aidop/s0/sales/CustomerList",
  246. Icon = "ele-User",
  247. Type = MenuTypeEnum.Menu,
  248. CreateTime = ct,
  249. OrderNo = 1,
  250. Remark = "S0 客户管理"
  251. };
  252. yield return new SysMenu
  253. {
  254. Id = subDirId + 2,
  255. Pid = subDirId,
  256. Title = "物料管理",
  257. Path = "/aidop/s0/sales/material",
  258. Name = "aidopS0SalesMaterial",
  259. Component = "/aidop/s0/sales/MaterialList",
  260. Icon = "ele-Box",
  261. Type = MenuTypeEnum.Menu,
  262. CreateTime = ct,
  263. OrderNo = 2,
  264. Remark = "S0 物料管理"
  265. };
  266. yield return new SysMenu
  267. {
  268. Id = subDirId + 3,
  269. Pid = subDirId,
  270. Title = "订单优先规则",
  271. Path = "/aidop/s0/sales/order-priority-rule",
  272. Name = "aidopS0SalesOrderPriorityRule",
  273. Component = "/aidop/s0/sales/OrderPriorityRuleList",
  274. Icon = "ele-Sort",
  275. Type = MenuTypeEnum.Menu,
  276. CreateTime = ct,
  277. OrderNo = 3,
  278. Remark = "S0 订单优先规则"
  279. };
  280. }
  281. private static IEnumerable<SysMenu> BuildS0ManufacturingMenus(DateTime ct)
  282. {
  283. const long s0DataModelingMenuId = 1322000000001L;
  284. const long subDirId = 1329003000000L;
  285. yield return new SysMenu
  286. {
  287. Id = subDirId,
  288. Pid = s0DataModelingMenuId,
  289. Title = "制造建模",
  290. Path = "/aidop/s0/manufacturing",
  291. Name = "aidopS0Manufacturing",
  292. Component = "Layout",
  293. Icon = "ele-SetUp",
  294. Type = MenuTypeEnum.Dir,
  295. CreateTime = ct,
  296. OrderNo = 30,
  297. Remark = "S0 制造建模"
  298. };
  299. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  300. {
  301. (1, "/aidop/s0/manufacturing/standard-bom", "aidopS0MfgStandardBom", "标准 BOM", "/aidop/s0/manufacturing/StandardBomManagement", 10),
  302. (2, "/aidop/s0/manufacturing/standard-operation", "aidopS0MfgStandardOperation", "标准工序", "/aidop/s0/manufacturing/StandardProcessList", 20),
  303. (3, "/aidop/s0/manufacturing/production-line", "aidopS0MfgProductionLine", "产线", "/aidop/s0/manufacturing/ProductionLineList", 30),
  304. (4, "/aidop/s0/manufacturing/routing", "aidopS0MfgRouting", "工艺路线", "/aidop/s0/manufacturing/RoutingList", 40),
  305. (5, "/aidop/s0/manufacturing/material-substitution", "aidopS0MfgMaterialSubstitution", "物料替代", "/aidop/s0/manufacturing/MaterialSubstitutionList", 50),
  306. (6, "/aidop/s0/manufacturing/work-order-control", "aidopS0MfgWorkOrderControl", "工单控制参数", "/aidop/s0/manufacturing/WorkOrderControlParams", 60),
  307. (7, "/aidop/s0/manufacturing/person-skill", "aidopS0MfgPersonSkill", "人员技能", "/aidop/s0/manufacturing/PersonnelSkillList", 70),
  308. (8, "/aidop/s0/manufacturing/person-skill-assignment", "aidopS0MfgPersonSkillAssignment", "人员技能维护", "/aidop/s0/manufacturing/PersonSkillAssignmentList", 80),
  309. (9, "/aidop/s0/manufacturing/line-post", "aidopS0MfgLinePost", "产线岗位维护", "/aidop/s0/manufacturing/LinePostList", 90),
  310. (10, "/aidop/s0/manufacturing/work-center", "aidopS0MfgWorkCenter", "工作中心", "/aidop/s0/manufacturing/WorkCenterList", 100),
  311. (11, "/aidop/s0/manufacturing/line-material", "aidopS0MfgLineMaterial", "线边物料", "/aidop/s0/manufacturing/LineMaterialList", 110),
  312. (12, "/aidop/s0/manufacturing/element-param-production", "aidopS0MfgElementParamProduction", "生产要素参数", "/aidop/s0/manufacturing/ProductionElementParamList", 120),
  313. (13, "/aidop/s0/manufacturing/material-process-element", "aidopS0MfgMaterialProcessElement", "物料工艺要素", "/aidop/s0/manufacturing/MaterialProcessElementList", 130),
  314. (14, "/aidop/s0/manufacturing/preprocess-element", "aidopS0MfgPreprocessElement", "前处理要素", "/aidop/s0/manufacturing/PreprocessElementList", 140),
  315. (15, "/aidop/s0/manufacturing/preprocess-element-param", "aidopS0MfgElementParamPreprocess", "前处理要素参数", "/aidop/s0/manufacturing/PreprocessElementParamList", 150),
  316. (16, "/aidop/s0/manufacturing/sop-file-type", "aidopS0MfgSopFileType", "SOP 文件类型", "/aidop/s0/manufacturing/SopFileTypeList", 160),
  317. (17, "/aidop/s0/manufacturing/sop-document", "aidopS0MfgSopDocument", "SOP 维护", "/aidop/s0/manufacturing/SopMaintenanceList", 170),
  318. };
  319. foreach (var (idOff, path, name, title, component, order) in leaves)
  320. {
  321. yield return new SysMenu
  322. {
  323. Id = subDirId + idOff,
  324. Pid = subDirId,
  325. Title = title,
  326. Path = path,
  327. Name = name,
  328. Component = component,
  329. Icon = "ele-Document",
  330. Type = MenuTypeEnum.Menu,
  331. CreateTime = ct,
  332. OrderNo = order,
  333. Remark = $"S0 {title}"
  334. };
  335. }
  336. yield return new SysMenu
  337. {
  338. Id = subDirId + 18,
  339. Pid = subDirId,
  340. Title = "选择替代方案",
  341. Path = "/aidop/s0/manufacturing/substitute-scheme-select",
  342. Name = "aidopS0MfgSubstituteSchemeSelect",
  343. Component = "/aidop/s0/manufacturing/SubstituteSchemeSelectList",
  344. Icon = "ele-List",
  345. Type = MenuTypeEnum.Menu,
  346. CreateTime = ct,
  347. OrderNo = 18,
  348. Remark = "S0 选择替代方案(只读查询)"
  349. };
  350. }
  351. private static IEnumerable<SysMenu> BuildS0SupplyMenus(DateTime ct)
  352. {
  353. const long s0DataModelingMenuId = 1322000000001L;
  354. const long subDirId = 1329004000000L;
  355. yield return new SysMenu
  356. {
  357. Id = subDirId,
  358. Pid = s0DataModelingMenuId,
  359. Title = "供应建模",
  360. Path = "/aidop/s0/supply",
  361. Name = "aidopS0Supply",
  362. Component = "Layout",
  363. Icon = "ele-Ship",
  364. Type = MenuTypeEnum.Dir,
  365. CreateTime = ct,
  366. OrderNo = 40,
  367. Remark = "S0 供应建模"
  368. };
  369. yield return new SysMenu
  370. {
  371. Id = subDirId + 1,
  372. Pid = subDirId,
  373. Title = "供应商维护",
  374. Path = "/aidop/s0/supply/supplier",
  375. Name = "aidopS0SupplySupplier",
  376. Component = "/aidop/s0/supply/SupplierList",
  377. Icon = "ele-UserFilled",
  378. Type = MenuTypeEnum.Menu,
  379. CreateTime = ct,
  380. OrderNo = 1,
  381. Remark = "S0 供应商维护"
  382. };
  383. yield return new SysMenu
  384. {
  385. Id = subDirId + 2,
  386. Pid = subDirId,
  387. Title = "货源清单",
  388. Path = "/aidop/s0/supply/sourcing-item",
  389. Name = "aidopS0SupplySourcingItem",
  390. Component = "/aidop/s0/supply/SourcingList",
  391. Icon = "ele-List",
  392. Type = MenuTypeEnum.Menu,
  393. CreateTime = ct,
  394. OrderNo = 2,
  395. Remark = "S0 货源清单(srm_purchase)"
  396. };
  397. }
  398. private static IEnumerable<SysMenu> BuildS0QualityMenus(DateTime ct)
  399. {
  400. const long s0DataModelingMenuId = 1322000000001L;
  401. const long subDirId = 1329004500000L;
  402. yield return new SysMenu
  403. {
  404. Id = subDirId,
  405. Pid = s0DataModelingMenuId,
  406. Title = "质量建模",
  407. Path = "/aidop/s0/quality",
  408. Name = "aidopS0Quality",
  409. Component = "Layout",
  410. Icon = "ele-DataAnalysis",
  411. Type = MenuTypeEnum.Dir,
  412. CreateTime = ct,
  413. OrderNo = 45,
  414. Remark = "S0 质量建模"
  415. };
  416. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  417. {
  418. (1, "/aidop/s0/quality/dictionary", "aidopS0QlyDictionary", "质量字典", "/aidop/s0/quality/QualityDictionaryPage", 10),
  419. (2, "/aidop/s0/quality/raw-whitelist", "aidopS0QlyRawWhitelist", "原材料白名单", "/aidop/s0/quality/RawWhitelistList", 20),
  420. (3, "/aidop/s0/quality/sampling-scheme", "aidopS0QlySamplingScheme", "抽样方案", "/aidop/s0/quality/SamplingSchemeList", 30),
  421. (4, "/aidop/s0/quality/instrument", "aidopS0QlyInstrument", "检验仪器", "/aidop/s0/quality/InspectionInstrumentList", 40),
  422. (5, "/aidop/s0/quality/inspection-method", "aidopS0QlyInspectionMethod", "检验方法", "/aidop/s0/quality/InspectionMethodList", 50),
  423. (6, "/aidop/s0/quality/inspection-basis", "aidopS0QlyInspectionBasis", "检验依据", "/aidop/s0/quality/InspectionBasisList", 60),
  424. (7, "/aidop/s0/quality/inspection-standard", "aidopS0QlyInspectionStandard", "检验标准", "/aidop/s0/quality/InspectionStandardList", 70),
  425. (8, "/aidop/s0/quality/inspection-item", "aidopS0QlyInspectionItem", "检验项目", "/aidop/s0/quality/InspectionItemList", 80),
  426. (9, "/aidop/s0/quality/inspection-frequency", "aidopS0QlyInspectionFrequency", "检验频率", "/aidop/s0/quality/InspectionFrequencyList", 90),
  427. (10, "/aidop/s0/quality/inspection-plan", "aidopS0QlyInspectionPlan", "检验方案", "/aidop/s0/quality/InspectionPlanList", 100),
  428. (11, "/aidop/s0/quality/raw-inspection-spec", "aidopS0QlyRawInspectionSpec", "原材料检验规范", "/aidop/s0/quality/RawInspectionSpecList", 110),
  429. (12, "/aidop/s0/quality/process-inspection-spec", "aidopS0QlyProcessInspectionSpec", "过程检验规范", "/aidop/s0/quality/ProcessInspectionSpecList", 120),
  430. };
  431. foreach (var (idOff, path, name, title, component, order) in leaves)
  432. {
  433. yield return new SysMenu
  434. {
  435. Id = subDirId + idOff,
  436. Pid = subDirId,
  437. Title = title,
  438. Path = path,
  439. Name = name,
  440. Component = component,
  441. Icon = "ele-Document",
  442. Type = MenuTypeEnum.Menu,
  443. CreateTime = ct,
  444. OrderNo = order,
  445. Remark = $"S0 {title}"
  446. };
  447. }
  448. }
  449. /// <summary>
  450. /// S8 异常协同:直接挂在「S8 异常监控」目录下,不再经过中间层「异常管理」。
  451. /// </summary>
  452. private static IEnumerable<SysMenu> BuildS8CollaborationMenus(DateTime ct)
  453. {
  454. const long s8DirId = 1321000009000L;
  455. const long baseId = 1329008000000L;
  456. // 可见业务页(「异常监控看板」复用自动生成的 1322000000028 菜单位)
  457. yield return new SysMenu
  458. {
  459. Id = baseId + 2,
  460. Pid = s8DirId,
  461. Title = "异常列表",
  462. Path = "/aidop/s8/exceptions",
  463. Name = "aidopS8ExceptionList",
  464. Component = "/aidop/s8/exceptions/S8ExceptionListPage",
  465. Icon = "ele-List",
  466. Type = MenuTypeEnum.Menu,
  467. CreateTime = ct,
  468. OrderNo = 20,
  469. Remark = "S8 异常列表"
  470. };
  471. yield return new SysMenu
  472. {
  473. Id = baseId + 3,
  474. Pid = s8DirId,
  475. Title = "主动提报",
  476. Path = "/aidop/s8/report",
  477. Name = "aidopS8ManualReport",
  478. Component = "/aidop/s8/report/S8ManualReportPage",
  479. Icon = "ele-EditPen",
  480. Type = MenuTypeEnum.Menu,
  481. CreateTime = ct,
  482. OrderNo = 30,
  483. Remark = "S8 主动提报"
  484. };
  485. yield return new SysMenu
  486. {
  487. Id = baseId + 4,
  488. Pid = s8DirId,
  489. Title = "配置中心",
  490. Path = "/aidop/s8/config",
  491. Name = "aidopS8ConfigHub",
  492. Component = "/aidop/s8/config/S8ConfigHubPage",
  493. Icon = "ele-Setting",
  494. Type = MenuTypeEnum.Menu,
  495. CreateTime = ct,
  496. OrderNo = 40,
  497. Remark = "S8 配置中心"
  498. };
  499. // 隐藏路由(不出侧栏,需参与动态路由注册)
  500. yield return new SysMenu
  501. {
  502. Id = baseId + 10,
  503. Pid = s8DirId,
  504. Title = "任务详情",
  505. Path = "/aidop/s8/exceptions/:id",
  506. Name = "aidopS8TaskDetail",
  507. Component = "/aidop/s8/exceptions/S8TaskDetailPage",
  508. Icon = "ele-Document",
  509. Type = MenuTypeEnum.Menu,
  510. CreateTime = ct,
  511. OrderNo = 90,
  512. IsHide = true,
  513. Remark = "S8 任务详情"
  514. };
  515. var cfg = new (long Off, string Path, string Name, string Title, string Component)[]
  516. {
  517. (11, "/aidop/s8/config/scenes", "aidopS8ScenarioConfig", "场景基础配置", "/aidop/s8/config/S8ScenarioConfigPage"),
  518. (12, "/aidop/s8/config/notifications", "aidopS8NotificationLayerConfig", "通知分层配置", "/aidop/s8/config/S8NotificationLayerPage"),
  519. (13, "/aidop/s8/config/roles", "aidopS8RolePermissionConfig", "角色权限配置", "/aidop/s8/config/S8RolePermissionConfigPage"),
  520. (14, "/aidop/s8/config/alert-rules", "aidopS8AlertRulesConfig", "报警规则配置", "/aidop/s8/config/S8AlertRulesPage"),
  521. (15, "/aidop/s8/config/data-sources", "aidopS8DataSourceConfig", "数据源配置", "/aidop/s8/config/S8DataSourceConfigPage"),
  522. (16, "/aidop/s8/config/watch-rules", "aidopS8WatchRuleConfig", "监视规则配置", "/aidop/s8/config/S8WatchRuleConfigPage"),
  523. };
  524. foreach (var (off, path, name, title, component) in cfg)
  525. {
  526. yield return new SysMenu
  527. {
  528. Id = baseId + off,
  529. Pid = s8DirId,
  530. Title = title,
  531. Path = path,
  532. Name = name,
  533. Component = component,
  534. Icon = "ele-Document",
  535. Type = MenuTypeEnum.Menu,
  536. CreateTime = ct,
  537. OrderNo = 100 + (int)off,
  538. IsHide = true,
  539. Remark = $"S8 {title}"
  540. };
  541. }
  542. }
  543. private static IEnumerable<SysMenu> BuildS0WarehouseMenus(DateTime ct)
  544. {
  545. const long s0DataModelingMenuId = 1322000000001L;
  546. const long subDirId = 1329005000000L;
  547. yield return new SysMenu
  548. {
  549. Id = subDirId,
  550. Pid = s0DataModelingMenuId,
  551. Title = "仓储建模",
  552. Path = "/aidop/s0/warehouse",
  553. Name = "aidopS0Warehouse",
  554. Component = "Layout",
  555. Icon = "ele-OfficeBuilding",
  556. Type = MenuTypeEnum.Dir,
  557. CreateTime = ct,
  558. OrderNo = 50,
  559. Remark = "S0 仓储建模"
  560. };
  561. var leaves = new (long IdOff, string Path, string Name, string Title, string Component, int Order)[]
  562. {
  563. (1, "/aidop/s0/warehouse/department", "aidopS0WhDepartment", "部门维护", "/aidop/s0/warehouse/DepartmentList", 10),
  564. (2, "/aidop/s0/warehouse/employee", "aidopS0WhEmployee", "雇员列表", "/aidop/s0/warehouse/EmployeeList", 20),
  565. (3, "/aidop/s0/warehouse/cost-center", "aidopS0WhCostCenter", "成本中心", "/aidop/s0/warehouse/CostCenterList", 30),
  566. (4, "/aidop/s0/warehouse/location", "aidopS0WhLocation", "库位维护", "/aidop/s0/warehouse/LocationList", 40),
  567. (5, "/aidop/s0/warehouse/location-shelf", "aidopS0WhLocationShelf", "货架列表", "/aidop/s0/warehouse/LocationShelfList", 50),
  568. (6, "/aidop/s0/warehouse/barcode-rule", "aidopS0WhBarcodeRule", "条码规则", "/aidop/s0/warehouse/BarcodeRuleList", 60),
  569. (7, "/aidop/s0/warehouse/label-type", "aidopS0WhLabelType", "标签格式", "/aidop/s0/warehouse/LabelTypeList", 70),
  570. (8, "/aidop/s0/warehouse/nbr-type", "aidopS0WhNbrType", "单号类型", "/aidop/s0/warehouse/NbrTypeList", 80),
  571. (9, "/aidop/s0/warehouse/nbr-control", "aidopS0WhNbrControl", "单号规则维护", "/aidop/s0/warehouse/NbrControlList", 90),
  572. (10, "/aidop/s0/warehouse/item-pack", "aidopS0WhItemPack", "零件包装规格", "/aidop/s0/warehouse/ItemPackList", 100),
  573. (11, "/aidop/s0/warehouse/emp-work-duty", "aidopS0WhEmpWorkDuty", "物料职责维护", "/aidop/s0/warehouse/EmpWorkDutyList", 110),
  574. (12, "/aidop/s0/warehouse/task-assignment", "aidopS0WhTaskAssignment", "物料状态任务指派", "/aidop/s0/warehouse/TaskAssignmentList", 120),
  575. };
  576. foreach (var (idOff, path, name, title, component, order) in leaves)
  577. {
  578. yield return new SysMenu
  579. {
  580. Id = subDirId + idOff,
  581. Pid = subDirId,
  582. Title = title,
  583. Path = path,
  584. Name = name,
  585. Component = component,
  586. Icon = "ele-Document",
  587. Type = MenuTypeEnum.Menu,
  588. CreateTime = ct,
  589. OrderNo = order,
  590. Remark = $"S0 {title}"
  591. };
  592. }
  593. }
  594. /// <summary>
  595. /// S1「产销协同看板」目录(Id=1322000000005)下的子菜单:指标看板、需求明细核验。
  596. /// </summary>
  597. private static IEnumerable<SysMenu> BuildS1SalesKanbanMenus(DateTime ct)
  598. {
  599. const long salesKanBanDirId = 1322000000005L;
  600. yield return new SysMenu
  601. {
  602. Id = 1322000000201L,
  603. Pid = salesKanBanDirId,
  604. Title = "产销协同指标看板",
  605. Path = "/aidop/s1/SalesKanBan/kanban",
  606. Name = "aidopS1SalesKanBanKanban",
  607. Component = "/aidop/kanban/s1",
  608. Icon = "ele-DataAnalysis",
  609. Type = MenuTypeEnum.Menu,
  610. CreateTime = ct,
  611. OrderNo = 10,
  612. Remark = "S1 产销协同看板(指标)"
  613. };
  614. yield return new SysMenu
  615. {
  616. Id = 1322000000202L,
  617. Pid = salesKanBanDirId,
  618. Title = "需求明细核验",
  619. Path = "/aidop/s1/SalesKanBan/requirement-examine-detail",
  620. Name = "aidopS1RequirementExamineDetail",
  621. Component = "/aidop/s1/sales-kanban/RequirementExamineDetailList",
  622. Icon = "ele-List",
  623. Type = MenuTypeEnum.Menu,
  624. CreateTime = ct,
  625. OrderNo = 20,
  626. Remark = "S1 需求明细核验"
  627. };
  628. }
  629. /// <summary>
  630. /// S1「订单管理」「工单管理」目录化后的子菜单:销售订单、合同评审、产品设计、工单下达等。
  631. /// 父级 Id:订单管理=1322000000003,工单管理=1322000000004(menuSeq 与 ModuleDefinitions 中 S1 叶子顺序一致)。
  632. /// 产销协同看板=1322000000005,路径 /aidop/s1/SalesKanBan(勿与工单管理目录混淆)。
  633. /// </summary>
  634. private static IEnumerable<SysMenu> BuildS1OrderWorkOrderMenus(DateTime ct)
  635. {
  636. const long orderMgmtDirId = 1322000000003L;
  637. const long workOrderMgmtDirId = 1322000000004L;
  638. yield return new SysMenu
  639. {
  640. Id = 1322000000101L,
  641. Pid = orderMgmtDirId,
  642. Title = "合同评审",
  643. Path = "/aidop/s1/order-mgmt/contract-review",
  644. Name = "aidopS1ContractReview",
  645. Component = "/aidop/business/contractReviewList",
  646. Icon = "ele-Edit",
  647. Type = MenuTypeEnum.Menu,
  648. CreateTime = ct,
  649. OrderNo = 10,
  650. Remark = "S1 合同评审"
  651. };
  652. yield return new SysMenu
  653. {
  654. Id = 1322000000102L,
  655. Pid = orderMgmtDirId,
  656. Title = "产品设计",
  657. Path = "/aidop/s1/order-mgmt/product-design",
  658. Name = "aidopS1ProductDesign",
  659. Component = "/aidop/business/productDesignList",
  660. Icon = "ele-Edit",
  661. Type = MenuTypeEnum.Menu,
  662. CreateTime = ct,
  663. OrderNo = 20,
  664. Remark = "S1 产品设计"
  665. };
  666. yield return new SysMenu
  667. {
  668. Id = 1322000000103L,
  669. Pid = orderMgmtDirId,
  670. Title = "订单评审",
  671. Path = "/aidop/s1/order-mgmt/order",
  672. Name = "aidopS1SalesOrder",
  673. Component = "/aidop/business/orderList",
  674. Icon = "ele-Document",
  675. Type = MenuTypeEnum.Menu,
  676. CreateTime = ct,
  677. OrderNo = 30,
  678. Remark = "S1 销售订单(原订单管理入口)"
  679. };
  680. yield return new SysMenu
  681. {
  682. Id = 1322000000104L,
  683. Pid = orderMgmtDirId,
  684. Title = "订单交付",
  685. Path = "/aidop/s1/order-mgmt/orderDelivery",
  686. Name = "aidopS1OrderDelivery",
  687. Component = "/aidop/business/orderDeliveryList",
  688. Icon = "ele-Document",
  689. Type = MenuTypeEnum.Menu,
  690. CreateTime = ct,
  691. OrderNo = 40,
  692. Remark = "S1 订单交付"
  693. };
  694. yield return new SysMenu
  695. {
  696. Id = 1322000000105L,
  697. Pid = orderMgmtDirId,
  698. Title = "订单发货",
  699. Path = "/aidop/s1/order-mgmt/asnShipper",
  700. Name = "aidopS1AsnShipper",
  701. Component = "/aidop/business/asnShipperList",
  702. Icon = "ele-Document",
  703. Type = MenuTypeEnum.Menu,
  704. CreateTime = ct,
  705. OrderNo = 50,
  706. Remark = "S1 订单发货"
  707. };
  708. yield return new SysMenu
  709. {
  710. Id = 1322000000106L,
  711. Pid = workOrderMgmtDirId,
  712. Title = "工单下达",
  713. Path = "/aidop/s1/workorder-mgmt/dispatch",
  714. Name = "aidopS1WorkOrderDispatch",
  715. Component = "/aidop/business/workOrderDispatchList",
  716. Icon = "ele-Position",
  717. Type = MenuTypeEnum.Menu,
  718. CreateTime = ct,
  719. OrderNo = 10,
  720. Remark = "S1 工单池下达"
  721. };
  722. }
  723. private static readonly (string Code, string L1, (string Title, string Desc, string Complexity, string Days, string Note)[] Leaves)[] ModuleDefinitions =
  724. {
  725. ("S0", "S0 运营建模", new[]
  726. {
  727. ("数据建模", "支持数据库表结构设计与建模", "高", "5", "核心基础功能"),
  728. ("业务建模", "支持业务流程建模与配置", "高", "5", "核心基础功能"),
  729. }),
  730. ("S1", "S1 产销协同", new[]
  731. {
  732. ("订单管理", "销售订单录入、查询、编辑、删除", "中", "3", ""),
  733. ("工单管理", "工单创建、分配、跟踪", "中", "3", ""),
  734. ("产销协同看板", "订单与生产协同数据可视化", "高", "5", "数据看板类"),
  735. }),
  736. ("S2", "S2 制造协同", new[]
  737. {
  738. ("生产排程", "生产任务排程与调度", "高", "5", ""),
  739. ("作业计划", "车间作业计划管理", "中", "3", ""),
  740. ("制造协同看板", "制造过程协同数据展示", "高", "5", "数据看板类"),
  741. }),
  742. ("S3", "S3 供应协同", new[]
  743. {
  744. ("物料计划", "物料需求计划(MRP)计算", "高", "7", "核心算法"),
  745. ("供应协同看板", "供应商协同数据可视化", "中", "4", "数据看板类"),
  746. }),
  747. ("S4", "S4 采购执行", new[]
  748. {
  749. ("采购管理", "采购申请、订单、合同管理", "中", "4", ""),
  750. ("交货管理", "供应商交货跟踪与验收", "中", "3", ""),
  751. ("退货管理", "采购退货流程处理", "低", "2", ""),
  752. ("采购执行看板", "采购执行数据可视化", "中", "4", "数据看板类"),
  753. }),
  754. ("S5", "S5 物料仓储", new[]
  755. {
  756. ("来料检验", "IQC来料质量检验", "中", "3", ""),
  757. ("仓储管理", "仓库入库、出库、调拨", "中", "4", ""),
  758. ("库存数据", "库存查询、盘点、调整", "中", "3", ""),
  759. ("物料仓储看板", "仓储数据可视化分析", "中", "4", "数据看板类"),
  760. }),
  761. ("S6", "S6 生产执行", new[]
  762. {
  763. ("生产记录管理", "生产过程数据记录", "中", "3", ""),
  764. ("过程质量管理", "IPQC过程质量检验", "中", "4", ""),
  765. ("设备工装管理", "设备台账、保养、维修", "中", "4", ""),
  766. ("生产执行看板", "生产执行数据可视化", "高", "5", "数据看板类"),
  767. }),
  768. ("S7", "S7 成品仓储", new[]
  769. {
  770. ("成品质量管理", "OQC成品质量检验", "中", "3", ""),
  771. ("生产入库管理", "成品入库流程", "低", "2", ""),
  772. ("成品出库管理", "成品出库发货流程", "低", "2", ""),
  773. ("成品库存管理", "成品库存查询与管理", "中", "3", ""),
  774. }),
  775. ("S8", "S8 异常监控", new[]
  776. {
  777. ("异常监控看板", "生产异常监控、处理、跟踪", "中", "4", ""),
  778. }),
  779. ("S9", "S9 运营指标", new[]
  780. {
  781. ("ERP同步", "与外部ERP系统数据同步", "高", "7", "接口集成"),
  782. ("日志查询", "系统操作日志查询", "低", "2", ""),
  783. ("ERP事务", "ERP相关事务处理", "中", "3", ""),
  784. }),
  785. ("M11", "系统管理", new[]
  786. {
  787. ("组织架构", "部门、岗位、人员管理", "中", "3", "与框架系统管理对应,后续可映射具体页"),
  788. ("菜单管理", "系统菜单权限配置", "中", "3", ""),
  789. }),
  790. ("M12", "流程平台", new[]
  791. {
  792. ("流程管理", "工作流流程定义与配置", "高", "7", "核心引擎"),
  793. ("表单管理", "流程表单设计与配置", "高", "5", ""),
  794. ("应用设计", "业务应用快速设计", "高", "5", ""),
  795. ("数据资源配置", "数据资源连接配置", "中", "4", ""),
  796. ("格式化JSON", "JSON数据格式化工具", "低", "1", "工具类"),
  797. ("模板管理", "流程模板管理", "中", "3", ""),
  798. ("系统按钮", "系统按钮权限配置", "低", "2", ""),
  799. ("流程按钮", "流程操作按钮配置", "低", "2", ""),
  800. ("应用程序", "外部应用集成管理", "中", "4", ""),
  801. ("接口系统", "API接口配置管理", "高", "5", ""),
  802. }),
  803. ("M13", "系统工具", new[]
  804. {
  805. ("数据字典", "系统字典数据管理", "低", "2", ""),
  806. ("数据连接", "数据库连接配置", "中", "3", ""),
  807. ("首页设置", "系统首页个性化配置", "低", "2", ""),
  808. ("日志查询", "系统运行日志查询", "低", "2", ""),
  809. ("流水号管理", "业务流水号规则配置", "低", "2", ""),
  810. ("工作日设置", "工作日历配置", "低", "1", ""),
  811. ("图标库", "系统图标资源管理", "低", "1", ""),
  812. ("在线用户", "在线用户监控", "低", "2", ""),
  813. ("周库存统计", "库存周期统计报表", "中", "3", "报表类"),
  814. ("数据导入", "批量数据导入工具", "中", "3", ""),
  815. }),
  816. ("M14", "流程中心", new[]
  817. {
  818. ("发起流程", "新建并发起工作流程", "中", "3", ""),
  819. ("待办事项", "个人待办任务处理", "中", "3", ""),
  820. ("待办批量处理", "待办任务批量操作", "中", "3", ""),
  821. ("已办事项", "已办任务查询", "低", "2", ""),
  822. ("我的流程", "我发起的流程跟踪", "中", "3", ""),
  823. ("已委托事项", "委托他人处理的事项", "低", "2", ""),
  824. ("流程委托", "流程任务委托配置", "低", "2", ""),
  825. ("流程意见", "流程审批意见管理", "低", "2", ""),
  826. }),
  827. ("M15", "个人设置", new[]
  828. {
  829. ("个人信息", "个人资料维护", "低", "1", ""),
  830. ("头像设置", "个人头像上传", "低", "1", ""),
  831. ("修改密码", "密码修改功能", "低", "1", ""),
  832. ("签章管理", "个人电子签章管理", "中", "3", ""),
  833. ("文件管理", "个人文件存储管理", "中", "3", ""),
  834. ("快捷菜单", "个人快捷方式配置", "低", "1", ""),
  835. }),
  836. ("M16", "系统首页", new[]
  837. {
  838. ("系统首页", "系统门户首页", "中", "3", "门户类"),
  839. ("发起流程(快捷)", "首页快捷发起流程", "低", "1", ""),
  840. ("我的流程(快捷)", "首页流程快捷入口", "低", "1", ""),
  841. ("待办事项(快捷)", "首页待办快捷入口", "低", "1", ""),
  842. }),
  843. };
  844. }