From 7d322db9ca89a01f0ed845bcedf2abd778636c9d Mon Sep 17 00:00:00 2001 From: Parker Date: Fri, 29 Apr 2022 18:16:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8B=A5=E5=B9=B2bug?= =?UTF-8?q?=201.=20=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=B8=8A=E7=BA=A7=E6=97=B6=EF=BC=8Cparent=5Fids=20=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=202.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=EF=BC=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81=E6=97=B6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db-file/升级SQL/1.6.3 =》1.6.4.sql | 42 +++++++++++++++++++ .../generator/logs/api/GenLogsApi.java | 4 +- .../logs/web/GenLogsRestController.java | 15 ++++++- .../menu/service/impl/MenuServiceImpl.java | 21 +++++++--- 4 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 db-file/升级SQL/1.6.3 =》1.6.4.sql diff --git a/db-file/升级SQL/1.6.3 =》1.6.4.sql b/db-file/升级SQL/1.6.3 =》1.6.4.sql new file mode 100644 index 0000000..56692fb --- /dev/null +++ b/db-file/升级SQL/1.6.3 =》1.6.4.sql @@ -0,0 +1,42 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +update sys_menu +set parent_ids = CONCAT_WS(',', 0, id) +where parent_id = 0; + +update sys_menu pp + left join sys_menu p on p.id = pp.parent_id + set + pp.parent_ids = CONCAT_WS(',', p.parent_ids, pp.id) +where p.parent_id = 0; + +update sys_menu ppp + left join sys_menu pp on pp.id = ppp.parent_id + left join sys_menu p on p.id = pp.parent_id + set + ppp.parent_ids = CONCAT_WS(',', pp.parent_ids, ppp.id) +where p.parent_id = 0; + + +update sys_menu pppp + left join sys_menu ppp on ppp.id = pppp.parent_id + left join sys_menu pp on pp.id = ppp.parent_id + left join sys_menu p on p.id = pp.parent_id + set + pppp.parent_ids = CONCAT_WS(',', ppp.parent_ids, pppp.id) +where p.parent_id = 0; + + + +update sys_menu ppppp + left join sys_menu pppp on pppp.id = ppppp.parent_id + left join sys_menu ppp on ppp.id = pppp.parent_id + left join sys_menu pp on pp.id = ppp.parent_id + left join sys_menu p on p.id = pp.parent_id + set + ppppp.parent_ids = CONCAT_WS(',', pppp.parent_ids, ppppp.id) +where p.parent_id = 0; + + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/api/GenLogsApi.java b/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/api/GenLogsApi.java index 3bb0202..5588dfa 100644 --- a/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/api/GenLogsApi.java +++ b/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/api/GenLogsApi.java @@ -20,6 +20,7 @@ import org.opsli.modulars.generator.logs.wrapper.GenLogsModel; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -51,10 +52,9 @@ public interface GenLogsApi { /** * 代码生成 修改 - * @param model 模型 */ @GetMapping("/create") - void create(GenLogsModel model, HttpServletResponse response); + void create(HttpServletRequest request, HttpServletResponse response); /** * 生成菜单 diff --git a/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/web/GenLogsRestController.java b/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/web/GenLogsRestController.java index 103ed33..ccceaec 100644 --- a/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/web/GenLogsRestController.java +++ b/opsli-modulars/opsli-modulars-generator/src/main/java/org/opsli/modulars/generator/logs/web/GenLogsRestController.java @@ -18,6 +18,7 @@ package org.opsli.modulars.generator.logs.web; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.beanutils.BeanUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.opsli.api.base.result.ResultVo; import org.opsli.common.annotation.ApiRestController; @@ -28,7 +29,10 @@ import org.opsli.modulars.generator.logs.entity.GenLogs; import org.opsli.modulars.generator.logs.service.IGenLogsService; import org.opsli.modulars.generator.logs.wrapper.GenLogsModel; import org.opsli.plugins.generator.utils.GeneratorHandleUtil; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -57,13 +61,20 @@ public class GenLogsRestController extends BaseRestController