【modify】统一权限平台,菜单对接修改
This commit is contained in:
+30
-11
@@ -17,46 +17,65 @@ public class ResourceDto {
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 功能名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 菜单路径
|
||||
* 对应前端组件
|
||||
*/
|
||||
private String url;
|
||||
private String component;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 一级菜单跳转地址
|
||||
*/
|
||||
private String redirect;
|
||||
|
||||
/**
|
||||
* 类型(0:一级菜单; 1:子菜单:2:按钮权限)
|
||||
*/
|
||||
private int menu_type;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private int sort;
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 类型(0是菜单,1是行为)
|
||||
* 菜单英文
|
||||
*/
|
||||
private int type;
|
||||
private String menu_en;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
* 菜单是否为路径菜单(默认值为1)
|
||||
*/
|
||||
private String parentId;
|
||||
private Integer is_route;
|
||||
|
||||
/**
|
||||
* 父级菜单code
|
||||
* 打开外部链接菜单的方式(默认值为0)
|
||||
*/
|
||||
private String parentCode;
|
||||
private Integer internal_or_external;
|
||||
|
||||
/**
|
||||
* 多套功能权限区分标识
|
||||
* 菜单是否隐藏(默认值为0)
|
||||
*/
|
||||
private String amFlag;
|
||||
private Integer hidden;
|
||||
|
||||
/**
|
||||
* 菜单是否需要缓存(默认值为0)
|
||||
*/
|
||||
private Integer keep_alive;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
+35
-12
@@ -665,12 +665,14 @@ public class SyncIamService {
|
||||
sysPermission.setPermsType("1"); // 1显示2禁用,固定为1
|
||||
sysPermission.setIcon("copy"); //IAM 没有icon字段,设定为固定值
|
||||
sysPermission.setPerms(resourceDto.getCode());
|
||||
sysPermission.setComponent(resourceDto.getCode()); // 组件的路径
|
||||
sysPermission.setUrl(resourceDto.getUrl()); // 地址栏显示的路径
|
||||
sysPermission.setComponent(resourceDto.getComponent()); // 组件的路径
|
||||
sysPermission.setUrl(resourceDto.getRedirect()); // 地址栏显示的路径
|
||||
sysPermission.setSortNo(Double.valueOf(resourceDto.getSort()));
|
||||
|
||||
// TODO 菜单英文名数据库中没有,需要确认
|
||||
|
||||
// sysPermission的 menuType (0:一级菜单;1:子菜单 ;2:按钮权限)
|
||||
if (DockingConstant.BPMC_RESOURCE_TYPE_MENU == resourceDto.getType()){
|
||||
if (DockingConstant.BPMC_RESOURCE_TYPE_MENU == resourceDto.getMenu_type()){
|
||||
if (CharSequenceUtil.isEmpty(resourceDto.getParentId())){
|
||||
sysPermission.setMenuType(0);
|
||||
} else {
|
||||
@@ -687,14 +689,14 @@ public class SyncIamService {
|
||||
sysPermission.setDescription(resourceDto.getDescription());
|
||||
|
||||
// 以下为IAM没有的属性,设置默认值
|
||||
sysPermission.setRoute(true); // 是否路由,设固定值
|
||||
sysPermission.setKeepAlive(false); // 是否缓存,设固定值
|
||||
sysPermission.setRoute(resourceDto.getIs_route() == 0 ? false : true); // 是否路由,设固定值
|
||||
sysPermission.setKeepAlive(resourceDto.getKeep_alive() == 0 ? false : true); // 是否缓存,设固定值
|
||||
sysPermission.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysPermission.setRuleFlag(0); // 是否配置菜单的数据权限 1是0否 默认0
|
||||
sysPermission.setHidden(false); // 是否配置菜单的数据权限 1是0否 默认0
|
||||
sysPermission.setHidden(resourceDto.getHidden() == 0 ? false : true); // 是否配置菜单的数据权限 1是0否 默认0
|
||||
sysPermission.setStatus("1"); // 按钮权限状态(0无效1有效)
|
||||
sysPermission.setAlwaysShow(false);
|
||||
sysPermission.setInternalOrExternal(false); // 默认为内部打开(即跳转页面)
|
||||
sysPermission.setInternalOrExternal(resourceDto.getInternal_or_external() == 0 ? false : true);
|
||||
|
||||
sysPermissionService.addPermission(sysPermission);
|
||||
} catch (Exception e){
|
||||
@@ -730,17 +732,22 @@ public class SyncIamService {
|
||||
|
||||
if (CharSequenceUtil.isNotEmpty(resourceDto.getCode())){
|
||||
sysPermission.setPerms(resourceDto.getCode());
|
||||
sysPermission.setComponent(resourceDto.getCode()); // 组件的路径
|
||||
}
|
||||
|
||||
if (CharSequenceUtil.isNotEmpty(resourceDto.getUrl())){
|
||||
sysPermission.setUrl(resourceDto.getUrl()); // 地址栏显示的路径
|
||||
if (CharSequenceUtil.isNotEmpty(resourceDto.getComponent())){
|
||||
sysPermission.setComponent(resourceDto.getComponent()); // 组件的路径
|
||||
}
|
||||
|
||||
sysPermission.setSortNo(Double.valueOf(resourceDto.getSort()));
|
||||
if (CharSequenceUtil.isNotEmpty(resourceDto.getRedirect())){
|
||||
sysPermission.setUrl(resourceDto.getRedirect()); // 地址栏显示的路径
|
||||
}
|
||||
|
||||
if (resourceDto.getSort() != null){
|
||||
sysPermission.setSortNo(Double.valueOf(resourceDto.getSort()));
|
||||
}
|
||||
|
||||
// sysPermission的 menuType (0:一级菜单;1:子菜单 ;2:按钮权限)
|
||||
if (DockingConstant.BPMC_RESOURCE_TYPE_MENU == resourceDto.getType()){
|
||||
if (DockingConstant.BPMC_RESOURCE_TYPE_MENU == resourceDto.getMenu_type()){
|
||||
if (CharSequenceUtil.isEmpty(resourceDto.getParentId())){
|
||||
sysPermission.setMenuType(0);
|
||||
} else {
|
||||
@@ -754,6 +761,22 @@ public class SyncIamService {
|
||||
sysPermission.setUpdateBy(DockingConstant.IAM_SYSTEM_NAME);
|
||||
sysPermission.setDescription(resourceDto.getDescription());
|
||||
|
||||
if (resourceDto.getIs_route() != null){
|
||||
sysPermission.setRoute(resourceDto.getIs_route() == 0 ? false : true);
|
||||
}
|
||||
|
||||
if (resourceDto.getKeep_alive() != null){
|
||||
sysPermission.setKeepAlive(resourceDto.getKeep_alive() == 0 ? false : true);
|
||||
}
|
||||
|
||||
if (resourceDto.getHidden() != null){
|
||||
sysPermission.setHidden(resourceDto.getKeep_alive() == 0 ? false : true);
|
||||
}
|
||||
|
||||
if (resourceDto.getInternal_or_external() != null){
|
||||
sysPermission.setInternalOrExternal(resourceDto.getInternal_or_external() == 0 ? false : true);
|
||||
}
|
||||
|
||||
sysPermissionService.editPermission(sysPermission);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
+6
-1
@@ -74,9 +74,14 @@ public class DockingConstant {
|
||||
*/
|
||||
public static int BPMC_RESOURCE_TYPE_MENU = 0;
|
||||
|
||||
/**
|
||||
* 竹云统一认证平台,功能权限(资源类型):子菜单
|
||||
*/
|
||||
public static int BPMC_RESOURCE_TYPE_CHILD_MENU = 1;
|
||||
|
||||
/**
|
||||
* 竹云统一认证平台,功能权限(资源类型):按钮
|
||||
*/
|
||||
public static int BPMC_RESOURCE_TYPE_BUTTON = 1;
|
||||
public static int BPMC_RESOURCE_TYPE_BUTTON = 2;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user