|
@@ -788,9 +788,7 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
} else {
|
|
|
unitJson.put("begin_time", group.getBeginTime());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
// 优先从系统应用商店下载
|
|
|
if (!Check.isNull(group.getUseAppMarket())) {
|
|
|
unitJson.put("use_app_market", group.getUseAppMarket());
|
|
@@ -836,8 +834,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
if (!Check.isNull(group.getSpeed())) {
|
|
|
unitJson.put("speed", group.getSpeed());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
QueryWrapper<KuaiShouGroupTarget> targetQueryWrapper = new QueryWrapper<>();
|
|
|
targetQueryWrapper.eq("account_id", group.getAccountId());
|
|
|
targetQueryWrapper.eq("unit_id", group.getUnitId());
|
|
@@ -966,8 +962,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
|
|
|
unitJson.put("target", targetJson);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// 出价
|
|
|
if (!Check.isNull(group.getBid())) {
|
|
|
unitJson.put("bid", group.getBid());
|
|
@@ -1194,7 +1188,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
creativeJson.put("site_id", creative.getSiteId());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (creativeMaterialType == 4) {
|
|
|
creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
|
|
|
creativeJson.put("short_slogan", creative.getShortSlogan());
|
|
@@ -1214,8 +1207,6 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
creativeJson.put("click_track_url", click_track_url);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
// 安卓下载中间页
|
|
|
Map<String, Object> returnCreativeMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
|
|
@@ -1279,12 +1270,10 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
if (Check.isNull(oauthToken)) {
|
|
|
throw new Exception("未获取到账户信息");
|
|
|
}
|
|
|
-
|
|
|
Long unitId = requestJson.getLong("unitId");
|
|
|
if (Check.isNull(unitId)) {
|
|
|
throw new Exception("请选择广告组");
|
|
|
}
|
|
|
-
|
|
|
JSONObject creativeJson = new JSONObject();
|
|
|
creativeJson.put("advertiser_id", accountId);
|
|
|
creativeJson.put("unit_id", unitId);
|
|
@@ -1296,18 +1285,14 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
String site_id = requestJson.getString("siteId");
|
|
|
Integer creativeCategory = requestJson.getInteger("creativeCategory");// 创意分类
|
|
|
JSONArray creativeTag = requestJson.getJSONArray("creativeTag");
|
|
|
-
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
JSONArray successArr = new JSONArray();
|
|
|
JSONArray failArr = new JSONArray();
|
|
|
JSONArray dataJsons = requestJson.getJSONArray("dataJson");
|
|
|
-
|
|
|
Integer content = requestJson.getInteger("content");
|
|
|
-
|
|
|
if (!Check.isNull(dataJsons)) {
|
|
|
for (int i = 0; i < dataJsons.size(); i++) {
|
|
|
JSONObject dataJson = dataJsons.getJSONObject(i);
|
|
|
-
|
|
|
String creativeMaterialType = dataJson.getString("creativeMaterialType");
|
|
|
String shortSlogan = dataJson.getString("shortSlogan");
|
|
|
String overlayType = dataJson.getString("overlayType");
|
|
@@ -1436,19 +1421,13 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
creativeJson.put("unit_id", unitId);
|
|
|
String click_track_url = requestJson.getString("clickTrackUrl");
|
|
|
String actionbar_click_url = requestJson.getString("actionbarClickUrl");
|
|
|
-
|
|
|
-
|
|
|
// 素材类型
|
|
|
-
|
|
|
String action_bar_text = requestJson.getString("actionBarText");
|
|
|
String site_id = requestJson.getString("siteId");
|
|
|
Integer creativeCategory = requestJson.getInteger("creativeCategory");// 创意分类
|
|
|
JSONArray creativeTag = requestJson.getJSONArray("creativeTag");
|
|
|
-
|
|
|
-
|
|
|
JSONArray dataJsons = requestJson.getJSONArray("dataJson");
|
|
|
Integer content = requestJson.getInteger("content");
|
|
|
-
|
|
|
if (!Check.isNull(dataJsons)) {
|
|
|
JSONArray creatives = new JSONArray();
|
|
|
for (int i = 0; i < dataJsons.size(); i++) {
|
|
@@ -1539,6 +1518,34 @@ public class BatchServiceImpl implements IBatchService {
|
|
|
return returnUnitMap;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public JSONObject getCategoryWhite(Long accountId, String accessToken) {
|
|
|
+ try {
|
|
|
+ String url = "https://ad.e.kuaishou.com/rest/openapi/v1/advertiser/white_list";
|
|
|
+ Map<String, String> headers = new HashMap<String, String>();
|
|
|
+ headers.put("Content-Type", "application/json");
|
|
|
+ headers.put("Access-Token", accessToken);
|
|
|
+ Map<String, Object> param = new HashMap<String, Object>();
|
|
|
+ param.put("advertiser_id", accountId);
|
|
|
+ String result = HttpUtils.httpPostRequest(url, param, headers);
|
|
|
+ JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
+ if (!Check.isNull(resultJson)) {
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
+ if (code == 0) {
|
|
|
+ JSONObject data = resultJson.getJSONObject("data");
|
|
|
+ if (!Check.isNull(data)) {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取创意信息
|