Jelajahi Sumber

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

zhaoxian 4 tahun lalu
induk
melakukan
677da20341

+ 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 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -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);

+ 6 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/WarningOperationServiceImpl.java

@@ -63,12 +63,12 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         try {
             String text = messageTemplate.getKuaiShouBidTypeMessage(projectName, advertiserId, unitId, unit_name);
 
-            sendMessageService.sendMessage(userId, text);
+       //     sendMessageService.sendMessage(userId, text);
         } catch (Exception e) {
             e.printStackTrace();
         }
-        CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserId);
-        updateService.updateUnitStatus(token.getAccessToken(), advertiserId, unitId, 2, "admin");
+       /* CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserId);
+        updateService.updateUnitStatus(token.getAccessToken(), advertiserId, unitId, 2, "admin");*/
         WarningOperationLog warningOperationLog = new WarningOperationLog();
         warningOperationLog.setAccountId(advertiserId);
         warningOperationLog.setSubject("出价方式预警");
@@ -97,13 +97,13 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         try {
             String text = messageTemplate.getKuaiShouBidMessage(projectName, advertiserId, unitId, unit_name);
 
-            sendMessageService.sendMessage(userId, text);
+       //     sendMessageService.sendMessage(userId, text);
         } catch (Exception e) {
             e.printStackTrace();
         }
 
-        CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserId);
-        updateService.updateUnitStatus(token.getAccessToken(), advertiserId, unitId, 2, "admin");
+        /*CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserId);
+        updateService.updateUnitStatus(token.getAccessToken(), advertiserId, unitId, 2, "admin");*/
 
         WarningOperationLog warningOperationLog = new WarningOperationLog();
         warningOperationLog.setAccountId(advertiserId);