yumeng 4 years ago
parent
commit
1d32f79a98

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -128,7 +128,7 @@ public class Project {
     @TableField(exist = false)
     private Integer needExamine;
     private Integer bidType;
-    private Integer ocpxActionType;
+    private String ocpxActionType;
 
    /* @TableField(exist = false)
     private String responsibleName; // 运营负责人

+ 20 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1236,10 +1236,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     static ExecutorService executorMaxBidService = Executors.newFixedThreadPool(5);
 
     private void addGroup(Long advertiserId, JSONArray details) {
-        JSONObject json = warningOperationService.getBidTypeAndMaxBid(advertiserId);
+    /*    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 (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(i);
+                                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,9 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 });
                             }
                         }
-                    }*/
+                    }
+*/
+
                     KuaiShouGroup group = new KuaiShouGroup();
                     group.setId("" + advertiserId + unitId);
                     group.setAccountId(advertiserId);
@@ -1287,12 +1299,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"));