From e03419a4a3d4afd481fa3bc0d0a3ea7c5b3b26d6 Mon Sep 17 00:00:00 2001 From: Hoshi <1196756653@qq.com> Date: Wed, 18 Sep 2024 11:40:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bocloud/sms/service/IndexServiceImpl.java | 8 ++++---- .../src/main/java/com/bocloud/sms/utils/YkUtil.java | 4 +++- 2 files changed, 7 insertions(+), 5 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 e1718c8..4881d28 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 @@ -45,7 +45,7 @@ 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("userId", user.getUserId() == null ? ykUtil.getReqUserId() : user.getUserId()); param.put("page", pager.getPage()); param.put("limit", pager.getRows()); String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); @@ -92,7 +92,7 @@ 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("userId", user.getUserId() == null ? ykUtil.getReqUserId() : user.getUserId()); param.put("page", 1); param.put("limit", Integer.MAX_VALUE); String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class); @@ -107,7 +107,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()); + userParam.put("userId", user.getUserId() == null ? ykUtil.getReqUserId() : user.getUserId()); String data = ykUtil.call(YkInfo.getCountTaskByUser, userParam, JSONArray.class); List list = JSONObject.parseObject(data, List.class); @@ -221,7 +221,7 @@ 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("userId", user.getUserId() == null ? ykUtil.getReqUserId() : 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); diff --git a/bocloud.sms.storage/src/main/java/com/bocloud/sms/utils/YkUtil.java b/bocloud.sms.storage/src/main/java/com/bocloud/sms/utils/YkUtil.java index 91c695c..d79431e 100644 --- a/bocloud.sms.storage/src/main/java/com/bocloud/sms/utils/YkUtil.java +++ b/bocloud.sms.storage/src/main/java/com/bocloud/sms/utils/YkUtil.java @@ -5,12 +5,14 @@ import com.alibaba.fastjson.JSONObject; import com.bocloud.sms.entity.YkReqVo; import com.bocloud.sms.enums.YkInfo; import com.google.protobuf.ServiceException; +import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -@Component +@Data @Slf4j +@Component public class YkUtil { //参考application.yml配置文件