【system】layui版本首页顶部英文名称改为中文名称

pull/3/head
fengshuonan 2021-01-01 18:20:17 +08:00
parent 08565c886e
commit b33e72d017
4 changed files with 52 additions and 1 deletions

View File

@ -22,4 +22,14 @@ public interface AppServiceApi {
*/
Set<SimpleDict> getAppsByAppCodes(Set<String> appCodes);
/**
* appapp
*
* @param appCode
* @return
* @author fengshuonan
* @date 2020/11/29 20:06
*/
String getAppNameByAppCode(String appCode);
}

View File

@ -18,6 +18,11 @@ public class LayuiAppIndexMenus {
*/
private String appCode;
/**
*
*/
private String appName;
/**
*
*/

View File

@ -141,6 +141,27 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
return simpleDicts;
}
@Override
public String getAppNameByAppCode(String appCode) {
String emptyName = "空应用";
if (ObjectUtil.isEmpty(appCode)) {
return emptyName;
}
LambdaQueryWrapper<SysApp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SysApp::getAppCode, appCode);
lambdaQueryWrapper.select(SysApp::getAppName);
SysApp sysApp = this.getOne(lambdaQueryWrapper);
if (sysApp == null || ObjectUtil.isEmpty(sysApp.getAppName())) {
return emptyName;
} else {
return sysApp.getAppName();
}
}
/**
*
*

View File

@ -1,8 +1,12 @@
package cn.stylefeng.roses.kernel.menu.modular.factory;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.stylefeng.roses.kernel.menu.modular.entity.SysMenu;
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
import cn.stylefeng.roses.kernel.rule.factory.DefaultTreeBuildFactory;
import cn.stylefeng.roses.kernel.system.AppServiceApi;
import cn.stylefeng.roses.kernel.system.pojo.menu.layui.LayuiAppIndexMenus;
import cn.stylefeng.roses.kernel.system.pojo.menu.layui.LayuiIndexMenuTreeNode;
@ -40,7 +44,6 @@ public class LayuiMenusFactory {
// 找出每个应用下的所有菜单
for (String appCode : appCodes) {
// 找出这个应用下的菜单
List<SysMenu> appMenus = sysMenuList.stream()
.filter(i -> i.getAppCode().equals(appCode))
@ -60,6 +63,7 @@ public class LayuiMenusFactory {
// 将appCode和对应的树包装为实体
LayuiAppIndexMenus layuiAppIndexMenus = new LayuiAppIndexMenus();
layuiAppIndexMenus.setAppCode(appCode);
layuiAppIndexMenus.setAppName(getAppNameByAppCode(appCode));
layuiAppIndexMenus.setLayuiIndexMenuTreeNodes(layuiIndexMenuTreeNodeList);
resultList.add(layuiAppIndexMenus);
}
@ -67,4 +71,15 @@ public class LayuiMenusFactory {
return resultList;
}
/**
*
*
* @author fengshuonan
* @date 2021/1/1 18:09
*/
private static String getAppNameByAppCode(String appCode) {
AppServiceApi appServiceApi = SpringUtil.getBean(AppServiceApi.class);
return appServiceApi.getAppNameByAppCode(appCode);
}
}