‘linchangsheng’ 5 mesiacov pred
rodič
commit
ae62aa3baf

+ 3 - 2
mall-server-api/src/main/java/com/gree/mall/manager/logic/SyncOrderInfoLogic.java

@@ -30,6 +30,7 @@ import com.gree.mall.manager.utils.http.HttpUtils;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import okhttp3.Response;
 import org.apache.velocity.util.ArrayListWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -353,9 +354,9 @@ public class SyncOrderInfoLogic {
                 String json = JSONUtil.toJsonStr(workOrderSearchReq);
 
 
-                String body = HttpUtils.requestPostBody(greeUrl + Constant.gree.POST_WORKER_ORDER_DETAIL, json, heard);
+                Response body = HttpUtils.requestPostBody(greeUrl + Constant.gree.POST_WORKER_ORDER_DETAIL, json, heard);
 
-                Map<String, Object> bodyMap = JSON.parseObject(body);
+                Map<String, Object> bodyMap = JSON.parseObject(body.body().string());
                 String s = bodyMap.get("data").toString();
 
 

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/utils/http/HttpUtils.java

@@ -81,7 +81,7 @@ public class HttpUtils {
 
     }
 
-    static public String requestPostBody(String url, String json, Map<String, String> heads) {
+    static public Response requestPostBody(String url, String json, Map<String, String> heads) {
 
 //        OkHttpClient okHttpClient = new OkHttpClient();
 
@@ -101,7 +101,7 @@ public class HttpUtils {
             Response response = okHttpClient.newCall(req).execute();
 
             if (response.isSuccessful()) {
-                return response.body().string();
+                return response;
                 //打印服务端返回结果
             }
         } catch (Exception e) {