Browse Source

Merge branch 'dev' of http://192.168.0.115:3000/4dzfb-2.0/shop into dev

jinx 3 years ago
parent
commit
9d530dabde

+ 3 - 3
platform-shop/src/main/java/com/platform/service/impl/BrandServiceImpl.java

@@ -280,9 +280,9 @@ public class BrandServiceImpl implements BrandService {
 
         String openApiurl = apiHostQueryUrl + "/api/shop/formatBrand?" + "appId=" + appId + "&sign=" + sign + "&token=" + token + "&timeStamp=" + timeStamp;
         log.info("请求openApi的url={}", openApiurl);
-        ResponseEntity<String> apiResultStr = restTemplate.postForEntity(openApiurl , sortMapStr,String.class);
-        log.info("api平台返回结果:{}" , apiResultStr.getBody());
-        return R.ok(apiResultStr.getBody());
+        String apiResultStr = HttpClientUtil.doPostJson(openApiurl , sortMapStr);
+        log.info("api平台返回结果:{}" , apiResultStr);
+        return R.ok(apiResultStr);
 
     }
 

+ 4 - 3
platform-shop/src/main/java/com/platform/task/SceneStatisticTask.java

@@ -9,6 +9,7 @@ import com.platform.entity.TmTaskLog;
 import com.platform.service.custom.*;
 import com.platform.service.impl.BrandServiceImpl;
 import com.platform.service.impl.OrderServiceImpl;
+import com.platform.utils.HttpClientUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -323,9 +324,9 @@ public class SceneStatisticTask {
                 //从商圈API获取店铺下面所有商品的数量
                 String shopApiUrl = openApiUrl + "4dage/shop/getGoodsNum?sceneNum=" + brandEntity.getSceneNum();
 
-                ResponseEntity<String> resultString = restTemplate.getForEntity(shopApiUrl,String.class);
-                log.info("商圈api返回详情:{}", resultString.getBody());
-                JSONObject resObj = JSON.parseObject(resultString.getBody(), JSONObject.class);
+                String resultString = HttpClientUtil.doGet(shopApiUrl);
+                log.info("商圈api返回详情:{}", JSON.toJSONString(resultString));
+                JSONObject resObj = JSON.parseObject(resultString, JSONObject.class);
                 if (null != resObj) {
                     int code = resObj.getInteger("code");
                     if (code == 0) {