查询用户授权app
parent
ddd530f969
commit
57ec1cc335
|
@ -49,13 +49,7 @@ public class IndexServiceImpl implements IndexService {
|
||||||
public GeneralResult workOrderStatic(RequestContext requestContext) {
|
public GeneralResult workOrderStatic(RequestContext requestContext) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
JSONObject param = new JSONObject();
|
JSONObject jsonObject = getTaskList(requestContext);
|
||||||
User user = userRepository.query(requestContext.getTarget());
|
|
||||||
param.put("userId", "1111");
|
|
||||||
param.put("page", 1);
|
|
||||||
param.put("limit", Integer.MAX_VALUE);
|
|
||||||
String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class);
|
|
||||||
JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class);
|
|
||||||
Integer total = jsonObject.getInteger("total");
|
Integer total = jsonObject.getInteger("total");
|
||||||
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
@ -82,6 +76,17 @@ public class IndexServiceImpl implements IndexService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private JSONObject getTaskList(RequestContext requestContext) throws Exception {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
User user = userRepository.query(requestContext.getTarget());
|
||||||
|
param.put("userId", "1111");
|
||||||
|
param.put("page", 1);
|
||||||
|
param.put("limit", Integer.MAX_VALUE);
|
||||||
|
String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class);
|
||||||
|
JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneralResult userDataStatic(RequestContext requestContext) {
|
public GeneralResult userDataStatic(RequestContext requestContext) {
|
||||||
try {
|
try {
|
||||||
|
@ -90,10 +95,17 @@ public class IndexServiceImpl implements IndexService {
|
||||||
List<JSONObject> userAppList = getUserAppList(requestContext);
|
List<JSONObject> userAppList = getUserAppList(requestContext);
|
||||||
resultMap.put("userAppCount", userAppList.size());
|
resultMap.put("userAppCount", userAppList.size());
|
||||||
|
|
||||||
//获取用户信息
|
|
||||||
|
//获取运维任务申请表
|
||||||
|
JSONObject taskJson = getTaskList(requestContext);
|
||||||
|
Integer total = taskJson.getInteger("total");
|
||||||
|
resultMap.put("taskCount", total);
|
||||||
|
|
||||||
|
|
||||||
|
//获取用户数据权限申请数量
|
||||||
JSONObject userParam = new JSONObject();
|
JSONObject userParam = new JSONObject();
|
||||||
userParam.put("userId", "1111");
|
userParam.put("userId", "1111");
|
||||||
String userRolesStr = ykUtil.call(YkInfo.getUserRoles, userParam, JSONArray.class);
|
String userRolesStr = ykUtil.call(YkInfo.getUserDataJurisdiction, userParam, JSONArray.class);
|
||||||
|
|
||||||
|
|
||||||
return new GeneralResult(true, resultMap, "查询成功");
|
return new GeneralResult(true, resultMap, "查询成功");
|
||||||
|
@ -117,12 +129,14 @@ public class IndexServiceImpl implements IndexService {
|
||||||
JSONObject allAppJson = JSONObject.parseObject(result, JSONObject.class);
|
JSONObject allAppJson = JSONObject.parseObject(result, JSONObject.class);
|
||||||
List<JSONObject> allAppList = JSONObject.parseObject(allAppJson.getString("list"), List.class);
|
List<JSONObject> allAppList = JSONObject.parseObject(allAppJson.getString("list"), List.class);
|
||||||
|
|
||||||
|
|
||||||
List<JSONObject> userAppList = getUserAppList(requestContext);
|
List<JSONObject> userAppList = getUserAppList(requestContext);
|
||||||
List<String> appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList());
|
List<String> appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList());
|
||||||
for (JSONObject data : allAppList) {
|
for (JSONObject data : allAppList) {
|
||||||
if(appIdList.contains(data.getString("appId"))){
|
if(appIdList.contains(data.getString("appId"))){
|
||||||
data.put("enable", "1");
|
data.put("enable", "1");
|
||||||
|
}else{
|
||||||
|
|
||||||
|
data.put("enable", "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new GeneralResult(true, allAppList, "查询成功");
|
return new GeneralResult(true, allAppList, "查询成功");
|
||||||
|
|
|
@ -13,6 +13,8 @@ public enum YkInfo {
|
||||||
getAllAppList("/system/sysapp/getAppList"),
|
getAllAppList("/system/sysapp/getAppList"),
|
||||||
//获取用户角色信息
|
//获取用户角色信息
|
||||||
getUserRoles("/system/user/queryUserRoles"),
|
getUserRoles("/system/user/queryUserRoles"),
|
||||||
|
//用户数据权限信息查询接口
|
||||||
|
getUserDataJurisdiction("/system/user/queryUserAuthres"),
|
||||||
|
|
||||||
getTaskByUser("/system/task/countTaskByUser");
|
getTaskByUser("/system/task/countTaskByUser");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue