From ca4662481a96825dffab34118fbfb6b18a92923e Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 03 七月 2020 19:23:50 +0800
Subject: [PATCH] 优化 事务

---
 java110-core/src/main/java/com/java110/core/component/BaseComponentSMO.java |   81 ++++++++++++++++++++++++----------------
 1 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/java110-core/src/main/java/com/java110/core/component/BaseComponentSMO.java b/java110-core/src/main/java/com/java110/core/component/BaseComponentSMO.java
index 2a4a860..d06edce 100644
--- a/java110-core/src/main/java/com/java110/core/component/BaseComponentSMO.java
+++ b/java110-core/src/main/java/com/java110/core/component/BaseComponentSMO.java
@@ -2,18 +2,18 @@
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.context.IPageData;
+import com.java110.entity.component.ComponentValidateResult;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.ServiceCodeConstant;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.exception.SMOException;
 import com.java110.utils.factory.ApplicationContextFactory;
 import com.java110.utils.util.Assert;
-import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.core.context.IPageData;
-import com.java110.entity.component.ComponentValidateResult;
 import com.java110.utils.util.StringUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.http.HttpMethod;
@@ -102,6 +102,50 @@
         // 杩囨护杩斿洖鎶ユ枃涓殑瀛楁锛屽彧杩斿洖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":""}
 
+        return responseEntity;
+
+    }
+
+    /**
+     * 鑾峰彇鐢ㄦ埛淇℃伅
+     *
+     * @param pd
+     * @param restTemplate
+     * @return
+     */
+    protected ResponseEntity<String> getUserAndAttr(IPageData pd, RestTemplate restTemplate, Map paramIn) {
+        //Assert.hasLength(pd.getUserId(), "鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
+        ResponseEntity<String> responseEntity = null;
+        if (paramIn != null) {
+            paramIn.put("page", "1");
+            paramIn.put("row", "1");
+        }
+        responseEntity = this.callCenterService(restTemplate, pd, "",
+                ServiceConstant.SERVICE_API_URL + "/api/user.listUsers" + mapToUrlParam(paramIn), 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":""}
+        return responseEntity;
+
+    }
+
+    /**
+     * 鑾峰彇鐢ㄦ埛淇℃伅
+     *
+     * @param pd
+     * @param restTemplate
+     * @return
+     */
+    protected ResponseEntity<String> getOwnerAppUser(IPageData pd, RestTemplate restTemplate, Map paramIn) {
+        //Assert.hasLength(pd.getUserId(), "鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
+        ResponseEntity<String> responseEntity = null;
+        if (paramIn != null) {
+            paramIn.put("page", "1");
+            paramIn.put("row", "1");
+        }
+        responseEntity = this.callCenterService(restTemplate, pd, "",
+                ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCodeConstant.LIST_APPUSERBINDINGOWNERS + mapToUrlParam(paramIn), 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":""}
         return responseEntity;
 
     }
@@ -200,33 +244,6 @@
 
     }
 
-    /**
-     * map 鍙傛暟杞� url get 鍙傛暟 闈炵┖鍊艰浆涓篻et鍙傛暟 绌哄�煎拷鐣�
-     *
-     * @param info map鏁版嵁
-     * @return url get 鍙傛暟 甯︼紵
-     */
-    protected String mapToUrlParam(Map info) {
-        String urlParam = "";
-        if (info == null || info.isEmpty()) {
-            return urlParam;
-        }
-
-        urlParam += "?";
-
-        for (Object key : info.keySet()) {
-            if (StringUtils.isEmpty(info.get(key) + "")) {
-                continue;
-            }
-
-            urlParam += (key + "=" + info.get(key) + "&");
-        }
-
-        urlParam = urlParam.endsWith("&") ? urlParam.substring(0, urlParam.length() - 1) : urlParam;
-
-        return urlParam;
-    }
-
 
     /**
      * 鏍¢獙 鍛樺伐 鍟嗘埛 灏忓尯 鍏崇郴
@@ -254,7 +271,7 @@
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
 
         String communityId = "";
-        if (paramIn.containsKey("communityId")&& !StringUtil.isEmpty(paramIn.getString("communityId"))) {
+        if (paramIn.containsKey("communityId") && !StringUtil.isEmpty(paramIn.getString("communityId"))) {
             communityId = paramIn.getString("communityId");
             checkStoreEnterCommunity(pd, storeId, storeTypeCd, communityId, restTemplate);
         }

--
Gitblit v1.8.0