From 57ec1cc3351bb2e059040dfb639aca4a8ba9f5e2 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Mon, 26 Aug 2024 20:14:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7=E6=8E=88?= =?UTF-8?q?=E6=9D=83app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bocloud/sms/service/IndexServiceImpl.java | 34 +++++++++++++------ .../java/com/bocloud/sms/enums/YkInfo.java | 2 ++ 2 files changed, 26 insertions(+), 10 deletions(-) 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");