【7.3.2】【menu】更新菜单资源的初始化编码修改

pull/43/MERGE
fengshuonan 2022-11-17 00:05:00 +08:00
parent cd17de64d0
commit 660c680950
3 changed files with 17 additions and 3 deletions

View File

@ -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);
}

View File

@ -60,9 +60,11 @@ public interface SysMenuResourceService extends IService<SysMenuResource> {
/**
* code
*
* @param decisionFirstStart trueupdate
* @param newAppCode
* @author fengshuonan
* @date 2022/11/16 23:13
*/
void updateNewAppCode(String newAppCode);
void updateNewAppCode(Boolean decisionFirstStart, String newAppCode);
}

View File

@ -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();