提交 6bb6586d 编写于 作者: zhouweidong's avatar zhouweidong

业务系统权限接入user代码

上级 b8ec2915
......@@ -42,8 +42,8 @@ public class PermissionFeignService {
* 根据登录的用户userid,系统标识,获取指定该系统下角色的菜单、或权限
* @return
*/
@GetMapping(value = "/uaa/permission/{userid}")
public JSONObject getUserPermissionData(@Validated @NotBlank(message = "userid不允许为空")@PathVariable("userid") String userid, @Validated @NotBlank(message = "systemid不允许为空") @RequestParam("systemid") String systemid) {
@GetMapping(value = "/uaa/permission/{loginname}")
public JSONObject getUserPermissionData(@Validated @NotBlank(message = "loginname不允许为空")@PathVariable("loginname") String loginName, @Validated @NotBlank(message = "systemid不允许为空") @RequestParam("systemid") String systemid) {
String menuSQL="SELECT\n" +
"\tt3.PERMISSIONID as permissionid\n" +
......@@ -55,15 +55,15 @@ public class PermissionFeignService {
"t.SYS_ROLEID IN (\n" +
" SELECT SYS_ROLEID\n" +
" FROM\n" +
" IBZUSER_ROLE\n" +
" IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" +
" WHERE\n" +
" SYS_USERID = '%s'\n" +
" T1.USERNAME = '%s'\n" +
" )\n" +
"AND t2.SYSTEMID = '%s'\n" +
"AND t2.ENABLE = 1\n" +
"AND t2.TYPE = 0";
List<JSONObject> permissionList= permissionService.select(String.format(menuSQL,userid,systemid)); //查询用户权限下的菜单数据
List<JSONObject> permissionList= permissionService.select(String.format(menuSQL,loginName,systemid)); //查询用户权限下的菜单数据
JSONObject permissionObj=new JSONObject();
JSONObject gridData=new JSONObject();
......@@ -90,17 +90,16 @@ public class PermissionFeignService {
"INNER JOIN ibzpsdeoppriv T2 on T1.SYS_PERMISSIONID=t2.SYS_PSDEOPPRIVID\n" +
"WHERE\n" +
"\tT.SYS_ROLEID IN (\n" +
"\t\tSELECT\n" +
"\t\t\tSYS_ROLEID\n" +
"\t\tFROM\n" +
"\t\t\tIBZUSER_ROLE\n" +
"\t\tWHERE\n" +
"\t\t\tSYS_USERID = '%s'\n" +
"\t SELECT SYS_ROLEID\n" +
"\t FROM\n" +
"\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" +
"\t WHERE\n" +
"\t T1.USERNAME = '%s'\n" +
"\t)\n" +
"AND T1.SYSTEMID = '%s'\n" +
"AND T1.TYPE = 1";
List<JSONObject> permissionList2= permissionService.select(String.format(opprivSQL,userid,systemid)); //查询用户权限下的菜单数据
List<JSONObject> permissionList2= permissionService.select(String.format(opprivSQL,loginName,systemid)); //查询用户权限下的菜单数据
gridData=getGridPermission(permissionList2);//拿到表格需要json数据
formdata=getFormPermission(permissionList2);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册