From 7276c85268da0c89fbcf0293c3cb6e0053c8395b Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期二, 07 五月 2019 17:24:38 +0800
Subject: [PATCH] 加入房屋保存接口信息

---
 WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java |   73 +++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 7 deletions(-)

diff --git a/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java b/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
index 1b32c53..f32b160 100644
--- a/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
+++ b/WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
@@ -1,9 +1,12 @@
 package com.java110.web.smo.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.common.constant.ServiceConstant;
+import com.java110.common.constant.StatusConstant;
 import com.java110.core.context.IPageData;
 import com.java110.web.core.BaseComponentSMO;
+import com.java110.web.smo.ICommunityServiceSMO;
 import com.java110.web.smo.INavServiceSMO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,13 +24,18 @@
  */
 @Service("navServiceSMOImpl")
 public class NavServiceSMOImpl extends BaseComponentSMO implements INavServiceSMO {
-    private final static Logger logger = LoggerFactory.getLogger(NavServiceSMOImpl.class);
+    private static Logger logger = LoggerFactory.getLogger(NavServiceSMOImpl.class);
 
     @Autowired
     private RestTemplate restTemplate;
 
+
+    @Autowired
+    private ICommunityServiceSMO communityServiceSMOImpl;
+
     /**
      * 鐢ㄦ埛閫�鍑�
+     *
      * @param pd
      * @return
      */
@@ -35,31 +43,82 @@
     public ResponseEntity<String> doExit(IPageData pd) {
         ResponseEntity<String> responseEntity = null;
         JSONObject exitInfo = new JSONObject();
-        exitInfo.put("token",pd.getToken());
-        responseEntity = this.callCenterService(restTemplate,pd,exitInfo.toJSONString(), ServiceConstant.SERVICE_API_URL+"/api/user.service.logout", HttpMethod.POST);
+        exitInfo.put("token", pd.getToken());
+        responseEntity = this.callCenterService(restTemplate, pd, exitInfo.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/user.service.logout", HttpMethod.POST);
 
         return responseEntity;
     }
 
     /**
      * 鑾峰彇鐢ㄦ埛淇℃伅
+     *
      * @param pd
      * @return
      */
     @Override
     public ResponseEntity<String> getUserInfo(IPageData pd) {
-        Assert.hasLength(pd.getUserId(),"鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
-        ResponseEntity<String> responseEntity = null;
-        responseEntity = this.callCenterService(restTemplate,pd,"", ServiceConstant.SERVICE_API_URL+"/api/query.user.userInfo?userId="+pd.getUserId(), HttpMethod.GET);
+        Assert.hasLength(pd.getUserId(), "鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
+        /*ResponseEntity<String> responseEntity = null;
+        responseEntity = this.callCenterService(restTemplate,pd,"",
+        ServiceConstant.SERVICE_API_URL+"/api/query.user.userInfo?userId="+pd.getUserId(), HttpMethod.GET);
         // 杩囨护杩斿洖鎶ユ枃涓殑瀛楁锛屽彧杩斿洖name瀛楁
-        //{"address":"","orderTypeCd":"Q","serviceCode":"","responseTime":"20190401194712","sex":"","localtionCd":"","userId":"302019033054910001","levelCd":"00","transactionId":"-1","dataFlowId":"-1","response":{"code":"0000","message":"鎴愬姛"},"name":"996icu","tel":"18909780341","bId":"-1","businessType":"","email":""}
+        //{"address":"","orderTypeCd":"Q","serviceCode":"","responseTime":"20190401194712","sex":"",
+        "localtionCd":"","userId":"302019033054910001","levelCd":"00","transactionId":"-1","dataFlowId":"-1",
+        "response":{"code":"0000","message":"鎴愬姛"},"name":"996icu","tel":"18909780341","bId":"-1","businessType":"","email":""}
 
         if(responseEntity.getStatusCode() == HttpStatus.OK){
             JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
             JSONObject resultUserInfo = new JSONObject();
             resultUserInfo.put("name",tmpUserInfo.getString("name"));
             responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(),HttpStatus.OK);
+        }*/
+        ResponseEntity<String> responseEntity = null;
+        responseEntity = super.getUserInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() == HttpStatus.OK) {
+            JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
+            JSONObject resultUserInfo = new JSONObject();
+            resultUserInfo.put("name", tmpUserInfo.getString("name"));
+            responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(), HttpStatus.OK);
         }
         return responseEntity;
     }
+
+
+    @Override
+    public ResponseEntity<String> listMyCommunity(IPageData pd) {
+        ResponseEntity<String> responseEntity = communityServiceSMOImpl.listMyCommunity(pd);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
+            return responseEntity;
+        }
+
+        JSONArray communitys = JSONArray.parseArray(responseEntity.getBody());
+
+        JSONArray newCommunitys = new JSONArray();
+
+        //鍙繑鍥炲皬鍖篒D鍜屽皬鍖哄悕绉� 骞朵笖鏄湪鐢ㄧ殑
+        JSONObject tempCommunity = null;
+        JSONObject newCommunity = null;
+        for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
+            tempCommunity = communitys.getJSONObject(communityIndex);
+
+            if (!StatusConstant.STATUS_CD_AUDIT_COMPLETE.equals(tempCommunity.getString("auditStatusCd"))) {
+                continue;
+            }
+            newCommunity = new JSONObject();
+            newCommunity.put("communityId", tempCommunity.getString("communityId"));
+            newCommunity.put("name", tempCommunity.getString("name"));
+            newCommunitys.add(newCommunity);
+        }
+        responseEntity = new ResponseEntity<String>(newCommunitys.toJSONString(), HttpStatus.OK);
+        return responseEntity;
+    }
+
+    public ICommunityServiceSMO getCommunityServiceSMOImpl() {
+        return communityServiceSMOImpl;
+    }
+
+    public void setCommunityServiceSMOImpl(ICommunityServiceSMO communityServiceSMOImpl) {
+        this.communityServiceSMOImpl = communityServiceSMOImpl;
+    }
 }

--
Gitblit v1.8.0