From c1f55e4c99f9da7b68252dc99bad12ed01e0b387 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Mon, 26 Aug 2024 20:07:53 +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 --- .../com/bocloud/sms/service/IndexServiceImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 035f22a..8819b8a 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 @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Service("IndexService") @Slf4j @@ -110,10 +111,18 @@ public class IndexServiceImpl implements IndexService { //查询当前用户授权应用 JSONObject param = new JSONObject(); param.put("type", "user"); + param.put("page", 1); + param.put("limit", Integer.MAX_VALUE); String result = ykUtil.call(YkInfo.getAllAppList, param, JSONArray.class); - + List list = JSONObject.parseObject(result, List.class); List userAppList = getUserAppList(requestContext); + List appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList()); + for (JSONObject data : list) { + if(appIdList.contains(data.getString("appId"))){ + data.put("enable", "1"); + } + } return new GeneralResult(true, userAppList, "查询成功"); } catch (Exception e) { log.info("查询失败", e);