// Ai-DOP 业务规划菜单种子(由 ai-dop-platform/tools/gen_aidop_menu.py 生成)
namespace Admin.NET.Plugin.AiDOP;
///
/// Ai-DOP 规划菜单;类名须为 SysMenuSeedData,以便租户默认菜单聚合所有程序集种子。
///
[IncreSeed]
public class SysMenuSeedData : ISqlSugarEntitySeedData
{
private const long AidopRootId = 1320990000101L;
///
public IEnumerable HasData()
{
var ct = DateTime.Parse("2022-02-10 00:00:00");
var list = new List
{
new()
{
Id = AidopRootId,
Pid = 0,
Title = "Ai-DOP",
Path = "/aidop",
Name = "aidopRoot",
Component = "Layout",
Icon = "ele-Grid",
Type = MenuTypeEnum.Dir,
CreateTime = ct,
OrderNo = 250,
Remark = "Ai-DOP 主菜单(规划项,叶子为占位页)"
}
};
var dirSeq = 0;
var menuSeq = 0;
foreach (var mod in ModuleDefinitions)
{
dirSeq++;
var dirId = 1321000000000L + dirSeq * 1000L;
var modCode = mod.Code;
var codeLower = mod.Code.ToLowerInvariant();
list.Add(new SysMenu
{
Id = dirId,
Pid = AidopRootId,
Title = mod.L1,
Path = $"/aidop/{codeLower}",
Name = $"aidopDir{mod.Code}",
Component = "Layout",
Icon = "ele-Folder",
Type = MenuTypeEnum.Dir,
CreateTime = ct,
OrderNo = 260 + dirSeq
});
var subOrder = 100;
var idx = 0;
foreach (var leaf in mod.Leaves)
{
menuSeq++;
idx++;
var component = ResolveComponent(modCode, idx);
list.Add(new SysMenu
{
Id = 1322000000000L + menuSeq,
Pid = dirId,
Title = leaf.Title,
Path = $"/aidop/{codeLower}/{idx:000}",
Name = $"aidop{mod.Code}{idx:000}",
Component = component,
Type = MenuTypeEnum.Menu,
CreateTime = ct,
OrderNo = subOrder++,
Icon = "ele-Document",
Remark = BuildRemark(mod.Code, leaf)
});
}
}
foreach (var m in BuildAidopSmartOpsSeedMenus(ct))
list.Add(m);
return list;
}
///
/// 智慧诊断 + 智慧运营看板(入库,便于平台「菜单管理」配置;勿在 Web aidopMenuDisplay 再注入整段菜单)。
///
private static IEnumerable BuildAidopSmartOpsSeedMenus(DateTime ct)
{
const long smartOpsDirId = 1320990000200L;
yield return new SysMenu
{
Id = 1320990000201L,
Pid = AidopRootId,
Title = "智慧诊断",
Path = "/aidop/smart-diagnosis",
Name = "aidopSmartDiagnosis",
Component = "/aidop/diagnosis/index",
Icon = "ele-TrendCharts",
Type = MenuTypeEnum.Menu,
CreateTime = ct,
OrderNo = 251,
Remark = "Ai-DOP 智慧诊断"
};
yield return new SysMenu
{
Id = smartOpsDirId,
Pid = AidopRootId,
Title = "智慧运营看板",
Path = "/aidop/smart-ops",
Name = "aidopSmartOpsRoot",
Component = "Layout",
Icon = "ele-DataBoard",
Type = MenuTypeEnum.Dir,
CreateTime = ct,
OrderNo = 252,
Remark = "Ai-DOP 智慧运营看板分组"
};
var children = new (long Id, string Path, string Name, string Title, string Component, int Order)[]
{
(1320990000301L, "/aidop/smart-ops/grid", "aidopSmartOpsGrid", "九宫格智慧运营看板", "/dashboard/home", 100),
(1320990000302L, "/aidop/smart-ops/s1", "aidopSmartOpsS1", "S1产销协同看板", "/aidop/kanban/s1", 110),
(1320990000303L, "/aidop/smart-ops/s2", "aidopSmartOpsS2", "S2制造协同看板", "/aidop/kanban/s2", 120),
(1320990000304L, "/aidop/smart-ops/s3", "aidopSmartOpsS3", "S3供应协同看板", "/aidop/kanban/s3", 130),
(1320990000305L, "/aidop/smart-ops/s4", "aidopSmartOpsS4", "S4采购执行看板", "/aidop/kanban/s4", 140),
(1320990000306L, "/aidop/smart-ops/s5", "aidopSmartOpsS5", "S5物料仓储看板", "/aidop/kanban/s5", 150),
(1320990000307L, "/aidop/smart-ops/s6", "aidopSmartOpsS6", "S6生产执行看板", "/aidop/kanban/s6", 160),
(1320990000308L, "/aidop/smart-ops/s7", "aidopSmartOpsS7", "S7成品仓储看板", "/aidop/kanban/s7", 170),
(1320990000309L, "/aidop/smart-ops/s8", "aidopSmartOpsS8", "S8异常监控看板", "/aidop/kanban/s8", 180),
(1320990000310L, "/aidop/smart-ops/s9", "aidopSmartOpsS9", "S9运营指标看板", "/aidop/kanban/s9", 190),
(1320990000311L, "/aidop/smart-ops/modeling", "aidopSmartOpsModeling", "运营指标建模", "/aidop/kanban/s0", 200),
};
foreach (var (id, path, name, title, component, order) in children)
{
yield return new SysMenu
{
Id = id,
Pid = smartOpsDirId,
Title = title,
Path = path,
Name = name,
Component = component,
Icon = "ele-DataAnalysis",
Type = MenuTypeEnum.Menu,
CreateTime = ct,
OrderNo = order,
Remark = title
};
}
}
private static string ResolveComponent(string modCode, int leafIndex) =>
ComponentOverrides.TryGetValue((modCode, leafIndex), out var c) ? c : "/aidop/planning/index";
private static readonly Dictionary<(string Mod, int Leaf), string> ComponentOverrides = new()
{
{ ("S1", 1), "/aidop/business/orderList" },
{ ("S1", 2), "/aidop/business/planList" },
{ ("S1", 3), "/aidop/business/workOrderList" },
{ ("S1", 4), "/aidop/demo/cockpit" },
};
private static string BuildRemark(string code, (string Title, string Desc, string Complexity, string Days, string Note) leaf)
{
var notePart = string.IsNullOrWhiteSpace(leaf.Note) ? "" : $" | {leaf.Note}";
var s = $"[{code}|{leaf.Complexity}|{leaf.Days}人天] {leaf.Desc}{notePart}";
return s.Length <= 256 ? s : s[..256];
}
private static readonly (string Code, string L1, (string Title, string Desc, string Complexity, string Days, string Note)[] Leaves)[] ModuleDefinitions =
{
("S0", "S0 运营建模", new[]
{
("数据建模", "支持数据库表结构设计与建模", "高", "5", "核心基础功能"),
("业务建模", "支持业务流程建模与配置", "高", "5", "核心基础功能"),
}),
("S1", "S1 产销协同", new[]
{
("订单管理", "销售订单录入、查询、编辑、删除", "中", "3", ""),
("计划管理", "生产计划制定与分解", "中", "3", ""),
("工单管理", "工单创建、分配、跟踪", "中", "3", ""),
("产销协同看板", "订单与生产协同数据可视化", "高", "5", "数据看板类"),
}),
("S2", "S2 制造协同", new[]
{
("生产排程", "生产任务排程与调度", "高", "5", ""),
("作业计划", "车间作业计划管理", "中", "3", ""),
("制造协同看板", "制造过程协同数据展示", "高", "5", "数据看板类"),
}),
("S3", "S3 供应协同", new[]
{
("物料计划", "物料需求计划(MRP)计算", "高", "7", "核心算法"),
("供应协同看板", "供应商协同数据可视化", "中", "4", "数据看板类"),
}),
("S4", "S4 采购执行", new[]
{
("采购管理", "采购申请、订单、合同管理", "中", "4", ""),
("交货管理", "供应商交货跟踪与验收", "中", "3", ""),
("退货管理", "采购退货流程处理", "低", "2", ""),
("采购执行看板", "采购执行数据可视化", "中", "4", "数据看板类"),
}),
("S5", "S5 物料仓储", new[]
{
("来料检验", "IQC来料质量检验", "中", "3", ""),
("仓储管理", "仓库入库、出库、调拨", "中", "4", ""),
("库存数据", "库存查询、盘点、调整", "中", "3", ""),
("物料仓储看板", "仓储数据可视化分析", "中", "4", "数据看板类"),
}),
("S6", "S6 生产执行", new[]
{
("生产记录管理", "生产过程数据记录", "中", "3", ""),
("过程质量管理", "IPQC过程质量检验", "中", "4", ""),
("设备工装管理", "设备台账、保养、维修", "中", "4", ""),
("生产执行看板", "生产执行数据可视化", "高", "5", "数据看板类"),
}),
("S7", "S7 成品仓储", new[]
{
("成品质量管理", "OQC成品质量检验", "中", "3", ""),
("生产入库管理", "成品入库流程", "低", "2", ""),
("成品出库管理", "成品出库发货流程", "低", "2", ""),
("成品库存管理", "成品库存查询与管理", "中", "3", ""),
}),
("S8", "S8 异常监控", new[]
{
("异常管理", "生产异常上报、处理、跟踪", "中", "4", ""),
}),
("S9", "S9 运营指标", new[]
{
("ERP同步", "与外部ERP系统数据同步", "高", "7", "接口集成"),
("日志查询", "系统操作日志查询", "低", "2", ""),
("ERP事务", "ERP相关事务处理", "中", "3", ""),
}),
("M11", "系统管理", new[]
{
("组织架构", "部门、岗位、人员管理", "中", "3", "与框架系统管理对应,后续可映射具体页"),
("菜单管理", "系统菜单权限配置", "中", "3", ""),
}),
("M12", "流程平台", new[]
{
("流程管理", "工作流流程定义与配置", "高", "7", "核心引擎"),
("表单管理", "流程表单设计与配置", "高", "5", ""),
("应用设计", "业务应用快速设计", "高", "5", ""),
("数据资源配置", "数据资源连接配置", "中", "4", ""),
("格式化JSON", "JSON数据格式化工具", "低", "1", "工具类"),
("模板管理", "流程模板管理", "中", "3", ""),
("系统按钮", "系统按钮权限配置", "低", "2", ""),
("流程按钮", "流程操作按钮配置", "低", "2", ""),
("应用程序", "外部应用集成管理", "中", "4", ""),
("接口系统", "API接口配置管理", "高", "5", ""),
}),
("M13", "系统工具", new[]
{
("数据字典", "系统字典数据管理", "低", "2", ""),
("数据连接", "数据库连接配置", "中", "3", ""),
("首页设置", "系统首页个性化配置", "低", "2", ""),
("日志查询", "系统运行日志查询", "低", "2", ""),
("流水号管理", "业务流水号规则配置", "低", "2", ""),
("工作日设置", "工作日历配置", "低", "1", ""),
("图标库", "系统图标资源管理", "低", "1", ""),
("在线用户", "在线用户监控", "低", "2", ""),
("周库存统计", "库存周期统计报表", "中", "3", "报表类"),
("数据导入", "批量数据导入工具", "中", "3", ""),
}),
("M14", "流程中心", new[]
{
("发起流程", "新建并发起工作流程", "中", "3", ""),
("待办事项", "个人待办任务处理", "中", "3", ""),
("待办批量处理", "待办任务批量操作", "中", "3", ""),
("已办事项", "已办任务查询", "低", "2", ""),
("我的流程", "我发起的流程跟踪", "中", "3", ""),
("已委托事项", "委托他人处理的事项", "低", "2", ""),
("流程委托", "流程任务委托配置", "低", "2", ""),
("流程意见", "流程审批意见管理", "低", "2", ""),
}),
("M15", "个人设置", new[]
{
("个人信息", "个人资料维护", "低", "1", ""),
("头像设置", "个人头像上传", "低", "1", ""),
("修改密码", "密码修改功能", "低", "1", ""),
("签章管理", "个人电子签章管理", "中", "3", ""),
("文件管理", "个人文件存储管理", "中", "3", ""),
("快捷菜单", "个人快捷方式配置", "低", "1", ""),
}),
("M16", "系统首页", new[]
{
("系统首页", "系统门户首页", "中", "3", "门户类"),
("发起流程(快捷)", "首页快捷发起流程", "低", "1", ""),
("我的流程(快捷)", "首页流程快捷入口", "低", "1", ""),
("待办事项(快捷)", "首页待办快捷入口", "低", "1", ""),
}),
};
}