提交 1ec8ec0c 编写于 作者: zhouweidong's avatar zhouweidong

业务系统权限接入user代码

上级 f6c46904
......@@ -45,6 +45,8 @@ public class PermissionFeignService {
@GetMapping(value = "/uaa/permission/{loginname}")
public JSONObject getUserPermissionData(@Validated @NotBlank(message = "loginname不允许为空")@PathVariable("loginname") String loginName, @Validated @NotBlank(message = "systemid不允许为空") @RequestParam("systemid") String systemid) {
JSONObject permissionObj=new JSONObject();
String menuSQL="SELECT\n" +
"\tt3.PERMISSIONID as permissionid\n" +
"FROM\n" +
......@@ -63,15 +65,11 @@ public class PermissionFeignService {
"AND t2.ENABLE = 1\n" +
"AND t2.TYPE = 0";
List<JSONObject> permissionList= permissionService.select(String.format(menuSQL,loginName,systemid)); //查询用户权限下的菜单数据
JSONObject permissionObj=new JSONObject();
JSONObject gridData=new JSONObject();
JSONObject formdata=new JSONObject();
List<JSONObject> menuPermissionList= permissionService.select(String.format(menuSQL,loginName,systemid)); //查询用户权限下的菜单数据
JSONArray menuArray=new JSONArray();//菜单
if(permissionList.size()>0){
for(Map permission :permissionList){
if(menuPermissionList.size()>0){
for(Map permission :menuPermissionList){
if(!StringUtils.isEmpty(permission.get("permissionid"))){
menuArray.add(permission.get("permissionid"));
}
......@@ -99,14 +97,14 @@ public class PermissionFeignService {
"AND T1.SYSTEMID = '%s'\n" +
"AND T1.TYPE = 1";
List<JSONObject> permissionList2= permissionService.select(String.format(opprivSQL,loginName,systemid)); //查询用户权限下的菜单数据
List<JSONObject> opprivPermissionList= permissionService.select(String.format(opprivSQL,loginName,systemid)); //查询用户权限下的菜单数据
gridData=getGridPermission(permissionList2);//拿到表格需要json数据
formdata=getFormPermission(permissionList2);
JSONObject datasetPermission=getGridPermission(opprivPermissionList);//拿到表格需要json数据
JSONObject actionPermission=getFormPermission(opprivPermissionList);
permissionObj.put("menuList",menuArray);
permissionObj.put("dataAbility-grid",gridData);
permissionObj.put("dataAbility-form",formdata);
permissionObj.put("deDataSetPermission",datasetPermission);
permissionObj.put("deActionPermission",actionPermission);
return permissionObj;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册