diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java index 6830919..97a00a0 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java @@ -49,13 +49,7 @@ public class IndexServiceImpl implements IndexService { public GeneralResult workOrderStatic(RequestContext requestContext) { try { - 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); + JSONObject jsonObject = getTaskList(requestContext); Integer total = jsonObject.getInteger("total"); Map 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 public GeneralResult userDataStatic(RequestContext requestContext) { try { @@ -90,10 +95,17 @@ public class IndexServiceImpl implements IndexService { List userAppList = getUserAppList(requestContext); resultMap.put("userAppCount", userAppList.size()); - //获取用户信息 + + //获取运维任务申请表 + JSONObject taskJson = getTaskList(requestContext); + Integer total = taskJson.getInteger("total"); + resultMap.put("taskCount", total); + + + //获取用户数据权限申请数量 JSONObject userParam = new JSONObject(); 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, "查询成功"); @@ -117,12 +129,14 @@ public class IndexServiceImpl implements IndexService { JSONObject allAppJson = JSONObject.parseObject(result, JSONObject.class); List allAppList = JSONObject.parseObject(allAppJson.getString("list"), List.class); - List userAppList = getUserAppList(requestContext); List appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList()); for (JSONObject data : allAppList) { if(appIdList.contains(data.getString("appId"))){ data.put("enable", "1"); + }else{ + + data.put("enable", "0"); } } return new GeneralResult(true, allAppList, "查询成功"); diff --git a/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/YkInfo.java b/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/YkInfo.java index 53dd9ef..18bdc96 100644 --- a/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/YkInfo.java +++ b/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/YkInfo.java @@ -13,6 +13,8 @@ public enum YkInfo { getAllAppList("/system/sysapp/getAppList"), //获取用户角色信息 getUserRoles("/system/user/queryUserRoles"), + //用户数据权限信息查询接口 + getUserDataJurisdiction("/system/user/queryUserAuthres"), getTaskByUser("/system/task/countTaskByUser");