mirror of https://gitee.com/stylefeng/roses
【7.3.2】【menu】更新菜单资源的初始化编码修改
parent
cd17de64d0
commit
660c680950
|
@ -30,7 +30,7 @@ public class MenuResourceUpdateListener extends ApplicationStartedListener imple
|
|||
String springApplicationName = environment.getProperty("spring.application.name");
|
||||
|
||||
// 获取所有menu_resource表记录
|
||||
sysMenuResourceService.updateNewAppCode(springApplicationName);
|
||||
sysMenuResourceService.updateNewAppCode(true, springApplicationName);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -60,9 +60,11 @@ public interface SysMenuResourceService extends IService<SysMenuResource> {
|
|||
/**
|
||||
* 更新本表的所有资源编码,改为新的应用code前缀
|
||||
*
|
||||
* @param decisionFirstStart 判断是否是第一次启动,参数传true,则判断必须是第一次启动才执行update操作
|
||||
* @param newAppCode 新应用编码
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/16 23:13
|
||||
*/
|
||||
void updateNewAppCode(String newAppCode);
|
||||
void updateNewAppCode(Boolean decisionFirstStart, String newAppCode);
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.system.modular.menu.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.config.api.InitConfigApi;
|
||||
import cn.stylefeng.roses.kernel.rule.util.GunsResourceCodeUtil;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.menu.SysMenuResourceRequest;
|
||||
import cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenuResource;
|
||||
|
@ -55,6 +56,9 @@ public class SysMenuResourceServiceImpl extends ServiceImpl<SysMenuResourceMappe
|
|||
@Resource
|
||||
private SysResourceService sysResourceService;
|
||||
|
||||
@Resource
|
||||
private InitConfigApi initConfigApi;
|
||||
|
||||
@Override
|
||||
public List<ResourceTreeNode> getMenuResourceTree(Long businessId) {
|
||||
LambdaQueryWrapper<SysMenuResource> wrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -93,7 +97,15 @@ public class SysMenuResourceServiceImpl extends ServiceImpl<SysMenuResourceMappe
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateNewAppCode(String newAppCode) {
|
||||
public void updateNewAppCode(Boolean decisionFirstStart, String newAppCode) {
|
||||
|
||||
// 判断是否是第一次启动项目
|
||||
if (decisionFirstStart) {
|
||||
Boolean initConfigFlag = initConfigApi.getInitConfigFlag();
|
||||
if (initConfigFlag) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有菜单资源表信息
|
||||
List<SysMenuResource> list = this.list();
|
||||
|
|
Loading…
Reference in New Issue