|
@@ -69,12 +69,47 @@ public class TestController {
|
|
|
private IBytedanceReportService bytedanceReportService;
|
|
|
@Autowired
|
|
|
private IKuaishouInterfaceService2 kuaishouInterfaceService2;
|
|
|
+ @Autowired
|
|
|
+ private IUserAllocationService userAllocationService;
|
|
|
|
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(15);
|
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/getDailyDataByProjectId")
|
|
|
+ public String getDailyDataByProjectId(Long projectId, String startDate, String endDate) {
|
|
|
+ Result<String> result = new Result<>();
|
|
|
+ try {
|
|
|
+
|
|
|
+ QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
|
+ userAllocationQueryWrapper.eq("project_id", projectId);
|
|
|
+ userAllocationQueryWrapper.eq("account_status", 0);
|
|
|
+ List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
|
+ if (!Check.isNull(list)) {
|
|
|
+ for (UserAllocation allocation : list) {
|
|
|
+ Long accountId = allocation.getAccountId();
|
|
|
+ QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
+ tokenQueryWrapper.eq("media_id", 2);
|
|
|
+ tokenQueryWrapper.eq("account_id", accountId);
|
|
|
+ CtopOauthToken ctopOauthTokens = oauthTokenMapper.selectOne(tokenQueryWrapper);
|
|
|
+ if (!Check.isNull(ctopOauthTokens)) {
|
|
|
+ historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.setSuccess(false);
|
|
|
+ }
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@GetMapping(value = "/getDailyDataByAccountId")
|
|
|
public String getDailyDataByAccountId(Long accountId) {
|
|
|
Result<String> result = new Result<>();
|
|
@@ -617,9 +652,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
- private IUserAllocationService userAllocationService;
|
|
|
-
|
|
|
@GetMapping(value = "/getPlanAndGroupByAccount")
|
|
|
public void getPlanAndGroupByAccount(Long accountId) {
|
|
|
QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|