|
@@ -124,7 +124,7 @@ public class JstApiService {
|
|
|
bizJson.put("page_size", JstConstant.PAGE_SIZE);
|
|
|
bizJson.put("start_ts", lastTs);
|
|
|
}
|
|
|
- String body = executeJst(bizJson);
|
|
|
+ String body = executeJst(bizJson, jushuitanConfig);
|
|
|
ParserConfig specialConfig = new ParserConfig();
|
|
|
specialConfig.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
|
|
|
JstApiOrderInfoVO jstApiOrderInfoVO = JSONObject.parseObject(body, JstApiOrderInfoVO.class, specialConfig);
|
|
@@ -135,6 +135,10 @@ public class JstApiService {
|
|
|
}
|
|
|
totalPage = data.getPageCount();
|
|
|
handleDbData(data.getOrders());
|
|
|
+ if (ObjectUtil.isNull(lastTs)) {
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
lastTs = data.getOrders().get(data.getOrders().size() - 1).getTs();
|
|
|
pageIndex++;
|
|
@@ -198,7 +202,7 @@ public class JstApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private String executeJst(JSONObject bizJson){
|
|
|
+ private String executeJst(JSONObject bizJson, JushuitanConfig jushuitanConfig){
|
|
|
|
|
|
ApiClient client = new DefaultApiClient();
|
|
|
|
|
@@ -211,7 +215,7 @@ public class JstApiService {
|
|
|
ApiRequest request = new ApiRequest.Builder(url, JstConstant.APP_KEY, JstConstant.APP_SECRET)
|
|
|
.biz(biz).build();
|
|
|
|
|
|
- ApiResponse response = client.execute(request, JstConstant.ACCESS_TOKEN);
|
|
|
+ ApiResponse response = client.execute(request, jushuitanConfig.getAccessToken());
|
|
|
if (!response.isSuccess()) {
|
|
|
log.error("获取订单失败,response:{}", JSON.toJSONString(response));
|
|
|
throw new ApiException(ApiCodeEnum.SYS_ERROR);
|