|
@@ -12,9 +12,9 @@ import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
|
|
import org.jeecg.modules.bytedance.common.utils.HttpUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.HttpUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.PropertiesUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.PropertiesUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.StringUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.StringUtils;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -24,7 +24,7 @@ import java.util.Map;
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdvertisePlanMapper, ByteDanceAdvertisePlan> implements IByteDanceAdvertisePlanService {
|
|
public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdvertisePlanMapper, ByteDanceAdvertisePlan> implements IByteDanceAdvertisePlanService {
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
private ByteDanceAdvertisePlanMapper byteDanceAdvertisePlanMapper;
|
|
private ByteDanceAdvertisePlanMapper byteDanceAdvertisePlanMapper;
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate) {
|
|
public Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate) {
|
|
@@ -42,7 +42,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
|
//查询记录,获取修改时间等字段
|
|
//查询记录,获取修改时间等字段
|
|
- List adId=new ArrayList();
|
|
|
|
|
|
+ List<Long> adId=new ArrayList<>();
|
|
adId.add(byteDanceAdvertisePlan.getId());
|
|
adId.add(byteDanceAdvertisePlan.getId());
|
|
Map<String, Object> map = queryAdByAdId(token, Long.valueOf(byteDanceAdvertisePlan.getAccountId()), adId);
|
|
Map<String, Object> map = queryAdByAdId(token, Long.valueOf(byteDanceAdvertisePlan.getAccountId()), adId);
|
|
if(!map.get("code").equals(0)){
|
|
if(!map.get("code").equals(0)){
|
|
@@ -166,7 +166,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
|
|
param.put("page_size", 100);
|
|
param.put("page_size", 100);
|
|
param.put("filtering", filtering);
|
|
param.put("filtering", filtering);
|
|
JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
|
|
JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
|
|
- int code = resultObject.getInteger("code");
|
|
|
|
|
|
+ Integer code = resultObject.getInteger("code");
|
|
if (code != 0) {
|
|
if (code != 0) {
|
|
log.error("获取广告计划信息接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
|
|
log.error("获取广告计划信息接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
|
|
return;
|
|
return;
|
|
@@ -210,7 +210,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
|
|
return this.list(queryWrapper);
|
|
return this.list(queryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, Object> queryAdByAdId(CtopOauthToken token, Long accountId, List adId){
|
|
|
|
|
|
+ private Map<String, Object> queryAdByAdId(CtopOauthToken token, Long accountId, List<Long> adId){
|
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
Map<String, String> headers = new HashMap<>();
|
|
headers.put("Content-Type", "application/json");
|
|
headers.put("Content-Type", "application/json");
|