From 9ac20d69056bff4e7fe645d3cd54be43d9f91420 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Fri, 30 Aug 2024 17:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bocloud/sms/service/IndexServiceImpl.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 191173b..e397aff 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 @@ -38,6 +38,7 @@ public class IndexServiceImpl implements IndexService { try { JSONObject param = new JSONObject(); User user = userRepository.query(requestContext.getTarget()); + log.info("user:{}", JSON.toJSONString(user)); param.put("userId", user.getUserId()); param.put("page", pager.getPage()); param.put("limit", pager.getRows()); @@ -84,6 +85,7 @@ public class IndexServiceImpl implements IndexService { private JSONObject getTaskList(RequestContext requestContext) throws Exception { JSONObject param = new JSONObject(); User user = userRepository.query(requestContext.getTarget()); + log.info("user:{}", JSON.toJSONString(user)); param.put("userId", user.getUserId()); param.put("page", 1); param.put("limit", Integer.MAX_VALUE); @@ -98,6 +100,7 @@ public class IndexServiceImpl implements IndexService { //获取用户数据权限申请数量 JSONObject userParam = new JSONObject(); User user = userRepository.query(requestContext.getTarget()); + log.info("user:{}", JSON.toJSONString(user)); userParam.put("userId", user.getUserId()); String data = ykUtil.call(YkInfo.getCountTaskByUser, userParam, JSONArray.class); List list = JSONObject.parseObject(data, List.class); @@ -123,17 +126,19 @@ public class IndexServiceImpl implements IndexService { String result = ykUtil.call(YkInfo.getAllAppList, param, JSONArray.class); JSONObject allAppJson = JSONObject.parseObject(result, JSONObject.class); List allAppList = JSONObject.parseObject(allAppJson.getString("list"), List.class); - + log.info("allAppList:{}", JSON.toJSONString(allAppList)); List userAppList = getUserAppList(requestContext); + log.info("userAppList:{}", JSON.toJSONString(userAppList)); List appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList()); + log.info("appIdList:{}", JSON.toJSONString(appIdList)); for (JSONObject data : allAppList) { if (appIdList.contains(data.getString("appId"))) { data.put("enable", "1"); } else { - data.put("enable", "0"); } } + log.info("allAppList:{}", JSON.toJSONString(allAppList)); return new GeneralResult(true, allAppList, "查询成功"); } catch (Exception e) { log.info("查询失败", e); @@ -198,9 +203,12 @@ public class IndexServiceImpl implements IndexService { //查询当前用户授权应用 JSONObject param = new JSONObject(); User user = userRepository.query(requestContext.getTarget()); + log.info("user:{}", JSON.toJSONString(user)); param.put("userId", user.getUserId()); param.put("type", "user"); + log.info("get user app list params:{}", JSON.toJSONString(param)); String result = ykUtil.call(YkInfo.getUserAppList, param, JSONArray.class); + log.info("get user app list result:" + result); return JSONObject.parseObject(result, List.class); } }