SysMenuSeedData.cs 35 KB

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