浏览代码

报表定时任务添加睡眠

zhaoxian 3 年之前
父节点
当前提交
32d9cbb4bc

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouAccountBudgetService.java

@@ -21,7 +21,7 @@ public interface IKuaishouAccountBudgetService extends IService<KuaishouAccountB
      * @param advertiserId
      * @param advertiserId
      * @param accessToken
      * @param accessToken
      */
      */
-    JSONObject getAccountBudget(CtopOauthToken oauthToken) throws InterruptedException;
+    JSONObject getAccountBudget(CtopOauthToken oauthToken) ;
 
 
     void insertAccountBudget(Long advertiserId, String accessToken);
     void insertAccountBudget(Long advertiserId, String accessToken);
 
 

+ 6 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouAccountBudgetServiceImpl.java

@@ -86,7 +86,7 @@ public class KuaishouAccountBudgetServiceImpl extends ServiceImpl<KuaishouAccoun
     }
     }
 
 
     @Override
     @Override
-    public JSONObject getAccountBudget(CtopOauthToken oauthToken) throws InterruptedException {
+    public JSONObject getAccountBudget(CtopOauthToken oauthToken)  {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_BUDGET;
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_BUDGET;
         Map<String, String> headers = new HashMap<>();
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", oauthToken.getAccessToken());
         headers.put("Access-Token", oauthToken.getAccessToken());
@@ -94,7 +94,11 @@ public class KuaishouAccountBudgetServiceImpl extends ServiceImpl<KuaishouAccoun
         JSONObject json = new JSONObject();
         JSONObject json = new JSONObject();
         json.put("advertiser_id", oauthToken.getAccountId());
         json.put("advertiser_id", oauthToken.getAccountId());
         String result = HttpUtils.kuaiShouhttpPostRequest(url, json.toJSONString(), headers);
         String result = HttpUtils.kuaiShouhttpPostRequest(url, json.toJSONString(), headers);
-        Thread.sleep(500);
+        try {
+            Thread.sleep(500);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
         JSONObject resultJson = JSONObject.parseObject(result);
         JSONObject resultJson = JSONObject.parseObject(result);
         if (!Check.isNull(resultJson)) {
         if (!Check.isNull(resultJson)) {
             Integer code = resultJson.getInteger("code");
             Integer code = resultJson.getInteger("code");