upgrade:升级8.0适配
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.core.init;
|
package com.cool.core.init;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
@@ -14,6 +15,7 @@ import com.cool.modules.base.entity.sys.BaseSysMenuEntity;
|
|||||||
import com.cool.modules.base.service.sys.BaseSysConfService;
|
import com.cool.modules.base.service.sys.BaseSysConfService;
|
||||||
import com.cool.modules.base.service.sys.BaseSysMenuService;
|
import com.cool.modules.base.service.sys.BaseSysMenuService;
|
||||||
import com.mybatisflex.core.BaseMapper;
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -204,7 +206,19 @@ public class DBFromJsonInit {
|
|||||||
menuEntity.setParentName(parentMenuEntity.getName());
|
menuEntity.setParentName(parentMenuEntity.getName());
|
||||||
menuEntity.setParentId(parentMenuEntity.getId());
|
menuEntity.setParentId(parentMenuEntity.getId());
|
||||||
}
|
}
|
||||||
baseSysMenuService.add(menuEntity);
|
QueryWrapper queryWrapper = QueryWrapper.create()
|
||||||
|
.eq(BaseSysMenuEntity::getName, menuEntity.getName());
|
||||||
|
if (ObjUtil.isNull(menuEntity.getParentId())) {
|
||||||
|
queryWrapper.isNull(BaseSysMenuEntity::getParentId);
|
||||||
|
} else {
|
||||||
|
queryWrapper.eq(BaseSysMenuEntity::getParentId, menuEntity.getParentId());
|
||||||
|
}
|
||||||
|
BaseSysMenuEntity dbBaseSysMenuEntity = baseSysMenuService.getOne(queryWrapper);
|
||||||
|
if (ObjUtil.isNull(dbBaseSysMenuEntity)) {
|
||||||
|
baseSysMenuService.add(menuEntity);
|
||||||
|
} else {
|
||||||
|
menuEntity = dbBaseSysMenuEntity;
|
||||||
|
}
|
||||||
// 递归处理子菜单
|
// 递归处理子菜单
|
||||||
JSONArray childMenus = jsonObj.getJSONArray("childMenus");
|
JSONArray childMenus = jsonObj.getJSONArray("childMenus");
|
||||||
if (childMenus != null) {
|
if (childMenus != null) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.cool.modules.base.service.sys.impl;
|
|||||||
import com.cool.core.exception.CoolPreconditions;
|
import com.cool.core.exception.CoolPreconditions;
|
||||||
import com.cool.modules.base.dto.sys.CodeContentDto;
|
import com.cool.modules.base.dto.sys.CodeContentDto;
|
||||||
import com.cool.modules.base.service.sys.BaseCodingService;
|
import com.cool.modules.base.service.sys.BaseCodingService;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -11,11 +12,10 @@ import java.nio.file.Path;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class BaseCodingServiceImpl implements BaseCodingService {
|
public class BaseCodingServiceImpl implements BaseCodingService {
|
||||||
@@ -69,6 +69,8 @@ public class BaseCodingServiceImpl implements BaseCodingService {
|
|||||||
}
|
}
|
||||||
// 写入文件
|
// 写入文件
|
||||||
try (FileWriter writer = new FileWriter(filePath.toFile())) {
|
try (FileWriter writer = new FileWriter(filePath.toFile())) {
|
||||||
|
formattedContent = formattedContent.replace("com.tangzc.mybatisflex.autotable.annotation.Index;",
|
||||||
|
"org.dromara.autotable.annotation.Index;");
|
||||||
writer.write(formattedContent);
|
writer.write(formattedContent);
|
||||||
}
|
}
|
||||||
list.add(filePath.toString());
|
list.add(filePath.toString());
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"router": "/sys",
|
"router": "/sys",
|
||||||
"perms": null,
|
"perms": null,
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"icon": "icon-system",
|
"icon": "icon-set",
|
||||||
"orderNum": 2,
|
"orderNum": 2,
|
||||||
"viewPath": null,
|
"viewPath": null,
|
||||||
"keepAlive": true,
|
"keepAlive": true,
|
||||||
@@ -809,55 +809,5 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "扩展管理",
|
|
||||||
"router": null,
|
|
||||||
"perms": null,
|
|
||||||
"type": 0,
|
|
||||||
"icon": "icon-favor",
|
|
||||||
"orderNum": 8,
|
|
||||||
"viewPath": null,
|
|
||||||
"keepAlive": true,
|
|
||||||
"isShow": true,
|
|
||||||
"childMenus": [
|
|
||||||
{
|
|
||||||
"name": "后端插件",
|
|
||||||
"router": "/helper/plugins/serve",
|
|
||||||
"perms": null,
|
|
||||||
"type": 1,
|
|
||||||
"icon": "icon-component",
|
|
||||||
"orderNum": 2,
|
|
||||||
"viewPath": "modules/helper/views/plugins/serve.vue",
|
|
||||||
"keepAlive": true,
|
|
||||||
"isShow": true,
|
|
||||||
"childMenus": [
|
|
||||||
{
|
|
||||||
"name": "权限",
|
|
||||||
"router": null,
|
|
||||||
"perms": "plugin:info:install,plugin:info:delete,plugin:info:update,plugin:info:page,plugin:info:info",
|
|
||||||
"type": 2,
|
|
||||||
"icon": null,
|
|
||||||
"orderNum": 0,
|
|
||||||
"viewPath": null,
|
|
||||||
"keepAlive": true,
|
|
||||||
"isShow": true,
|
|
||||||
"childMenus": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "前端插件",
|
|
||||||
"router": "/helper/plugins/vue",
|
|
||||||
"perms": null,
|
|
||||||
"type": 1,
|
|
||||||
"icon": "icon-vue",
|
|
||||||
"orderNum": 1,
|
|
||||||
"viewPath": "modules/helper/views/plugins/vue.vue",
|
|
||||||
"keepAlive": true,
|
|
||||||
"isShow": true,
|
|
||||||
"childMenus": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
158
src/main/resources/cool/data/menu/menu_8.0.json
Normal file
158
src/main/resources/cool/data/menu/menu_8.0.json
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "数据管理",
|
||||||
|
"router": null,
|
||||||
|
"perms": null,
|
||||||
|
"type": 0,
|
||||||
|
"icon": "icon-data",
|
||||||
|
"orderNum": 7,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": [
|
||||||
|
{
|
||||||
|
"name": "字典管理",
|
||||||
|
"router": "/dict/list",
|
||||||
|
"perms": null,
|
||||||
|
"type": 1,
|
||||||
|
"icon": "icon-dict",
|
||||||
|
"orderNum": 3,
|
||||||
|
"viewPath": "modules/dict/views/list.vue",
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": [
|
||||||
|
{
|
||||||
|
"name": "字典类型",
|
||||||
|
"router": null,
|
||||||
|
"perms": "dict:type:delete,dict:type:update,dict:type:info,dict:type:list,dict:type:page,dict:type:add",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "扩展管理",
|
||||||
|
"router": null,
|
||||||
|
"perms": null,
|
||||||
|
"type": 0,
|
||||||
|
"icon": "icon-favor",
|
||||||
|
"orderNum": 8,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": [
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "插件列表",
|
||||||
|
"router": "/helper/plugins",
|
||||||
|
"perms": null,
|
||||||
|
"type": 1,
|
||||||
|
"icon": "icon-list",
|
||||||
|
"orderNum": 1,
|
||||||
|
"viewPath": "modules/helper/views/plugins.vue",
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": [
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "删除",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:delete",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "分页查询",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:page",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "单个信息",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:info",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "安装插件",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:install",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "修改",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:update",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "列表查询",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:list",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tenantId": null,
|
||||||
|
"name": "新增",
|
||||||
|
"router": null,
|
||||||
|
"perms": "plugin:info:add",
|
||||||
|
"type": 2,
|
||||||
|
"icon": null,
|
||||||
|
"orderNum": 0,
|
||||||
|
"viewPath": null,
|
||||||
|
"keepAlive": true,
|
||||||
|
"isShow": true,
|
||||||
|
"childMenus": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user