SysMenuSeedData.cs 33 KB

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