From cc085bf3253a2d0b511b6b7dbb7982cfd5d64d33 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 18 六月 2020 09:46:12 +0800
Subject: [PATCH] 优化支付问题

---
 service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java b/service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java
index 4e50bd6..b175924 100644
--- a/service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java
+++ b/service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java
@@ -6,6 +6,7 @@
 import com.java110.front.smo.payment.IToNotifySMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeConstant;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.PayUtil;
@@ -90,8 +91,8 @@
         String openId = "";
         String paySwitch = MappingCache.getValue(AppAbstractComponentSMO.DOMAIN_WECHAT_PAY, AppAbstractComponentSMO.WECHAT_SERVICE_PAY_SWITCH);
         if (AppAbstractComponentSMO.WECHAT_SERVICE_PAY_SWITCH_ON.equals(paySwitch)) {
-            openId =  map.get("sub_openid").toString();
-        }else {
+            openId = map.get("sub_openid").toString();
+        } else {
             openId = map.get("openid").toString();
         }
 
@@ -103,7 +104,7 @@
         }
 
         JSONObject userResult = JSONObject.parseObject(responseEntity.getBody());
-        JSONObject realUserInfo = userResult.getJSONArray("users").getJSONObject(0);
+        JSONObject realUserInfo = userResult.getJSONArray("data").getJSONObject(0);
         String useId = realUserInfo.getString("userId");
 
         //鏌ヨ鐢ㄦ埛ID
@@ -128,7 +129,7 @@
         //Assert.hasLength(pd.getUserId(), "鐢ㄦ埛鏈櫥褰曡鍏堢櫥褰�");
         ResponseEntity<String> responseEntity = null;
         responseEntity = this.callCenterService(restTemplate, "-1", "",
-                ServiceConstant.SERVICE_API_URL + "/api/user.listUsers?openId=" + openId + "&page=1&row=1", HttpMethod.GET);
+                ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCodeConstant.LIST_APPUSERBINDINGOWNERS + "?openId=" + openId + "&page=1&row=1", 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":""}
 
@@ -155,7 +156,7 @@
         try {
             responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class);
         } catch (HttpStatusCodeException e) { //杩欓噷spring 妗嗘灦 鍦�4XX 鎴� 5XX 鏃舵姏鍑� HttpServerErrorException 寮傚父锛岄渶瑕侀噸鏂板皝瑁呬竴涓�
-            responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode());
+            responseEntity = new ResponseEntity<String>(e.getResponseBodyAsString(), e.getStatusCode());
         } catch (Exception e) {
             responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
         } finally {

--
Gitblit v1.8.0