Browse Source

批量创建--出价逻辑修改

zhaoxian 4 years ago
parent
commit
82c2940413

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

@@ -543,15 +543,20 @@ public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<Kuaisho
         groupPreview.setUnitNameFormat(groupJson.getString("unitName"));
         groupPreview.setPutStatus(Check.isNull(campaignJson.getInteger("unitStatus")) || campaignJson.getInteger("unitStatus") == 2 ? 2 : null);
         groupPreview.setBidType(groupJson.getInteger("bidType"));
+        int bid = -1;
         if (!Check.isNull(groupJson.getInteger("bidMin")) && !Check.isNull(groupJson.getInteger("bidMax"))) {
-            int bid = getRandom(groupJson.getInteger("bidMax"), groupJson.getInteger("bidMin"));
+            bid = getRandom(groupJson.getInteger("bidMax"), groupJson.getInteger("bidMin"));
             if (bid > 0) {
                 groupJson.put("bid", bid);
             }
         }
 
         if (groupJson.getInteger("bidType") == 10) {
-            groupPreview.setCpaBid(groupJson.getInteger("cpaBid"));
+            if (bid > 0) {
+                groupPreview.setCpaBid(bid);
+            } else {
+                groupPreview.setCpaBid(groupJson.getInteger("cpaBid"));
+            }
         } else {
             groupPreview.setBid(groupJson.getInteger("bid"));
         }