|
@@ -5,9 +5,12 @@ import cn.com.ctop.common.utils.PropertiesUtils;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.modules.ctop.entity.*;
|
|
|
import org.jeecg.modules.ctop.mapper.*;
|
|
|
-import org.jeecg.modules.ctop.service.ITouTiaoAdvertiserService;
|
|
|
+import org.jeecg.modules.ctop.service.IByteDanceAdvertiserDataService;
|
|
|
+import org.jeecg.modules.ctop.service.ICTopOauthTokenService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -18,17 +21,22 @@ import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
import java.util.TreeMap;
|
|
|
|
|
|
+/**
|
|
|
+ * @author 宋英豪
|
|
|
+ */
|
|
|
@Service
|
|
|
-public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(TouTiaoAdvertiserServiceImpl.class);
|
|
|
+public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserDataService {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(ByteDanceAdvertiserDataServiceImpl.class);
|
|
|
@Autowired
|
|
|
private CTopOauthTokenMapper cTopOauthTokenMapper;
|
|
|
+
|
|
|
private CTopOauthToken getOAuthTokenByAccountId(String accountId){
|
|
|
QueryWrapper<CTopOauthToken> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("advertiser_id", accountId).orderByDesc("create_time");
|
|
|
CTopOauthToken cTopOauthToken = cTopOauthTokenMapper.selectOne(queryWrapper);
|
|
|
return cTopOauthToken;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> getAdvertiserInfo(String accountId) {
|
|
|
Map<String,Object>resultMap = new HashMap<>();
|
|
@@ -56,19 +64,19 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
resultMap.put("message","广告主信息不存在");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- CTopToutiaoAdvertiser toutiaoAdvertiser = new CTopToutiaoAdvertiser(dataObject,accountId);
|
|
|
+ ByteDanceAdvertiser advertiser = new ByteDanceAdvertiser(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- cTopToutiaoAdvertiserMapper.deleteById(toutiaoAdvertiser.getId());
|
|
|
- cTopToutiaoAdvertiserMapper.insert(toutiaoAdvertiser);
|
|
|
+ advertiserMapper.deleteById(advertiser.getId());
|
|
|
+ advertiserMapper.insert(advertiser);
|
|
|
}
|
|
|
resultMap.put("code",0);
|
|
|
resultMap.put("message","获取广告主信息成功");
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
- private void getAdvertiserPlanByPageNumber(String accountId, Integer pageNumber,String ids){
|
|
|
+ private void getAdvertiserPlanByPageNumber(String accountId, Integer pageNumber, String ids) {
|
|
|
CTopOauthToken cTopOauthToken = getOAuthTokenByAccountId(accountId);
|
|
|
//2: 根据token以及用户id获取用户信息数据
|
|
|
String url = PropertiesUtils.getValue("bytedance_config","bytedance_api_url")+PropertiesUtils.getValue("bytedance_config","bytedance_v2_ad_get");
|
|
@@ -83,7 +91,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
if(null!=ids&&!"".equals(ids.trim())){
|
|
|
String[] idsArray = ids.split(",");
|
|
|
JSONArray filterIdsArray = new JSONArray();
|
|
|
- for (int i=0;i<idsArray.length;i++){
|
|
|
+ for (int i = 0; i < idsArray.length; i++) {
|
|
|
Long id = Long.parseLong(idsArray[i]);
|
|
|
filterIdsArray.add(id);
|
|
|
}
|
|
@@ -104,19 +112,21 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
logger.info("获取广告主广告计划信息不存在==》accountId:{},message:{}",accountId,jsonObject.getString("message"));
|
|
|
return ;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- CTopToutiaoAdvertisePlan toutiaoAdvertisePlan = new CTopToutiaoAdvertisePlan(dataObject,accountId);
|
|
|
+ ByteDanceAdvertisePlan advertisePlan = new ByteDanceAdvertisePlan(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- cTopToutiaoAdvertisePlanMapper.deleteById(toutiaoAdvertisePlan.getId());
|
|
|
- cTopToutiaoAdvertisePlanMapper.insert(toutiaoAdvertisePlan);
|
|
|
+ advertisePlanMapper.deleteById(advertisePlan.getId());
|
|
|
+ advertisePlanMapper.insert(advertisePlan);
|
|
|
}
|
|
|
getAdvertiserPlanByPageNumber(accountId,pageNumber+1,ids);
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
- private CTopToutiaoAdvertisePlanMapper cTopToutiaoAdvertisePlanMapper;
|
|
|
+ private ByteDanceAdvertisePlanMapper advertisePlanMapper;
|
|
|
+
|
|
|
@Override
|
|
|
- public Map<String, Object> getAdvertiserPlan(String accountId,String ids) {
|
|
|
+ public Map<String, Object> getAdvertiserPlan(String accountId, String ids) {
|
|
|
getAdvertiserPlanByPageNumber(accountId,1,ids);
|
|
|
Map<String,Object>resultMap = new HashMap<>();
|
|
|
resultMap.put("code",0);
|
|
@@ -125,7 +135,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> getAdvertiserCampaign(String accountId,String ids) {
|
|
|
+ public Map<String, Object> getAdvertiserCampaign(String accountId, String ids) {
|
|
|
getAdvertiserCampaignByPageNumber(accountId,1,ids);
|
|
|
Map<String,Object>resultMap = new HashMap<>();
|
|
|
resultMap.put("code",0);
|
|
@@ -162,12 +172,12 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
resultMap.put("message","获取广告主预算信息完成");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- CtopToutiaoAdvertiserBudget budget = new CtopToutiaoAdvertiserBudget(dataObject,accountId);
|
|
|
+ ByteDanceAdvertiserBudget advertiserBudget = new ByteDanceAdvertiserBudget(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- ctopToutiaoAdvertiserBudgetMapper.deleteById(budget.getId());
|
|
|
- ctopToutiaoAdvertiserBudgetMapper.insert(budget);
|
|
|
+ advertiserBudgetMapper.deleteById(advertiserBudget.getId());
|
|
|
+ advertiserBudgetMapper.insert(advertiserBudget);
|
|
|
}
|
|
|
resultMap.put("code",0);
|
|
|
resultMap.put("message","获取广告预算信息完成");
|
|
@@ -175,7 +185,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> getAdvertiserCreative(String accountId,String ids) {
|
|
|
+ public Map<String, Object> getAdvertiserCreative(String accountId, String ids) {
|
|
|
Map<String,Object>resultMap = new HashMap<>();
|
|
|
getAdvertiserCreativeByPageNumber(accountId,1,ids);
|
|
|
resultMap.put("code",0);
|
|
@@ -213,12 +223,12 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
resultMap.put("message","获取广告主预算信息完成");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- ToutiaoCreativeMaterial material = new ToutiaoCreativeMaterial(dataObject,accountId);
|
|
|
+ ByteDanceCreativeMaterial material = new ByteDanceCreativeMaterial(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- toutiaoCreativeMaterialMapper.deleteById(material.getId());
|
|
|
- toutiaoCreativeMaterialMapper.insert(material);
|
|
|
+ creativeMaterialMapper.deleteById(material.getId());
|
|
|
+ creativeMaterialMapper.insert(material);
|
|
|
}
|
|
|
resultMap.put("code",0);
|
|
|
resultMap.put("message","获取广告主预算信息完成");
|
|
@@ -259,9 +269,9 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
return resultMap;
|
|
|
}
|
|
|
Long id = data.getLong("campaign_id");
|
|
|
- CTopToutiaoCampaign campaign = new CTopToutiaoCampaign(id,cTopOauthToken,campaignName,budgetMode,budget,landingType);
|
|
|
+ ByteDanceCampaign campaign = new ByteDanceCampaign(id, cTopOauthToken, campaignName, budgetMode, budget, landingType);
|
|
|
//清除清数据,插入新数据
|
|
|
- cTopToutiaoCampaignMapper.insert(campaign);
|
|
|
+ campaignMapper.insert(campaign);
|
|
|
resultMap.put("code",0);
|
|
|
resultMap.put("message","广告组创建成功");
|
|
|
return resultMap;
|
|
@@ -273,7 +283,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
JSONArray ids = new JSONArray();
|
|
|
String [] getIds = campaignIds.split(",");
|
|
|
if(null!=getIds&&getIds.length>0){
|
|
|
- for(int i=0;i<getIds.length;i++){
|
|
|
+ for (int i = 0; i < getIds.length; i++) {
|
|
|
ids.add(Long.parseLong(getIds[i]));
|
|
|
}
|
|
|
}
|
|
@@ -307,13 +317,13 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
}
|
|
|
JSONArray getCampaignIds = data.getJSONArray("campaign_ids");
|
|
|
if(null!=getCampaignIds&&getCampaignIds.size()>0){
|
|
|
- for(int i=0;i<getCampaignIds.size();i++){
|
|
|
+ for (int i = 0; i < getCampaignIds.size(); i++) {
|
|
|
Long id = getCampaignIds.getLong(i);
|
|
|
- CTopToutiaoCampaign campaign = cTopToutiaoCampaignMapper.selectById(id);
|
|
|
+ ByteDanceCampaign campaign = campaignMapper.selectById(id);
|
|
|
if(null!=campaign){
|
|
|
campaign.setOptStatus(optStatus);
|
|
|
}
|
|
|
- cTopToutiaoCampaignMapper.updateById(campaign);
|
|
|
+ campaignMapper.updateById(campaign);
|
|
|
}
|
|
|
}
|
|
|
resultMap.put("code",0);
|
|
@@ -322,10 +332,10 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> advertiserCampaignUpdate(String accountId, Long campaignId, String budgetMode, Integer budget,String campaignName) {
|
|
|
+ public Map<String, Object> advertiserCampaignUpdate(String accountId, Long campaignId, String budgetMode, Integer budget, String campaignName) {
|
|
|
Map<String,Object>resultMap = new HashMap<>();
|
|
|
CTopOauthToken cTopOauthToken = getOAuthTokenByAccountId(accountId);
|
|
|
- CTopToutiaoCampaign campaign = cTopToutiaoCampaignMapper.selectById(campaignId);
|
|
|
+ ByteDanceCampaign campaign = campaignMapper.selectById(campaignId);
|
|
|
//2: 根据token以及用户id获取用户信息数据
|
|
|
String url = PropertiesUtils.getValue("bytedance_config","bytedance_api_url")+PropertiesUtils.getValue("bytedance_config","bytedance_v2_campaign_update");
|
|
|
Map<String,String> headers = new HashMap<>();
|
|
@@ -373,7 +383,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
if(null!=budget){
|
|
|
campaign.setBudget(new BigDecimal(budget));
|
|
|
}
|
|
|
- cTopToutiaoCampaignMapper.updateById(campaign);
|
|
|
+ campaignMapper.updateById(campaign);
|
|
|
|
|
|
resultMap.put("code",0);
|
|
|
resultMap.put("message","广告组信息修改成功");
|
|
@@ -386,7 +396,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
JSONArray ids = new JSONArray();
|
|
|
String [] getIds = adIds.split(",");
|
|
|
if(null!=getIds&&getIds.length>0){
|
|
|
- for(int i=0;i<getIds.length;i++){
|
|
|
+ for (int i = 0; i < getIds.length; i++) {
|
|
|
ids.add(Long.parseLong(getIds[i]));
|
|
|
}
|
|
|
}
|
|
@@ -436,7 +446,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
String [] getadIds = adIds.split(",");
|
|
|
String [] getBids = bids.split(",");
|
|
|
if(null!=getadIds&&getadIds.length>0){
|
|
|
- for(int i=0;i<getadIds.length;i++){
|
|
|
+ for (int i = 0; i < getadIds.length; i++) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
Long ad_id = Long.parseLong(getadIds[i]);
|
|
|
Long bid = Long.parseLong(getBids[i]);
|
|
@@ -490,7 +500,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
String [] getadIds = adIds.split(",");
|
|
|
String [] getBudgets = budgets.split(",");
|
|
|
if(null!=getadIds&&getadIds.length>0){
|
|
|
- for(int i=0;i<getadIds.length;i++){
|
|
|
+ for (int i = 0; i < getadIds.length; i++) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
Long ad_id = Long.parseLong(getadIds[i]);
|
|
|
Long budget = Long.parseLong(getBudgets[i]);
|
|
@@ -541,7 +551,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
JSONArray ids = new JSONArray();
|
|
|
String [] getCreativeIds = creativeIds.split(",");
|
|
|
if(null!=getCreativeIds&&getCreativeIds.length>0){
|
|
|
- for(int i=0;i<getCreativeIds.length;i++){
|
|
|
+ for (int i = 0; i < getCreativeIds.length; i++) {
|
|
|
ids.add(Long.parseLong(getCreativeIds[i]));
|
|
|
}
|
|
|
}
|
|
@@ -583,10 +593,69 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询人群包信息
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> advertiserCustomAudienceSelect(String accountId) {
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ CTopOauthToken token = getOAuthTokenByAccountId(accountId);
|
|
|
+
|
|
|
+ String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_dmp_custom_audience_select");
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
+ headers.put("Content-Type", "application/json");
|
|
|
+ headers.put("Access-Token", token.getAccessToken());
|
|
|
+
|
|
|
+ TreeMap<String, Object> params = new TreeMap<>();
|
|
|
+ params.put("select_type", "0");
|
|
|
+ params.put("advertiser_id", token.getAccountId() + "");
|
|
|
+ params.put("limit", "100");
|
|
|
+ params.put("offset", "0");
|
|
|
+ String result = HttpUtils.httpGetRequest(url, headers, params);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ Integer code = jsonObject.getInteger("code");
|
|
|
+
|
|
|
+ if (null == code || !code.equals(0)) {
|
|
|
+ logger.info("获取人群包信息接口异常==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
|
|
|
+ resultMap.put("success", false);
|
|
|
+ resultMap.put("message", "获取人群包信息接口异常");
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ JSONArray data = jsonObject.getJSONObject("data").getJSONArray("custom_audience_list");
|
|
|
+ if (null == data || data.size() <= 0) {
|
|
|
+ logger.info("人群包信息不存在==》accountId:{},message:{}", token.getAdvertiserId(), jsonObject.getString("message"));
|
|
|
+ resultMap.put("success", false);
|
|
|
+ resultMap.put("message", "人群包信息不存在");
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ System.out.println(data.toJSONString());
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ JSONObject dataObject = data.getJSONObject(i);
|
|
|
+ ByteDanceCustomAudience audience = new ByteDanceCustomAudience(token, dataObject);
|
|
|
+ audienceMapper.deleteById(audience.getId());
|
|
|
+ audienceMapper.insert(audience);
|
|
|
+ }
|
|
|
+
|
|
|
+ resultMap.put("success", true);
|
|
|
+ resultMap.put("message", "人群包信息获取成功");
|
|
|
+ resultMap.put("code", 0);
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
@Autowired
|
|
|
- private ToutiaoCreativeMaterialMapper toutiaoCreativeMaterialMapper;
|
|
|
+ private ByteDanceCustomAudienceMapper audienceMapper;
|
|
|
|
|
|
- private void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber,String ids){
|
|
|
+ @Autowired
|
|
|
+ private ICTopOauthTokenService tokenService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ByteDanceCreativeMaterialMapper creativeMaterialMapper;
|
|
|
+
|
|
|
+ private void getAdvertiserCreativeByPageNumber(String accountId, Integer pageNumber, String ids) {
|
|
|
CTopOauthToken cTopOauthToken = getOAuthTokenByAccountId(accountId);
|
|
|
//2: 根据token以及用户id获取用户信息数据
|
|
|
String url = PropertiesUtils.getValue("bytedance_config","bytedance_api_url")+PropertiesUtils.getValue("bytedance_config","bytedance_v2_creative_get");
|
|
@@ -599,7 +668,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
if(null!=ids&&!"".equals(ids.trim())){
|
|
|
String[] idsArray = ids.split(",");
|
|
|
JSONArray filterIdsArray = new JSONArray();
|
|
|
- for (int i=0;i<idsArray.length;i++){
|
|
|
+ for (int i = 0; i < idsArray.length; i++) {
|
|
|
Long id = Long.parseLong(idsArray[i]);
|
|
|
filterIdsArray.add(id);
|
|
|
}
|
|
@@ -621,22 +690,22 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
logger.info("广告主广告创意信息不存在==》accountId:{},message:{}",accountId,jsonObject.getString("message"));
|
|
|
return ;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- ToutiaoCreative creative = new ToutiaoCreative(dataObject,accountId);
|
|
|
+ ByteDanceCreative creative = new ByteDanceCreative(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- toutiaoCreativeMapper.deleteById(creative.getId());
|
|
|
- toutiaoCreativeMapper.insert(creative);
|
|
|
+ creativeMapper.deleteById(creative.getId());
|
|
|
+ creativeMapper.insert(creative);
|
|
|
}
|
|
|
getAdvertiserCreativeByPageNumber(accountId,pageNumber+1,ids);
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- private ToutiaoCreativeMapper toutiaoCreativeMapper;
|
|
|
+ private ByteDanceCreativeMapper creativeMapper;
|
|
|
@Autowired
|
|
|
- private CtopToutiaoAdvertiserBudgetMapper ctopToutiaoAdvertiserBudgetMapper;
|
|
|
+ private ByteDanceAdvertiserBudgetMapper advertiserBudgetMapper;
|
|
|
|
|
|
- private void getAdvertiserCampaignByPageNumber(String accountId, Integer pageNumber,String ids){
|
|
|
+ private void getAdvertiserCampaignByPageNumber(String accountId, Integer pageNumber, String ids) {
|
|
|
CTopOauthToken cTopOauthToken = getOAuthTokenByAccountId(accountId);
|
|
|
//2: 根据token以及用户id获取用户信息数据
|
|
|
String url = PropertiesUtils.getValue("bytedance_config","bytedance_api_url")+PropertiesUtils.getValue("bytedance_config","bytedance_v2_campaign_get");
|
|
@@ -649,7 +718,7 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
if(null!=ids&&!"".equals(ids.trim())){
|
|
|
String[] idsArray = ids.split(",");
|
|
|
JSONArray filterIdsArray = new JSONArray();
|
|
|
- for (int i=0;i<idsArray.length;i++){
|
|
|
+ for (int i = 0; i < idsArray.length; i++) {
|
|
|
Long id = Long.parseLong(idsArray[i]);
|
|
|
filterIdsArray.add(id);
|
|
|
}
|
|
@@ -671,18 +740,19 @@ public class TouTiaoAdvertiserServiceImpl implements ITouTiaoAdvertiserService {
|
|
|
logger.info("获取广告主广告组信息不存在==》accountId:{},message:{}",accountId,jsonObject.getString("message"));
|
|
|
return ;
|
|
|
}
|
|
|
- for (int i=0;i<data.size();i++){
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
JSONObject dataObject = data.getJSONObject(i);
|
|
|
- CTopToutiaoCampaign toutiaoCampaign = new CTopToutiaoCampaign(dataObject,accountId);
|
|
|
+ ByteDanceCampaign campaign = new ByteDanceCampaign(dataObject, accountId);
|
|
|
//清除清数据,插入新数据
|
|
|
- cTopToutiaoCampaignMapper.deleteById(toutiaoCampaign.getId());
|
|
|
- cTopToutiaoCampaignMapper.insert(toutiaoCampaign);
|
|
|
+ campaignMapper.deleteById(campaign.getId());
|
|
|
+ campaignMapper.insert(campaign);
|
|
|
}
|
|
|
getAdvertiserCampaignByPageNumber(accountId,pageNumber+1,ids);
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
- private CTopToutiaoCampaignMapper cTopToutiaoCampaignMapper;
|
|
|
+ private ByteDanceCampaignMapper campaignMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private CTopToutiaoAdvertiserMapper cTopToutiaoAdvertiserMapper;
|
|
|
+ private ByteDanceAdvertiserMapper advertiserMapper;
|
|
|
}
|