浏览代码

頭條-账号余额 定時

zhaoxian 1 年之前
父节点
当前提交
14e6369d9f

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/RuleDataAccountCleanJob.java

@@ -48,7 +48,7 @@ public class RuleDataAccountCleanJob {
      */
     @XxlJob("getBytedanceAccountBalanceJob")
     public void getBytedanceAccountBalance() throws Exception {
-        List<CtopOauthToken> tokens = oauthTokenService.queryTtValidRuleAccountsToken();
+        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
         tokens.forEach(token -> executorService.submit(()->{
             ruleByteDanceAccountService.getBytedanceAccountBalance(token);
         }));

+ 7 - 6
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/RuleByteDanceAccountServiceImpl.java

@@ -24,12 +24,12 @@ public class RuleByteDanceAccountServiceImpl extends ServiceImpl<RuleDataAccount
 
     @Override
     public void cleanRuleDataAccount(Long accountId) {
-        CtopOauthToken oauthToken=oauthTokenService.getTokenByAccountId(accountId);
+        CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
         //查询账户实时数据
-        JSONObject dataAccount=byteDanceGetAccountFundService.getAccountReportBy(oauthToken,accountId);
-        if(!dataAccount.isEmpty()){
-            JSONObject fundData=byteDanceGetAccountFundService.getAccountFundBy(oauthToken,accountId);
-            RuleDataAccount ruleDataAccount=new RuleDataAccount();
+        JSONObject dataAccount = byteDanceGetAccountFundService.getAccountReportBy(oauthToken, accountId);
+        if (!dataAccount.isEmpty()) {
+            JSONObject fundData = byteDanceGetAccountFundService.getAccountFundBy(oauthToken, accountId);
+            RuleDataAccount ruleDataAccount = new RuleDataAccount();
             ruleDataAccount.setId(accountId);
             ruleDataAccount.setAccountId(accountId);
             ruleDataAccount.setAccountName(fundData.getString("name"));
@@ -47,7 +47,8 @@ public class RuleByteDanceAccountServiceImpl extends ServiceImpl<RuleDataAccount
 
     @Override
     public void getBytedanceAccountBalance(CtopOauthToken token) {
-        JSONObject fundData=byteDanceGetAccountFundService.getAccountFundBy(token,token.getAccountId());
+        JSONObject fundData = byteDanceGetAccountFundService.getAccountFundBy(token, token.getAccountId());
+        log.error(fundData + "");
         ruleDataAccountService.replaceBytedanceAccountBalance(fundData);
     }
 }