|
@@ -75,6 +75,27 @@ public class TestController {
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/getDailyDataByAccountId")
|
|
|
|
+ public String getDailyDataByAccountId(Long accountId) {
|
|
|
|
+ Result<String> result = new Result<>();
|
|
|
|
+ try {
|
|
|
|
+ String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
|
+ String statDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
|
|
|
|
+ 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(), statDate, statDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ result.setSuccess(false);
|
|
|
|
+ }
|
|
|
|
+ return "success";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/getCut")
|
|
@GetMapping(value = "/getCut")
|
|
public void getCut() {
|
|
public void getCut() {
|
|
@@ -113,11 +134,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/t")
|
|
@GetMapping(value = "/t")
|
|
public String test() {
|
|
public String test() {
|
|
Result<String> result = new Result<>();
|
|
Result<String> result = new Result<>();
|
|
@@ -821,7 +837,6 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@GetMapping(value = "/getAppList")
|
|
@GetMapping(value = "/getAppList")
|
|
public void getAppList() throws JobExecutionException {
|
|
public void getAppList() throws JobExecutionException {
|
|
try {
|
|
try {
|
|
@@ -837,7 +852,7 @@ public class TestController {
|
|
|
|
|
|
tokens.forEach(token -> {
|
|
tokens.forEach(token -> {
|
|
|
|
|
|
- kuaishouInterfaceService.getAppList(token.getAccountId(),token.getAccessToken());
|
|
|
|
|
|
+ kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
|
|
//suzhaoService.submit(new Runnable() {
|
|
//suzhaoService.submit(new Runnable() {
|
|
// @Override
|
|
// @Override
|
|
// public void run() {
|
|
// public void run() {
|
|
@@ -856,22 +871,22 @@ public class TestController {
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getOperationRecord")
|
|
@GetMapping(value = "/getOperationRecord")
|
|
- public Result getOperationRecord(@Param("accountId")Long accountId, @Param("operationTarget")Integer operationTarget, @Param("startDate")String startDate, @Param("endDate")String endDate){
|
|
|
|
|
|
+ public Result getOperationRecord(@Param("accountId") Long accountId, @Param("operationTarget") Integer operationTarget, @Param("startDate") String startDate, @Param("endDate") String endDate) {
|
|
Result result = new Result();
|
|
Result result = new Result();
|
|
try {
|
|
try {
|
|
- if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
|
|
|
|
|
|
+ if (StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)) {
|
|
result.setSuccess(false);
|
|
result.setSuccess(false);
|
|
result.setMessage("时间参数不能为空");
|
|
result.setMessage("时间参数不能为空");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- if(operationTarget == null){
|
|
|
|
|
|
+ if (operationTarget == null) {
|
|
result.setSuccess(false);
|
|
result.setSuccess(false);
|
|
result.setMessage("类型不能为空");
|
|
result.setMessage("类型不能为空");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- if(accountId == null){
|
|
|
|
|
|
+ if (accountId == null) {
|
|
//1:查询当日数据
|
|
//1:查询当日数据
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("media_id", 2);
|
|
queryWrapper.eq("media_id", 2);
|
|
@@ -895,7 +910,7 @@ public class TestController {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("account_id", accountId);
|
|
queryWrapper.eq("account_id", accountId);
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(accountId));
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(accountId));
|
|
@@ -922,10 +937,10 @@ public class TestController {
|
|
public IBytedanceInterfaceService bytedanceInterfaceService;
|
|
public IBytedanceInterfaceService bytedanceInterfaceService;
|
|
|
|
|
|
@GetMapping(value = "/searchLog")
|
|
@GetMapping(value = "/searchLog")
|
|
- public Result searchLog(@Param("accountId")Long accountId, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("operationTarget")Integer operationTarget) {
|
|
|
|
|
|
+ public Result searchLog(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("operationTarget") Integer operationTarget) {
|
|
Result result = new Result();
|
|
Result result = new Result();
|
|
|
|
|
|
- if(accountId == null){
|
|
|
|
|
|
+ if (accountId == null) {
|
|
//1:查询当日数据
|
|
//1:查询当日数据
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("media_id", 1);
|
|
queryWrapper.eq("media_id", 1);
|
|
@@ -944,12 +959,12 @@ public class TestController {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
log.info("获取操作记录开始:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
log.info("获取操作记录开始:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
- bytedanceInterfaceService.searchLog(token.getAccountId(), token, operationTarget,startDate, endDate);
|
|
|
|
|
|
+ bytedanceInterfaceService.searchLog(token.getAccountId(), token, operationTarget, startDate, endDate);
|
|
log.info("获取快手操作记录结束:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
log.info("获取快手操作记录结束:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("account_id", accountId);
|
|
queryWrapper.eq("account_id", accountId);
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(accountId));
|
|
CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(accountId));
|
|
@@ -960,7 +975,7 @@ public class TestController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
log.info("获取快手操作记录开始:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
log.info("获取快手操作记录开始:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
- bytedanceInterfaceService.searchLog(accountId, token, operationTarget,startDate, endDate);
|
|
|
|
|
|
+ bytedanceInterfaceService.searchLog(accountId, token, operationTarget, startDate, endDate);
|
|
log.info("获取快手操作记录结束:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
log.info("获取快手操作记录结束:accountId:{},startDate:{},endDate:{}", token.getAccountId(), startDate, endDate);
|
|
}
|
|
}
|
|
|
|
|