|
@@ -1239,7 +1239,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
JSONObject json = warningOperationService.getBidTypeAndMaxBid(advertiserId);
|
|
|
Long maxBid = json.getLong("maxBid");// 最高出价
|
|
|
Integer bidType = json.getInteger("bidType"); // 出价方式
|
|
|
- Integer ocpxActionType = json.getInteger("ocpxActionType"); // 优化目标
|
|
|
+ String ocpxActionTypeStr = json.getString("ocpxActionType"); // 优化目标
|
|
|
+ JSONArray bidArr = JSONArray.parseArray(ocpxActionTypeStr);
|
|
|
if (!Check.isNull(details)) {
|
|
|
List<KuaiShouGroup> groups = new ArrayList<>();
|
|
|
for (int i = 0; i < details.size(); i++) {
|
|
@@ -1254,9 +1255,18 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
String unit_name = detail.getString("unit_name");
|
|
|
Integer status = detail.getInteger("status");
|
|
|
Integer put_status = detail.getInteger("put_status");
|
|
|
- /* if (put_status == 1) { // 组状态为 投放中的
|
|
|
+
|
|
|
+ if (put_status == 1) { // 组状态为 投放中的
|
|
|
if (status != 15) { // 广告组状态为非暂停
|
|
|
- if ((!bidType.equals(bid_type)) || (!ocpxActionType.equals(ocpx_action_type))) { // 出价方式设置非法
|
|
|
+ Boolean trueOrFalse = false;
|
|
|
+ for (int j = 0; j < bidArr.size(); j++) {
|
|
|
+ Integer ocpxActionType = (Integer) bidArr.get(j);
|
|
|
+ if (ocpxActionType.equals(ocpx_action_type)) {
|
|
|
+ trueOrFalse = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((!bidType.equals(bid_type)) || !trueOrFalse) { // 出价方式设置非法
|
|
|
if (day_budget > 500 * 1000 || day_budget == 0) { // 预算大于500 或者不限制预算 需要发送通知 并且进行暂停操作
|
|
|
executorBidTypeService.submit(new Runnable() {
|
|
|
@Override
|
|
@@ -1275,7 +1285,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
+
|
|
|
KuaiShouGroup group = new KuaiShouGroup();
|
|
|
group.setId("" + advertiserId + unitId);
|
|
|
group.setAccountId(advertiserId);
|
|
@@ -1287,12 +1298,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
group.setCreateChannel(detail.getInteger("create_channel"));
|
|
|
group.setReviewDetail(detail.getString("review_detail"));
|
|
|
group.setBidType(bid_type);
|
|
|
- group.setBid(detail.getLong("bid"));
|
|
|
- group.setCpaBid(detail.getLong("cpa_bid"));
|
|
|
- group.setOcpxActionType(detail.getInteger("ocpx_action_type"));
|
|
|
+ group.setBid(bid);
|
|
|
+ group.setCpaBid(cpa_bid);
|
|
|
+ group.setOcpxActionType(ocpx_action_type);
|
|
|
group.setDeepConversionType(detail.getInteger("deep_conversion_type"));
|
|
|
group.setDeepConversionBid(detail.getLong("deep_conversion_bid"));
|
|
|
- group.setDayBudget(detail.getLong("day_budget"));
|
|
|
+ group.setDayBudget(day_budget);
|
|
|
group.setSpeed(detail.getInteger("speed"));
|
|
|
group.setBeginTime(detail.getString("begin_time"));
|
|
|
group.setEndTime(detail.getString("end_time"));
|
|
@@ -1350,7 +1361,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
param.put("start_date", DateUtils.formatDate(startDate));
|
|
|
param.put("end_date", DateUtils.formatDate(endDate));
|
|
|
}
|
|
|
- param.put("page_size", 200);
|
|
|
+ param.put("page_size", 500);
|
|
|
param.put("page", page);
|
|
|
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|