From a2e439d3d0b7e52ff98e5be89c121c9b167fe6dc Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 22 六月 2020 18:53:24 +0800
Subject: [PATCH] 微信公众号加入wId

---
 service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java b/service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java
index ab22672..6774aae 100644
--- a/service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java
+++ b/service-front/src/main/java/com/java110/front/smo/wechatGateway/impl/WechatGatewaySMOImpl.java
@@ -5,10 +5,13 @@
 import com.java110.core.context.IPageData;
 import com.java110.core.factory.WechatFactory;
 import com.java110.dto.owner.OwnerAppUserDto;
+import com.java110.dto.smallWeChat.SmallWeChatDto;
+import com.java110.dto.smallWechatAttr.SmallWechatAttrDto;
 import com.java110.front.properties.WechatAuthProperties;
 import com.java110.front.smo.wechatGateway.IWechatGatewaySMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.ServiceCodeConstant;
+import com.java110.utils.constant.ServiceCodeSmallWeChatConstant;
 import com.java110.utils.constant.WechatConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.StringUtil;
@@ -44,7 +47,7 @@
     public ResponseEntity<String>
     gateway(IPageData pd) throws Exception {
 
-        JSONObject paramIn = JSONObject.parseObject(JSONObject.toJSONString(pd.getReqData()));
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         Assert.hasKeyAndValue(paramIn, "fromUserName", "璇锋眰鎶ユ枃涓湭鍖呭惈fromUserName");
         Assert.hasKeyAndValue(paramIn, "toUserName", "璇锋眰鎶ユ枃涓湭鍖呭惈toUserName");
 
@@ -74,6 +77,23 @@
         return new ResponseEntity<>(responseStr, HttpStatus.OK);
     }
 
+    @Override
+    public SmallWeChatDto getSmallWechat(IPageData pd, SmallWeChatDto smallWeChatDto) {
+
+        List<SmallWeChatDto> smallWeChatDtos = super.getForApis(pd, smallWeChatDto, ServiceCodeSmallWeChatConstant.LIST_SMALL_WE_CHATS, SmallWeChatDto.class);
+        if (smallWeChatDtos == null || smallWeChatDtos.size() < 1) {
+            return null;
+        }
+        smallWeChatDto = smallWeChatDtos.get(0);
+        SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto();
+        smallWechatAttrDto.setCommunityId(smallWeChatDto.getObjId());
+        smallWechatAttrDto.setWechatId(smallWeChatDto.getWeChatId());
+        List<SmallWechatAttrDto> smallWechatAttrs = super.getForApis(pd, smallWechatAttrDto, ServiceCodeSmallWeChatConstant.LIST_SMALL_WE_CHATS, SmallWechatAttrDto.class);
+
+        smallWeChatDto.setSmallWechatAttrs(smallWechatAttrs);
+        return smallWeChatDto;
+    }
+
 
     public RestTemplate getRestTemplate() {
         return restTemplate;

--
Gitblit v1.8.0