|
@@ -1,4 +1,4 @@
|
|
|
-/*
|
|
|
+
|
|
|
package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.*;
|
|
@@ -37,6 +37,8 @@ import cn.com.ctop.toutiao.modules.report.service.*;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.xxl.job.core.context.XxlJobHelper;
|
|
|
+import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
@@ -58,11 +60,9 @@ import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
-
|
|
|
-*/
|
|
|
/**
|
|
|
* @author jeecg-boot
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/test")
|
|
@@ -993,22 +993,7 @@ public class TestController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @GetMapping("checkFile")
|
|
|
- public Map<String, Object> checkFile() {
|
|
|
- String nowDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
- String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
- // 查询快手token
|
|
|
- List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
- log.info("定时获取快手数据异常:未获取到可用的token");
|
|
|
- }
|
|
|
- for (CtopOauthToken token : tokens) {
|
|
|
- dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate);
|
|
|
- }
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
- ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
- return result;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
@GetMapping("loadBytedanceHistoryData")
|
|
@@ -1128,7 +1113,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping("/bytedance/effectVideo/get")
|
|
|
public Map<String, Object> effectVideoGet(String date) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
@@ -1313,7 +1297,7 @@ public class TestController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
+
|
|
|
/**
|
|
|
* 勿动勿删,煜一人群报表数据拉取接口。
|
|
|
*
|
|
@@ -1357,22 +1341,23 @@ public class TestController {
|
|
|
static CountDownLatch countDownLatch = null;
|
|
|
@Resource
|
|
|
AiKuaishouUnitLevelOperationRecordMapper kuaishouUnitLevelOperationRecordMapper;
|
|
|
+
|
|
|
@GetMapping(value = "/getAudienceDataNew")
|
|
|
- public void getAudienceData(@RequestParam(required = false,defaultValue = "2019-01-01") String date) throws Exception {
|
|
|
+ public void getAudienceData(@RequestParam(required = false, defaultValue = "2019-01-01") String date) throws Exception {
|
|
|
int page = 1;
|
|
|
int pageSize = 2000;
|
|
|
- if(date.equals("2019-01-01")){
|
|
|
+ if (date.equals("2019-01-01")) {
|
|
|
date = DateUtils.formatDate(DateUtils.addDay(DateUtils.getNowDate(), -1), "yyyy-MM-dd");
|
|
|
}
|
|
|
List<CtopOauthToken> tokens = tokenService.getByProjectId(458L); //淘特项目
|
|
|
for (CtopOauthToken token : tokens) {
|
|
|
Date startDate = DateUtils.addDay(DateUtils.getNowDate(), -1);
|
|
|
- if(startDate.after(token.getAccessTokenExpiresIn())){ //过期跳过
|
|
|
+ if (startDate.after(token.getAccessTokenExpiresIn())) { //过期跳过
|
|
|
continue;
|
|
|
}
|
|
|
Date enDate = DateUtils.addDay(startDate, -30);
|
|
|
List<AiKuaishouUnitLevelOperationRecord> planIdsAndUnitIds = kuaishouUnitLevelOperationRecordMapper.selectAllByAccountIdAndDate(token.getAccountId(), enDate, startDate);
|
|
|
- if(Check.isNull(planIdsAndUnitIds)){
|
|
|
+ if (Check.isNull(planIdsAndUnitIds)) {
|
|
|
continue;
|
|
|
}
|
|
|
countDownLatch = new CountDownLatch(planIdsAndUnitIds.size());
|
|
@@ -1493,5 +1478,13 @@ public class TestController {
|
|
|
log.info("数据更新完成");
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
*/
|
|
|
+ @GetMapping("checkUnitBid")
|
|
|
+ public Result checkUnitBid(Long accountId) throws Exception {
|
|
|
+ Date nowDate = new Date();
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
|
|
|
+ kuaishouInterfaceService.getGroupList(token, nowDate, nowDate);
|
|
|
+ return Result.ok("success");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|