lvzhiqiang 1 gadu atpakaļ
vecāks
revīzija
6327c5ae18

+ 10 - 6
src/main/java/top/lvzhiqiang/service/impl/CoinServiceImpl.java

@@ -161,12 +161,16 @@ public class CoinServiceImpl implements CoinService {
 
         String signQueryString = paramMap.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining("&"));
 
-        JSONObject response = requestApi4Common("/api/mix/v1/order/historyProductType", signQueryString, null, JsoupUtil.HTTP_GET, paramMap);
-
-        JSONArray orderList = response.getJSONObject("data").getJSONArray("orderList");
-        if (orderList.size() > 0) {
-            coinMapper.insertHistoryOrderList(JSONArray.parseArray(orderList.toJSONString(), CoinHistoryOrder.class));
-            log.warn("syncData->insertHistoryOrderList,startTime={},endTime={},size={}", startTime, endTime, orderList.size());
+        JSONObject response = null;
+        try {
+            response = requestApi4Common("/api/mix/v1/order/historyProductType", signQueryString, null, JsoupUtil.HTTP_GET, paramMap);
+            JSONArray orderList = response.getJSONObject("data").getJSONArray("orderList");
+            if (orderList.size() > 0) {
+                coinMapper.insertHistoryOrderList(JSONArray.parseArray(orderList.toJSONString(), CoinHistoryOrder.class));
+                log.warn("syncData->insertHistoryOrderList,startTime={},endTime={},size={}", startTime, endTime, orderList.size());
+            }
+        } catch (Exception e) {
+            log.error("syncData->insertHistoryOrderList error,response={}", response, e);
         }
     }