Selaa lähdekoodia

快手-实时获取账户组信息

yangzian 3 vuotta sitten
vanhempi
commit
15e76e2b6b

+ 20 - 7
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouRealTimeController.java

@@ -187,7 +187,8 @@ public class KuaiShouRealTimeController {
             unitInfo.setUnitName(vo.getString("unit_name"));
 
             //出价
-            unitInfo.setBid(Double.valueOf(vo.getLong("bid")));
+            unitInfo.setBid(vo.getLong("bid"));
+            unitInfo.setCpaBid(vo.getLong("cpa_bid"));
             unitInfo.setBidType(vo.getInteger("bid_type"));
             //优化目标
             conver = vo.getInteger("ocpx_action_type");
@@ -198,6 +199,9 @@ public class KuaiShouRealTimeController {
             unitInfo.setUnitId(vo.getLong("unit_id"));
             unitInfo.setUnitName(vo.getString("unit_name"));
 
+            //投放状态 1:投放中;2:暂停 3:删除
+            unitInfo.setPutStatus(vo.getInteger("put_status"));
+
             //激活成本 = 花费  / 激活数
             String activationCost = "0";
 
@@ -250,33 +254,42 @@ public class KuaiShouRealTimeController {
                 //操作建议
                 //消耗
                 Double charge = unitInfo.getCharge().doubleValue();
-                //出价
-                Double bid = unitInfo.getBid();
+                //出价 单位:厘
+                long bid = new Long("1000");
+                //2:CPC
+                if (unitInfo.getBidType() == 2){
+                    bid = unitInfo.getBid();
+                //10:OCPM
+                }else if(unitInfo.getBidType() == 10){
+                    bid = unitInfo.getCpaBid();
+                }
+                Double price = new Double(bid/1000).doubleValue();
+
                 //转化数量
                 Integer converNum = unitInfo.getConverNum();
                 //转化成本
                 Double converCost = unitInfo.getConverCost();
 
                 //1. 转化成本大于出价×120%,消耗大于500元:
-                if ((converCost > bid * 1.2) && (charge > 500)) {
+                if ((converCost > price * 1.2) && (charge > 500)) {
                     unitInfo.setOperationAgree("高成本 | 有消耗");
                     unitInfo.setOperationAgreeContent("建议限制预算");
                     unitInfo.setOperationAgreeInfo("当前广告组转化成本偏高且消耗大于500,建议限制预算;");
                 }
                 //2.  转化成本大于出价×120%,转化数大于10小于等于50:
-                if (converCost > bid * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(10,50)")) {
+                if (converCost > price * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(10,50)")) {
                     unitInfo.setOperationAgree("高成本 | 有转化");
                     unitInfo.setOperationAgreeContent("建议限制预算");
                     unitInfo.setOperationAgreeInfo("当前广告组成本大于出价×120%且转化数介于10-50之间;");
                 }
                 //3. 转化成本大于出价×120%,转化数大于50
-                if (converCost > bid * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(50,∞)")) {
+                if (converCost > price * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(50,∞)")) {
                     unitInfo.setOperationAgree("高成本 | 有转化");
                     unitInfo.setOperationAgreeContent("建议降低出价;");
                     unitInfo.setOperationAgreeInfo("当前转化成本大于出价×120%,转化数大于50,建议降低出价;");
                 }
                 //4.  转化成本小于等于出价×120%,转化数大于10小于等于50
-                if (converCost <= bid * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(10,50]")) {
+                if (converCost <= price * 1.2 && LinkUtils.isInTheInterval(String.valueOf(converNum), "(10,50]")) {
                     unitInfo.setOperationAgree("成本合理 | 有转化");
                     unitInfo.setOperationAgreeContent("建议复制推广组或放开预算");
                     unitInfo.setOperationAgreeInfo("当前转化成本小于等于出价×120%,转化数大于10小于等于50,建议复制推广组或放开预算;");

+ 6 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyGroup.java

@@ -137,8 +137,13 @@ public class KuaishouReportHourlyGroup implements Serializable {
     @JsonProperty
     private Integer totalCount;
 
+
+    @JsonProperty
+    private Integer putStatus; //1:投放中;2:暂停 3:删除
+
     //出价
-    private Double bid;
+    private Long bid;
+    private Long cpaBid;
     //出价类型 1:CPM,2:CPC,6:OCPC(使用 OCPC 代表 OCPX),10:OCPM,20:eCPC
     private Integer bidType;
     //转化类型