yumeng 4 vuotta sitten
vanhempi
commit
dd830025b5

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

@@ -127,7 +127,7 @@ public class Project {
 
     @TableField(exist = false)
     private Integer needExamine;
-    private Integer bidType;
+    private String bidType;
     private String ocpxActionType;
 
    /* @TableField(exist = false)

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

@@ -1238,7 +1238,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private void addGroup(Long advertiserId, JSONArray details) {
         JSONObject json = warningOperationService.getBidTypeAndMaxBid(advertiserId);
         Long maxBid = json.getLong("maxBid");// 最高出价
-        Integer bidType = json.getInteger("bidType"); // 出价方式
+        String bidTypeStr = json.getString("bidType"); // 出价方式
+        JSONArray bidTypeArr = JSONArray.parseArray(bidTypeStr);
         String ocpxActionTypeStr = json.getString("ocpxActionType"); // 优化目标
         JSONArray bidArr = JSONArray.parseArray(ocpxActionTypeStr);
         if (!Check.isNull(details)) {
@@ -1255,18 +1256,25 @@ 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) { // 广告组状态为非暂停
-                            Boolean trueOrFalse = false;
+                            Boolean ocpxTrueOrFalse = false;
                             for (int j = 0; j < bidArr.size(); j++) {
                                 Integer ocpxActionType = (Integer) bidArr.get(j);
                                 if (ocpxActionType.equals(ocpx_action_type)) {
-                                    trueOrFalse = true;
+                                    ocpxTrueOrFalse = true;
+                                    break;
+                                }
+                            }
+                            Boolean bidTypeTrueOrFalse = false;
+                            for (int j = 0; j < bidTypeArr.size(); j++) {
+                                Integer bidType = (Integer) bidTypeArr.get(j);
+                                if (bidType.equals(bid_type)) {
+                                    bidTypeTrueOrFalse = true;
                                     break;
                                 }
                             }
-                            if ((!bidType.equals(bid_type)) || !trueOrFalse) { // 出价方式设置非法
+                            if (!bidTypeTrueOrFalse || !ocpxTrueOrFalse) { // 出价方式设置非法
                                 if (day_budget > 500 * 1000 || day_budget == 0) { // 预算大于500 或者不限制预算 需要发送通知 并且进行暂停操作
                                     executorBidTypeService.submit(new Runnable() {
                                         @Override

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

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
-import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.WarningOperationLog;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
@@ -63,7 +62,7 @@ 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();
         }
@@ -96,8 +95,7 @@ public class WarningOperationServiceImpl implements IWarningOperationService {
         String userId = userAllocationMapper.queryUserIdByAccountId(advertiserId);
         try {
             String text = messageTemplate.getKuaiShouBidMessage(projectName, advertiserId, unitId, unit_name);
-
-       //     sendMessageService.sendMessage(userId, text);
+            sendMessageService.sendMessage(userId, text);
         } catch (Exception e) {
             e.printStackTrace();
         }