|
@@ -9303,6 +9303,67 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.warn("扩展 tasks.status 枚举失败(可能已修改): {}", e.getMessage());
|
|
log.warn("扩展 tasks.status 枚举失败(可能已修改): {}", e.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 迁移267: 方案中心菜单(插在家庭运营与任务中心之间)
|
|
|
|
|
+ migratePlanCenterMenu();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 迁移267: 存量库插入「方案中心」一级菜单及子菜单(幂等)
|
|
|
|
|
+ * 位置:家庭运营(sort=1) 与 任务中心 之间;任务中心及之后顶级菜单 sort+1
|
|
|
|
|
+ */
|
|
|
|
|
+ private void migratePlanCenterMenu() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Long existed = queryMenuId("SELECT id FROM sys_menu WHERE parent_id=0 AND title='方案中心'");
|
|
|
|
|
+ if (existed == null) {
|
|
|
|
|
+ // 为任务中心及之后的顶级菜单腾出 sort=2
|
|
|
|
|
+ jdbcTemplate.update(
|
|
|
|
|
+ "UPDATE sys_menu SET sort = sort + 1 WHERE parent_id=0 AND sort >= 2 " +
|
|
|
|
|
+ "AND title <> '方案中心'");
|
|
|
|
|
+ jdbcTemplate.update(
|
|
|
|
|
+ "INSERT INTO sys_menu (parent_id, title, label, path, icon, perm, sort, visible) " +
|
|
|
|
|
+ "VALUES (0, '方案中心', NULL, NULL, 'el-icon-notebook-2', 'plan:*', 2, 1)");
|
|
|
|
|
+ existed = jdbcTemplate.queryForObject("SELECT LAST_INSERT_ID()", Long.class);
|
|
|
|
|
+ log.info("迁移267: 已插入方案中心一级菜单");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (existed == null) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ Long healthPlanId = insertPlanCenterChild(existed, "健康方案管理", "/health-plan-manage",
|
|
|
|
|
+ "el-icon-first-aid-kit", "plan:health", 0);
|
|
|
|
|
+ Long assessmentPlanId = insertPlanCenterChild(existed, "测评方案管理", "/assessment-plan-manage",
|
|
|
|
|
+ "el-icon-edit", "plan:assessment", 1);
|
|
|
|
|
+ Integer grantCount = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM sys_role_menu", Integer.class);
|
|
|
|
|
+ if (grantCount != null && grantCount > 0) {
|
|
|
|
|
+ String[] roles = {"admin", "butler", "nutritionist", "operator"};
|
|
|
|
|
+ Long[] menuIds = {existed, healthPlanId, assessmentPlanId};
|
|
|
|
|
+ for (String role : roles) {
|
|
|
|
|
+ for (Long menuId : menuIds) {
|
|
|
|
|
+ grantMenuToRole(role, menuId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("迁移267: 方案中心菜单挂载完成");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.warn("迁移267失败: {}", e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private Long insertPlanCenterChild(Long parentId, String label, String path, String icon, String perm, int sort) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Long existed = queryMenuId("SELECT id FROM sys_menu WHERE parent_id=" + parentId + " AND path='" + path + "'");
|
|
|
|
|
+ if (existed != null) {
|
|
|
|
|
+ return existed;
|
|
|
|
|
+ }
|
|
|
|
|
+ jdbcTemplate.update(
|
|
|
|
|
+ "INSERT INTO sys_menu (parent_id, title, label, path, icon, perm, sort, visible) VALUES (?, NULL, ?, ?, ?, ?, ?, 1)",
|
|
|
|
|
+ parentId, label, path, icon, perm, sort
|
|
|
|
|
+ );
|
|
|
|
|
+ return jdbcTemplate.queryForObject("SELECT LAST_INSERT_ID()", Long.class);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.warn("迁移267: 挂载子菜单「{}」失败: {}", label, e.getMessage());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -9553,20 +9614,24 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
{"operation", "pointsLog", "", "积分记录", "/points-log", "el-icon-document", "family:points,family:bound", "3"},
|
|
{"operation", "pointsLog", "", "积分记录", "/points-log", "el-icon-document", "family:points,family:bound", "3"},
|
|
|
{"operation", "wishes", "", "心愿管理", "/wishes", "el-icon-star-off", "family:wishes", "4"},
|
|
{"operation", "wishes", "", "心愿管理", "/wishes", "el-icon-star-off", "family:wishes", "4"},
|
|
|
{"operation", "rewards", "", "奖励管理", "/rewards", "el-icon-s-goods", "reward:list", "5"},
|
|
{"operation", "rewards", "", "奖励管理", "/rewards", "el-icon-s-goods", "reward:list", "5"},
|
|
|
|
|
+ // 方案中心(plan:*,插在家庭运营与任务中心之间)
|
|
|
|
|
+ {"", "planCenter", "方案中心", "", "", "el-icon-notebook-2", "plan:*", "2"},
|
|
|
|
|
+ {"planCenter", "healthPlanManage", "", "健康方案管理", "/health-plan-manage", "el-icon-first-aid-kit", "plan:health", "0"},
|
|
|
|
|
+ {"planCenter", "assessmentPlanManage", "", "测评方案管理", "/assessment-plan-manage", "el-icon-edit", "plan:assessment", "1"},
|
|
|
// 任务中心(task:*)
|
|
// 任务中心(task:*)
|
|
|
- {"", "taskCenter", "任务中心", "", "", "el-icon-s-order", "task:*", "2"},
|
|
|
|
|
|
|
+ {"", "taskCenter", "任务中心", "", "", "el-icon-s-order", "task:*", "3"},
|
|
|
{"taskCenter", "tasks", "", "任务列表", "/tasks", "el-icon-s-order", "task:list", "0"},
|
|
{"taskCenter", "tasks", "", "任务列表", "/tasks", "el-icon-s-order", "task:list", "0"},
|
|
|
{"taskCenter", "taskTemplates", "", "任务模板", "/task-templates", "el-icon-document", "task:templates", "1"},
|
|
{"taskCenter", "taskTemplates", "", "任务模板", "/task-templates", "el-icon-document", "task:templates", "1"},
|
|
|
{"taskCenter", "growthTask", "", "成长任务管理", "/growth-task", "el-icon-s-management", "task:growth", "2"},
|
|
{"taskCenter", "growthTask", "", "成长任务管理", "/growth-task", "el-icon-s-management", "task:growth", "2"},
|
|
|
// 审核中心(audit,归集各审核页:服务角色申请/活动审核/退款/提现)
|
|
// 审核中心(audit,归集各审核页:服务角色申请/活动审核/退款/提现)
|
|
|
- {"", "reviewCenterGroup", "审核中心", "", "", "el-icon-s-check", "audit", "3"},
|
|
|
|
|
|
|
+ {"", "reviewCenterGroup", "审核中心", "", "", "el-icon-s-check", "audit", "4"},
|
|
|
{"reviewCenterGroup", "reviewCenter", "", "审核中心总览", "/review-center", "el-icon-s-check", "audit", "0"},
|
|
{"reviewCenterGroup", "reviewCenter", "", "审核中心总览", "/review-center", "el-icon-s-check", "audit", "0"},
|
|
|
{"reviewCenterGroup", "serviceRoleApp", "", "服务角色申请审核", "/service-role-applications", "el-icon-s-check", "audit:service-role", "1"},
|
|
{"reviewCenterGroup", "serviceRoleApp", "", "服务角色申请审核", "/service-role-applications", "el-icon-s-check", "audit:service-role", "1"},
|
|
|
{"reviewCenterGroup", "activityReview", "", "活动审核", "/activity-review", "el-icon-document-checked", "audit:activity", "2"},
|
|
{"reviewCenterGroup", "activityReview", "", "活动审核", "/activity-review", "el-icon-document-checked", "audit:activity", "2"},
|
|
|
{"reviewCenterGroup", "pendingRefund", "", "待退款管理", "/pending-refund", "el-icon-warning", "audit:refund", "3"},
|
|
{"reviewCenterGroup", "pendingRefund", "", "待退款管理", "/pending-refund", "el-icon-warning", "audit:refund", "3"},
|
|
|
{"reviewCenterGroup", "earningWithdraw", "", "收益提现审核", "/family-earnings-withdraw", "el-icon-document-checked", "audit:withdraw", "4"},
|
|
{"reviewCenterGroup", "earningWithdraw", "", "收益提现审核", "/family-earnings-withdraw", "el-icon-document-checked", "audit:withdraw", "4"},
|
|
|
// 商城营销(commerce:*)
|
|
// 商城营销(commerce:*)
|
|
|
- {"", "commerce", "商城营销", "", "", "el-icon-s-goods", "commerce:*", "4"},
|
|
|
|
|
|
|
+ {"", "commerce", "商城营销", "", "", "el-icon-s-goods", "commerce:*", "5"},
|
|
|
{"commerce", "productManage", "", "商品管理", "/product-manage", "el-icon-s-goods", "commerce:products,commerce:self", "0"},
|
|
{"commerce", "productManage", "", "商品管理", "/product-manage", "el-icon-s-goods", "commerce:products,commerce:self", "0"},
|
|
|
{"commerce", "inventory", "", "库存管理", "/inventory", "el-icon-document", "inventory:self", "1"},
|
|
{"commerce", "inventory", "", "库存管理", "/inventory", "el-icon-document", "inventory:self", "1"},
|
|
|
{"commerce", "orderManage", "", "订单管理", "/order-manage", "el-icon-s-order", "commerce:orders,order:self", "2"},
|
|
{"commerce", "orderManage", "", "订单管理", "/order-manage", "el-icon-s-order", "commerce:orders,order:self", "2"},
|
|
@@ -9577,7 +9642,7 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
{"commerce", "promotion", "", "推广管理", "/promotion", "el-icon-s-marketing", "commerce:promotion", "7"},
|
|
{"commerce", "promotion", "", "推广管理", "/promotion", "el-icon-s-marketing", "commerce:promotion", "7"},
|
|
|
{"commerce", "familyEarnings", "", "家庭收益", "/family-earnings", "el-icon-s-money", "finance:family-earnings", "8"},
|
|
{"commerce", "familyEarnings", "", "家庭收益", "/family-earnings", "el-icon-s-money", "finance:family-earnings", "8"},
|
|
|
// 知识中心(articles:*)
|
|
// 知识中心(articles:*)
|
|
|
- {"", "knowledge", "知识中心", "", "", "el-icon-document", "articles:*", "5"},
|
|
|
|
|
|
|
+ {"", "knowledge", "知识中心", "", "", "el-icon-document", "articles:*", "6"},
|
|
|
{"knowledge", "articleCategories", "", "知识分类", "/article-categories", "el-icon-folder", "articles:categories", "0"},
|
|
{"knowledge", "articleCategories", "", "知识分类", "/article-categories", "el-icon-folder", "articles:categories", "0"},
|
|
|
{"knowledge", "articleManage", "", "知识管理", "/article-manage", "el-icon-document", "articles:manage", "1"},
|
|
{"knowledge", "articleManage", "", "知识管理", "/article-manage", "el-icon-document", "articles:manage", "1"},
|
|
|
{"knowledge", "commentReview", "", "评论审核", "/comment-review", "el-icon-chat-dot-round", "articles:manage", "2"},
|
|
{"knowledge", "commentReview", "", "评论审核", "/comment-review", "el-icon-chat-dot-round", "articles:manage", "2"},
|
|
@@ -9585,11 +9650,11 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
{"knowledge", "knowledgeBase", "", "知识库", "/knowledge-base", "el-icon-reading", "knowledge:base", "4"},
|
|
{"knowledge", "knowledgeBase", "", "知识库", "/knowledge-base", "el-icon-reading", "knowledge:base", "4"},
|
|
|
{"knowledge", "healthKnowledge", "", "健康知识库", "/health-knowledge", "el-icon-first-aid-kit", "knowledge:base", "5"},
|
|
{"knowledge", "healthKnowledge", "", "健康知识库", "/health-knowledge", "el-icon-first-aid-kit", "knowledge:base", "5"},
|
|
|
// 活动管理(activity:*,活动审核已移入审核中心)
|
|
// 活动管理(activity:*,活动审核已移入审核中心)
|
|
|
- {"", "activity", "活动管理", "", "", "el-icon-date", "activity:*", "6"},
|
|
|
|
|
|
|
+ {"", "activity", "活动管理", "", "", "el-icon-date", "activity:*", "7"},
|
|
|
{"activity", "activities", "", "活动列表", "/activities", "el-icon-date", "activity:list,activity:self", "0"},
|
|
{"activity", "activities", "", "活动列表", "/activities", "el-icon-date", "activity:list,activity:self", "0"},
|
|
|
{"activity", "activityRegReview", "", "活动报名审核", "/activity-registration-review", "el-icon-document-checked", "activity:registration", "1"},
|
|
{"activity", "activityRegReview", "", "活动报名审核", "/activity-registration-review", "el-icon-document-checked", "activity:registration", "1"},
|
|
|
// 健康饮食(health:*,能量规则/行为/周期性服务已移入系统配置·健康配置,LangGraph已移入报告解析系统;报告管理/报告审核/应季食材按方案挂载)
|
|
// 健康饮食(health:*,能量规则/行为/周期性服务已移入系统配置·健康配置,LangGraph已移入报告解析系统;报告管理/报告审核/应季食材按方案挂载)
|
|
|
- {"", "health", "健康饮食", "", "", "el-icon-first-aid-kit", "health:*", "7"},
|
|
|
|
|
|
|
+ {"", "health", "健康饮食", "", "", "el-icon-first-aid-kit", "health:*", "8"},
|
|
|
{"health", "healthReports", "", "健康报告", "/health-reports", "el-icon-document", "health:reports", "0"},
|
|
{"health", "healthReports", "", "健康报告", "/health-reports", "el-icon-document", "health:reports", "0"},
|
|
|
{"health", "reportManagement", "", "报告管理", "/report-management", "el-icon-document", "health:reports", "1"},
|
|
{"health", "reportManagement", "", "报告管理", "/report-management", "el-icon-document", "health:reports", "1"},
|
|
|
{"health", "reportAudit", "", "报告审核", "/report-audit", "el-icon-document-checked", "report:audit", "2"},
|
|
{"health", "reportAudit", "", "报告审核", "/report-audit", "el-icon-document-checked", "report:audit", "2"},
|
|
@@ -9603,22 +9668,22 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
{"health", "nutritionProducts", "", "营养产品", "/nutrition-products", "el-icon-first-aid-kit", "health:products", "10"},
|
|
{"health", "nutritionProducts", "", "营养产品", "/nutrition-products", "el-icon-first-aid-kit", "health:products", "10"},
|
|
|
{"health", "energySandbox", "", "五维能量", "/energy-sandbox", "el-icon-data-line", "health:energy", "11"},
|
|
{"health", "energySandbox", "", "五维能量", "/energy-sandbox", "el-icon-data-line", "health:energy", "11"},
|
|
|
// 报告解析系统(config:report-parser,LangGraph 管理归入)
|
|
// 报告解析系统(config:report-parser,LangGraph 管理归入)
|
|
|
- {"", "reportParser", "报告解析系统", "", "", "el-icon-cpu", "config:report-parser", "8"},
|
|
|
|
|
|
|
+ {"", "reportParser", "报告解析系统", "", "", "el-icon-cpu", "config:report-parser", "9"},
|
|
|
{"reportParser", "reportTypes", "", "报告类型管理", "/report-types", "el-icon-collection", "config:report-parser", "0"},
|
|
{"reportParser", "reportTypes", "", "报告类型管理", "/report-types", "el-icon-collection", "config:report-parser", "0"},
|
|
|
{"reportParser", "reportParserImport", "", "解析器导入", "/report-parser-import", "el-icon-upload2", "config:report-parser", "1"},
|
|
{"reportParser", "reportParserImport", "", "解析器导入", "/report-parser-import", "el-icon-upload2", "config:report-parser", "1"},
|
|
|
{"reportParser", "reportUnknownClusters", "", "未知报告审核", "/report-unknown-clusters", "el-icon-question", "config:report-parser", "2"},
|
|
{"reportParser", "reportUnknownClusters", "", "未知报告审核", "/report-unknown-clusters", "el-icon-question", "config:report-parser", "2"},
|
|
|
{"reportParser", "reportAutoLearn", "", "报告自学习", "/report-auto-learn", "el-icon-magic-stick", "config:report-parser", "3"},
|
|
{"reportParser", "reportAutoLearn", "", "报告自学习", "/report-auto-learn", "el-icon-magic-stick", "config:report-parser", "3"},
|
|
|
{"reportParser", "langgraphAdmin", "", "LangGraph 管理", "/langgraph-admin", "el-icon-cpu", "config:report-parser", "4"},
|
|
{"reportParser", "langgraphAdmin", "", "LangGraph 管理", "/langgraph-admin", "el-icon-cpu", "config:report-parser", "4"},
|
|
|
// 家庭服务(service:*)
|
|
// 家庭服务(service:*)
|
|
|
- {"", "familyService", "家庭服务", "", "", "el-icon-s-custom", "service:*", "9"},
|
|
|
|
|
|
|
+ {"", "familyService", "家庭服务", "", "", "el-icon-s-custom", "service:*", "10"},
|
|
|
{"familyService", "myFamilies", "", "我的家庭", "/my-families", "el-icon-s-custom", "service:family", "0"},
|
|
{"familyService", "myFamilies", "", "我的家庭", "/my-families", "el-icon-s-custom", "service:family", "0"},
|
|
|
{"familyService", "teacherTeam", "", "我的团队", "/teacher-team", "el-icon-s-custom", "service:team", "1"},
|
|
{"familyService", "teacherTeam", "", "我的团队", "/teacher-team", "el-icon-s-custom", "service:team", "1"},
|
|
|
// 业务管理(biz:*)
|
|
// 业务管理(biz:*)
|
|
|
- {"", "biz", "业务管理", "", "", "el-icon-s-marketing", "biz:*", "10"},
|
|
|
|
|
|
|
+ {"", "biz", "业务管理", "", "", "el-icon-s-marketing", "biz:*", "11"},
|
|
|
{"biz", "teacherPackages", "", "任务模板管理", "/teacher-packages", "el-icon-s-goods", "biz:packages", "0"},
|
|
{"biz", "teacherPackages", "", "任务模板管理", "/teacher-packages", "el-icon-s-goods", "biz:packages", "0"},
|
|
|
{"biz", "teacherOrders", "", "订单佣金", "/teacher-orders", "el-icon-s-order", "biz:orders", "1"},
|
|
{"biz", "teacherOrders", "", "订单佣金", "/teacher-orders", "el-icon-s-order", "biz:orders", "1"},
|
|
|
// 测评咨询(测评管理/测评订单/待分配规划师已从系统配置移入)
|
|
// 测评咨询(测评管理/测评订单/待分配规划师已从系统配置移入)
|
|
|
- {"", "assessment", "测评咨询", "", "", "el-icon-edit", "assessment:*", "11"},
|
|
|
|
|
|
|
+ {"", "assessment", "测评咨询", "", "", "el-icon-edit", "assessment:*", "12"},
|
|
|
{"assessment", "assessmentAdmin", "", "测评管理", "/assessment-admin", "el-icon-edit", "assessment:manage", "0"},
|
|
{"assessment", "assessmentAdmin", "", "测评管理", "/assessment-admin", "el-icon-edit", "assessment:manage", "0"},
|
|
|
{"assessment", "assessmentOrders", "", "测评订单", "/assessment-orders", "el-icon-s-order", "assessment:orders", "1"},
|
|
{"assessment", "assessmentOrders", "", "测评订单", "/assessment-orders", "el-icon-s-order", "assessment:orders", "1"},
|
|
|
{"assessment", "assessmentAssign", "", "待分配规划师", "/assessment-assign", "el-icon-user", "assessment:assign", "2"},
|
|
{"assessment", "assessmentAssign", "", "待分配规划师", "/assessment-assign", "el-icon-user", "assessment:assign", "2"},
|
|
@@ -9627,7 +9692,7 @@ public class DatabaseInitializer implements CommandLineRunner {
|
|
|
{"assessment", "growthRecords", "", "成长记录", "/growth-records", "el-icon-document", "growth:records", "5"},
|
|
{"assessment", "growthRecords", "", "成长记录", "/growth-records", "el-icon-document", "growth:records", "5"},
|
|
|
{"assessment", "growthPlans", "", "成长计划", "/growth-plans", "el-icon-document", "growth:plans", "6"},
|
|
{"assessment", "growthPlans", "", "成长计划", "/growth-plans", "el-icon-document", "growth:plans", "6"},
|
|
|
// 系统配置(system:*,权限拆分 system:base / config:member / config:dimension / config:health)
|
|
// 系统配置(system:*,权限拆分 system:base / config:member / config:dimension / config:health)
|
|
|
- {"", "system", "系统配置", "", "", "el-icon-s-tools", "system:*", "12"},
|
|
|
|
|
|
|
+ {"", "system", "系统配置", "", "", "el-icon-s-tools", "system:*", "13"},
|
|
|
{"system", "baseManage", "基础管理", "", "", "el-icon-s-tools", "system:base", "0"},
|
|
{"system", "baseManage", "基础管理", "", "", "el-icon-s-tools", "system:base", "0"},
|
|
|
{"baseManage", "sysConfig", "", "系统配置", "/sys-config", "el-icon-s-tools", "system:base", "0"},
|
|
{"baseManage", "sysConfig", "", "系统配置", "/sys-config", "el-icon-s-tools", "system:base", "0"},
|
|
|
{"baseManage", "users", "", "用户管理", "/users", "el-icon-user", "system:users", "1"},
|
|
{"baseManage", "users", "", "用户管理", "/users", "el-icon-user", "system:users", "1"},
|