Bladeren bron

Double -> BigDecimal

wcc 3 jaren geleden
bovenliggende
commit
dc6896a88f
20 gewijzigde bestanden met toevoegingen van 1351 en 1255 verwijderingen
  1. 2 2
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/AdDayStreamJob.java
  2. 7 6
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/AdHourStreamJob.java
  3. 2 2
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/PlanDayStreamJob.java
  4. 2 2
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/PlanHourStreamJob.java
  5. 3 2
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/config/MysqlDataSourceFactory.java
  6. 31 30
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfDayODS.java
  7. 29 28
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfHourODS.java
  8. 29 28
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfMinuteODS.java
  9. 173 171
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfDayDWD.java
  10. 206 203
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfHourDWD.java
  11. 233 206
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfMinuteDWD.java
  12. 124 121
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfDayDWD.java
  13. 204 200
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfHourDWD.java
  14. 250 221
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfMinuteDWD.java
  15. 4 2
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/properties/ApplicationProperties.java
  16. 10 10
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostHourDayProcess.java
  17. 15 15
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostHourProcess.java
  18. 5 5
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostMinuteProcess.java
  19. 6 1
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/sink/TunnelBatchStreamSink.java
  20. 16 0
      flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/util/NumberUtil.java

+ 2 - 2
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/AdDayStreamJob.java

@@ -63,8 +63,8 @@ public class AdDayStreamJob {
         // 大概是允许 checkpoint失败几次,默认 0
         env.getCheckpointConfig().setTolerableCheckpointFailureNumber(0);
         env.setStateBackend(new EmbeddedRocksDBStateBackend(true));
-        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT))) {
-            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT));
+        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT))) {
+            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT));
         }
 
         KafkaSource<String> adStreamOfDaySource = KafkaComponent.buildKafkaSource(props, KafkaComponent.KafkaTopic.adDayTopic, KafkaComponent.KafkaTopic.KafkaGroupId.adDayConsumerGroup);

+ 7 - 6
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/AdHourStreamJob.java

@@ -50,6 +50,7 @@ public class AdHourStreamJob {
             configuration.setString(key.trim(), StringUtils.isBlank(value) ? "" : value.trim());
         });
         env.getConfig().setGlobalJobParameters(configuration);
+        int parallelismKafka = Integer.parseInt(props.getProperty(ApplicationProperties.FLINK_PARALLELISM_KAFKA));
 
         // checkpoint配置
         env.enableCheckpointing(2 * 60 * 1000L, CheckpointingMode.EXACTLY_ONCE);
@@ -67,12 +68,12 @@ public class AdHourStreamJob {
         // 大概是允许 checkpoint失败几次,默认 0
         env.getCheckpointConfig().setTolerableCheckpointFailureNumber(0);
         env.setStateBackend(new EmbeddedRocksDBStateBackend(true));
-        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT))) {
-            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT));
+        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT))) {
+            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT));
         }
 
         KafkaSource<String> adStreamOfMinuteSource = KafkaComponent.buildKafkaSource(props, KafkaComponent.KafkaTopic.adHourTopic, KafkaComponent.KafkaTopic.KafkaGroupId.adHourConsumerGroup);
-        DataStreamSource<String> adStreamOfMinuteIn = env.fromSource(adStreamOfMinuteSource, WatermarkStrategy.noWatermarks(), "adHourSource_kafka").setParallelism(12);
+        DataStreamSource<String> adStreamOfMinuteIn = env.fromSource(adStreamOfMinuteSource, WatermarkStrategy.noWatermarks(), "adHourSource_kafka").setParallelism(parallelismKafka);
 
         // 广告分钟数据(前 5分钟的广告消耗数据)
         final OutputTag<AdDataOfMinuteODS> adMinuteStreamTag = new OutputTag<AdDataOfMinuteODS>("adMinuteStream") {
@@ -83,8 +84,8 @@ public class AdHourStreamJob {
 
         // 对流进行映射,拆分(实时的分钟流和回滚的小时流)
         SingleOutputStreamOperator<AdDataOfMinuteODS> adODSStream = adStreamOfMinuteIn
-                .filter(StringUtils::isNotBlank).setParallelism(12)
-                .process(new AdHourDTOStreamProcess(adMinuteStreamTag, adHourStreamTag)).setParallelism(12);
+                .filter(StringUtils::isNotBlank).setParallelism(parallelismKafka)
+                .process(new AdHourDTOStreamProcess(adMinuteStreamTag, adHourStreamTag)).setParallelism(parallelismKafka);
 
         // 分钟流
         DataStream<AdDataOfMinuteODS> adMinuteODSStream = adODSStream.getSideOutput(adMinuteStreamTag);
@@ -104,7 +105,7 @@ public class AdHourStreamJob {
                 .window(TumblingEventTimeWindows.of(Time.minutes(5L)))
                 .trigger(new AdMinuteODSStreamTrigger())
                 .process(new AdMinuteDWDProcess())
-                .setParallelism(12);
+                .setParallelism(parallelismKafka);
         new KeyedBatchStream<>("adMinuteDWDStream", adMinuteDWDStream.keyBy(AdStatOfMinuteDWD::getStatDay), 1000L, 60 * 1000L)
                 .toBatch()
                 .addSink(new TunnelBatchStreamSink<>(AdStatOfMinuteDWD.class))

+ 2 - 2
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/PlanDayStreamJob.java

@@ -62,8 +62,8 @@ public class PlanDayStreamJob {
         // 大概是允许 checkpoint失败几次,默认 0
         env.getCheckpointConfig().setTolerableCheckpointFailureNumber(0);
         env.setStateBackend(new EmbeddedRocksDBStateBackend(true));
-        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT))) {
-            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT));
+        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT))) {
+            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT));
         }
 
         KafkaSource<String> adStreamOfDaySource = KafkaComponent.buildKafkaSource(props, KafkaComponent.KafkaTopic.adDayTopic, KafkaComponent.KafkaTopic.KafkaGroupId.planDayConsumerGroup);

+ 2 - 2
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/PlanHourStreamJob.java

@@ -66,8 +66,8 @@ public class PlanHourStreamJob {
         // 大概是允许 checkpoint失败几次,默认 0
         env.getCheckpointConfig().setTolerableCheckpointFailureNumber(0);
         env.setStateBackend(new EmbeddedRocksDBStateBackend(true));
-        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT))) {
-            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.CHECKPOINT_SAVEPOINT));
+        if (StringUtils.isNotBlank(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT))) {
+            env.getCheckpointConfig().setCheckpointStorage(props.getProperty(ApplicationProperties.FLINK_CHECKPOINT_SAVEPOINT));
         }
 
         KafkaSource<String> adStreamOfMinuteSource = KafkaComponent.buildKafkaSource(props, KafkaComponent.KafkaTopic.adHourTopic, KafkaComponent.KafkaTopic.KafkaGroupId.planHourConsumerGroup);

+ 3 - 2
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/config/MysqlDataSourceFactory.java

@@ -40,8 +40,9 @@ public class MysqlDataSourceFactory implements DataSourceFactory {
         } catch (SQLException e) {
             log.error(e.getMessage(), e);
         }
-        HikariConfig config = new HikariConfig();
+        /*HikariConfig config = new HikariConfig();
         config.setDataSource(dataSource);
-        return new HikariDataSource(config);
+        return new HikariDataSource(config);*/
+        return dataSource;
     }
 }

+ 31 - 30
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfDayODS.java

@@ -6,6 +6,7 @@ import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTabl
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 @Data
@@ -72,7 +73,7 @@ public class AdDataOfDayODS implements Serializable {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate")
-    private Double costDeviationRate;
+    private BigDecimal costDeviationRate;
 
     /**
      * 消耗
@@ -108,7 +109,7 @@ public class AdDataOfDayODS implements Serializable {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user")
-    private Double avgViewPerUser;
+    private BigDecimal avgViewPerUser;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -126,7 +127,7 @@ public class AdDataOfDayODS implements Serializable {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr")
-    private Double ctr;
+    private BigDecimal ctr;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -144,7 +145,7 @@ public class AdDataOfDayODS implements Serializable {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate")
-    private Double valuableClickRate;
+    private BigDecimal valuableClickRate;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -168,7 +169,7 @@ public class AdDataOfDayODS implements Serializable {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate")
-    private Double conversionsRate;
+    private BigDecimal conversionsRate;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -186,7 +187,7 @@ public class AdDataOfDayODS implements Serializable {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate")
-    private Double deepConversionsRate;
+    private BigDecimal deepConversionsRate;
 
     /**
      * 关键页面访问人数。点击广告原生落地页的APP跳转按钮,并到达APP内关键页面的独立用户数。接入转化跟踪后可统计。
@@ -216,7 +217,7 @@ public class AdDataOfDayODS implements Serializable {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate")
-    private Double orderRate;
+    private BigDecimal orderRate;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -240,7 +241,7 @@ public class AdDataOfDayODS implements Serializable {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi")
-    private Double orderRoi;
+    private BigDecimal orderRoi;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -282,7 +283,7 @@ public class AdDataOfDayODS implements Serializable {
      * 首次付费转化率(人数)。一次点击到产生一个首次付费用户的转化率(原付费销售线索转化率)。H5推广需接入转化跟踪后可统计。
      */
     @SerializedName("leads_purchase_rate")
-    private Double leadsPurchaseRate;
+    private BigDecimal leadsPurchaseRate;
 
     /**
      * 加企业微信客服人数。添加企业微信好友成功的独立用户数。
@@ -306,13 +307,13 @@ public class AdDataOfDayODS implements Serializable {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate")
-    private Double wechatMinigameRegisterRate;
+    private BigDecimal wechatMinigameRegisterRate;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu")
-    private Double wechatMinigameArpu;
+    private BigDecimal wechatMinigameArpu;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -348,7 +349,7 @@ public class AdDataOfDayODS implements Serializable {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate")
-    private Double officialAccountFollowRate;
+    private BigDecimal officialAccountFollowRate;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -360,7 +361,7 @@ public class AdDataOfDayODS implements Serializable {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate")
-    private Double officialAccountRegisterRate;
+    private BigDecimal officialAccountRegisterRate;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -396,7 +397,7 @@ public class AdDataOfDayODS implements Serializable {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate")
-    private Double officialAccountApplyRate;
+    private BigDecimal officialAccountApplyRate;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -438,7 +439,7 @@ public class AdDataOfDayODS implements Serializable {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate")
-    private Double officialAccountOrderRate;
+    private BigDecimal officialAccountOrderRate;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -508,7 +509,7 @@ public class AdDataOfDayODS implements Serializable {
 
     public void removeNull() {
         if (costDeviationRate == null) {
-            costDeviationRate = 0.0;
+            costDeviationRate = BigDecimal.ZERO;
         }
 
         if (cost == null) {
@@ -532,7 +533,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (avgViewPerUser == null) {
-            avgViewPerUser = 0.0;
+            avgViewPerUser = BigDecimal.ZERO;
         }
 
         if (validClickCount == null) {
@@ -544,7 +545,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (ctr == null) {
-            ctr = 0.0;
+            ctr = BigDecimal.ZERO;
         }
 
         if (cpc == null) {
@@ -556,7 +557,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (valuableClickRate == null) {
-            valuableClickRate = 0.0;
+            valuableClickRate = BigDecimal.ZERO;
         }
 
         if (valuableClickCost == null) {
@@ -572,7 +573,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (conversionsRate == null) {
-            conversionsRate = 0.0;
+            conversionsRate = BigDecimal.ZERO;
         }
 
         if (deepConversionsCount == null) {
@@ -584,7 +585,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (deepConversionsRate == null) {
-            deepConversionsRate = 0.0;
+            deepConversionsRate = BigDecimal.ZERO;
         }
 
         if (keyPageUv == null) {
@@ -604,7 +605,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (orderRate == null) {
-            orderRate = 0.0;
+            orderRate = BigDecimal.ZERO;
         }
 
         if (orderAmount == null) {
@@ -620,7 +621,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (orderRoi == null) {
-            orderRoi = 0.0;
+            orderRoi = BigDecimal.ZERO;
         }
 
         if (signInCount == null) {
@@ -648,7 +649,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (leadsPurchaseRate == null) {
-            leadsPurchaseRate = 0.0;
+            leadsPurchaseRate = BigDecimal.ZERO;
         }
 
         if (scanFollowCount == null) {
@@ -664,11 +665,11 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (wechatMinigameRegisterRate == null) {
-            wechatMinigameRegisterRate = 0.0;
+            wechatMinigameRegisterRate = BigDecimal.ZERO;
         }
 
         if (wechatMinigameArpu == null) {
-            wechatMinigameArpu = 0.0;
+            wechatMinigameArpu = BigDecimal.ZERO;
         }
 
         if (wechatMinigameRetentionCount == null) {
@@ -692,7 +693,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (officialAccountFollowRate == null) {
-            officialAccountFollowRate = 0.0;
+            officialAccountFollowRate = BigDecimal.ZERO;
         }
 
         if (officialAccountRegisterUserCount == null) {
@@ -700,7 +701,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (officialAccountRegisterRate == null) {
-            officialAccountRegisterRate = 0.0;
+            officialAccountRegisterRate = BigDecimal.ZERO;
         }
 
         if (officialAccountRegisterCost == null) {
@@ -724,7 +725,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (officialAccountApplyRate == null) {
-            officialAccountApplyRate = 0.0;
+            officialAccountApplyRate = BigDecimal.ZERO;
         }
 
         if (officialAccountApplyCost == null) {
@@ -752,7 +753,7 @@ public class AdDataOfDayODS implements Serializable {
         }
 
         if (officialAccountOrderRate == null) {
-            officialAccountOrderRate = 0.0;
+            officialAccountOrderRate = BigDecimal.ZERO;
         }
 
         if (officialAccountOrderCost == null) {

+ 29 - 28
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfHourODS.java

@@ -6,6 +6,7 @@ import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTabl
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -88,7 +89,7 @@ public class AdDataOfHourODS implements Serializable {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate")
-    private Double costDeviationRate;
+    private BigDecimal costDeviationRate;
 
     /**
      * 消耗
@@ -118,7 +119,7 @@ public class AdDataOfHourODS implements Serializable {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user")
-    private Double avgViewPerUser;
+    private BigDecimal avgViewPerUser;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -130,7 +131,7 @@ public class AdDataOfHourODS implements Serializable {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr")
-    private Double ctr;
+    private BigDecimal ctr;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -148,7 +149,7 @@ public class AdDataOfHourODS implements Serializable {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate")
-    private Double valuableClickRate;
+    private BigDecimal valuableClickRate;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -172,7 +173,7 @@ public class AdDataOfHourODS implements Serializable {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate")
-    private Double conversionsRate;
+    private BigDecimal conversionsRate;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -190,7 +191,7 @@ public class AdDataOfHourODS implements Serializable {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate")
-    private Double deepConversionsRate;
+    private BigDecimal deepConversionsRate;
 
     /**
      * 下单量。用户通过该广告进行商品成交(如下单提交、在线支付)的次数。接入转化跟踪后可统计。
@@ -214,7 +215,7 @@ public class AdDataOfHourODS implements Serializable {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate")
-    private Double orderRate;
+    private BigDecimal orderRate;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -238,7 +239,7 @@ public class AdDataOfHourODS implements Serializable {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi")
-    private Double orderRoi;
+    private BigDecimal orderRoi;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -268,13 +269,13 @@ public class AdDataOfHourODS implements Serializable {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate")
-    private Double wechatMinigameRegisterRate;
+    private BigDecimal wechatMinigameRegisterRate;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu")
-    private Double wechatMinigameArpu;
+    private BigDecimal wechatMinigameArpu;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -310,7 +311,7 @@ public class AdDataOfHourODS implements Serializable {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate")
-    private Double officialAccountFollowRate;
+    private BigDecimal officialAccountFollowRate;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -322,7 +323,7 @@ public class AdDataOfHourODS implements Serializable {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate")
-    private Double officialAccountRegisterRate;
+    private BigDecimal officialAccountRegisterRate;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -358,7 +359,7 @@ public class AdDataOfHourODS implements Serializable {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate")
-    private Double officialAccountApplyRate;
+    private BigDecimal officialAccountApplyRate;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -400,7 +401,7 @@ public class AdDataOfHourODS implements Serializable {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate")
-    private Double officialAccountOrderRate;
+    private BigDecimal officialAccountOrderRate;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -473,7 +474,7 @@ public class AdDataOfHourODS implements Serializable {
      */
     public void removeNull() {
         if (costDeviationRate == null) {
-            costDeviationRate = 0.0;
+            costDeviationRate = BigDecimal.ZERO;
         }
         if (cost == null) {
             cost = 0L;
@@ -488,13 +489,13 @@ public class AdDataOfHourODS implements Serializable {
             thousandDisplayPrice = 0L;
         }
         if (avgViewPerUser == null) {
-            avgViewPerUser = 0.0;
+            avgViewPerUser = BigDecimal.ZERO;
         }
         if (validClickCount == null) {
             validClickCount = 0L;
         }
         if (ctr == null) {
-            ctr = 0.0;
+            ctr = BigDecimal.ZERO;
         }
         if (cpc == null) {
             cpc = 0L;
@@ -503,7 +504,7 @@ public class AdDataOfHourODS implements Serializable {
             valuableClickCount = 0L;
         }
         if (valuableClickRate == null) {
-            valuableClickRate = 0.0;
+            valuableClickRate = BigDecimal.ZERO;
         }
         if (valuableClickCost == null) {
             valuableClickCost = 0L;
@@ -515,7 +516,7 @@ public class AdDataOfHourODS implements Serializable {
             conversionsCost = 0L;
         }
         if (conversionsRate == null) {
-            conversionsRate = 0.0;
+            conversionsRate = BigDecimal.ZERO;
         }
         if (deepConversionsCount == null) {
             deepConversionsCount = 0L;
@@ -524,7 +525,7 @@ public class AdDataOfHourODS implements Serializable {
             deepConversionsCost = 0L;
         }
         if (deepConversionsRate == null) {
-            deepConversionsRate = 0.0;
+            deepConversionsRate = BigDecimal.ZERO;
         }
         if (orderCount == null) {
             orderCount = 0L;
@@ -536,7 +537,7 @@ public class AdDataOfHourODS implements Serializable {
             webOrderCost = 0L;
         }
         if (orderRate == null) {
-            orderRate = 0.0;
+            orderRate = BigDecimal.ZERO;
         }
         if (orderAmount == null) {
             orderAmount = 0L;
@@ -548,7 +549,7 @@ public class AdDataOfHourODS implements Serializable {
             orderUnitPrice = 0L;
         }
         if (orderRoi == null) {
-            orderRoi = 0.0;
+            orderRoi = BigDecimal.ZERO;
         }
         if (signInCount == null) {
             signInCount = 0L;
@@ -563,10 +564,10 @@ public class AdDataOfHourODS implements Serializable {
             wechatMinigameRegisterCost = 0L;
         }
         if (wechatMinigameRegisterRate == null) {
-            wechatMinigameRegisterRate = 0.0;
+            wechatMinigameRegisterRate = BigDecimal.ZERO;
         }
         if (wechatMinigameArpu == null) {
-            wechatMinigameArpu = 0.0;
+            wechatMinigameArpu = BigDecimal.ZERO;
         }
         if (wechatMinigameRetentionCount == null) {
             wechatMinigameRetentionCount = 0L;
@@ -584,13 +585,13 @@ public class AdDataOfHourODS implements Serializable {
             officialAccountFollowCost = 0L;
         }
         if (officialAccountFollowRate == null) {
-            officialAccountFollowRate = 0.0;
+            officialAccountFollowRate = BigDecimal.ZERO;
         }
         if (officialAccountRegisterUserCount == null) {
             officialAccountRegisterUserCount = 0L;
         }
         if (officialAccountRegisterRate == null) {
-            officialAccountRegisterRate = 0.0;
+            officialAccountRegisterRate = BigDecimal.ZERO;
         }
         if (officialAccountRegisterCost == null) {
             officialAccountRegisterCost = 0L;
@@ -608,7 +609,7 @@ public class AdDataOfHourODS implements Serializable {
             officialAccountApplyUserCount = 0L;
         }
         if (officialAccountApplyRate == null) {
-            officialAccountApplyRate = 0.0;
+            officialAccountApplyRate = BigDecimal.ZERO;
         }
         if (officialAccountApplyCost == null) {
             officialAccountApplyCost = 0L;
@@ -629,7 +630,7 @@ public class AdDataOfHourODS implements Serializable {
             officialAccountOrderUserCount = 0L;
         }
         if (officialAccountOrderRate == null) {
-            officialAccountOrderRate = 0.0;
+            officialAccountOrderRate = BigDecimal.ZERO;
         }
         if (officialAccountOrderCost == null) {
             officialAccountOrderCost = 0L;

+ 29 - 28
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdDataOfMinuteODS.java

@@ -7,6 +7,7 @@ import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTabl
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -89,7 +90,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate")
-    private Double costDeviationRate;
+    private BigDecimal costDeviationRate;
 
     /**
      * 消耗
@@ -119,7 +120,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user")
-    private Double avgViewPerUser;
+    private BigDecimal avgViewPerUser;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -131,7 +132,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr")
-    private Double ctr;
+    private BigDecimal ctr;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -149,7 +150,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate")
-    private Double valuableClickRate;
+    private BigDecimal valuableClickRate;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -173,7 +174,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate")
-    private Double conversionsRate;
+    private BigDecimal conversionsRate;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -191,7 +192,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate")
-    private Double deepConversionsRate;
+    private BigDecimal deepConversionsRate;
 
     /**
      * 下单量。用户通过该广告进行商品成交(如下单提交、在线支付)的次数。接入转化跟踪后可统计。
@@ -215,7 +216,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate")
-    private Double orderRate;
+    private BigDecimal orderRate;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -239,7 +240,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi")
-    private Double orderRoi;
+    private BigDecimal orderRoi;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -269,13 +270,13 @@ public class AdDataOfMinuteODS implements Serializable {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate")
-    private Double wechatMinigameRegisterRate;
+    private BigDecimal wechatMinigameRegisterRate;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu")
-    private Double wechatMinigameArpu;
+    private BigDecimal wechatMinigameArpu;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -311,7 +312,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate")
-    private Double officialAccountFollowRate;
+    private BigDecimal officialAccountFollowRate;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -323,7 +324,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate")
-    private Double officialAccountRegisterRate;
+    private BigDecimal officialAccountRegisterRate;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -359,7 +360,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate")
-    private Double officialAccountApplyRate;
+    private BigDecimal officialAccountApplyRate;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -401,7 +402,7 @@ public class AdDataOfMinuteODS implements Serializable {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate")
-    private Double officialAccountOrderRate;
+    private BigDecimal officialAccountOrderRate;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -474,7 +475,7 @@ public class AdDataOfMinuteODS implements Serializable {
      */
     public void removeNull() {
         if (costDeviationRate == null) {
-            costDeviationRate = 0.0;
+            costDeviationRate = BigDecimal.ZERO;
         }
         if (cost == null) {
             cost = 0L;
@@ -489,13 +490,13 @@ public class AdDataOfMinuteODS implements Serializable {
             thousandDisplayPrice = 0L;
         }
         if (avgViewPerUser == null) {
-            avgViewPerUser = 0.0;
+            avgViewPerUser = BigDecimal.ZERO;
         }
         if (validClickCount == null) {
             validClickCount = 0L;
         }
         if (ctr == null) {
-            ctr = 0.0;
+            ctr = BigDecimal.ZERO;
         }
         if (cpc == null) {
             cpc = 0L;
@@ -504,7 +505,7 @@ public class AdDataOfMinuteODS implements Serializable {
             valuableClickCount = 0L;
         }
         if (valuableClickRate == null) {
-            valuableClickRate = 0.0;
+            valuableClickRate = BigDecimal.ZERO;
         }
         if (valuableClickCost == null) {
             valuableClickCost = 0L;
@@ -516,7 +517,7 @@ public class AdDataOfMinuteODS implements Serializable {
             conversionsCost = 0L;
         }
         if (conversionsRate == null) {
-            conversionsRate = 0.0;
+            conversionsRate = BigDecimal.ZERO;
         }
         if (deepConversionsCount == null) {
             deepConversionsCount = 0L;
@@ -525,7 +526,7 @@ public class AdDataOfMinuteODS implements Serializable {
             deepConversionsCost = 0L;
         }
         if (deepConversionsRate == null) {
-            deepConversionsRate = 0.0;
+            deepConversionsRate = BigDecimal.ZERO;
         }
         if (orderCount == null) {
             orderCount = 0L;
@@ -537,7 +538,7 @@ public class AdDataOfMinuteODS implements Serializable {
             webOrderCost = 0L;
         }
         if (orderRate == null) {
-            orderRate = 0.0;
+            orderRate = BigDecimal.ZERO;
         }
         if (orderAmount == null) {
             orderAmount = 0L;
@@ -549,7 +550,7 @@ public class AdDataOfMinuteODS implements Serializable {
             orderUnitPrice = 0L;
         }
         if (orderRoi == null) {
-            orderRoi = 0.0;
+            orderRoi = BigDecimal.ZERO;
         }
         if (signInCount == null) {
             signInCount = 0L;
@@ -564,10 +565,10 @@ public class AdDataOfMinuteODS implements Serializable {
             wechatMinigameRegisterCost = 0L;
         }
         if (wechatMinigameRegisterRate == null) {
-            wechatMinigameRegisterRate = 0.0;
+            wechatMinigameRegisterRate = BigDecimal.ZERO;
         }
         if (wechatMinigameArpu == null) {
-            wechatMinigameArpu = 0.0;
+            wechatMinigameArpu = BigDecimal.ZERO;
         }
         if (wechatMinigameRetentionCount == null) {
             wechatMinigameRetentionCount = 0L;
@@ -585,13 +586,13 @@ public class AdDataOfMinuteODS implements Serializable {
             officialAccountFollowCost = 0L;
         }
         if (officialAccountFollowRate == null) {
-            officialAccountFollowRate = 0.0;
+            officialAccountFollowRate = BigDecimal.ZERO;
         }
         if (officialAccountRegisterUserCount == null) {
             officialAccountRegisterUserCount = 0L;
         }
         if (officialAccountRegisterRate == null) {
-            officialAccountRegisterRate = 0.0;
+            officialAccountRegisterRate = BigDecimal.ZERO;
         }
         if (officialAccountRegisterCost == null) {
             officialAccountRegisterCost = 0L;
@@ -609,7 +610,7 @@ public class AdDataOfMinuteODS implements Serializable {
             officialAccountApplyUserCount = 0L;
         }
         if (officialAccountApplyRate == null) {
-            officialAccountApplyRate = 0.0;
+            officialAccountApplyRate = BigDecimal.ZERO;
         }
         if (officialAccountApplyCost == null) {
             officialAccountApplyCost = 0L;
@@ -630,7 +631,7 @@ public class AdDataOfMinuteODS implements Serializable {
             officialAccountOrderUserCount = 0L;
         }
         if (officialAccountOrderRate == null) {
-            officialAccountOrderRate = 0.0;
+            officialAccountOrderRate = BigDecimal.ZERO;
         }
         if (officialAccountOrderCost == null) {
             officialAccountOrderCost = 0L;

+ 173 - 171
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfDayDWD.java

@@ -5,6 +5,7 @@ import com.google.gson.annotations.SerializedName;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeColumn;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTable;
 import flink.zanxiangnet.ad.monitoring.util.DateUtil;
+import flink.zanxiangnet.ad.monitoring.util.NumberUtil;
 import flink.zanxiangnet.ad.monitoring.util.ObjectUtil;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
@@ -78,13 +79,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_total")
-    private Double costDeviationRateTotal;
+    private BigDecimal costDeviationRateTotal;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_day")
-    private Double costDeviationRateDay;
+    private BigDecimal costDeviationRateDay;
 
     /**
      * 消耗
@@ -150,13 +151,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_all")
-    private Double avgViewPerUserAll;
+    private BigDecimal avgViewPerUserAll;
 
     /**
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_day")
-    private Double avgViewPerUserDay;
+    private BigDecimal avgViewPerUserDay;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -186,13 +187,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_all")
-    private Double ctrAll;
+    private BigDecimal ctrAll;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_day")
-    private Double ctrDay;
+    private BigDecimal ctrDay;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -222,13 +223,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_all")
-    private Double valuableClickRateAll;
+    private BigDecimal valuableClickRateAll;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_day")
-    private Double valuableClickRateDay;
+    private BigDecimal valuableClickRateDay;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -270,13 +271,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_all")
-    private Double conversionsRateAll;
+    private BigDecimal conversionsRateAll;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_day")
-    private Double conversionsRateDay;
+    private BigDecimal conversionsRateDay;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -306,13 +307,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_all")
-    private Double deepConversionsRateAll;
+    private BigDecimal deepConversionsRateAll;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_day")
-    private Double deepConversionsRateDay;
+    private BigDecimal deepConversionsRateDay;
 
     /**
      * 关键页面访问人数。点击广告原生落地页的APP跳转按钮,并到达APP内关键页面的独立用户数。接入转化跟踪后可统计。
@@ -366,13 +367,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_all")
-    private Double orderRateAll;
+    private BigDecimal orderRateAll;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_day")
-    private Double orderRateDay;
+    private BigDecimal orderRateDay;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -414,13 +415,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_all")
-    private Double orderRoiAll;
+    private BigDecimal orderRoiAll;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_day")
-    private Double orderRoiDay;
+    private BigDecimal orderRoiDay;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -498,13 +499,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 首次付费转化率(人数)。一次点击到产生一个首次付费用户的转化率(原付费销售线索转化率)。H5推广需接入转化跟踪后可统计。
      */
     @SerializedName("leads_purchase_rate_all")
-    private Double leadsPurchaseRateAll;
+    private BigDecimal leadsPurchaseRateAll;
 
     /**
      * 首次付费转化率(人数)。一次点击到产生一个首次付费用户的转化率(原付费销售线索转化率)。H5推广需接入转化跟踪后可统计。
      */
     @SerializedName("leads_purchase_rate_day")
-    private Double leadsPurchaseRateDay;
+    private BigDecimal leadsPurchaseRateDay;
 
     /**
      * 加企业微信客服人数。添加企业微信好友成功的独立用户数。
@@ -546,25 +547,25 @@ public class AdStatOfDayDWD implements Serializable {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_all")
-    private Double wechatMinigameRegisterRateAll;
+    private BigDecimal wechatMinigameRegisterRateAll;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_day")
-    private Double wechatMinigameRegisterRateDay;
+    private BigDecimal wechatMinigameRegisterRateDay;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_all")
-    private Double wechatMinigameArpuAll;
+    private BigDecimal wechatMinigameArpuAll;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_day")
-    private Double wechatMinigameArpuDay;
+    private BigDecimal wechatMinigameArpuDay;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -630,13 +631,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_all")
-    private Double officialAccountFollowRateAll;
+    private BigDecimal officialAccountFollowRateAll;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_day")
-    private Double officialAccountFollowRateDay;
+    private BigDecimal officialAccountFollowRateDay;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -654,13 +655,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_all")
-    private Double officialAccountRegisterRateAll;
+    private BigDecimal officialAccountRegisterRateAll;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_day")
-    private Double officialAccountRegisterRateDay;
+    private BigDecimal officialAccountRegisterRateDay;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -726,13 +727,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_all")
-    private Double officialAccountApplyRateAll;
+    private BigDecimal officialAccountApplyRateAll;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_day")
-    private Double officialAccountApplyRateDay;
+    private BigDecimal officialAccountApplyRateDay;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -810,13 +811,13 @@ public class AdStatOfDayDWD implements Serializable {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_all")
-    private Double officialAccountOrderRateAll;
+    private BigDecimal officialAccountOrderRateAll;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_day")
-    private Double officialAccountOrderRateDay;
+    private BigDecimal officialAccountOrderRateDay;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1110,7 +1111,7 @@ public class AdStatOfDayDWD implements Serializable {
             result.setNoInterestCountTotal(value2.getNoInterestCount());
             result.setNoInterestCountDay(value2.getNoInterestCount());
         } else {
-            result.setCostDeviationRateTotal(value1.getCostDeviationRateTotal() + value2.getCostDeviationRate());
+            result.setCostDeviationRateTotal(value1.getCostDeviationRateTotal().add(value2.getCostDeviationRate()));
             result.setCostDeviationRateDay(value2.getCostDeviationRate());
             result.setCostTotal(value1.getCostTotal() + value2.getCost());
             result.setCostDay(value2.getCost());
@@ -1118,15 +1119,11 @@ public class AdStatOfDayDWD implements Serializable {
             result.setCompensationAmountDay(value2.getCompensationAmount());
             result.setViewCountTotal(value1.getViewCountTotal() + value2.getViewCount());
             result.setViewCountDay(value2.getViewCount());
-            // 总消耗 / 总曝光
-            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : (result.getCostTotal() / result.getViewCountTotal() * 1000));
-            result.setThousandDisplayPriceDay(value2.getThousandDisplayPrice());
 
             // 应该不准,因为跨天的用户无法去重
             result.setViewUserCountTotal(value1.getViewUserCountTotal() + value2.getViewUserCount());
+            result.setThousandDisplayPriceDay(value2.getThousandDisplayPrice());
             result.setViewUserCountDay(value2.getViewUserCount());
-            // 曝光次数 / 曝光人数(不准)
-            result.setAvgViewPerUserAll(result.getViewUserCountTotal() == 0 ? 0.0 : result.getViewCountTotal() / result.getViewUserCountTotal());
             result.setAvgViewPerUserDay(value2.getAvgViewPerUser());
             result.setValidClickCountTotal(value1.getValidClickCountTotal() + value2.getValidClickCount());
             result.setValidClickCountDay(value2.getValidClickCount());
@@ -1134,35 +1131,19 @@ public class AdStatOfDayDWD implements Serializable {
             // 应该不准,因为跨天的用户无法去重
             result.setClickUserCountTotal(value1.getClickUserCountTotal() + value2.getClickUserCount());
             result.setClickUserCountDay(value2.getClickUserCount());
-            // 广告点击次数 / 广告曝光次数
-            result.setCtrAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValidClickCountTotal() / result.getViewCountTotal());
             result.setCtrDay(value2.getCtr());
-            // 广告花费/广告点击次数
-            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValidClickCountTotal());
             result.setCpcDay(value2.getCpc());
             result.setValuableClickCountTotal(value1.getValuableClickCountTotal() + value2.getValuableClickCount());
             result.setValuableClickCountDay(value2.getValuableClickCount());
-            // 广告可转化点击次数/广告曝光次数
-            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValuableClickCountTotal() / result.getViewCountTotal());
             result.setValuableClickRateDay(value2.getValuableClickRate());
-            // 广告花费/可转化点击次数
-            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValuableClickCountTotal());
             result.setValuableClickCostDay(value2.getValuableClickCost());
             result.setConversionsCountTotal(value1.getConversionsCountTotal() + value2.getConversionsCount());
             result.setConversionsCountDay(value2.getConversionsCount());
-            // 广告花费/转化目标量
-            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getConversionsCountTotal());
             result.setConversionsCostDay(value2.getConversionsCost());
-            // 公众号:转化目标量/点击次数。
-            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getConversionsCountTotal() / result.getValidClickCountTotal());
             result.setConversionsRateDay(value2.getConversionsRate());
             result.setDeepConversionsCountTotal(value1.getDeepConversionsCountTotal() + value2.getDeepConversionsCount());
             result.setDeepConversionsCountDay(value2.getDeepConversionsCount());
-            // 广告花费/深度转化目标量
-            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getDeepConversionsCountTotal());
             result.setDeepConversionsCostDay(value2.getDeepConversionsCost());
-            // 深度转化目标量/可转化点击次数
-            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? 0.0 : result.getDeepConversionsCountTotal() / result.getValuableClickCountTotal());
             result.setDeepConversionsRateDay(value2.getDeepConversionsRate());
             result.setKeyPageUvTotal(value1.getKeyPageUvTotal() + value2.getKeyPageUv());
             result.setKeyPageUvDay(value2.getKeyPageUv());
@@ -1170,21 +1151,13 @@ public class AdStatOfDayDWD implements Serializable {
             result.setOrderCountDay(value2.getOrderCount());
             result.setFirstDayOrderCountTotal(value1.getFirstDayOrderCountTotal() + value2.getFirstDayOrderCount());
             result.setFirstDayOrderCountDay(value2.getFirstDayOrderCount());
-            // 广告花费/下单量
-            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOrderCountTotal());
             result.setWebOrderCostDay(value2.getWebOrderCost());
-            // 下单量/点击次数
-            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOrderCountTotal() / result.getValidClickCountTotal());
             result.setOrderRateDay(value2.getOrderRate());
             result.setOrderAmountTotal(value1.getOrderAmountTotal() + value2.getOrderAmount());
             result.setOrderAmountDay(value2.getOrderAmount());
             result.setFirstDayOrderAmountTotal(value1.getFirstDayOrderAmountTotal() + value2.getFirstDayOrderAmount());
             result.setFirstDayOrderAmountDay(value2.getFirstDayOrderAmount());
-            // 下单金额/下单量
-            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : result.getOrderAmountTotal() / result.getOrderCountTotal());
             result.setOrderUnitPriceDay(value2.getOrderUnitPrice());
-            // 下单金额/广告花费
-            result.setOrderRoiAll(result.getCostTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getCostTotal());
             result.setOrderRoiDay(value2.getOrderRoi());
             result.setSignInCountTotal(value1.getSignInCountTotal() + value2.getSignInCount());
             result.setSignInCountDay(value2.getSignInCount());
@@ -1198,24 +1171,14 @@ public class AdStatOfDayDWD implements Serializable {
             // 应该不准,因为跨天的用户无法去重
             result.setLeadsPurchaseUvTotal(value1.getLeadsPurchaseUvTotal() + value2.getLeadsPurchaseUv());
             result.setLeadsPurchaseUvDay(value2.getLeadsPurchaseUv());
-            // 广告消耗/首次付费人数
-            result.setLeadsPurchaseCostAll(result.getLeadsPurchaseUvTotal() == 0 ? 0 : result.getCostTotal() / result.getLeadsPurchaseUvTotal());
             result.setLeadsPurchaseCostDay(value2.getLeadsPurchaseCost());
-            // 首次付费人数/广告点击次数
-            result.setLeadsPurchaseRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getLeadsPurchaseUvTotal() / result.getValidClickCountTotal());
             result.setLeadsPurchaseRateDay(value2.getLeadsPurchaseRate());
             result.setScanFollowCountTotal(value1.getScanFollowCountTotal() + value2.getScanFollowCount());
             result.setScanFollowCountDay(value2.getScanFollowCount());
             result.setWechatAppRegisterUvTotal(value1.getWechatAppRegisterUvTotal() + value2.getWechatAppRegisterUv());
             result.setWechatAppRegisterUvDay(value2.getWechatAppRegisterUv());
-            // 广告消耗 / 小游戏注册人数
-            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : result.getCostTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameRegisterCostDay(value2.getWechatMinigameRegisterCost());
-            // 小游戏注册人数 / 广告点击次数
-            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getWechatAppRegisterUvTotal() / result.getValidClickCountTotal());
             result.setWechatMinigameRegisterRateDay(value2.getWechatMinigameRegisterRate());
-            // 总收益 / 总人数
-            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameArpuDay(value2.getWechatMinigameArpu());
             result.setWechatMinigameRetentionCountTotal(value1.getWechatMinigameRetentionCountTotal() + value2.getWechatMinigameRetentionCount());
             result.setWechatMinigameRetentionCountDay(value2.getWechatMinigameRetentionCount());
@@ -1225,39 +1188,23 @@ public class AdStatOfDayDWD implements Serializable {
             result.setWechatMinigameCheckoutAmountDay(value2.getWechatMinigameCheckoutAmount());
             result.setOfficialAccountFollowCountTotal(value1.getOfficialAccountFollowCountTotal() + value2.getOfficialAccountFollowCount());
             result.setOfficialAccountFollowCountDay(value2.getOfficialAccountFollowCount());
-            // 广告消耗 / 关注次数
-            result.setOfficialAccountFollowCostAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountFollowCostDay(value2.getOfficialAccountFollowCost());
-            // 关注次数 / 点击次数
-            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOfficialAccountFollowCountTotal() / result.getValidClickCountTotal());
             result.setOfficialAccountFollowRateDay(value2.getOfficialAccountFollowRate());
             result.setOfficialAccountRegisterUserCountTotal(value1.getOfficialAccountRegisterUserCountTotal() + value2.getOfficialAccountRegisterUserCount());
             result.setOfficialAccountRegisterUserCountDay(value2.getOfficialAccountRegisterUserCount());
-            // 公众号内注册人数 / 公众号关注次数
-            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountRegisterRateDay(value2.getOfficialAccountRegisterRate());
-            // 广告消耗 / 广告注册人数
-            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountRegisterUserCountTotal());
             result.setOfficialAccountRegisterCostDay(value2.getOfficialAccountRegisterCost());
             result.setOfficialAccountRegisterAmountTotal(value1.getOfficialAccountRegisterAmountTotal() + value2.getOfficialAccountRegisterAmount());
             result.setOfficialAccountRegisterAmountDay(value2.getOfficialAccountRegisterAmount());
-            // 注册产生的订单金额累计/广告花费
-            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountRegisterAmountTotal() / result.getCostTotal());
             result.setOfficialAccountRegisterRoiDay(value2.getOfficialAccountRegisterRoi());
             result.setOfficialAccountApplyCountTotal(value1.getOfficialAccountApplyCountTotal() + value2.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyCountDay(value2.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyUserCountTotal(value1.getOfficialAccountApplyUserCountTotal() + value2.getOfficialAccountApplyUserCount());
             result.setOfficialAccountApplyUserCountDay(value2.getOfficialAccountApplyUserCount());
-            // 公众号内填单的独立用户数/公众号关注次数
-            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountApplyRateDay(value2.getOfficialAccountApplyRate());
-            // 广告花费/广告产生的填单行为数量
-            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountApplyUserCountTotal());
             result.setOfficialAccountApplyCostDay(value2.getOfficialAccountApplyCost());
             result.setOfficialAccountApplyAmountTotal(value1.getOfficialAccountApplyAmountTotal() + value2.getOfficialAccountApplyAmount());
             result.setOfficialAccountApplyAmountDay(value2.getOfficialAccountApplyAmount());
-            // 填单产生的订单金额累计/广告花费
-            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountApplyAmountTotal() / result.getCostTotal());
             result.setOfficialAccountApplyRoiDay(value2.getOfficialAccountApplyRoi());
             result.setOfficialAccountOrderCountTotal(value1.getOfficialAccountOrderCountTotal() + value2.getOfficialAccountOrderCount());
             result.setOfficialAccountOrderCountDay(value2.getOfficialAccountOrderCount());
@@ -1265,18 +1212,12 @@ public class AdStatOfDayDWD implements Serializable {
             result.setOfficialAccountFirstDayOrderCountDay(value2.getOfficialAccountFirstDayOrderCount());
             result.setOfficialAccountOrderUserCountTotal(value1.getOfficialAccountOrderUserCountTotal() + value2.getOfficialAccountOrderUserCount());
             result.setOfficialAccountOrderUserCountDay(value2.getOfficialAccountOrderUserCount());
-            // 公众号内下单独立用户数(UV)/公众号关注次数
-            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountOrderRateDay(value2.getOfficialAccountOrderRate());
-            // 广告花费/广告产生的下单行为数量
-            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountOrderCountTotal());
             result.setOfficialAccountOrderCostDay(value2.getOfficialAccountOrderCost());
             result.setOfficialAccountOrderAmountTotal(value1.getOfficialAccountOrderAmountTotal() + value2.getOfficialAccountOrderAmount());
             result.setOfficialAccountOrderAmountDay(value2.getOfficialAccountOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountTotal(value1.getOfficialAccountFirstDayOrderAmountTotal() + value2.getOfficialAccountFirstDayOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountDay(value2.getOfficialAccountFirstDayOrderAmount());
-            // 下单产生的订单金额累计/广告花费
-            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountOrderAmountTotal() / result.getCostTotal());
             result.setOfficialAccountOrderRoiDay(value2.getOfficialAccountOrderRoi());
             result.setOfficialAccountConsultCountTotal(value1.getOfficialAccountConsultCountTotal() + value2.getOfficialAccountConsultCount());
             result.setOfficialAccountConsultCountDay(value2.getOfficialAccountConsultCount());
@@ -1292,6 +1233,67 @@ public class AdStatOfDayDWD implements Serializable {
             result.setForwardUserCountDay(value2.getForwardUserCount());
             result.setNoInterestCountTotal(value1.getNoInterestCountTotal() + value2.getNoInterestCount());
             result.setNoInterestCountDay(value2.getNoInterestCount());
+
+            // 曝光次数 / 曝光人数(不准)
+            result.setAvgViewPerUserAll(result.getViewUserCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getViewCountTotal(), result.getViewUserCountTotal()));
+            // 广告点击次数 / 广告曝光次数
+            result.setCtrAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/广告点击次数
+            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValidClickCountTotal()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/转化目标量
+            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getConversionsCountTotal()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountTotal(), result.getValidClickCountTotal()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getDeepConversionsCountTotal()));
+            // 广告花费/下单量
+            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOrderCountTotal()));
+            // 下单量/点击次数
+            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountTotal(), result.getValidClickCountTotal()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountTotal(), result.getOrderCountTotal()));
+            // 下单金额/广告花费
+            result.setOrderRoiAll(result.getCostTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getCostTotal()));
+            // 广告消耗/首次付费人数
+            result.setLeadsPurchaseCostAll(result.getLeadsPurchaseUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getLeadsPurchaseUvTotal()));
+            // 首次付费人数/广告点击次数
+            result.setLeadsPurchaseRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getLeadsPurchaseUvTotal(), result.getValidClickCountTotal()));
+            // 广告消耗 / 小游戏注册人数
+            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getWechatAppRegisterUvTotal()));
+            // 小游戏注册人数 / 广告点击次数
+            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvTotal(), result.getValidClickCountTotal()));
+            // 总收益 / 总人数
+            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getWechatAppRegisterUvTotal()));
+            // 广告消耗 / 关注次数
+            result.setOfficialAccountFollowCostAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 关注次数 / 点击次数
+            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountTotal(), result.getValidClickCountTotal()));
+            // 公众号内注册人数 / 公众号关注次数
+            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告消耗 / 广告注册人数
+            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountRegisterUserCountTotal()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountTotal(), result.getCostTotal()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountApplyUserCountTotal()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountTotal(), result.getCostTotal()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountOrderCountTotal()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountTotal(), result.getCostTotal()));
+            // 总消耗 / 总曝光
+            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : NumberUtil.divideForAd(result.getCostTotal(), result.getViewCountTotal()).multiply(new BigDecimal(1000)).longValue());
         }
         return result;
     }
@@ -1307,8 +1309,8 @@ public class AdStatOfDayDWD implements Serializable {
         result.setAdgroupId(ObjectUtil.toLong(record.get("adgroup_id")));
         result.setAdId(ObjectUtil.toLong(record.get("ad_id")));
         result.setCreateTime(ObjectUtil.toDate(record.get("create_time")));
-        result.setCostDeviationRateTotal(ObjectUtil.toDouble(record.get("cost_deviation_rate_total")));
-        result.setCostDeviationRateDay(ObjectUtil.toDouble(record.get("cost_deviation_rate_day")));
+        result.setCostDeviationRateTotal(ObjectUtil.toDecimal(record.get("cost_deviation_rate_total")));
+        result.setCostDeviationRateDay(ObjectUtil.toDecimal(record.get("cost_deviation_rate_day")));
         result.setCostTotal(ObjectUtil.toLong(record.get("cost_total")));
         result.setCostDay(ObjectUtil.toLong(record.get("cost_day")));
         result.setCompensationAmountTotal(ObjectUtil.toLong(record.get("compensation_amount_total")));
@@ -1319,34 +1321,34 @@ public class AdStatOfDayDWD implements Serializable {
         result.setThousandDisplayPriceDay(ObjectUtil.toLong(record.get("thousand_display_price_day")));
         result.setViewUserCountTotal(ObjectUtil.toLong(record.get("view_user_count_total")));
         result.setViewUserCountDay(ObjectUtil.toLong(record.get("view_user_count_day")));
-        result.setAvgViewPerUserAll(ObjectUtil.toDouble(record.get("avg_view_per_user_all")));
-        result.setAvgViewPerUserDay(ObjectUtil.toDouble(record.get("avg_view_per_user_day")));
+        result.setAvgViewPerUserAll(ObjectUtil.toDecimal(record.get("avg_view_per_user_all")));
+        result.setAvgViewPerUserDay(ObjectUtil.toDecimal(record.get("avg_view_per_user_day")));
         result.setValidClickCountTotal(ObjectUtil.toLong(record.get("valid_click_count_total")));
         result.setValidClickCountDay(ObjectUtil.toLong(record.get("valid_click_count_day")));
         result.setClickUserCountTotal(ObjectUtil.toLong(record.get("click_user_count_total")));
         result.setClickUserCountDay(ObjectUtil.toLong(record.get("click_user_count_day")));
-        result.setCtrAll(ObjectUtil.toDouble(record.get("ctr_all")));
-        result.setCtrDay(ObjectUtil.toDouble(record.get("ctr_day")));
+        result.setCtrAll(ObjectUtil.toDecimal(record.get("ctr_all")));
+        result.setCtrDay(ObjectUtil.toDecimal(record.get("ctr_day")));
         result.setCpcAll(ObjectUtil.toLong(record.get("cpc_all")));
         result.setCpcDay(ObjectUtil.toLong(record.get("cpc_day")));
         result.setValuableClickCountTotal(ObjectUtil.toLong(record.get("valuable_click_count_total")));
         result.setValuableClickCountDay(ObjectUtil.toLong(record.get("valuable_click_count_day")));
-        result.setValuableClickRateAll(ObjectUtil.toDouble(record.get("valuable_click_rate_all")));
-        result.setValuableClickRateDay(ObjectUtil.toDouble(record.get("valuable_click_rate_day")));
+        result.setValuableClickRateAll(ObjectUtil.toDecimal(record.get("valuable_click_rate_all")));
+        result.setValuableClickRateDay(ObjectUtil.toDecimal(record.get("valuable_click_rate_day")));
         result.setValuableClickCostAll(ObjectUtil.toLong(record.get("valuable_click_cost_all")));
         result.setValuableClickCostDay(ObjectUtil.toLong(record.get("valuable_click_cost_day")));
         result.setConversionsCountTotal(ObjectUtil.toLong(record.get("conversions_count_total")));
         result.setConversionsCountDay(ObjectUtil.toLong(record.get("conversions_count_day")));
         result.setConversionsCostAll(ObjectUtil.toLong(record.get("conversions_cost_all")));
         result.setConversionsCostDay(ObjectUtil.toLong(record.get("conversions_cost_day")));
-        result.setConversionsRateAll(ObjectUtil.toDouble(record.get("conversions_rate_all")));
-        result.setConversionsRateDay(ObjectUtil.toDouble(record.get("conversions_rate_day")));
+        result.setConversionsRateAll(ObjectUtil.toDecimal(record.get("conversions_rate_all")));
+        result.setConversionsRateDay(ObjectUtil.toDecimal(record.get("conversions_rate_day")));
         result.setDeepConversionsCountTotal(ObjectUtil.toLong(record.get("deep_conversions_count_total")));
         result.setDeepConversionsCountDay(ObjectUtil.toLong(record.get("deep_conversions_count_day")));
         result.setDeepConversionsCostAll(ObjectUtil.toLong(record.get("deep_conversions_cost_all")));
         result.setDeepConversionsCostDay(ObjectUtil.toLong(record.get("deep_conversions_cost_day")));
-        result.setDeepConversionsRateAll(ObjectUtil.toDouble(record.get("deep_conversions_rate_all")));
-        result.setDeepConversionsRateDay(ObjectUtil.toDouble(record.get("deep_conversions_rate_day")));
+        result.setDeepConversionsRateAll(ObjectUtil.toDecimal(record.get("deep_conversions_rate_all")));
+        result.setDeepConversionsRateDay(ObjectUtil.toDecimal(record.get("deep_conversions_rate_day")));
         result.setKeyPageUvTotal(ObjectUtil.toLong(record.get("key_page_uv_total")));
         result.setKeyPageUvDay(ObjectUtil.toLong(record.get("key_page_uv_day")));
         result.setOrderCountTotal(ObjectUtil.toLong(record.get("order_count_total")));
@@ -1355,16 +1357,16 @@ public class AdStatOfDayDWD implements Serializable {
         result.setFirstDayOrderCountDay(ObjectUtil.toLong(record.get("first_day_order_count_day")));
         result.setWebOrderCostAll(ObjectUtil.toLong(record.get("web_order_cost_all")));
         result.setWebOrderCostDay(ObjectUtil.toLong(record.get("web_order_cost_day")));
-        result.setOrderRateAll(ObjectUtil.toDouble(record.get("order_rate_all")));
-        result.setOrderRateDay(ObjectUtil.toDouble(record.get("order_rate_day")));
+        result.setOrderRateAll(ObjectUtil.toDecimal(record.get("order_rate_all")));
+        result.setOrderRateDay(ObjectUtil.toDecimal(record.get("order_rate_day")));
         result.setOrderAmountTotal(ObjectUtil.toLong(record.get("order_amount_total")));
         result.setOrderAmountDay(ObjectUtil.toLong(record.get("order_amount_day")));
         result.setFirstDayOrderAmountTotal(ObjectUtil.toLong(record.get("first_day_order_amount_total")));
         result.setFirstDayOrderAmountDay(ObjectUtil.toLong(record.get("first_day_order_amount_day")));
         result.setOrderUnitPriceAll(ObjectUtil.toLong(record.get("order_unit_price_all")));
         result.setOrderUnitPriceDay(ObjectUtil.toLong(record.get("order_unit_price_day")));
-        result.setOrderRoiAll(ObjectUtil.toDouble(record.get("order_roi_all")));
-        result.setOrderRoiDay(ObjectUtil.toDouble(record.get("order_roi_day")));
+        result.setOrderRoiAll(ObjectUtil.toDecimal(record.get("order_roi_all")));
+        result.setOrderRoiDay(ObjectUtil.toDecimal(record.get("order_roi_day")));
         result.setSignInCountTotal(ObjectUtil.toLong(record.get("sign_in_count_total")));
         result.setSignInCountDay(ObjectUtil.toLong(record.get("sign_in_count_day")));
         result.setAddWishlistCountTotal(ObjectUtil.toLong(record.get("add_wishlist_count_total")));
@@ -1377,18 +1379,18 @@ public class AdStatOfDayDWD implements Serializable {
         result.setLeadsPurchaseUvDay(ObjectUtil.toLong(record.get("leads_purchase_uv_day")));
         result.setLeadsPurchaseCostAll(ObjectUtil.toLong(record.get("leads_purchase_cost_all")));
         result.setLeadsPurchaseCostDay(ObjectUtil.toLong(record.get("leads_purchase_cost_day")));
-        result.setLeadsPurchaseRateAll(ObjectUtil.toDouble(record.get("leads_purchase_rate_all")));
-        result.setLeadsPurchaseRateDay(ObjectUtil.toDouble(record.get("leads_purchase_rate_day")));
+        result.setLeadsPurchaseRateAll(ObjectUtil.toDecimal(record.get("leads_purchase_rate_all")));
+        result.setLeadsPurchaseRateDay(ObjectUtil.toDecimal(record.get("leads_purchase_rate_day")));
         result.setScanFollowCountTotal(ObjectUtil.toLong(record.get("scan_follow_count_total")));
         result.setScanFollowCountDay(ObjectUtil.toLong(record.get("scan_follow_count_day")));
         result.setWechatAppRegisterUvTotal(ObjectUtil.toLong(record.get("wechat_app_register_uv_total")));
         result.setWechatAppRegisterUvDay(ObjectUtil.toLong(record.get("wechat_app_register_uv_day")));
         result.setWechatMinigameRegisterCostAll(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_all")));
         result.setWechatMinigameRegisterCostDay(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_day")));
-        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_all")));
-        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_day")));
-        result.setWechatMinigameArpuAll(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_all")));
-        result.setWechatMinigameArpuDay(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_day")));
+        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_all")));
+        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_day")));
+        result.setWechatMinigameArpuAll(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_all")));
+        result.setWechatMinigameArpuDay(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_day")));
         result.setWechatMinigameRetentionCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_total")));
         result.setWechatMinigameRetentionCountDay(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_day")));
         result.setWechatMinigameCheckoutCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_checkout_count_total")));
@@ -1399,12 +1401,12 @@ public class AdStatOfDayDWD implements Serializable {
         result.setOfficialAccountFollowCountDay(ObjectUtil.toLong(record.get("official_account_follow_count_day")));
         result.setOfficialAccountFollowCostAll(ObjectUtil.toLong(record.get("official_account_follow_cost_all")));
         result.setOfficialAccountFollowCostDay(ObjectUtil.toLong(record.get("official_account_follow_cost_day")));
-        result.setOfficialAccountFollowRateAll(ObjectUtil.toDouble(record.get("official_account_follow_rate_all")));
-        result.setOfficialAccountFollowRateDay(ObjectUtil.toDouble(record.get("official_account_follow_rate_day")));
+        result.setOfficialAccountFollowRateAll(ObjectUtil.toDecimal(record.get("official_account_follow_rate_all")));
+        result.setOfficialAccountFollowRateDay(ObjectUtil.toDecimal(record.get("official_account_follow_rate_day")));
         result.setOfficialAccountRegisterUserCountTotal(ObjectUtil.toLong(record.get("official_account_register_user_count_total")));
         result.setOfficialAccountRegisterUserCountDay(ObjectUtil.toLong(record.get("official_account_register_user_count_day")));
-        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDouble(record.get("official_account_register_rate_all")));
-        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDouble(record.get("official_account_register_rate_day")));
+        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDecimal(record.get("official_account_register_rate_all")));
+        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDecimal(record.get("official_account_register_rate_day")));
         result.setOfficialAccountRegisterCostAll(ObjectUtil.toLong(record.get("official_account_register_cost_all")));
         result.setOfficialAccountRegisterCostDay(ObjectUtil.toLong(record.get("official_account_register_cost_day")));
         result.setOfficialAccountRegisterAmountTotal(ObjectUtil.toLong(record.get("official_account_register_amount_total")));
@@ -1415,8 +1417,8 @@ public class AdStatOfDayDWD implements Serializable {
         result.setOfficialAccountApplyCountDay(ObjectUtil.toLong(record.get("official_account_apply_count_day")));
         result.setOfficialAccountApplyUserCountTotal(ObjectUtil.toLong(record.get("official_account_apply_user_count_total")));
         result.setOfficialAccountApplyUserCountDay(ObjectUtil.toLong(record.get("official_account_apply_user_count_day")));
-        result.setOfficialAccountApplyRateAll(ObjectUtil.toDouble(record.get("official_account_apply_rate_all")));
-        result.setOfficialAccountApplyRateDay(ObjectUtil.toDouble(record.get("official_account_apply_rate_day")));
+        result.setOfficialAccountApplyRateAll(ObjectUtil.toDecimal(record.get("official_account_apply_rate_all")));
+        result.setOfficialAccountApplyRateDay(ObjectUtil.toDecimal(record.get("official_account_apply_rate_day")));
         result.setOfficialAccountApplyCostAll(ObjectUtil.toLong(record.get("official_account_apply_cost_all")));
         result.setOfficialAccountApplyCostDay(ObjectUtil.toLong(record.get("official_account_apply_cost_day")));
         result.setOfficialAccountApplyAmountTotal(ObjectUtil.toLong(record.get("official_account_apply_amount_total")));
@@ -1429,8 +1431,8 @@ public class AdStatOfDayDWD implements Serializable {
         result.setOfficialAccountFirstDayOrderCountDay(ObjectUtil.toLong(record.get("official_account_first_day_order_count_day")));
         result.setOfficialAccountOrderUserCountTotal(ObjectUtil.toLong(record.get("official_account_order_user_count_total")));
         result.setOfficialAccountOrderUserCountDay(ObjectUtil.toLong(record.get("official_account_order_user_count_day")));
-        result.setOfficialAccountOrderRateAll(ObjectUtil.toDouble(record.get("official_account_order_rate_all")));
-        result.setOfficialAccountOrderRateDay(ObjectUtil.toDouble(record.get("official_account_order_rate_day")));
+        result.setOfficialAccountOrderRateAll(ObjectUtil.toDecimal(record.get("official_account_order_rate_all")));
+        result.setOfficialAccountOrderRateDay(ObjectUtil.toDecimal(record.get("official_account_order_rate_day")));
         result.setOfficialAccountOrderCostAll(ObjectUtil.toLong(record.get("official_account_order_cost_all")));
         result.setOfficialAccountOrderCostDay(ObjectUtil.toLong(record.get("official_account_order_cost_day")));
         result.setOfficialAccountOrderAmountTotal(ObjectUtil.toLong(record.get("official_account_order_amount_total")));
@@ -1462,68 +1464,68 @@ public class AdStatOfDayDWD implements Serializable {
         BeanUtils.copyProperties(lastReduce, result);
         result.setCreateTime(new Date());
         result.setStatDay(statDay);
-        result.setCostDeviationRateDay(0.0);
+        result.setCostDeviationRateDay(BigDecimal.ZERO);
         result.setCostDay(0L);
         result.setCompensationAmountDay(0L);
         result.setViewCountDay(0L);
         result.setThousandDisplayPriceDay(0L);
         result.setViewUserCountDay(0L);
-        result.setAvgViewPerUserDay(0.0);
+        result.setAvgViewPerUserDay(BigDecimal.ZERO);
         result.setValidClickCountDay(0L);
         result.setClickUserCountDay(0L);
-        result.setCtrDay(0.0);
+        result.setCtrDay(BigDecimal.ZERO);
         result.setCpcDay(0L);
         result.setValuableClickCountDay(0L);
-        result.setValuableClickRateDay(0.0);
+        result.setValuableClickRateDay(BigDecimal.ZERO);
         result.setValuableClickCostDay(0L);
         result.setConversionsCountDay(0L);
         result.setConversionsCostDay(0L);
-        result.setConversionsRateDay(0.0);
+        result.setConversionsRateDay(BigDecimal.ZERO);
         result.setDeepConversionsCountDay(0L);
         result.setDeepConversionsCostDay(0L);
-        result.setDeepConversionsRateDay(0.0);
+        result.setDeepConversionsRateDay(BigDecimal.ZERO);
         result.setKeyPageUvDay(0L);
         result.setOrderCountDay(0L);
         result.setFirstDayOrderCountDay(0L);
         result.setWebOrderCostDay(0L);
-        result.setOrderRateDay(0.0);
+        result.setOrderRateDay(BigDecimal.ZERO);
         result.setOrderAmountDay(0L);
         result.setFirstDayOrderAmountDay(0L);
         result.setOrderUnitPriceDay(0L);
-        result.setOrderRoiDay(0.0);
+        result.setOrderRoiDay(BigDecimal.ZERO);
         result.setSignInCountDay(0L);
         result.setAddWishlistCountDay(0L);
         result.setViewCommodityPageUvDay(0L);
         result.setPageReservationCountDay(0L);
         result.setLeadsPurchaseUvDay(0L);
         result.setLeadsPurchaseCostDay(0L);
-        result.setLeadsPurchaseRateDay(0.0);
+        result.setLeadsPurchaseRateDay(BigDecimal.ZERO);
         result.setScanFollowCountDay(0L);
         result.setWechatAppRegisterUvDay(0L);
         result.setWechatMinigameRegisterCostDay(0L);
-        result.setWechatMinigameRegisterRateDay(0.0);
-        result.setWechatMinigameArpuDay(0.0);
+        result.setWechatMinigameRegisterRateDay(BigDecimal.ZERO);
+        result.setWechatMinigameArpuDay(BigDecimal.ZERO);
         result.setWechatMinigameRetentionCountDay(0L);
         result.setWechatMinigameCheckoutCountDay(0L);
         result.setWechatMinigameCheckoutAmountDay(0L);
         result.setOfficialAccountFollowCountDay(0L);
         result.setOfficialAccountFollowCostDay(0L);
-        result.setOfficialAccountFollowRateDay(0.0);
+        result.setOfficialAccountFollowRateDay(BigDecimal.ZERO);
         result.setOfficialAccountRegisterUserCountDay(0L);
-        result.setOfficialAccountRegisterRateDay(0.0);
+        result.setOfficialAccountRegisterRateDay(BigDecimal.ZERO);
         result.setOfficialAccountRegisterCostDay(0L);
         result.setOfficialAccountRegisterAmountDay(0L);
         result.setOfficialAccountRegisterRoiDay(0L);
         result.setOfficialAccountApplyCountDay(0L);
         result.setOfficialAccountApplyUserCountDay(0L);
-        result.setOfficialAccountApplyRateDay(0.0);
+        result.setOfficialAccountApplyRateDay(BigDecimal.ZERO);
         result.setOfficialAccountApplyCostDay(0L);
         result.setOfficialAccountApplyAmountDay(0L);
         result.setOfficialAccountApplyRoiDay(0L);
         result.setOfficialAccountOrderCountDay(0L);
         result.setOfficialAccountFirstDayOrderCountDay(0L);
         result.setOfficialAccountOrderUserCountDay(0L);
-        result.setOfficialAccountOrderRateDay(0.0);
+        result.setOfficialAccountOrderRateDay(BigDecimal.ZERO);
         result.setOfficialAccountOrderCostDay(0L);
         result.setOfficialAccountOrderAmountDay(0L);
         result.setOfficialAccountFirstDayOrderAmountDay(0L);
@@ -1543,8 +1545,8 @@ public class AdStatOfDayDWD implements Serializable {
         BeanUtils.copyProperties(hourDWD, result);
         result.setViewUserCountTotal(0L);
         result.setViewUserCountDay(0L);
-        result.setAvgViewPerUserAll(0.0);
-        result.setAvgViewPerUserDay(0.0);
+        result.setAvgViewPerUserAll(BigDecimal.ZERO);
+        result.setAvgViewPerUserDay(BigDecimal.ZERO);
         result.setClickUserCountTotal(0L);
         result.setClickUserCountDay(0L);
         result.setKeyPageUvTotal(0L);
@@ -1559,8 +1561,8 @@ public class AdStatOfDayDWD implements Serializable {
         result.setLeadsPurchaseUvDay(0L);
         result.setLeadsPurchaseCostAll(0L);
         result.setLeadsPurchaseCostDay(0L);
-        result.setLeadsPurchaseRateAll(0.0);
-        result.setLeadsPurchaseRateDay(0.0);
+        result.setLeadsPurchaseRateAll(BigDecimal.ZERO);
+        result.setLeadsPurchaseRateDay(BigDecimal.ZERO);
         result.setOfficialAccountFollowCostAll(0L);
         result.setOfficialAccountFollowCostDay(0L);
         return result;
@@ -1605,11 +1607,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (costDeviationRateTotal == null) {
-            costDeviationRateTotal = 0.0;
+            costDeviationRateTotal = BigDecimal.ZERO;
         }
 
         if (costDeviationRateDay == null) {
-            costDeviationRateDay = 0.0;
+            costDeviationRateDay = BigDecimal.ZERO;
         }
 
         if (costTotal == null) {
@@ -1653,11 +1655,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (avgViewPerUserAll == null) {
-            avgViewPerUserAll = 0.0;
+            avgViewPerUserAll = BigDecimal.ZERO;
         }
 
         if (avgViewPerUserDay == null) {
-            avgViewPerUserDay = 0.0;
+            avgViewPerUserDay = BigDecimal.ZERO;
         }
 
         if (validClickCountTotal == null) {
@@ -1677,11 +1679,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (ctrAll == null) {
-            ctrAll = 0.0;
+            ctrAll = BigDecimal.ZERO;
         }
 
         if (ctrDay == null) {
-            ctrDay = 0.0;
+            ctrDay = BigDecimal.ZERO;
         }
 
         if (cpcAll == null) {
@@ -1701,11 +1703,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (valuableClickRateAll == null) {
-            valuableClickRateAll = 0.0;
+            valuableClickRateAll = BigDecimal.ZERO;
         }
 
         if (valuableClickRateDay == null) {
-            valuableClickRateDay = 0.0;
+            valuableClickRateDay = BigDecimal.ZERO;
         }
 
         if (valuableClickCostAll == null) {
@@ -1733,11 +1735,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (conversionsRateAll == null) {
-            conversionsRateAll = 0.0;
+            conversionsRateAll = BigDecimal.ZERO;
         }
 
         if (conversionsRateDay == null) {
-            conversionsRateDay = 0.0;
+            conversionsRateDay = BigDecimal.ZERO;
         }
 
         if (deepConversionsCountTotal == null) {
@@ -1757,11 +1759,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (deepConversionsRateAll == null) {
-            deepConversionsRateAll = 0.0;
+            deepConversionsRateAll = BigDecimal.ZERO;
         }
 
         if (deepConversionsRateDay == null) {
-            deepConversionsRateDay = 0.0;
+            deepConversionsRateDay = BigDecimal.ZERO;
         }
 
         if (keyPageUvTotal == null) {
@@ -1797,11 +1799,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (orderRateAll == null) {
-            orderRateAll = 0.0;
+            orderRateAll = BigDecimal.ZERO;
         }
 
         if (orderRateDay == null) {
-            orderRateDay = 0.0;
+            orderRateDay = BigDecimal.ZERO;
         }
 
         if (orderAmountTotal == null) {
@@ -1829,11 +1831,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (orderRoiAll == null) {
-            orderRoiAll = 0.0;
+            orderRoiAll = BigDecimal.ZERO;
         }
 
         if (orderRoiDay == null) {
-            orderRoiDay = 0.0;
+            orderRoiDay = BigDecimal.ZERO;
         }
 
         if (signInCountTotal == null) {
@@ -1885,11 +1887,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (leadsPurchaseRateAll == null) {
-            leadsPurchaseRateAll = 0.0;
+            leadsPurchaseRateAll = BigDecimal.ZERO;
         }
 
         if (leadsPurchaseRateDay == null) {
-            leadsPurchaseRateDay = 0.0;
+            leadsPurchaseRateDay = BigDecimal.ZERO;
         }
 
         if (scanFollowCountTotal == null) {
@@ -1917,19 +1919,19 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (wechatMinigameRegisterRateAll == null) {
-            wechatMinigameRegisterRateAll = 0.0;
+            wechatMinigameRegisterRateAll = BigDecimal.ZERO;
         }
 
         if (wechatMinigameRegisterRateDay == null) {
-            wechatMinigameRegisterRateDay = 0.0;
+            wechatMinigameRegisterRateDay = BigDecimal.ZERO;
         }
 
         if (wechatMinigameArpuAll == null) {
-            wechatMinigameArpuAll = 0.0;
+            wechatMinigameArpuAll = BigDecimal.ZERO;
         }
 
         if (wechatMinigameArpuDay == null) {
-            wechatMinigameArpuDay = 0.0;
+            wechatMinigameArpuDay = BigDecimal.ZERO;
         }
 
         if (wechatMinigameRetentionCountTotal == null) {
@@ -1973,11 +1975,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (officialAccountFollowRateAll == null) {
-            officialAccountFollowRateAll = 0.0;
+            officialAccountFollowRateAll = BigDecimal.ZERO;
         }
 
         if (officialAccountFollowRateDay == null) {
-            officialAccountFollowRateDay = 0.0;
+            officialAccountFollowRateDay = BigDecimal.ZERO;
         }
 
         if (officialAccountRegisterUserCountTotal == null) {
@@ -1989,11 +1991,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (officialAccountRegisterRateAll == null) {
-            officialAccountRegisterRateAll = 0.0;
+            officialAccountRegisterRateAll = BigDecimal.ZERO;
         }
 
         if (officialAccountRegisterRateDay == null) {
-            officialAccountRegisterRateDay = 0.0;
+            officialAccountRegisterRateDay = BigDecimal.ZERO;
         }
 
         if (officialAccountRegisterCostAll == null) {
@@ -2037,11 +2039,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (officialAccountApplyRateAll == null) {
-            officialAccountApplyRateAll = 0.0;
+            officialAccountApplyRateAll = BigDecimal.ZERO;
         }
 
         if (officialAccountApplyRateDay == null) {
-            officialAccountApplyRateDay = 0.0;
+            officialAccountApplyRateDay = BigDecimal.ZERO;
         }
 
         if (officialAccountApplyCostAll == null) {
@@ -2093,11 +2095,11 @@ public class AdStatOfDayDWD implements Serializable {
         }
 
         if (officialAccountOrderRateAll == null) {
-            officialAccountOrderRateAll = 0.0;
+            officialAccountOrderRateAll = BigDecimal.ZERO;
         }
 
         if (officialAccountOrderRateDay == null) {
-            officialAccountOrderRateDay = 0.0;
+            officialAccountOrderRateDay = BigDecimal.ZERO;
         }
 
         if (officialAccountOrderCostAll == null) {

+ 206 - 203
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfHourDWD.java

@@ -6,10 +6,12 @@ import flink.zanxiangnet.ad.monitoring.maxcompute.bean.BeanUtil;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeColumn;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTable;
 import flink.zanxiangnet.ad.monitoring.util.DateUtil;
+import flink.zanxiangnet.ad.monitoring.util.NumberUtil;
 import flink.zanxiangnet.ad.monitoring.util.ObjectUtil;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.List;
@@ -86,19 +88,19 @@ public class AdStatOfHourDWD {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_total")
-    private Double costDeviationRateTotal;
+    private BigDecimal costDeviationRateTotal;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_day")
-    private Double costDeviationRateDay;
+    private BigDecimal costDeviationRateDay;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_hour")
-    private Double costDeviationRateHour;
+    private BigDecimal costDeviationRateHour;
 
     /**
      * 消耗
@@ -176,7 +178,7 @@ public class AdStatOfHourDWD {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_hour")
-    private Double avgViewPerUserHour;
+    private BigDecimal avgViewPerUserHour;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -200,19 +202,19 @@ public class AdStatOfHourDWD {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_all")
-    private Double ctrAll;
+    private BigDecimal ctrAll;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_day")
-    private Double ctrDay;
+    private BigDecimal ctrDay;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_hour")
-    private Double ctrHour;
+    private BigDecimal ctrHour;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -254,19 +256,19 @@ public class AdStatOfHourDWD {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_all")
-    private Double valuableClickRateAll;
+    private BigDecimal valuableClickRateAll;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_day")
-    private Double valuableClickRateDay;
+    private BigDecimal valuableClickRateDay;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_hour")
-    private Double valuableClickRateHour;
+    private BigDecimal valuableClickRateHour;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -326,19 +328,19 @@ public class AdStatOfHourDWD {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_all")
-    private Double conversionsRateAll;
+    private BigDecimal conversionsRateAll;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_day")
-    private Double conversionsRateDay;
+    private BigDecimal conversionsRateDay;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_hour")
-    private Double conversionsRateHour;
+    private BigDecimal conversionsRateHour;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -380,19 +382,19 @@ public class AdStatOfHourDWD {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_all")
-    private Double deepConversionsRateAll;
+    private BigDecimal deepConversionsRateAll;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_day")
-    private Double deepConversionsRateDay;
+    private BigDecimal deepConversionsRateDay;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_hour")
-    private Double deepConversionsRateHour;
+    private BigDecimal deepConversionsRateHour;
 
     /**
      * 下单量。用户通过该广告进行商品成交(如下单提交、在线支付)的次数。接入转化跟踪后可统计。
@@ -452,19 +454,19 @@ public class AdStatOfHourDWD {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_all")
-    private Double orderRateAll;
+    private BigDecimal orderRateAll;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_day")
-    private Double orderRateDay;
+    private BigDecimal orderRateDay;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_hour")
-    private Double orderRateHour;
+    private BigDecimal orderRateHour;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -524,19 +526,19 @@ public class AdStatOfHourDWD {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_all")
-    private Double orderRoiAll;
+    private BigDecimal orderRoiAll;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_day")
-    private Double orderRoiDay;
+    private BigDecimal orderRoiDay;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_hour")
-    private Double orderRoiHour;
+    private BigDecimal orderRoiHour;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -614,37 +616,37 @@ public class AdStatOfHourDWD {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_all")
-    private Double wechatMinigameRegisterRateAll;
+    private BigDecimal wechatMinigameRegisterRateAll;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_day")
-    private Double wechatMinigameRegisterRateDay;
+    private BigDecimal wechatMinigameRegisterRateDay;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_hour")
-    private Double wechatMinigameRegisterRateHour;
+    private BigDecimal wechatMinigameRegisterRateHour;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_all")
-    private Double wechatMinigameArpuAll;
+    private BigDecimal wechatMinigameArpuAll;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_day")
-    private Double wechatMinigameArpuDay;
+    private BigDecimal wechatMinigameArpuDay;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_hour")
-    private Double wechatMinigameArpuHour;
+    private BigDecimal wechatMinigameArpuHour;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -722,19 +724,19 @@ public class AdStatOfHourDWD {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_all")
-    private Double officialAccountFollowRateAll;
+    private BigDecimal officialAccountFollowRateAll;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_day")
-    private Double officialAccountFollowRateDay;
+    private BigDecimal officialAccountFollowRateDay;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_hour")
-    private Double officialAccountFollowRateHour;
+    private BigDecimal officialAccountFollowRateHour;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -758,19 +760,19 @@ public class AdStatOfHourDWD {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_all")
-    private Double officialAccountRegisterRateAll;
+    private BigDecimal officialAccountRegisterRateAll;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_day")
-    private Double officialAccountRegisterRateDay;
+    private BigDecimal officialAccountRegisterRateDay;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_hour")
-    private Double officialAccountRegisterRateHour;
+    private BigDecimal officialAccountRegisterRateHour;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -866,19 +868,19 @@ public class AdStatOfHourDWD {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_all")
-    private Double officialAccountApplyRateAll;
+    private BigDecimal officialAccountApplyRateAll;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_day")
-    private Double officialAccountApplyRateDay;
+    private BigDecimal officialAccountApplyRateDay;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_hour")
-    private Double officialAccountApplyRateHour;
+    private BigDecimal officialAccountApplyRateHour;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -992,19 +994,19 @@ public class AdStatOfHourDWD {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_all")
-    private Double officialAccountOrderRateAll;
+    private BigDecimal officialAccountOrderRateAll;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_day")
-    private Double officialAccountOrderRateDay;
+    private BigDecimal officialAccountOrderRateDay;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_hour")
-    private Double officialAccountOrderRateHour;
+    private BigDecimal officialAccountOrderRateHour;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1358,7 +1360,7 @@ public class AdStatOfHourDWD {
         result.setNoInterestCountHour(hourODS.getNoInterestCount());
 
         // 聚合天数据
-        result.setCostDeviationRateDay(0.0);
+        result.setCostDeviationRateDay(BigDecimal.ZERO);
         result.setCostDay(0L);
         result.setCompensationAmountDay(0L);
         result.setViewCountDay(0L);
@@ -1395,7 +1397,7 @@ public class AdStatOfHourDWD {
         result.setForwardUserCountDay(0L);
         result.setNoInterestCountDay(0L);
         for (AdDataOfHourODS ods : hourODSList) {
-            result.setCostDeviationRateDay(result.getCostDeviationRateDay() + ods.getCostDeviationRate());
+            result.setCostDeviationRateDay(result.getCostDeviationRateDay().add(ods.getCostDeviationRate()));
             result.setCostDay(result.getCostDay() + ods.getCost());
             result.setCompensationAmountDay(result.getCompensationAmountDay() + ods.getCompensationAmount());
             result.setViewCountDay(result.getViewCountDay() + ods.getViewCount());
@@ -1432,32 +1434,32 @@ public class AdStatOfHourDWD {
             result.setForwardUserCountDay(result.getForwardUserCountDay() + ods.getForwardUserCount());
             result.setNoInterestCountDay(result.getNoInterestCountDay() + ods.getNoInterestCount());
         }
-        result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0 : (result.getCostDay() / result.getViewCountDay() * 1000));
-        result.setCtrDay(result.getViewCountDay() == 0 ? 0.0 : result.getValidClickCountDay() / result.getViewCountDay());
-        result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValidClickCountDay());
-        result.setValuableClickRateDay(result.getViewCountDay() == 0 ? 0.0 : result.getValuableClickCountDay() / result.getViewCountDay());
-        result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValuableClickCountDay());
-        result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getConversionsCountDay());
-        result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getConversionsCountDay() / result.getValidClickCountDay());
-        result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getDeepConversionsCountDay());
-        result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? 0.0 : result.getDeepConversionsCountDay() / result.getValuableClickCountDay());
-        result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOrderCountDay());
-        result.setOrderRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOrderCountDay() / result.getValidClickCountDay());
-        result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : result.getOrderAmountDay() / result.getOrderCountDay());
-        result.setOrderRoiDay(result.getCostDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getCostDay());
-        result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : result.getCostDay() / result.getWechatAppRegisterUvDay());
-        result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getWechatAppRegisterUvDay() / result.getValidClickCountDay());
-        result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getWechatAppRegisterUvDay());
-        result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOfficialAccountFollowCountDay() / result.getValidClickCountDay());
-        result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountDay() / result.getOfficialAccountFollowCountDay());
-        result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountRegisterUserCountDay());
-        result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountRegisterAmountDay() / result.getCostDay());
-        result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountDay() / result.getOfficialAccountFollowCountDay());
-        result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountApplyUserCountDay());
-        result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountApplyAmountDay() / result.getCostDay());
-        result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountDay() / result.getOfficialAccountFollowCountDay());
-        result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountOrderCountDay());
-        result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountOrderAmountDay() / result.getCostDay());
+        result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0L : NumberUtil.divideForAd(result.getCostDay(), result.getViewCountDay()).multiply(new BigDecimal(1000)).longValue());
+        result.setCtrDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountDay(), result.getViewCountDay()));
+        result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValidClickCountDay()));
+        result.setValuableClickRateDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountDay(), result.getViewCountDay()));
+        result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValuableClickCountDay()));
+        result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getConversionsCountDay()));
+        result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountDay(), result.getValidClickCountDay()));
+        result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getDeepConversionsCountDay()));
+        result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountDay(), result.getValuableClickCountDay()));
+        result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0L : NumberUtil.divideForMoney(result.getCostDay(), result.getOrderCountDay()));
+        result.setOrderRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountDay(), result.getValidClickCountDay()));
+        result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountDay(), result.getOrderCountDay()));
+        result.setOrderRoiDay(result.getCostDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getCostDay()));
+        result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getWechatAppRegisterUvDay()));
+        result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvDay(), result.getValidClickCountDay()));
+        result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getWechatAppRegisterUvDay()));
+        result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountDay(), result.getValidClickCountDay()));
+        result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountDay(), result.getOfficialAccountFollowCountDay()));
+        result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountRegisterUserCountDay()));
+        result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountDay(), result.getCostDay()));
+        result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountDay(), result.getOfficialAccountFollowCountDay()));
+        result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountApplyUserCountDay()));
+        result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountDay(), result.getCostDay()));
+        result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountDay(), result.getOfficialAccountFollowCountDay()));
+        result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountOrderCountDay()));
+        result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountDay(), result.getCostDay()));
 
         // 聚合总数据
         if (yesterdayDWD == null) {
@@ -1524,88 +1526,34 @@ public class AdStatOfHourDWD {
             result.setForwardUserCountTotal(result.getForwardUserCountDay());
             result.setNoInterestCountTotal(result.getNoInterestCountDay());
         } else {
-            result.setCostDeviationRateTotal(yesterdayDWD.getCostDeviationRateTotal() + result.getCostDeviationRateDay());
+            result.setCostDeviationRateTotal(yesterdayDWD.getCostDeviationRateTotal().add(result.getCostDeviationRateDay()));
             result.setCostTotal(yesterdayDWD.getCostTotal() + result.getCostDay());
             result.setCompensationAmountTotal(yesterdayDWD.getCompensationAmountTotal() + result.getCompensationAmountDay());
             result.setViewCountTotal(yesterdayDWD.getViewCountTotal() + result.getViewCountDay());
-            // 总消耗 / 总曝光
-            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : (result.getCostTotal() / result.getViewCountTotal() * 1000));
-            // 曝光次数 / 曝光人数(拿不到曝光人数)
-            result.setValidClickCountTotal(yesterdayDWD.getValidClickCountTotal() + result.getValidClickCountDay());
-            // 广告点击次数 / 广告曝光次数
-            result.setCtrAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValidClickCountTotal() / result.getViewCountTotal());
-            // 广告花费/广告点击次数
-            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValidClickCountTotal());
             result.setValuableClickCountTotal(yesterdayDWD.getValuableClickCountTotal() + result.getValuableClickCountDay());
-            // 广告可转化点击次数/广告曝光次数
-            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValuableClickCountTotal() / result.getViewCountTotal());
-            // 广告花费/可转化点击次数
-            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValuableClickCountTotal());
             result.setConversionsCountTotal(yesterdayDWD.getConversionsCountTotal() + result.getConversionsCountDay());
-            // 广告花费/转化目标量
-            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getConversionsCountTotal());
-            // 公众号:转化目标量/点击次数。
-            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getConversionsCountTotal() / result.getValidClickCountTotal());
             result.setDeepConversionsCountTotal(yesterdayDWD.getDeepConversionsCountTotal() + result.getDeepConversionsCountDay());
-            // 广告花费/深度转化目标量
-            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getDeepConversionsCountTotal());
-            // 深度转化目标量/可转化点击次数
-            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? 0.0 : result.getDeepConversionsCountTotal() / result.getValuableClickCountTotal());
             result.setOrderCountTotal(yesterdayDWD.getOrderCountTotal() + result.getOrderCountDay());
             result.setFirstDayOrderCountTotal(yesterdayDWD.getFirstDayOrderCountTotal() + result.getFirstDayOrderCountDay());
-            // 广告花费/下单量
-            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOrderCountTotal());
-            // 下单量/点击次数
-            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOrderCountTotal() / result.getValidClickCountTotal());
             result.setOrderAmountTotal(yesterdayDWD.getOrderAmountTotal() + result.getOrderAmountDay());
             result.setFirstDayOrderAmountTotal(yesterdayDWD.getFirstDayOrderAmountTotal() + result.getFirstDayOrderAmountDay());
-            // 下单金额/下单量
-            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : result.getOrderAmountTotal() / result.getOrderCountTotal());
-            // 下单金额/广告花费
-            result.setOrderRoiAll(result.getCostTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getCostTotal());
             result.setSignInCountTotal(yesterdayDWD.getSignInCountTotal() + result.getSignInCountDay());
             result.setScanFollowCountTotal(yesterdayDWD.getScanFollowCountTotal() + result.getScanFollowCountDay());
             result.setWechatAppRegisterUvTotal(yesterdayDWD.getWechatAppRegisterUvTotal() + result.getWechatAppRegisterUvDay());
-            // 广告消耗 / 小游戏注册人数
-            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : result.getCostTotal() / result.getWechatAppRegisterUvTotal());
-            // 小游戏注册人数 / 广告点击次数
-            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getWechatAppRegisterUvTotal() / result.getValidClickCountTotal());
-            // 总收益 / 总人数
-            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameRetentionCountTotal(yesterdayDWD.getWechatMinigameRetentionCountTotal() + result.getWechatMinigameRetentionCountDay());
             result.setWechatMinigameCheckoutCountTotal(yesterdayDWD.getWechatMinigameCheckoutCountTotal() + result.getWechatMinigameCheckoutCountDay());
             result.setWechatMinigameCheckoutAmountTotal(yesterdayDWD.getWechatMinigameCheckoutAmountTotal() + result.getWechatMinigameCheckoutAmountDay());
             result.setOfficialAccountFollowCountTotal(yesterdayDWD.getOfficialAccountFollowCountTotal() + result.getOfficialAccountFollowCountDay());
-            // 关注次数 / 点击次数
-            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOfficialAccountFollowCountTotal() / result.getValidClickCountTotal());
             result.setOfficialAccountRegisterUserCountTotal(yesterdayDWD.getOfficialAccountRegisterUserCountTotal() + result.getOfficialAccountRegisterUserCountDay());
-            // 公众号内注册人数 / 公众号关注次数
-            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告消耗 / 广告注册人数
-            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountRegisterUserCountTotal());
             result.setOfficialAccountRegisterAmountTotal(yesterdayDWD.getOfficialAccountRegisterAmountTotal() + result.getOfficialAccountRegisterAmountDay());
-            // 注册产生的订单金额累计/广告花费
-            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountRegisterAmountTotal() / result.getCostTotal());
             result.setOfficialAccountApplyCountTotal(yesterdayDWD.getOfficialAccountApplyCountTotal() + result.getOfficialAccountApplyCountDay());
             result.setOfficialAccountApplyUserCountTotal(yesterdayDWD.getOfficialAccountApplyUserCountTotal() + result.getOfficialAccountApplyUserCountDay());
-            // 公众号内填单的独立用户数/公众号关注次数
-            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告花费/广告产生的填单行为数量
-            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountApplyUserCountTotal());
             result.setOfficialAccountApplyAmountTotal(yesterdayDWD.getOfficialAccountApplyAmountTotal() + result.getOfficialAccountApplyAmountDay());
-            // 填单产生的订单金额累计/广告花费
-            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountApplyAmountTotal() / result.getCostTotal());
             result.setOfficialAccountOrderCountTotal(yesterdayDWD.getOfficialAccountOrderCountTotal() + result.getOfficialAccountOrderCountDay());
             result.setOfficialAccountFirstDayOrderCountTotal(yesterdayDWD.getOfficialAccountFirstDayOrderCountTotal() + result.getOfficialAccountFirstDayOrderCountDay());
             result.setOfficialAccountOrderUserCountTotal(yesterdayDWD.getOfficialAccountOrderUserCountTotal() + result.getOfficialAccountOrderUserCountDay());
-            // 公众号内下单独立用户数(UV)/公众号关注次数
-            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告花费/广告产生的下单行为数量
-            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountOrderCountTotal());
             result.setOfficialAccountOrderAmountTotal(yesterdayDWD.getOfficialAccountOrderAmountTotal() + result.getOfficialAccountOrderAmountDay());
             result.setOfficialAccountFirstDayOrderAmountTotal(yesterdayDWD.getOfficialAccountFirstDayOrderAmountTotal() + result.getOfficialAccountFirstDayOrderAmountDay());
-            // 下单产生的订单金额累计/广告花费
-            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountOrderAmountTotal() / result.getCostTotal());
             result.setOfficialAccountConsultCountTotal(yesterdayDWD.getOfficialAccountConsultCountTotal() + result.getOfficialAccountConsultCountDay());
             result.setOfficialAccountReaderCountTotal(yesterdayDWD.getOfficialAccountReaderCountTotal() + result.getOfficialAccountReaderCountDay());
             result.setOfficialAccountCreditApplyUserCountTotal(yesterdayDWD.getOfficialAccountCreditApplyUserCountTotal() + result.getOfficialAccountCreditApplyUserCountDay());
@@ -1613,6 +1561,61 @@ public class AdStatOfHourDWD {
             result.setForwardCountTotal(yesterdayDWD.getForwardCountTotal() + result.getForwardCountDay());
             result.setForwardUserCountTotal(yesterdayDWD.getForwardUserCountTotal() + result.getForwardUserCountDay());
             result.setNoInterestCountTotal(yesterdayDWD.getNoInterestCountTotal() + result.getNoInterestCountDay());
+
+            // 总消耗, 总曝光
+            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0L : NumberUtil.divideForAd(result.getCostTotal(), result.getViewCountTotal()).multiply(new BigDecimal(1000)).longValue());
+            // 曝光次数, 曝光人数(拿不到曝光人数)
+            result.setValidClickCountTotal(yesterdayDWD.getValidClickCountTotal() + result.getValidClickCountDay());
+            // 广告点击次数, 广告曝光次数
+            result.setCtrAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/广告点击次数
+            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValidClickCountTotal()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/转化目标量
+            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getConversionsCountTotal()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountTotal(), result.getValidClickCountTotal()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getDeepConversionsCountTotal()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/下单量
+            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOrderCountTotal()));
+            // 下单量/点击次数
+            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountTotal(), result.getValidClickCountTotal()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountTotal(), result.getOrderCountTotal()));
+            // 下单金额/广告花费
+            result.setOrderRoiAll(result.getCostTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getCostTotal()));
+            // 广告消耗, 小游戏注册人数
+            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getWechatAppRegisterUvTotal()));
+            // 小游戏注册人数, 广告点击次数
+            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvTotal(), result.getValidClickCountTotal()));
+            // 总收益, 总人数
+            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getWechatAppRegisterUvTotal()));
+            // 关注次数, 点击次数
+            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountTotal(), result.getValidClickCountTotal()));
+            // 公众号内注册人数, 公众号关注次数
+            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告消耗, 广告注册人数
+            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountRegisterUserCountTotal()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountTotal(), result.getCostTotal()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountApplyUserCountTotal()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountTotal(), result.getCostTotal()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountOrderCountTotal()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountTotal(), result.getCostTotal()));
         }
         return result;
     }
@@ -1629,9 +1632,9 @@ public class AdStatOfHourDWD {
         result.setAdgroupId(ObjectUtil.toLong(record.get("adgroup_id")));
         result.setAdId(ObjectUtil.toLong(record.get("ad_id")));
         result.setCreateTime(ObjectUtil.toDate(record.get("create_time")));
-        result.setCostDeviationRateTotal(ObjectUtil.toDouble(record.get("cost_deviation_rate_total")));
-        result.setCostDeviationRateDay(ObjectUtil.toDouble(record.get("cost_deviation_rate_day")));
-        result.setCostDeviationRateHour(ObjectUtil.toDouble(record.get("cost_deviation_rate_hour")));
+        result.setCostDeviationRateTotal(ObjectUtil.toDecimal(record.get("cost_deviation_rate_total")));
+        result.setCostDeviationRateDay(ObjectUtil.toDecimal(record.get("cost_deviation_rate_day")));
+        result.setCostDeviationRateHour(ObjectUtil.toDecimal(record.get("cost_deviation_rate_hour")));
         result.setCostTotal(ObjectUtil.toLong(record.get("cost_total")));
         result.setCostDay(ObjectUtil.toLong(record.get("cost_day")));
         result.setCostHour(ObjectUtil.toLong(record.get("cost_hour")));
@@ -1644,22 +1647,22 @@ public class AdStatOfHourDWD {
         result.setThousandDisplayPriceAll(ObjectUtil.toLong(record.get("thousand_display_price_all")));
         result.setThousandDisplayPriceDay(ObjectUtil.toLong(record.get("thousand_display_price_day")));
         result.setThousandDisplayPriceHour(ObjectUtil.toLong(record.get("thousand_display_price_hour")));
-        result.setAvgViewPerUserHour(ObjectUtil.toDouble(record.get("avg_view_per_user_hour")));
+        result.setAvgViewPerUserHour(ObjectUtil.toDecimal(record.get("avg_view_per_user_hour")));
         result.setValidClickCountTotal(ObjectUtil.toLong(record.get("valid_click_count_total")));
         result.setValidClickCountDay(ObjectUtil.toLong(record.get("valid_click_count_day")));
         result.setValidClickCountHour(ObjectUtil.toLong(record.get("valid_click_count_hour")));
-        result.setCtrAll(ObjectUtil.toDouble(record.get("ctr_all")));
-        result.setCtrDay(ObjectUtil.toDouble(record.get("ctr_day")));
-        result.setCtrHour(ObjectUtil.toDouble(record.get("ctr_hour")));
+        result.setCtrAll(ObjectUtil.toDecimal(record.get("ctr_all")));
+        result.setCtrDay(ObjectUtil.toDecimal(record.get("ctr_day")));
+        result.setCtrHour(ObjectUtil.toDecimal(record.get("ctr_hour")));
         result.setCpcAll(ObjectUtil.toLong(record.get("cpc_all")));
         result.setCpcDay(ObjectUtil.toLong(record.get("cpc_day")));
         result.setCpcHour(ObjectUtil.toLong(record.get("cpc_hour")));
         result.setValuableClickCountTotal(ObjectUtil.toLong(record.get("valuable_click_count_total")));
         result.setValuableClickCountDay(ObjectUtil.toLong(record.get("valuable_click_count_day")));
         result.setValuableClickCountHour(ObjectUtil.toLong(record.get("valuable_click_count_hour")));
-        result.setValuableClickRateAll(ObjectUtil.toDouble(record.get("valuable_click_rate_all")));
-        result.setValuableClickRateDay(ObjectUtil.toDouble(record.get("valuable_click_rate_day")));
-        result.setValuableClickRateHour(ObjectUtil.toDouble(record.get("valuable_click_rate_hour")));
+        result.setValuableClickRateAll(ObjectUtil.toDecimal(record.get("valuable_click_rate_all")));
+        result.setValuableClickRateDay(ObjectUtil.toDecimal(record.get("valuable_click_rate_day")));
+        result.setValuableClickRateHour(ObjectUtil.toDecimal(record.get("valuable_click_rate_hour")));
         result.setValuableClickCostAll(ObjectUtil.toLong(record.get("valuable_click_cost_all")));
         result.setValuableClickCostDay(ObjectUtil.toLong(record.get("valuable_click_cost_day")));
         result.setValuableClickCostHour(ObjectUtil.toLong(record.get("valuable_click_cost_hour")));
@@ -1669,18 +1672,18 @@ public class AdStatOfHourDWD {
         result.setConversionsCostAll(ObjectUtil.toLong(record.get("conversions_cost_all")));
         result.setConversionsCostDay(ObjectUtil.toLong(record.get("conversions_cost_day")));
         result.setConversionsCostHour(ObjectUtil.toLong(record.get("conversions_cost_hour")));
-        result.setConversionsRateAll(ObjectUtil.toDouble(record.get("conversions_rate_all")));
-        result.setConversionsRateDay(ObjectUtil.toDouble(record.get("conversions_rate_day")));
-        result.setConversionsRateHour(ObjectUtil.toDouble(record.get("conversions_rate_hour")));
+        result.setConversionsRateAll(ObjectUtil.toDecimal(record.get("conversions_rate_all")));
+        result.setConversionsRateDay(ObjectUtil.toDecimal(record.get("conversions_rate_day")));
+        result.setConversionsRateHour(ObjectUtil.toDecimal(record.get("conversions_rate_hour")));
         result.setDeepConversionsCountTotal(ObjectUtil.toLong(record.get("deep_conversions_count_total")));
         result.setDeepConversionsCountDay(ObjectUtil.toLong(record.get("deep_conversions_count_day")));
         result.setDeepConversionsCountHour(ObjectUtil.toLong(record.get("deep_conversions_count_hour")));
         result.setDeepConversionsCostAll(ObjectUtil.toLong(record.get("deep_conversions_cost_all")));
         result.setDeepConversionsCostDay(ObjectUtil.toLong(record.get("deep_conversions_cost_day")));
         result.setDeepConversionsCostHour(ObjectUtil.toLong(record.get("deep_conversions_cost_hour")));
-        result.setDeepConversionsRateAll(ObjectUtil.toDouble(record.get("deep_conversions_rate_all")));
-        result.setDeepConversionsRateDay(ObjectUtil.toDouble(record.get("deep_conversions_rate_day")));
-        result.setDeepConversionsRateHour(ObjectUtil.toDouble(record.get("deep_conversions_rate_hour")));
+        result.setDeepConversionsRateAll(ObjectUtil.toDecimal(record.get("deep_conversions_rate_all")));
+        result.setDeepConversionsRateDay(ObjectUtil.toDecimal(record.get("deep_conversions_rate_day")));
+        result.setDeepConversionsRateHour(ObjectUtil.toDecimal(record.get("deep_conversions_rate_hour")));
         result.setOrderCountTotal(ObjectUtil.toLong(record.get("order_count_total")));
         result.setOrderCountDay(ObjectUtil.toLong(record.get("order_count_day")));
         result.setOrderCountHour(ObjectUtil.toLong(record.get("order_count_hour")));
@@ -1690,9 +1693,9 @@ public class AdStatOfHourDWD {
         result.setWebOrderCostAll(ObjectUtil.toLong(record.get("web_order_cost_all")));
         result.setWebOrderCostDay(ObjectUtil.toLong(record.get("web_order_cost_day")));
         result.setWebOrderCostHour(ObjectUtil.toLong(record.get("web_order_cost_hour")));
-        result.setOrderRateAll(ObjectUtil.toDouble(record.get("order_rate_all")));
-        result.setOrderRateDay(ObjectUtil.toDouble(record.get("order_rate_day")));
-        result.setOrderRateHour(ObjectUtil.toDouble(record.get("order_rate_hour")));
+        result.setOrderRateAll(ObjectUtil.toDecimal(record.get("order_rate_all")));
+        result.setOrderRateDay(ObjectUtil.toDecimal(record.get("order_rate_day")));
+        result.setOrderRateHour(ObjectUtil.toDecimal(record.get("order_rate_hour")));
         result.setOrderAmountTotal(ObjectUtil.toLong(record.get("order_amount_total")));
         result.setOrderAmountDay(ObjectUtil.toLong(record.get("order_amount_day")));
         result.setOrderAmountHour(ObjectUtil.toLong(record.get("order_amount_hour")));
@@ -1702,9 +1705,9 @@ public class AdStatOfHourDWD {
         result.setOrderUnitPriceAll(ObjectUtil.toLong(record.get("order_unit_price_all")));
         result.setOrderUnitPriceDay(ObjectUtil.toLong(record.get("order_unit_price_day")));
         result.setOrderUnitPriceHour(ObjectUtil.toLong(record.get("order_unit_price_hour")));
-        result.setOrderRoiAll(ObjectUtil.toDouble(record.get("order_roi_all")));
-        result.setOrderRoiDay(ObjectUtil.toDouble(record.get("order_roi_day")));
-        result.setOrderRoiHour(ObjectUtil.toDouble(record.get("order_roi_hour")));
+        result.setOrderRoiAll(ObjectUtil.toDecimal(record.get("order_roi_all")));
+        result.setOrderRoiDay(ObjectUtil.toDecimal(record.get("order_roi_day")));
+        result.setOrderRoiHour(ObjectUtil.toDecimal(record.get("order_roi_hour")));
         result.setSignInCountTotal(ObjectUtil.toLong(record.get("sign_in_count_total")));
         result.setSignInCountDay(ObjectUtil.toLong(record.get("sign_in_count_day")));
         result.setSignInCountHour(ObjectUtil.toLong(record.get("sign_in_count_hour")));
@@ -1717,12 +1720,12 @@ public class AdStatOfHourDWD {
         result.setWechatMinigameRegisterCostAll(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_all")));
         result.setWechatMinigameRegisterCostDay(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_day")));
         result.setWechatMinigameRegisterCostHour(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_hour")));
-        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_all")));
-        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_day")));
-        result.setWechatMinigameRegisterRateHour(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_hour")));
-        result.setWechatMinigameArpuAll(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_all")));
-        result.setWechatMinigameArpuDay(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_day")));
-        result.setWechatMinigameArpuHour(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_hour")));
+        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_all")));
+        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_day")));
+        result.setWechatMinigameRegisterRateHour(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_hour")));
+        result.setWechatMinigameArpuAll(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_all")));
+        result.setWechatMinigameArpuDay(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_day")));
+        result.setWechatMinigameArpuHour(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_hour")));
         result.setWechatMinigameRetentionCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_total")));
         result.setWechatMinigameRetentionCountDay(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_day")));
         result.setWechatMinigameRetentionCountHour(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_hour")));
@@ -1735,15 +1738,15 @@ public class AdStatOfHourDWD {
         result.setOfficialAccountFollowCountTotal(ObjectUtil.toLong(record.get("official_account_follow_count_total")));
         result.setOfficialAccountFollowCountDay(ObjectUtil.toLong(record.get("official_account_follow_count_day")));
         result.setOfficialAccountFollowCountHour(ObjectUtil.toLong(record.get("official_account_follow_count_hour")));
-        result.setOfficialAccountFollowRateAll(ObjectUtil.toDouble(record.get("official_account_follow_rate_all")));
-        result.setOfficialAccountFollowRateDay(ObjectUtil.toDouble(record.get("official_account_follow_rate_day")));
-        result.setOfficialAccountFollowRateHour(ObjectUtil.toDouble(record.get("official_account_follow_rate_hour")));
+        result.setOfficialAccountFollowRateAll(ObjectUtil.toDecimal(record.get("official_account_follow_rate_all")));
+        result.setOfficialAccountFollowRateDay(ObjectUtil.toDecimal(record.get("official_account_follow_rate_day")));
+        result.setOfficialAccountFollowRateHour(ObjectUtil.toDecimal(record.get("official_account_follow_rate_hour")));
         result.setOfficialAccountRegisterUserCountTotal(ObjectUtil.toLong(record.get("official_account_register_user_count_total")));
         result.setOfficialAccountRegisterUserCountDay(ObjectUtil.toLong(record.get("official_account_register_user_count_day")));
         result.setOfficialAccountRegisterUserCountHour(ObjectUtil.toLong(record.get("official_account_register_user_count_hour")));
-        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDouble(record.get("official_account_register_rate_all")));
-        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDouble(record.get("official_account_register_rate_day")));
-        result.setOfficialAccountRegisterRateHour(ObjectUtil.toDouble(record.get("official_account_register_rate_hour")));
+        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDecimal(record.get("official_account_register_rate_all")));
+        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDecimal(record.get("official_account_register_rate_day")));
+        result.setOfficialAccountRegisterRateHour(ObjectUtil.toDecimal(record.get("official_account_register_rate_hour")));
         result.setOfficialAccountRegisterCostAll(ObjectUtil.toLong(record.get("official_account_register_cost_all")));
         result.setOfficialAccountRegisterCostDay(ObjectUtil.toLong(record.get("official_account_register_cost_day")));
         result.setOfficialAccountRegisterCostHour(ObjectUtil.toLong(record.get("official_account_register_cost_hour")));
@@ -1759,9 +1762,9 @@ public class AdStatOfHourDWD {
         result.setOfficialAccountApplyUserCountTotal(ObjectUtil.toLong(record.get("official_account_apply_user_count_total")));
         result.setOfficialAccountApplyUserCountDay(ObjectUtil.toLong(record.get("official_account_apply_user_count_day")));
         result.setOfficialAccountApplyUserCountHour(ObjectUtil.toLong(record.get("official_account_apply_user_count_hour")));
-        result.setOfficialAccountApplyRateAll(ObjectUtil.toDouble(record.get("official_account_apply_rate_all")));
-        result.setOfficialAccountApplyRateDay(ObjectUtil.toDouble(record.get("official_account_apply_rate_day")));
-        result.setOfficialAccountApplyRateHour(ObjectUtil.toDouble(record.get("official_account_apply_rate_hour")));
+        result.setOfficialAccountApplyRateAll(ObjectUtil.toDecimal(record.get("official_account_apply_rate_all")));
+        result.setOfficialAccountApplyRateDay(ObjectUtil.toDecimal(record.get("official_account_apply_rate_day")));
+        result.setOfficialAccountApplyRateHour(ObjectUtil.toDecimal(record.get("official_account_apply_rate_hour")));
         result.setOfficialAccountApplyCostAll(ObjectUtil.toLong(record.get("official_account_apply_cost_all")));
         result.setOfficialAccountApplyCostDay(ObjectUtil.toLong(record.get("official_account_apply_cost_day")));
         result.setOfficialAccountApplyCostHour(ObjectUtil.toLong(record.get("official_account_apply_cost_hour")));
@@ -1780,9 +1783,9 @@ public class AdStatOfHourDWD {
         result.setOfficialAccountOrderUserCountTotal(ObjectUtil.toLong(record.get("official_account_order_user_count_total")));
         result.setOfficialAccountOrderUserCountDay(ObjectUtil.toLong(record.get("official_account_order_user_count_day")));
         result.setOfficialAccountOrderUserCountHour(ObjectUtil.toLong(record.get("official_account_order_user_count_hour")));
-        result.setOfficialAccountOrderRateAll(ObjectUtil.toDouble(record.get("official_account_order_rate_all")));
-        result.setOfficialAccountOrderRateDay(ObjectUtil.toDouble(record.get("official_account_order_rate_day")));
-        result.setOfficialAccountOrderRateHour(ObjectUtil.toDouble(record.get("official_account_order_rate_hour")));
+        result.setOfficialAccountOrderRateAll(ObjectUtil.toDecimal(record.get("official_account_order_rate_all")));
+        result.setOfficialAccountOrderRateDay(ObjectUtil.toDecimal(record.get("official_account_order_rate_day")));
+        result.setOfficialAccountOrderRateHour(ObjectUtil.toDecimal(record.get("official_account_order_rate_hour")));
         result.setOfficialAccountOrderCostAll(ObjectUtil.toLong(record.get("official_account_order_cost_all")));
         result.setOfficialAccountOrderCostDay(ObjectUtil.toLong(record.get("official_account_order_cost_day")));
         result.setOfficialAccountOrderCostHour(ObjectUtil.toLong(record.get("official_account_order_cost_hour")));
@@ -1961,9 +1964,9 @@ public class AdStatOfHourDWD {
     }
 
     public static void initValue(AdStatOfHourDWD bean) {
-        bean.setCostDeviationRateTotal(0.0);
-        bean.setCostDeviationRateDay(0.0);
-        bean.setCostDeviationRateHour(0.0);
+        bean.setCostDeviationRateTotal(BigDecimal.ZERO);
+        bean.setCostDeviationRateDay(BigDecimal.ZERO);
+        bean.setCostDeviationRateHour(BigDecimal.ZERO);
         bean.setCostTotal(0L);
         bean.setCostDay(0L);
         bean.setCostHour(0L);
@@ -1976,22 +1979,22 @@ public class AdStatOfHourDWD {
         bean.setThousandDisplayPriceAll(0L);
         bean.setThousandDisplayPriceDay(0L);
         bean.setThousandDisplayPriceHour(0L);
-        bean.setAvgViewPerUserHour(0.0);
+        bean.setAvgViewPerUserHour(BigDecimal.ZERO);
         bean.setValidClickCountTotal(0L);
         bean.setValidClickCountDay(0L);
         bean.setValidClickCountHour(0L);
-        bean.setCtrAll(0.0);
-        bean.setCtrDay(0.0);
-        bean.setCtrHour(0.0);
+        bean.setCtrAll(BigDecimal.ZERO);
+        bean.setCtrDay(BigDecimal.ZERO);
+        bean.setCtrHour(BigDecimal.ZERO);
         bean.setCpcAll(0L);
         bean.setCpcDay(0L);
         bean.setCpcHour(0L);
         bean.setValuableClickCountTotal(0L);
         bean.setValuableClickCountDay(0L);
         bean.setValuableClickCountHour(0L);
-        bean.setValuableClickRateAll(0.0);
-        bean.setValuableClickRateDay(0.0);
-        bean.setValuableClickRateHour(0.0);
+        bean.setValuableClickRateAll(BigDecimal.ZERO);
+        bean.setValuableClickRateDay(BigDecimal.ZERO);
+        bean.setValuableClickRateHour(BigDecimal.ZERO);
         bean.setValuableClickCostAll(0L);
         bean.setValuableClickCostDay(0L);
         bean.setValuableClickCostHour(0L);
@@ -2001,18 +2004,18 @@ public class AdStatOfHourDWD {
         bean.setConversionsCostAll(0L);
         bean.setConversionsCostDay(0L);
         bean.setConversionsCostHour(0L);
-        bean.setConversionsRateAll(0.0);
-        bean.setConversionsRateDay(0.0);
-        bean.setConversionsRateHour(0.0);
+        bean.setConversionsRateAll(BigDecimal.ZERO);
+        bean.setConversionsRateDay(BigDecimal.ZERO);
+        bean.setConversionsRateHour(BigDecimal.ZERO);
         bean.setDeepConversionsCountTotal(0L);
         bean.setDeepConversionsCountDay(0L);
         bean.setDeepConversionsCountHour(0L);
         bean.setDeepConversionsCostAll(0L);
         bean.setDeepConversionsCostDay(0L);
         bean.setDeepConversionsCostHour(0L);
-        bean.setDeepConversionsRateAll(0.0);
-        bean.setDeepConversionsRateDay(0.0);
-        bean.setDeepConversionsRateHour(0.0);
+        bean.setDeepConversionsRateAll(BigDecimal.ZERO);
+        bean.setDeepConversionsRateDay(BigDecimal.ZERO);
+        bean.setDeepConversionsRateHour(BigDecimal.ZERO);
         bean.setOrderCountTotal(0L);
         bean.setOrderCountDay(0L);
         bean.setOrderCountHour(0L);
@@ -2022,9 +2025,9 @@ public class AdStatOfHourDWD {
         bean.setWebOrderCostAll(0L);
         bean.setWebOrderCostDay(0L);
         bean.setWebOrderCostHour(0L);
-        bean.setOrderRateAll(0.0);
-        bean.setOrderRateDay(0.0);
-        bean.setOrderRateHour(0.0);
+        bean.setOrderRateAll(BigDecimal.ZERO);
+        bean.setOrderRateDay(BigDecimal.ZERO);
+        bean.setOrderRateHour(BigDecimal.ZERO);
         bean.setOrderAmountTotal(0L);
         bean.setOrderAmountDay(0L);
         bean.setOrderAmountHour(0L);
@@ -2034,9 +2037,9 @@ public class AdStatOfHourDWD {
         bean.setOrderUnitPriceAll(0L);
         bean.setOrderUnitPriceDay(0L);
         bean.setOrderUnitPriceHour(0L);
-        bean.setOrderRoiAll(0.0);
-        bean.setOrderRoiDay(0.0);
-        bean.setOrderRoiHour(0.0);
+        bean.setOrderRoiAll(BigDecimal.ZERO);
+        bean.setOrderRoiDay(BigDecimal.ZERO);
+        bean.setOrderRoiHour(BigDecimal.ZERO);
         bean.setSignInCountTotal(0L);
         bean.setSignInCountDay(0L);
         bean.setSignInCountHour(0L);
@@ -2049,12 +2052,12 @@ public class AdStatOfHourDWD {
         bean.setWechatMinigameRegisterCostAll(0L);
         bean.setWechatMinigameRegisterCostDay(0L);
         bean.setWechatMinigameRegisterCostHour(0L);
-        bean.setWechatMinigameRegisterRateAll(0.0);
-        bean.setWechatMinigameRegisterRateDay(0.0);
-        bean.setWechatMinigameRegisterRateHour(0.0);
-        bean.setWechatMinigameArpuAll(0.0);
-        bean.setWechatMinigameArpuDay(0.0);
-        bean.setWechatMinigameArpuHour(0.0);
+        bean.setWechatMinigameRegisterRateAll(BigDecimal.ZERO);
+        bean.setWechatMinigameRegisterRateDay(BigDecimal.ZERO);
+        bean.setWechatMinigameRegisterRateHour(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuAll(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuDay(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuHour(BigDecimal.ZERO);
         bean.setWechatMinigameRetentionCountTotal(0L);
         bean.setWechatMinigameRetentionCountDay(0L);
         bean.setWechatMinigameRetentionCountHour(0L);
@@ -2067,15 +2070,15 @@ public class AdStatOfHourDWD {
         bean.setOfficialAccountFollowCountTotal(0L);
         bean.setOfficialAccountFollowCountDay(0L);
         bean.setOfficialAccountFollowCountHour(0L);
-        bean.setOfficialAccountFollowRateAll(0.0);
-        bean.setOfficialAccountFollowRateDay(0.0);
-        bean.setOfficialAccountFollowRateHour(0.0);
+        bean.setOfficialAccountFollowRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountFollowRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountFollowRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountRegisterUserCountTotal(0L);
         bean.setOfficialAccountRegisterUserCountDay(0L);
         bean.setOfficialAccountRegisterUserCountHour(0L);
-        bean.setOfficialAccountRegisterRateAll(0.0);
-        bean.setOfficialAccountRegisterRateDay(0.0);
-        bean.setOfficialAccountRegisterRateHour(0.0);
+        bean.setOfficialAccountRegisterRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountRegisterRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountRegisterRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountRegisterCostAll(0L);
         bean.setOfficialAccountRegisterCostDay(0L);
         bean.setOfficialAccountRegisterCostHour(0L);
@@ -2091,9 +2094,9 @@ public class AdStatOfHourDWD {
         bean.setOfficialAccountApplyUserCountTotal(0L);
         bean.setOfficialAccountApplyUserCountDay(0L);
         bean.setOfficialAccountApplyUserCountHour(0L);
-        bean.setOfficialAccountApplyRateAll(0.0);
-        bean.setOfficialAccountApplyRateDay(0.0);
-        bean.setOfficialAccountApplyRateHour(0.0);
+        bean.setOfficialAccountApplyRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountApplyRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountApplyRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountApplyCostAll(0L);
         bean.setOfficialAccountApplyCostDay(0L);
         bean.setOfficialAccountApplyCostHour(0L);
@@ -2112,9 +2115,9 @@ public class AdStatOfHourDWD {
         bean.setOfficialAccountOrderUserCountTotal(0L);
         bean.setOfficialAccountOrderUserCountDay(0L);
         bean.setOfficialAccountOrderUserCountHour(0L);
-        bean.setOfficialAccountOrderRateAll(0.0);
-        bean.setOfficialAccountOrderRateDay(0.0);
-        bean.setOfficialAccountOrderRateHour(0.0);
+        bean.setOfficialAccountOrderRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountOrderRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountOrderRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountOrderCostAll(0L);
         bean.setOfficialAccountOrderCostDay(0L);
         bean.setOfficialAccountOrderCostHour(0L);

File diff suppressed because it is too large
+ 233 - 206
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/AdStatOfMinuteDWD.java


+ 124 - 121
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfDayDWD.java

@@ -4,12 +4,14 @@ import com.aliyun.odps.data.Record;
 import com.google.gson.annotations.SerializedName;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeColumn;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTable;
+import flink.zanxiangnet.ad.monitoring.util.NumberUtil;
 import flink.zanxiangnet.ad.monitoring.util.ObjectUtil;
 import flink.zanxiangnet.ad.monitoring.util.PlanUtil;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.*;
 
 @Data
@@ -90,13 +92,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_total")
-    private Double costDeviationRateTotal;
+    private BigDecimal costDeviationRateTotal;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_day")
-    private Double costDeviationRateDay;
+    private BigDecimal costDeviationRateDay;
 
     /**
      * 消耗
@@ -162,13 +164,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_all")
-    private Double avgViewPerUserAll;
+    private BigDecimal avgViewPerUserAll;
 
     /**
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_day")
-    private Double avgViewPerUserDay;
+    private BigDecimal avgViewPerUserDay;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -198,13 +200,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_all")
-    private Double ctrAll;
+    private BigDecimal ctrAll;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_day")
-    private Double ctrDay;
+    private BigDecimal ctrDay;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -234,13 +236,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_all")
-    private Double valuableClickRateAll;
+    private BigDecimal valuableClickRateAll;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_day")
-    private Double valuableClickRateDay;
+    private BigDecimal valuableClickRateDay;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -282,13 +284,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_all")
-    private Double conversionsRateAll;
+    private BigDecimal conversionsRateAll;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_day")
-    private Double conversionsRateDay;
+    private BigDecimal conversionsRateDay;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -318,13 +320,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_all")
-    private Double deepConversionsRateAll;
+    private BigDecimal deepConversionsRateAll;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_day")
-    private Double deepConversionsRateDay;
+    private BigDecimal deepConversionsRateDay;
 
     /**
      * 关键页面访问人数。点击广告原生落地页的APP跳转按钮,并到达APP内关键页面的独立用户数。接入转化跟踪后可统计。
@@ -378,13 +380,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_all")
-    private Double orderRateAll;
+    private BigDecimal orderRateAll;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_day")
-    private Double orderRateDay;
+    private BigDecimal orderRateDay;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -426,13 +428,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_all")
-    private Double orderRoiAll;
+    private BigDecimal orderRoiAll;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_day")
-    private Double orderRoiDay;
+    private BigDecimal orderRoiDay;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -510,13 +512,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 首次付费转化率(人数)。一次点击到产生一个首次付费用户的转化率(原付费销售线索转化率)。H5推广需接入转化跟踪后可统计。
      */
     @SerializedName("leads_purchase_rate_all")
-    private Double leadsPurchaseRateAll;
+    private BigDecimal leadsPurchaseRateAll;
 
     /**
      * 首次付费转化率(人数)。一次点击到产生一个首次付费用户的转化率(原付费销售线索转化率)。H5推广需接入转化跟踪后可统计。
      */
     @SerializedName("leads_purchase_rate_day")
-    private Double leadsPurchaseRateDay;
+    private BigDecimal leadsPurchaseRateDay;
 
     /**
      * 加企业微信客服人数。添加企业微信好友成功的独立用户数。
@@ -558,25 +560,25 @@ public class PlanStatOfDayDWD implements Serializable {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_all")
-    private Double wechatMinigameRegisterRateAll;
+    private BigDecimal wechatMinigameRegisterRateAll;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_day")
-    private Double wechatMinigameRegisterRateDay;
+    private BigDecimal wechatMinigameRegisterRateDay;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_all")
-    private Double wechatMinigameArpuAll;
+    private BigDecimal wechatMinigameArpuAll;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_day")
-    private Double wechatMinigameArpuDay;
+    private BigDecimal wechatMinigameArpuDay;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -642,13 +644,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_all")
-    private Double officialAccountFollowRateAll;
+    private BigDecimal officialAccountFollowRateAll;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_day")
-    private Double officialAccountFollowRateDay;
+    private BigDecimal officialAccountFollowRateDay;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -666,13 +668,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_all")
-    private Double officialAccountRegisterRateAll;
+    private BigDecimal officialAccountRegisterRateAll;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_day")
-    private Double officialAccountRegisterRateDay;
+    private BigDecimal officialAccountRegisterRateDay;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -738,13 +740,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_all")
-    private Double officialAccountApplyRateAll;
+    private BigDecimal officialAccountApplyRateAll;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_day")
-    private Double officialAccountApplyRateDay;
+    private BigDecimal officialAccountApplyRateDay;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -822,13 +824,13 @@ public class PlanStatOfDayDWD implements Serializable {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_all")
-    private Double officialAccountOrderRateAll;
+    private BigDecimal officialAccountOrderRateAll;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_day")
-    private Double officialAccountOrderRateDay;
+    private BigDecimal officialAccountOrderRateDay;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1141,7 +1143,7 @@ public class PlanStatOfDayDWD implements Serializable {
             result.getAdIds().add(value2.getAdId());
             result.setAdIdsStr(PlanUtil.adIdsStr(result.getAdIds()));
 
-            result.setCostDeviationRateTotal(value1.getCostDeviationRateTotal() + value2.getCostDeviationRate());
+            result.setCostDeviationRateTotal(value1.getCostDeviationRateTotal().add(value2.getCostDeviationRate()));
             result.setCostDeviationRateDay(value2.getCostDeviationRate());
             result.setCostTotal(value1.getCostTotal() + value2.getCost());
             result.setCostDay(value2.getCost());
@@ -1149,15 +1151,11 @@ public class PlanStatOfDayDWD implements Serializable {
             result.setCompensationAmountDay(value2.getCompensationAmount());
             result.setViewCountTotal(value1.getViewCountTotal() + value2.getViewCount());
             result.setViewCountDay(value2.getViewCount());
-            // 总消耗 / 总曝光
-            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : (result.getCostTotal() / result.getViewCountTotal() * 1000));
             result.setThousandDisplayPriceDay(value2.getThousandDisplayPrice());
 
             // 应该不准,因为跨天的用户无法去重
             result.setViewUserCountTotal(value1.getViewUserCountTotal() + value2.getViewUserCount());
             result.setViewUserCountDay(value2.getViewUserCount());
-            // 曝光次数 / 曝光人数(不准)
-            result.setAvgViewPerUserAll(result.getViewUserCountTotal() == 0 ? 0.0 : result.getViewCountTotal() / result.getViewUserCountTotal());
             result.setAvgViewPerUserDay(value2.getAvgViewPerUser());
             result.setValidClickCountTotal(value1.getValidClickCountTotal() + value2.getValidClickCount());
             result.setValidClickCountDay(value2.getValidClickCount());
@@ -1165,35 +1163,19 @@ public class PlanStatOfDayDWD implements Serializable {
             // 应该不准,因为跨天的用户无法去重
             result.setClickUserCountTotal(value1.getClickUserCountTotal() + value2.getClickUserCount());
             result.setClickUserCountDay(value2.getClickUserCount());
-            // 广告点击次数 / 广告曝光次数
-            result.setCtrAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValidClickCountTotal() / result.getViewCountTotal());
             result.setCtrDay(value2.getCtr());
-            // 广告花费/广告点击次数
-            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValidClickCountTotal());
             result.setCpcDay(value2.getCpc());
             result.setValuableClickCountTotal(value1.getValuableClickCountTotal() + value2.getValuableClickCount());
             result.setValuableClickCountDay(value2.getValuableClickCount());
-            // 广告可转化点击次数/广告曝光次数
-            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValuableClickCountTotal() / result.getViewCountTotal());
             result.setValuableClickRateDay(value2.getValuableClickRate());
-            // 广告花费/可转化点击次数
-            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValuableClickCountTotal());
             result.setValuableClickCostDay(value2.getValuableClickCost());
             result.setConversionsCountTotal(value1.getConversionsCountTotal() + value2.getConversionsCount());
             result.setConversionsCountDay(value2.getConversionsCount());
-            // 广告花费/转化目标量
-            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getConversionsCountTotal());
             result.setConversionsCostDay(value2.getConversionsCost());
-            // 公众号:转化目标量/点击次数。
-            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getConversionsCountTotal() / result.getValidClickCountTotal());
             result.setConversionsRateDay(value2.getConversionsRate());
             result.setDeepConversionsCountTotal(value1.getDeepConversionsCountTotal() + value2.getDeepConversionsCount());
             result.setDeepConversionsCountDay(value2.getDeepConversionsCount());
-            // 广告花费/深度转化目标量
-            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getDeepConversionsCountTotal());
             result.setDeepConversionsCostDay(value2.getDeepConversionsCost());
-            // 深度转化目标量/可转化点击次数
-            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? 0.0 : result.getDeepConversionsCountTotal() / result.getValuableClickCountTotal());
             result.setDeepConversionsRateDay(value2.getDeepConversionsRate());
             result.setKeyPageUvTotal(value1.getKeyPageUvTotal() + value2.getKeyPageUv());
             result.setKeyPageUvDay(value2.getKeyPageUv());
@@ -1201,21 +1183,13 @@ public class PlanStatOfDayDWD implements Serializable {
             result.setOrderCountDay(value2.getOrderCount());
             result.setFirstDayOrderCountTotal(value1.getFirstDayOrderCountTotal() + value2.getFirstDayOrderCount());
             result.setFirstDayOrderCountDay(value2.getFirstDayOrderCount());
-            // 广告花费/下单量
-            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOrderCountTotal());
             result.setWebOrderCostDay(value2.getWebOrderCost());
-            // 下单量/点击次数
-            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOrderCountTotal() / result.getValidClickCountTotal());
             result.setOrderRateDay(value2.getOrderRate());
             result.setOrderAmountTotal(value1.getOrderAmountTotal() + value2.getOrderAmount());
             result.setOrderAmountDay(value2.getOrderAmount());
             result.setFirstDayOrderAmountTotal(value1.getFirstDayOrderAmountTotal() + value2.getFirstDayOrderAmount());
             result.setFirstDayOrderAmountDay(value2.getFirstDayOrderAmount());
-            // 下单金额/下单量
-            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : result.getOrderAmountTotal() / result.getOrderCountTotal());
             result.setOrderUnitPriceDay(value2.getOrderUnitPrice());
-            // 下单金额/广告花费
-            result.setOrderRoiAll(result.getCostTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getCostTotal());
             result.setOrderRoiDay(value2.getOrderRoi());
             result.setSignInCountTotal(value1.getSignInCountTotal() + value2.getSignInCount());
             result.setSignInCountDay(value2.getSignInCount());
@@ -1229,24 +1203,14 @@ public class PlanStatOfDayDWD implements Serializable {
             // 应该不准,因为跨天的用户无法去重
             result.setLeadsPurchaseUvTotal(value1.getLeadsPurchaseUvTotal() + value2.getLeadsPurchaseUv());
             result.setLeadsPurchaseUvDay(value2.getLeadsPurchaseUv());
-            // 广告消耗/首次付费人数
-            result.setLeadsPurchaseCostAll(result.getLeadsPurchaseUvTotal() == 0 ? 0 : result.getCostTotal() / result.getLeadsPurchaseUvTotal());
             result.setLeadsPurchaseCostDay(value2.getLeadsPurchaseCost());
-            // 首次付费人数/广告点击次数
-            result.setLeadsPurchaseRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getLeadsPurchaseUvTotal() / result.getValidClickCountTotal());
             result.setLeadsPurchaseRateDay(value2.getLeadsPurchaseRate());
             result.setScanFollowCountTotal(value1.getScanFollowCountTotal() + value2.getScanFollowCount());
             result.setScanFollowCountDay(value2.getScanFollowCount());
             result.setWechatAppRegisterUvTotal(value1.getWechatAppRegisterUvTotal() + value2.getWechatAppRegisterUv());
             result.setWechatAppRegisterUvDay(value2.getWechatAppRegisterUv());
-            // 广告消耗 / 小游戏注册人数
-            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : result.getCostTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameRegisterCostDay(value2.getWechatMinigameRegisterCost());
-            // 小游戏注册人数 / 广告点击次数
-            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getWechatAppRegisterUvTotal() / result.getValidClickCountTotal());
             result.setWechatMinigameRegisterRateDay(value2.getWechatMinigameRegisterRate());
-            // 总收益 / 总人数
-            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameArpuDay(value2.getWechatMinigameArpu());
             result.setWechatMinigameRetentionCountTotal(value1.getWechatMinigameRetentionCountTotal() + value2.getWechatMinigameRetentionCount());
             result.setWechatMinigameRetentionCountDay(value2.getWechatMinigameRetentionCount());
@@ -1256,39 +1220,23 @@ public class PlanStatOfDayDWD implements Serializable {
             result.setWechatMinigameCheckoutAmountDay(value2.getWechatMinigameCheckoutAmount());
             result.setOfficialAccountFollowCountTotal(value1.getOfficialAccountFollowCountTotal() + value2.getOfficialAccountFollowCount());
             result.setOfficialAccountFollowCountDay(value2.getOfficialAccountFollowCount());
-            // 广告消耗 / 关注次数
-            result.setOfficialAccountFollowCostAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountFollowCostDay(value2.getOfficialAccountFollowCost());
-            // 关注次数 / 点击次数
-            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOfficialAccountFollowCountTotal() / result.getValidClickCountTotal());
             result.setOfficialAccountFollowRateDay(value2.getOfficialAccountFollowRate());
             result.setOfficialAccountRegisterUserCountTotal(value1.getOfficialAccountRegisterUserCountTotal() + value2.getOfficialAccountRegisterUserCount());
             result.setOfficialAccountRegisterUserCountDay(value2.getOfficialAccountRegisterUserCount());
-            // 公众号内注册人数 / 公众号关注次数
-            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountRegisterRateDay(value2.getOfficialAccountRegisterRate());
-            // 广告消耗 / 广告注册人数
-            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountRegisterUserCountTotal());
             result.setOfficialAccountRegisterCostDay(value2.getOfficialAccountRegisterCost());
             result.setOfficialAccountRegisterAmountTotal(value1.getOfficialAccountRegisterAmountTotal() + value2.getOfficialAccountRegisterAmount());
             result.setOfficialAccountRegisterAmountDay(value2.getOfficialAccountRegisterAmount());
-            // 注册产生的订单金额累计/广告花费
-            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountRegisterAmountTotal() / result.getCostTotal());
             result.setOfficialAccountRegisterRoiDay(value2.getOfficialAccountRegisterRoi());
             result.setOfficialAccountApplyCountTotal(value1.getOfficialAccountApplyCountTotal() + value2.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyCountDay(value2.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyUserCountTotal(value1.getOfficialAccountApplyUserCountTotal() + value2.getOfficialAccountApplyUserCount());
             result.setOfficialAccountApplyUserCountDay(value2.getOfficialAccountApplyUserCount());
-            // 公众号内填单的独立用户数/公众号关注次数
-            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountApplyRateDay(value2.getOfficialAccountApplyRate());
-            // 广告花费/广告产生的填单行为数量
-            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountApplyUserCountTotal());
             result.setOfficialAccountApplyCostDay(value2.getOfficialAccountApplyCost());
             result.setOfficialAccountApplyAmountTotal(value1.getOfficialAccountApplyAmountTotal() + value2.getOfficialAccountApplyAmount());
             result.setOfficialAccountApplyAmountDay(value2.getOfficialAccountApplyAmount());
-            // 填单产生的订单金额累计/广告花费
-            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountApplyAmountTotal() / result.getCostTotal());
             result.setOfficialAccountApplyRoiDay(value2.getOfficialAccountApplyRoi());
             result.setOfficialAccountOrderCountTotal(value1.getOfficialAccountOrderCountTotal() + value2.getOfficialAccountOrderCount());
             result.setOfficialAccountOrderCountDay(value2.getOfficialAccountOrderCount());
@@ -1296,18 +1244,12 @@ public class PlanStatOfDayDWD implements Serializable {
             result.setOfficialAccountFirstDayOrderCountDay(value2.getOfficialAccountFirstDayOrderCount());
             result.setOfficialAccountOrderUserCountTotal(value1.getOfficialAccountOrderUserCountTotal() + value2.getOfficialAccountOrderUserCount());
             result.setOfficialAccountOrderUserCountDay(value2.getOfficialAccountOrderUserCount());
-            // 公众号内下单独立用户数(UV)/公众号关注次数
-            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountTotal() / result.getOfficialAccountFollowCountTotal());
             result.setOfficialAccountOrderRateDay(value2.getOfficialAccountOrderRate());
-            // 广告花费/广告产生的下单行为数量
-            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountOrderCountTotal());
             result.setOfficialAccountOrderCostDay(value2.getOfficialAccountOrderCost());
             result.setOfficialAccountOrderAmountTotal(value1.getOfficialAccountOrderAmountTotal() + value2.getOfficialAccountOrderAmount());
             result.setOfficialAccountOrderAmountDay(value2.getOfficialAccountOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountTotal(value1.getOfficialAccountFirstDayOrderAmountTotal() + value2.getOfficialAccountFirstDayOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountDay(value2.getOfficialAccountFirstDayOrderAmount());
-            // 下单产生的订单金额累计/广告花费
-            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountOrderAmountTotal() / result.getCostTotal());
             result.setOfficialAccountOrderRoiDay(value2.getOfficialAccountOrderRoi());
             result.setOfficialAccountConsultCountTotal(value1.getOfficialAccountConsultCountTotal() + value2.getOfficialAccountConsultCount());
             result.setOfficialAccountConsultCountDay(value2.getOfficialAccountConsultCount());
@@ -1323,6 +1265,67 @@ public class PlanStatOfDayDWD implements Serializable {
             result.setForwardUserCountDay(value2.getForwardUserCount());
             result.setNoInterestCountTotal(value1.getNoInterestCountTotal() + value2.getNoInterestCount());
             result.setNoInterestCountDay(value2.getNoInterestCount());
+
+            // 总消耗 / 总曝光
+            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : NumberUtil.divideForAd(result.getCostTotal(), result.getViewCountTotal()).multiply(new BigDecimal(1000)).longValue());
+            // 曝光次数 / 曝光人数(不准)
+            result.setAvgViewPerUserAll(result.getViewUserCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getViewCountTotal(), result.getViewUserCountTotal()));
+            // 广告点击次数 / 广告曝光次数
+            result.setCtrAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/广告点击次数
+            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValidClickCountTotal()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/转化目标量
+            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getConversionsCountTotal()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountTotal(), result.getValidClickCountTotal()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getDeepConversionsCountTotal()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/下单量
+            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOrderCountTotal()));
+            // 下单量/点击次数
+            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountTotal(), result.getValidClickCountTotal()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountTotal(), result.getOrderCountTotal()));
+            // 下单金额/广告花费
+            result.setOrderRoiAll(result.getCostTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getCostTotal()));
+            // 广告消耗/首次付费人数
+            result.setLeadsPurchaseCostAll(result.getLeadsPurchaseUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getLeadsPurchaseUvTotal()));
+            // 首次付费人数/广告点击次数
+            result.setLeadsPurchaseRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getLeadsPurchaseUvTotal(), result.getValidClickCountTotal()));
+            // 广告消耗 / 小游戏注册人数
+            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getWechatAppRegisterUvTotal()));
+            // 小游戏注册人数 / 广告点击次数
+            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvTotal(), result.getValidClickCountTotal()));
+            // 总收益 / 总人数
+            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getWechatAppRegisterUvTotal()));
+            // 广告消耗 / 关注次数
+            result.setOfficialAccountFollowCostAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 关注次数 / 点击次数
+            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountTotal(), result.getValidClickCountTotal()));
+            // 公众号内注册人数 / 公众号关注次数
+            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告消耗 / 广告注册人数
+            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountRegisterUserCountTotal()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountTotal(), result.getCostTotal()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountApplyUserCountTotal()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountTotal(), result.getCostTotal()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountOrderCountTotal()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountTotal(), result.getCostTotal()));
         }
         return result;
     }
@@ -1342,8 +1345,8 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setAdIds(PlanUtil.parseAdStr(result.getAdIdsStr()));
 
         result.setCreateTime(ObjectUtil.toDate(record.get("create_time")));
-        result.setCostDeviationRateTotal(ObjectUtil.toDouble(record.get("cost_deviation_rate_total")));
-        result.setCostDeviationRateDay(ObjectUtil.toDouble(record.get("cost_deviation_rate_day")));
+        result.setCostDeviationRateTotal(ObjectUtil.toDecimal(record.get("cost_deviation_rate_total")));
+        result.setCostDeviationRateDay(ObjectUtil.toDecimal(record.get("cost_deviation_rate_day")));
         result.setCostTotal(ObjectUtil.toLong(record.get("cost_total")));
         result.setCostDay(ObjectUtil.toLong(record.get("cost_day")));
         result.setCompensationAmountTotal(ObjectUtil.toLong(record.get("compensation_amount_total")));
@@ -1354,34 +1357,34 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setThousandDisplayPriceDay(ObjectUtil.toLong(record.get("thousand_display_price_day")));
         result.setViewUserCountTotal(ObjectUtil.toLong(record.get("view_user_count_total")));
         result.setViewUserCountDay(ObjectUtil.toLong(record.get("view_user_count_day")));
-        result.setAvgViewPerUserAll(ObjectUtil.toDouble(record.get("avg_view_per_user_all")));
-        result.setAvgViewPerUserDay(ObjectUtil.toDouble(record.get("avg_view_per_user_day")));
+        result.setAvgViewPerUserAll(ObjectUtil.toDecimal(record.get("avg_view_per_user_all")));
+        result.setAvgViewPerUserDay(ObjectUtil.toDecimal(record.get("avg_view_per_user_day")));
         result.setValidClickCountTotal(ObjectUtil.toLong(record.get("valid_click_count_total")));
         result.setValidClickCountDay(ObjectUtil.toLong(record.get("valid_click_count_day")));
         result.setClickUserCountTotal(ObjectUtil.toLong(record.get("click_user_count_total")));
         result.setClickUserCountDay(ObjectUtil.toLong(record.get("click_user_count_day")));
-        result.setCtrAll(ObjectUtil.toDouble(record.get("ctr_all")));
-        result.setCtrDay(ObjectUtil.toDouble(record.get("ctr_day")));
+        result.setCtrAll(ObjectUtil.toDecimal(record.get("ctr_all")));
+        result.setCtrDay(ObjectUtil.toDecimal(record.get("ctr_day")));
         result.setCpcAll(ObjectUtil.toLong(record.get("cpc_all")));
         result.setCpcDay(ObjectUtil.toLong(record.get("cpc_day")));
         result.setValuableClickCountTotal(ObjectUtil.toLong(record.get("valuable_click_count_total")));
         result.setValuableClickCountDay(ObjectUtil.toLong(record.get("valuable_click_count_day")));
-        result.setValuableClickRateAll(ObjectUtil.toDouble(record.get("valuable_click_rate_all")));
-        result.setValuableClickRateDay(ObjectUtil.toDouble(record.get("valuable_click_rate_day")));
+        result.setValuableClickRateAll(ObjectUtil.toDecimal(record.get("valuable_click_rate_all")));
+        result.setValuableClickRateDay(ObjectUtil.toDecimal(record.get("valuable_click_rate_day")));
         result.setValuableClickCostAll(ObjectUtil.toLong(record.get("valuable_click_cost_all")));
         result.setValuableClickCostDay(ObjectUtil.toLong(record.get("valuable_click_cost_day")));
         result.setConversionsCountTotal(ObjectUtil.toLong(record.get("conversions_count_total")));
         result.setConversionsCountDay(ObjectUtil.toLong(record.get("conversions_count_day")));
         result.setConversionsCostAll(ObjectUtil.toLong(record.get("conversions_cost_all")));
         result.setConversionsCostDay(ObjectUtil.toLong(record.get("conversions_cost_day")));
-        result.setConversionsRateAll(ObjectUtil.toDouble(record.get("conversions_rate_all")));
-        result.setConversionsRateDay(ObjectUtil.toDouble(record.get("conversions_rate_day")));
+        result.setConversionsRateAll(ObjectUtil.toDecimal(record.get("conversions_rate_all")));
+        result.setConversionsRateDay(ObjectUtil.toDecimal(record.get("conversions_rate_day")));
         result.setDeepConversionsCountTotal(ObjectUtil.toLong(record.get("deep_conversions_count_total")));
         result.setDeepConversionsCountDay(ObjectUtil.toLong(record.get("deep_conversions_count_day")));
         result.setDeepConversionsCostAll(ObjectUtil.toLong(record.get("deep_conversions_cost_all")));
         result.setDeepConversionsCostDay(ObjectUtil.toLong(record.get("deep_conversions_cost_day")));
-        result.setDeepConversionsRateAll(ObjectUtil.toDouble(record.get("deep_conversions_rate_all")));
-        result.setDeepConversionsRateDay(ObjectUtil.toDouble(record.get("deep_conversions_rate_day")));
+        result.setDeepConversionsRateAll(ObjectUtil.toDecimal(record.get("deep_conversions_rate_all")));
+        result.setDeepConversionsRateDay(ObjectUtil.toDecimal(record.get("deep_conversions_rate_day")));
         result.setKeyPageUvTotal(ObjectUtil.toLong(record.get("key_page_uv_total")));
         result.setKeyPageUvDay(ObjectUtil.toLong(record.get("key_page_uv_day")));
         result.setOrderCountTotal(ObjectUtil.toLong(record.get("order_count_total")));
@@ -1390,16 +1393,16 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setFirstDayOrderCountDay(ObjectUtil.toLong(record.get("first_day_order_count_day")));
         result.setWebOrderCostAll(ObjectUtil.toLong(record.get("web_order_cost_all")));
         result.setWebOrderCostDay(ObjectUtil.toLong(record.get("web_order_cost_day")));
-        result.setOrderRateAll(ObjectUtil.toDouble(record.get("order_rate_all")));
-        result.setOrderRateDay(ObjectUtil.toDouble(record.get("order_rate_day")));
+        result.setOrderRateAll(ObjectUtil.toDecimal(record.get("order_rate_all")));
+        result.setOrderRateDay(ObjectUtil.toDecimal(record.get("order_rate_day")));
         result.setOrderAmountTotal(ObjectUtil.toLong(record.get("order_amount_total")));
         result.setOrderAmountDay(ObjectUtil.toLong(record.get("order_amount_day")));
         result.setFirstDayOrderAmountTotal(ObjectUtil.toLong(record.get("first_day_order_amount_total")));
         result.setFirstDayOrderAmountDay(ObjectUtil.toLong(record.get("first_day_order_amount_day")));
         result.setOrderUnitPriceAll(ObjectUtil.toLong(record.get("order_unit_price_all")));
         result.setOrderUnitPriceDay(ObjectUtil.toLong(record.get("order_unit_price_day")));
-        result.setOrderRoiAll(ObjectUtil.toDouble(record.get("order_roi_all")));
-        result.setOrderRoiDay(ObjectUtil.toDouble(record.get("order_roi_day")));
+        result.setOrderRoiAll(ObjectUtil.toDecimal(record.get("order_roi_all")));
+        result.setOrderRoiDay(ObjectUtil.toDecimal(record.get("order_roi_day")));
         result.setSignInCountTotal(ObjectUtil.toLong(record.get("sign_in_count_total")));
         result.setSignInCountDay(ObjectUtil.toLong(record.get("sign_in_count_day")));
         result.setAddWishlistCountTotal(ObjectUtil.toLong(record.get("add_wishlist_count_total")));
@@ -1412,18 +1415,18 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setLeadsPurchaseUvDay(ObjectUtil.toLong(record.get("leads_purchase_uv_day")));
         result.setLeadsPurchaseCostAll(ObjectUtil.toLong(record.get("leads_purchase_cost_all")));
         result.setLeadsPurchaseCostDay(ObjectUtil.toLong(record.get("leads_purchase_cost_day")));
-        result.setLeadsPurchaseRateAll(ObjectUtil.toDouble(record.get("leads_purchase_rate_all")));
-        result.setLeadsPurchaseRateDay(ObjectUtil.toDouble(record.get("leads_purchase_rate_day")));
+        result.setLeadsPurchaseRateAll(ObjectUtil.toDecimal(record.get("leads_purchase_rate_all")));
+        result.setLeadsPurchaseRateDay(ObjectUtil.toDecimal(record.get("leads_purchase_rate_day")));
         result.setScanFollowCountTotal(ObjectUtil.toLong(record.get("scan_follow_count_total")));
         result.setScanFollowCountDay(ObjectUtil.toLong(record.get("scan_follow_count_day")));
         result.setWechatAppRegisterUvTotal(ObjectUtil.toLong(record.get("wechat_app_register_uv_total")));
         result.setWechatAppRegisterUvDay(ObjectUtil.toLong(record.get("wechat_app_register_uv_day")));
         result.setWechatMinigameRegisterCostAll(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_all")));
         result.setWechatMinigameRegisterCostDay(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_day")));
-        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_all")));
-        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_day")));
-        result.setWechatMinigameArpuAll(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_all")));
-        result.setWechatMinigameArpuDay(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_day")));
+        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_all")));
+        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_day")));
+        result.setWechatMinigameArpuAll(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_all")));
+        result.setWechatMinigameArpuDay(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_day")));
         result.setWechatMinigameRetentionCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_total")));
         result.setWechatMinigameRetentionCountDay(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_day")));
         result.setWechatMinigameCheckoutCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_checkout_count_total")));
@@ -1434,12 +1437,12 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setOfficialAccountFollowCountDay(ObjectUtil.toLong(record.get("official_account_follow_count_day")));
         result.setOfficialAccountFollowCostAll(ObjectUtil.toLong(record.get("official_account_follow_cost_all")));
         result.setOfficialAccountFollowCostDay(ObjectUtil.toLong(record.get("official_account_follow_cost_day")));
-        result.setOfficialAccountFollowRateAll(ObjectUtil.toDouble(record.get("official_account_follow_rate_all")));
-        result.setOfficialAccountFollowRateDay(ObjectUtil.toDouble(record.get("official_account_follow_rate_day")));
+        result.setOfficialAccountFollowRateAll(ObjectUtil.toDecimal(record.get("official_account_follow_rate_all")));
+        result.setOfficialAccountFollowRateDay(ObjectUtil.toDecimal(record.get("official_account_follow_rate_day")));
         result.setOfficialAccountRegisterUserCountTotal(ObjectUtil.toLong(record.get("official_account_register_user_count_total")));
         result.setOfficialAccountRegisterUserCountDay(ObjectUtil.toLong(record.get("official_account_register_user_count_day")));
-        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDouble(record.get("official_account_register_rate_all")));
-        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDouble(record.get("official_account_register_rate_day")));
+        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDecimal(record.get("official_account_register_rate_all")));
+        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDecimal(record.get("official_account_register_rate_day")));
         result.setOfficialAccountRegisterCostAll(ObjectUtil.toLong(record.get("official_account_register_cost_all")));
         result.setOfficialAccountRegisterCostDay(ObjectUtil.toLong(record.get("official_account_register_cost_day")));
         result.setOfficialAccountRegisterAmountTotal(ObjectUtil.toLong(record.get("official_account_register_amount_total")));
@@ -1450,8 +1453,8 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setOfficialAccountApplyCountDay(ObjectUtil.toLong(record.get("official_account_apply_count_day")));
         result.setOfficialAccountApplyUserCountTotal(ObjectUtil.toLong(record.get("official_account_apply_user_count_total")));
         result.setOfficialAccountApplyUserCountDay(ObjectUtil.toLong(record.get("official_account_apply_user_count_day")));
-        result.setOfficialAccountApplyRateAll(ObjectUtil.toDouble(record.get("official_account_apply_rate_all")));
-        result.setOfficialAccountApplyRateDay(ObjectUtil.toDouble(record.get("official_account_apply_rate_day")));
+        result.setOfficialAccountApplyRateAll(ObjectUtil.toDecimal(record.get("official_account_apply_rate_all")));
+        result.setOfficialAccountApplyRateDay(ObjectUtil.toDecimal(record.get("official_account_apply_rate_day")));
         result.setOfficialAccountApplyCostAll(ObjectUtil.toLong(record.get("official_account_apply_cost_all")));
         result.setOfficialAccountApplyCostDay(ObjectUtil.toLong(record.get("official_account_apply_cost_day")));
         result.setOfficialAccountApplyAmountTotal(ObjectUtil.toLong(record.get("official_account_apply_amount_total")));
@@ -1464,8 +1467,8 @@ public class PlanStatOfDayDWD implements Serializable {
         result.setOfficialAccountFirstDayOrderCountDay(ObjectUtil.toLong(record.get("official_account_first_day_order_count_day")));
         result.setOfficialAccountOrderUserCountTotal(ObjectUtil.toLong(record.get("official_account_order_user_count_total")));
         result.setOfficialAccountOrderUserCountDay(ObjectUtil.toLong(record.get("official_account_order_user_count_day")));
-        result.setOfficialAccountOrderRateAll(ObjectUtil.toDouble(record.get("official_account_order_rate_all")));
-        result.setOfficialAccountOrderRateDay(ObjectUtil.toDouble(record.get("official_account_order_rate_day")));
+        result.setOfficialAccountOrderRateAll(ObjectUtil.toDecimal(record.get("official_account_order_rate_all")));
+        result.setOfficialAccountOrderRateDay(ObjectUtil.toDecimal(record.get("official_account_order_rate_day")));
         result.setOfficialAccountOrderCostAll(ObjectUtil.toLong(record.get("official_account_order_cost_all")));
         result.setOfficialAccountOrderCostDay(ObjectUtil.toLong(record.get("official_account_order_cost_day")));
         result.setOfficialAccountOrderAmountTotal(ObjectUtil.toLong(record.get("official_account_order_amount_total")));

+ 204 - 200
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfHourDWD.java

@@ -4,11 +4,13 @@ import com.aliyun.odps.data.Record;
 import com.google.gson.annotations.SerializedName;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeColumn;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTable;
+import flink.zanxiangnet.ad.monitoring.util.NumberUtil;
 import flink.zanxiangnet.ad.monitoring.util.ObjectUtil;
 import flink.zanxiangnet.ad.monitoring.util.PlanUtil;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
 
+import java.math.BigDecimal;
 import java.util.*;
 
 /**
@@ -97,19 +99,19 @@ public class PlanStatOfHourDWD {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_total")
-    private Double costDeviationRateTotal;
+    private BigDecimal costDeviationRateTotal;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_day")
-    private Double costDeviationRateDay;
+    private BigDecimal costDeviationRateDay;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_hour")
-    private Double costDeviationRateHour;
+    private BigDecimal costDeviationRateHour;
 
     /**
      * 消耗
@@ -187,7 +189,7 @@ public class PlanStatOfHourDWD {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_hour")
-    private Double avgViewPerUserHour;
+    private BigDecimal avgViewPerUserHour;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -211,19 +213,19 @@ public class PlanStatOfHourDWD {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_all")
-    private Double ctrAll;
+    private BigDecimal ctrAll;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_day")
-    private Double ctrDay;
+    private BigDecimal ctrDay;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_hour")
-    private Double ctrHour;
+    private BigDecimal ctrHour;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -265,19 +267,19 @@ public class PlanStatOfHourDWD {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_all")
-    private Double valuableClickRateAll;
+    private BigDecimal valuableClickRateAll;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_day")
-    private Double valuableClickRateDay;
+    private BigDecimal valuableClickRateDay;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_hour")
-    private Double valuableClickRateHour;
+    private BigDecimal valuableClickRateHour;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -337,19 +339,19 @@ public class PlanStatOfHourDWD {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_all")
-    private Double conversionsRateAll;
+    private BigDecimal conversionsRateAll;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_day")
-    private Double conversionsRateDay;
+    private BigDecimal conversionsRateDay;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_hour")
-    private Double conversionsRateHour;
+    private BigDecimal conversionsRateHour;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -391,19 +393,19 @@ public class PlanStatOfHourDWD {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_all")
-    private Double deepConversionsRateAll;
+    private BigDecimal deepConversionsRateAll;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_day")
-    private Double deepConversionsRateDay;
+    private BigDecimal deepConversionsRateDay;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_hour")
-    private Double deepConversionsRateHour;
+    private BigDecimal deepConversionsRateHour;
 
     /**
      * 下单量。用户通过该广告进行商品成交(如下单提交、在线支付)的次数。接入转化跟踪后可统计。
@@ -463,19 +465,19 @@ public class PlanStatOfHourDWD {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_all")
-    private Double orderRateAll;
+    private BigDecimal orderRateAll;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_day")
-    private Double orderRateDay;
+    private BigDecimal orderRateDay;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_hour")
-    private Double orderRateHour;
+    private BigDecimal orderRateHour;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -535,19 +537,19 @@ public class PlanStatOfHourDWD {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_all")
-    private Double orderRoiAll;
+    private BigDecimal orderRoiAll;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_day")
-    private Double orderRoiDay;
+    private BigDecimal orderRoiDay;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_hour")
-    private Double orderRoiHour;
+    private BigDecimal orderRoiHour;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -625,37 +627,37 @@ public class PlanStatOfHourDWD {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_all")
-    private Double wechatMinigameRegisterRateAll;
+    private BigDecimal wechatMinigameRegisterRateAll;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_day")
-    private Double wechatMinigameRegisterRateDay;
+    private BigDecimal wechatMinigameRegisterRateDay;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_hour")
-    private Double wechatMinigameRegisterRateHour;
+    private BigDecimal wechatMinigameRegisterRateHour;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_all")
-    private Double wechatMinigameArpuAll;
+    private BigDecimal wechatMinigameArpuAll;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_day")
-    private Double wechatMinigameArpuDay;
+    private BigDecimal wechatMinigameArpuDay;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_hour")
-    private Double wechatMinigameArpuHour;
+    private BigDecimal wechatMinigameArpuHour;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -733,19 +735,19 @@ public class PlanStatOfHourDWD {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_all")
-    private Double officialAccountFollowRateAll;
+    private BigDecimal officialAccountFollowRateAll;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_day")
-    private Double officialAccountFollowRateDay;
+    private BigDecimal officialAccountFollowRateDay;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_hour")
-    private Double officialAccountFollowRateHour;
+    private BigDecimal officialAccountFollowRateHour;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -769,19 +771,19 @@ public class PlanStatOfHourDWD {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_all")
-    private Double officialAccountRegisterRateAll;
+    private BigDecimal officialAccountRegisterRateAll;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_day")
-    private Double officialAccountRegisterRateDay;
+    private BigDecimal officialAccountRegisterRateDay;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_hour")
-    private Double officialAccountRegisterRateHour;
+    private BigDecimal officialAccountRegisterRateHour;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -877,19 +879,19 @@ public class PlanStatOfHourDWD {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_all")
-    private Double officialAccountApplyRateAll;
+    private BigDecimal officialAccountApplyRateAll;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_day")
-    private Double officialAccountApplyRateDay;
+    private BigDecimal officialAccountApplyRateDay;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_hour")
-    private Double officialAccountApplyRateHour;
+    private BigDecimal officialAccountApplyRateHour;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1003,19 +1005,19 @@ public class PlanStatOfHourDWD {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_all")
-    private Double officialAccountOrderRateAll;
+    private BigDecimal officialAccountOrderRateAll;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_day")
-    private Double officialAccountOrderRateDay;
+    private BigDecimal officialAccountOrderRateDay;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_hour")
-    private Double officialAccountOrderRateHour;
+    private BigDecimal officialAccountOrderRateHour;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1365,61 +1367,35 @@ public class PlanStatOfHourDWD {
             result.getAdIds().addAll(value1.getAdIds());
             PlanUtil.reduceAdGroup(result.getAdGroupMap(), value1.getAdGroupMap());
 
-            result.setCostDeviationRateDay(value1.getCostDeviationRateDay() + value2.getCostDeviationRate());
+            result.setCostDeviationRateDay(value1.getCostDeviationRateDay().add(value2.getCostDeviationRate()));
             result.setCostDay(value1.getCostDay() + value2.getCost());
             result.setCompensationAmountDay(value1.getCompensationAmountDay() + value2.getCompensationAmount());
             result.setViewCountDay(value1.getViewCountDay() + value2.getViewCount());
-            result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0 : (result.getCostDay() / result.getViewCountDay() * 1000));
             result.setValidClickCountDay(value1.getValidClickCountDay() + value2.getValidClickCount());
-            result.setCtrDay(result.getViewCountDay() == 0 ? 0.0 : result.getValidClickCountDay() / result.getViewCountDay());
-            result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValidClickCountDay());
             result.setValuableClickCountDay(value1.getValuableClickCountDay() + value2.getValuableClickCount());
-            result.setValuableClickRateDay(result.getViewCountDay() == 0 ? 0.0 : result.getValuableClickCountDay() / result.getViewCountDay());
-            result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValuableClickCountDay());
             result.setConversionsCountDay(value1.getConversionsCountDay() + value2.getConversionsCount());
-            result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getConversionsCountDay());
-            result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getConversionsCountDay() / result.getValidClickCountDay());
             result.setDeepConversionsCountDay(value1.getDeepConversionsCountDay() + value2.getDeepConversionsCount());
-            result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getDeepConversionsCountDay());
-            result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? 0.0 : result.getDeepConversionsCountDay() / result.getValuableClickCountDay());
             result.setOrderCountDay(value1.getOrderCountDay() + value2.getOrderCount());
             result.setFirstDayOrderCountDay(value1.getFirstDayOrderCountDay() + value2.getFirstDayOrderCount());
-            result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOrderCountDay());
-            result.setOrderRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOrderCountDay() / result.getValidClickCountDay());
             result.setOrderAmountDay(value1.getOrderAmountDay() + value2.getOrderAmount());
             result.setFirstDayOrderAmountDay(value1.getFirstDayOrderAmountDay() + value2.getFirstDayOrderAmount());
-            result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : result.getOrderAmountDay() / result.getOrderCountDay());
-            result.setOrderRoiDay(result.getCostDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getCostDay());
             result.setSignInCountDay(value1.getSignInCountDay() + value2.getSignInCount());
             result.setScanFollowCountDay(value1.getScanFollowCountDay() + value2.getScanFollowCount());
             result.setWechatAppRegisterUvDay(value1.getWechatAppRegisterUvDay() + value2.getWechatAppRegisterUv());
-            result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : result.getCostDay() / result.getWechatAppRegisterUvDay());
-            result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getWechatAppRegisterUvDay() / result.getValidClickCountDay());
-            result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getWechatAppRegisterUvDay());
             result.setWechatMinigameRetentionCountDay(value1.getWechatMinigameRetentionCountDay() + value2.getWechatMinigameRetentionCount());
             result.setWechatMinigameCheckoutCountDay(value1.getWechatMinigameCheckoutCountDay() + value2.getWechatMinigameCheckoutCount());
             result.setWechatMinigameCheckoutAmountDay(value1.getWechatMinigameCheckoutAmountDay() + value2.getWechatMinigameCheckoutAmount());
             result.setOfficialAccountFollowCountDay(value1.getOfficialAccountFollowCountDay() + value2.getOfficialAccountFollowCount());
-            result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOfficialAccountFollowCountDay() / result.getValidClickCountDay());
             result.setOfficialAccountRegisterUserCountDay(value1.getOfficialAccountRegisterUserCountDay() + value2.getOfficialAccountRegisterUserCount());
-            result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountDay() / result.getOfficialAccountFollowCountDay());
-            result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountRegisterUserCountDay());
             result.setOfficialAccountRegisterAmountDay(value1.getOfficialAccountRegisterAmountDay() + value2.getOfficialAccountRegisterAmount());
-            result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountRegisterAmountDay() / result.getCostDay());
             result.setOfficialAccountApplyCountDay(value1.getOfficialAccountApplyCountDay() + value2.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyUserCountDay(value1.getOfficialAccountApplyUserCountDay() + value2.getOfficialAccountApplyUserCount());
-            result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountDay() / result.getOfficialAccountFollowCountDay());
-            result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountApplyUserCountDay());
             result.setOfficialAccountApplyAmountDay(value1.getOfficialAccountApplyAmountDay() + value2.getOfficialAccountApplyAmount());
-            result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountApplyAmountDay() / result.getCostDay());
             result.setOfficialAccountOrderCountDay(value1.getOfficialAccountOrderCountDay() + value2.getOfficialAccountOrderCount());
             result.setOfficialAccountFirstDayOrderCountDay(value1.getOfficialAccountFirstDayOrderCountDay() + value2.getOfficialAccountFirstDayOrderCount());
             result.setOfficialAccountOrderUserCountDay(value1.getOfficialAccountOrderUserCountDay() + value2.getOfficialAccountOrderUserCount());
-            result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountDay() / result.getOfficialAccountFollowCountDay());
-            result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountOrderCountDay());
             result.setOfficialAccountOrderAmountDay(value1.getOfficialAccountOrderAmountDay() + value2.getOfficialAccountOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountDay(value1.getOfficialAccountFirstDayOrderAmountDay() + value2.getOfficialAccountFirstDayOrderAmount());
-            result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountOrderAmountDay() / result.getCostDay());
             result.setOfficialAccountConsultCountDay(value1.getOfficialAccountConsultCountDay() + value2.getOfficialAccountConsultCount());
             result.setOfficialAccountReaderCountDay(value1.getOfficialAccountReaderCountDay() + value2.getOfficialAccountReaderCount());
             result.setOfficialAccountCreditApplyUserCountDay(value1.getOfficialAccountCreditApplyUserCountDay() + value2.getOfficialAccountCreditApplyUserCount());
@@ -1427,6 +1403,33 @@ public class PlanStatOfHourDWD {
             result.setForwardCountDay(value1.getForwardCountDay() + value2.getForwardCount());
             result.setForwardUserCountDay(value1.getForwardUserCountDay() + value2.getForwardUserCount());
             result.setNoInterestCountDay(value1.getNoInterestCountDay() + value2.getNoInterestCount());
+
+            result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0 : NumberUtil.divideForAd(result.getCostDay(), result.getViewCountDay()).multiply(new BigDecimal(1000)).longValue());
+            result.setCtrDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountDay(), result.getViewCountDay()));
+            result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValidClickCountDay()));
+            result.setValuableClickRateDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountDay(), result.getViewCountDay()));
+            result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValuableClickCountDay()));
+            result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getConversionsCountDay()));
+            result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountDay(), result.getValidClickCountDay()));
+            result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getDeepConversionsCountDay()));
+            result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountDay(), result.getValuableClickCountDay()));
+            result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOrderCountDay()));
+            result.setOrderRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountDay(), result.getValidClickCountDay()));
+            result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountDay(), result.getOrderCountDay()));
+            result.setOrderRoiDay(result.getCostDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getCostDay()));
+            result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getWechatAppRegisterUvDay()));
+            result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvDay(), result.getValidClickCountDay()));
+            result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getWechatAppRegisterUvDay()));
+            result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountDay(), result.getValidClickCountDay()));
+            result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountRegisterUserCountDay()));
+            result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountDay(), result.getCostDay()));
+            result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountApplyUserCountDay()));
+            result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountDay(), result.getCostDay()));
+            result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountOrderCountDay()));
+            result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountDay(), result.getCostDay()));
         }
         if (yesterdayDWD == null) {
             result.setCostDeviationRateTotal(result.getCostDeviationRateDay());
@@ -1495,88 +1498,36 @@ public class PlanStatOfHourDWD {
             result.getAdIds().addAll(yesterdayDWD.getAdIds());
             PlanUtil.reduceAdGroup(result.getAdGroupMap(), yesterdayDWD.getAdGroupMap());
 
-            result.setCostDeviationRateTotal(yesterdayDWD.getCostDeviationRateTotal() + result.getCostDeviationRateDay());
+            result.setCostDeviationRateTotal(yesterdayDWD.getCostDeviationRateTotal().add(result.getCostDeviationRateDay()));
             result.setCostTotal(yesterdayDWD.getCostTotal() + result.getCostDay());
             result.setCompensationAmountTotal(yesterdayDWD.getCompensationAmountTotal() + result.getCompensationAmountDay());
             result.setViewCountTotal(yesterdayDWD.getViewCountTotal() + result.getViewCountDay());
-            // 总消耗 / 总曝光
-            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : (result.getCostTotal() / result.getViewCountTotal() * 1000));
             // 曝光次数 / 曝光人数(拿不到曝光人数)
             result.setValidClickCountTotal(yesterdayDWD.getValidClickCountTotal() + result.getValidClickCountDay());
-            // 广告点击次数 / 广告曝光次数
-            result.setCtrAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValidClickCountTotal() / result.getViewCountTotal());
-            // 广告花费/广告点击次数
-            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValidClickCountTotal());
             result.setValuableClickCountTotal(yesterdayDWD.getValuableClickCountTotal() + result.getValuableClickCountDay());
-            // 广告可转化点击次数/广告曝光次数
-            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValuableClickCountTotal() / result.getViewCountTotal());
-            // 广告花费/可转化点击次数
-            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValuableClickCountTotal());
             result.setConversionsCountTotal(yesterdayDWD.getConversionsCountTotal() + result.getConversionsCountDay());
-            // 广告花费/转化目标量
-            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getConversionsCountTotal());
-            // 公众号:转化目标量/点击次数。
-            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getConversionsCountTotal() / result.getValidClickCountTotal());
             result.setDeepConversionsCountTotal(yesterdayDWD.getDeepConversionsCountTotal() + result.getDeepConversionsCountDay());
-            // 广告花费/深度转化目标量
-            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getDeepConversionsCountTotal());
-            // 深度转化目标量/可转化点击次数
-            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? 0.0 : result.getDeepConversionsCountTotal() / result.getValuableClickCountTotal());
             result.setOrderCountTotal(yesterdayDWD.getOrderCountTotal() + result.getOrderCountDay());
             result.setFirstDayOrderCountTotal(yesterdayDWD.getFirstDayOrderCountTotal() + result.getFirstDayOrderCountDay());
-            // 广告花费/下单量
-            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOrderCountTotal());
-            // 下单量/点击次数
-            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOrderCountTotal() / result.getValidClickCountTotal());
             result.setOrderAmountTotal(yesterdayDWD.getOrderAmountTotal() + result.getOrderAmountDay());
             result.setFirstDayOrderAmountTotal(yesterdayDWD.getFirstDayOrderAmountTotal() + result.getFirstDayOrderAmountDay());
-            // 下单金额/下单量
-            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : result.getOrderAmountTotal() / result.getOrderCountTotal());
-            // 下单金额/广告花费
-            result.setOrderRoiAll(result.getCostTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getCostTotal());
             result.setSignInCountTotal(yesterdayDWD.getSignInCountTotal() + result.getSignInCountDay());
             result.setScanFollowCountTotal(yesterdayDWD.getScanFollowCountTotal() + result.getScanFollowCountDay());
             result.setWechatAppRegisterUvTotal(yesterdayDWD.getWechatAppRegisterUvTotal() + result.getWechatAppRegisterUvDay());
-            // 广告消耗 / 小游戏注册人数
-            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : result.getCostTotal() / result.getWechatAppRegisterUvTotal());
-            // 小游戏注册人数 / 广告点击次数
-            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getWechatAppRegisterUvTotal() / result.getValidClickCountTotal());
-            // 总收益 / 总人数
-            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getWechatAppRegisterUvTotal());
             result.setWechatMinigameRetentionCountTotal(yesterdayDWD.getWechatMinigameRetentionCountTotal() + result.getWechatMinigameRetentionCountDay());
             result.setWechatMinigameCheckoutCountTotal(yesterdayDWD.getWechatMinigameCheckoutCountTotal() + result.getWechatMinigameCheckoutCountDay());
             result.setWechatMinigameCheckoutAmountTotal(yesterdayDWD.getWechatMinigameCheckoutAmountTotal() + result.getWechatMinigameCheckoutAmountDay());
             result.setOfficialAccountFollowCountTotal(yesterdayDWD.getOfficialAccountFollowCountTotal() + result.getOfficialAccountFollowCountDay());
-            // 关注次数 / 点击次数
-            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOfficialAccountFollowCountTotal() / result.getValidClickCountTotal());
             result.setOfficialAccountRegisterUserCountTotal(yesterdayDWD.getOfficialAccountRegisterUserCountTotal() + result.getOfficialAccountRegisterUserCountDay());
-            // 公众号内注册人数 / 公众号关注次数
-            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告消耗 / 广告注册人数
-            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountRegisterUserCountTotal());
             result.setOfficialAccountRegisterAmountTotal(yesterdayDWD.getOfficialAccountRegisterAmountTotal() + result.getOfficialAccountRegisterAmountDay());
-            // 注册产生的订单金额累计/广告花费
-            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountRegisterAmountTotal() / result.getCostTotal());
             result.setOfficialAccountApplyCountTotal(yesterdayDWD.getOfficialAccountApplyCountTotal() + result.getOfficialAccountApplyCountDay());
             result.setOfficialAccountApplyUserCountTotal(yesterdayDWD.getOfficialAccountApplyUserCountTotal() + result.getOfficialAccountApplyUserCountDay());
-            // 公众号内填单的独立用户数/公众号关注次数
-            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告花费/广告产生的填单行为数量
-            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountApplyUserCountTotal());
             result.setOfficialAccountApplyAmountTotal(yesterdayDWD.getOfficialAccountApplyAmountTotal() + result.getOfficialAccountApplyAmountDay());
-            // 填单产生的订单金额累计/广告花费
-            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountApplyAmountTotal() / result.getCostTotal());
             result.setOfficialAccountOrderCountTotal(yesterdayDWD.getOfficialAccountOrderCountTotal() + result.getOfficialAccountOrderCountDay());
             result.setOfficialAccountFirstDayOrderCountTotal(yesterdayDWD.getOfficialAccountFirstDayOrderCountTotal() + result.getOfficialAccountFirstDayOrderCountDay());
             result.setOfficialAccountOrderUserCountTotal(yesterdayDWD.getOfficialAccountOrderUserCountTotal() + result.getOfficialAccountOrderUserCountDay());
-            // 公众号内下单独立用户数(UV)/公众号关注次数
-            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountTotal() / result.getOfficialAccountFollowCountTotal());
-            // 广告花费/广告产生的下单行为数量
-            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountOrderCountTotal());
             result.setOfficialAccountOrderAmountTotal(yesterdayDWD.getOfficialAccountOrderAmountTotal() + result.getOfficialAccountOrderAmountDay());
             result.setOfficialAccountFirstDayOrderAmountTotal(yesterdayDWD.getOfficialAccountFirstDayOrderAmountTotal() + result.getOfficialAccountFirstDayOrderAmountDay());
-            // 下单产生的订单金额累计/广告花费
-            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountOrderAmountTotal() / result.getCostTotal());
             result.setOfficialAccountConsultCountTotal(yesterdayDWD.getOfficialAccountConsultCountTotal() + result.getOfficialAccountConsultCountDay());
             result.setOfficialAccountReaderCountTotal(yesterdayDWD.getOfficialAccountReaderCountTotal() + result.getOfficialAccountReaderCountDay());
             result.setOfficialAccountCreditApplyUserCountTotal(yesterdayDWD.getOfficialAccountCreditApplyUserCountTotal() + result.getOfficialAccountCreditApplyUserCountDay());
@@ -1584,6 +1535,59 @@ public class PlanStatOfHourDWD {
             result.setForwardCountTotal(yesterdayDWD.getForwardCountTotal() + result.getForwardCountDay());
             result.setForwardUserCountTotal(yesterdayDWD.getForwardUserCountTotal() + result.getForwardUserCountDay());
             result.setNoInterestCountTotal(yesterdayDWD.getNoInterestCountTotal() + result.getNoInterestCountDay());
+
+            // 总消耗 / 总曝光
+            result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : NumberUtil.divideForAd(result.getCostTotal(), result.getViewCountTotal()).multiply(new BigDecimal(1000)).longValue());
+            // 广告点击次数 / 广告曝光次数
+            result.setCtrAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/广告点击次数
+            result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValidClickCountTotal()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountTotal(), result.getViewCountTotal()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/转化目标量
+            result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getConversionsCountTotal()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountTotal(), result.getValidClickCountTotal()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getDeepConversionsCountTotal()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountTotal(), result.getValuableClickCountTotal()));
+            // 广告花费/下单量
+            result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOrderCountTotal()));
+            // 下单量/点击次数
+            result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountTotal(), result.getValidClickCountTotal()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountTotal(), result.getOrderCountTotal()));
+            // 下单金额/广告花费
+            result.setOrderRoiAll(result.getCostTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getCostTotal()));
+            // 广告消耗 / 小游戏注册人数
+            result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getWechatAppRegisterUvTotal()));
+            // 小游戏注册人数 / 广告点击次数
+            result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvTotal(), result.getValidClickCountTotal()));
+            // 总收益 / 总人数
+            result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getWechatAppRegisterUvTotal()));
+            // 关注次数 / 点击次数
+            result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountTotal(), result.getValidClickCountTotal()));
+            // 公众号内注册人数 / 公众号关注次数
+            result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告消耗 / 广告注册人数
+            result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountRegisterUserCountTotal()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountTotal(), result.getCostTotal()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountApplyUserCountTotal()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountTotal(), result.getCostTotal()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountOrderCountTotal()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountTotal(), result.getCostTotal()));
         }
         result.setAdGroupMapStr(PlanUtil.adGroupMapStr(adGroupMap));
         result.setAdIdsStr(PlanUtil.adIdsStr(value2.getAdId()));
@@ -1606,9 +1610,9 @@ public class PlanStatOfHourDWD {
         result.setAdIds(PlanUtil.parseAdStr(result.getAdIdsStr()));
 
         result.setCreateTime(ObjectUtil.toDate(record.get("create_time")));
-        result.setCostDeviationRateTotal(ObjectUtil.toDouble(record.get("cost_deviation_rate_total")));
-        result.setCostDeviationRateDay(ObjectUtil.toDouble(record.get("cost_deviation_rate_day")));
-        result.setCostDeviationRateHour(ObjectUtil.toDouble(record.get("cost_deviation_rate_hour")));
+        result.setCostDeviationRateTotal(ObjectUtil.toDecimal(record.get("cost_deviation_rate_total")));
+        result.setCostDeviationRateDay(ObjectUtil.toDecimal(record.get("cost_deviation_rate_day")));
+        result.setCostDeviationRateHour(ObjectUtil.toDecimal(record.get("cost_deviation_rate_hour")));
         result.setCostTotal(ObjectUtil.toLong(record.get("cost_total")));
         result.setCostDay(ObjectUtil.toLong(record.get("cost_day")));
         result.setCostHour(ObjectUtil.toLong(record.get("cost_hour")));
@@ -1621,22 +1625,22 @@ public class PlanStatOfHourDWD {
         result.setThousandDisplayPriceAll(ObjectUtil.toLong(record.get("thousand_display_price_all")));
         result.setThousandDisplayPriceDay(ObjectUtil.toLong(record.get("thousand_display_price_day")));
         result.setThousandDisplayPriceHour(ObjectUtil.toLong(record.get("thousand_display_price_hour")));
-        result.setAvgViewPerUserHour(ObjectUtil.toDouble(record.get("avg_view_per_user_hour")));
+        result.setAvgViewPerUserHour(ObjectUtil.toDecimal(record.get("avg_view_per_user_hour")));
         result.setValidClickCountTotal(ObjectUtil.toLong(record.get("valid_click_count_total")));
         result.setValidClickCountDay(ObjectUtil.toLong(record.get("valid_click_count_day")));
         result.setValidClickCountHour(ObjectUtil.toLong(record.get("valid_click_count_hour")));
-        result.setCtrAll(ObjectUtil.toDouble(record.get("ctr_all")));
-        result.setCtrDay(ObjectUtil.toDouble(record.get("ctr_day")));
-        result.setCtrHour(ObjectUtil.toDouble(record.get("ctr_hour")));
+        result.setCtrAll(ObjectUtil.toDecimal(record.get("ctr_all")));
+        result.setCtrDay(ObjectUtil.toDecimal(record.get("ctr_day")));
+        result.setCtrHour(ObjectUtil.toDecimal(record.get("ctr_hour")));
         result.setCpcAll(ObjectUtil.toLong(record.get("cpc_all")));
         result.setCpcDay(ObjectUtil.toLong(record.get("cpc_day")));
         result.setCpcHour(ObjectUtil.toLong(record.get("cpc_hour")));
         result.setValuableClickCountTotal(ObjectUtil.toLong(record.get("valuable_click_count_total")));
         result.setValuableClickCountDay(ObjectUtil.toLong(record.get("valuable_click_count_day")));
         result.setValuableClickCountHour(ObjectUtil.toLong(record.get("valuable_click_count_hour")));
-        result.setValuableClickRateAll(ObjectUtil.toDouble(record.get("valuable_click_rate_all")));
-        result.setValuableClickRateDay(ObjectUtil.toDouble(record.get("valuable_click_rate_day")));
-        result.setValuableClickRateHour(ObjectUtil.toDouble(record.get("valuable_click_rate_hour")));
+        result.setValuableClickRateAll(ObjectUtil.toDecimal(record.get("valuable_click_rate_all")));
+        result.setValuableClickRateDay(ObjectUtil.toDecimal(record.get("valuable_click_rate_day")));
+        result.setValuableClickRateHour(ObjectUtil.toDecimal(record.get("valuable_click_rate_hour")));
         result.setValuableClickCostAll(ObjectUtil.toLong(record.get("valuable_click_cost_all")));
         result.setValuableClickCostDay(ObjectUtil.toLong(record.get("valuable_click_cost_day")));
         result.setValuableClickCostHour(ObjectUtil.toLong(record.get("valuable_click_cost_hour")));
@@ -1646,18 +1650,18 @@ public class PlanStatOfHourDWD {
         result.setConversionsCostAll(ObjectUtil.toLong(record.get("conversions_cost_all")));
         result.setConversionsCostDay(ObjectUtil.toLong(record.get("conversions_cost_day")));
         result.setConversionsCostHour(ObjectUtil.toLong(record.get("conversions_cost_hour")));
-        result.setConversionsRateAll(ObjectUtil.toDouble(record.get("conversions_rate_all")));
-        result.setConversionsRateDay(ObjectUtil.toDouble(record.get("conversions_rate_day")));
-        result.setConversionsRateHour(ObjectUtil.toDouble(record.get("conversions_rate_hour")));
+        result.setConversionsRateAll(ObjectUtil.toDecimal(record.get("conversions_rate_all")));
+        result.setConversionsRateDay(ObjectUtil.toDecimal(record.get("conversions_rate_day")));
+        result.setConversionsRateHour(ObjectUtil.toDecimal(record.get("conversions_rate_hour")));
         result.setDeepConversionsCountTotal(ObjectUtil.toLong(record.get("deep_conversions_count_total")));
         result.setDeepConversionsCountDay(ObjectUtil.toLong(record.get("deep_conversions_count_day")));
         result.setDeepConversionsCountHour(ObjectUtil.toLong(record.get("deep_conversions_count_hour")));
         result.setDeepConversionsCostAll(ObjectUtil.toLong(record.get("deep_conversions_cost_all")));
         result.setDeepConversionsCostDay(ObjectUtil.toLong(record.get("deep_conversions_cost_day")));
         result.setDeepConversionsCostHour(ObjectUtil.toLong(record.get("deep_conversions_cost_hour")));
-        result.setDeepConversionsRateAll(ObjectUtil.toDouble(record.get("deep_conversions_rate_all")));
-        result.setDeepConversionsRateDay(ObjectUtil.toDouble(record.get("deep_conversions_rate_day")));
-        result.setDeepConversionsRateHour(ObjectUtil.toDouble(record.get("deep_conversions_rate_hour")));
+        result.setDeepConversionsRateAll(ObjectUtil.toDecimal(record.get("deep_conversions_rate_all")));
+        result.setDeepConversionsRateDay(ObjectUtil.toDecimal(record.get("deep_conversions_rate_day")));
+        result.setDeepConversionsRateHour(ObjectUtil.toDecimal(record.get("deep_conversions_rate_hour")));
         result.setOrderCountTotal(ObjectUtil.toLong(record.get("order_count_total")));
         result.setOrderCountDay(ObjectUtil.toLong(record.get("order_count_day")));
         result.setOrderCountHour(ObjectUtil.toLong(record.get("order_count_hour")));
@@ -1667,9 +1671,9 @@ public class PlanStatOfHourDWD {
         result.setWebOrderCostAll(ObjectUtil.toLong(record.get("web_order_cost_all")));
         result.setWebOrderCostDay(ObjectUtil.toLong(record.get("web_order_cost_day")));
         result.setWebOrderCostHour(ObjectUtil.toLong(record.get("web_order_cost_hour")));
-        result.setOrderRateAll(ObjectUtil.toDouble(record.get("order_rate_all")));
-        result.setOrderRateDay(ObjectUtil.toDouble(record.get("order_rate_day")));
-        result.setOrderRateHour(ObjectUtil.toDouble(record.get("order_rate_hour")));
+        result.setOrderRateAll(ObjectUtil.toDecimal(record.get("order_rate_all")));
+        result.setOrderRateDay(ObjectUtil.toDecimal(record.get("order_rate_day")));
+        result.setOrderRateHour(ObjectUtil.toDecimal(record.get("order_rate_hour")));
         result.setOrderAmountTotal(ObjectUtil.toLong(record.get("order_amount_total")));
         result.setOrderAmountDay(ObjectUtil.toLong(record.get("order_amount_day")));
         result.setOrderAmountHour(ObjectUtil.toLong(record.get("order_amount_hour")));
@@ -1679,9 +1683,9 @@ public class PlanStatOfHourDWD {
         result.setOrderUnitPriceAll(ObjectUtil.toLong(record.get("order_unit_price_all")));
         result.setOrderUnitPriceDay(ObjectUtil.toLong(record.get("order_unit_price_day")));
         result.setOrderUnitPriceHour(ObjectUtil.toLong(record.get("order_unit_price_hour")));
-        result.setOrderRoiAll(ObjectUtil.toDouble(record.get("order_roi_all")));
-        result.setOrderRoiDay(ObjectUtil.toDouble(record.get("order_roi_day")));
-        result.setOrderRoiHour(ObjectUtil.toDouble(record.get("order_roi_hour")));
+        result.setOrderRoiAll(ObjectUtil.toDecimal(record.get("order_roi_all")));
+        result.setOrderRoiDay(ObjectUtil.toDecimal(record.get("order_roi_day")));
+        result.setOrderRoiHour(ObjectUtil.toDecimal(record.get("order_roi_hour")));
         result.setSignInCountTotal(ObjectUtil.toLong(record.get("sign_in_count_total")));
         result.setSignInCountDay(ObjectUtil.toLong(record.get("sign_in_count_day")));
         result.setSignInCountHour(ObjectUtil.toLong(record.get("sign_in_count_hour")));
@@ -1694,12 +1698,12 @@ public class PlanStatOfHourDWD {
         result.setWechatMinigameRegisterCostAll(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_all")));
         result.setWechatMinigameRegisterCostDay(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_day")));
         result.setWechatMinigameRegisterCostHour(ObjectUtil.toLong(record.get("wechat_minigame_register_cost_hour")));
-        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_all")));
-        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_day")));
-        result.setWechatMinigameRegisterRateHour(ObjectUtil.toDouble(record.get("wechat_minigame_register_rate_hour")));
-        result.setWechatMinigameArpuAll(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_all")));
-        result.setWechatMinigameArpuDay(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_day")));
-        result.setWechatMinigameArpuHour(ObjectUtil.toDouble(record.get("wechat_minigame_arpu_hour")));
+        result.setWechatMinigameRegisterRateAll(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_all")));
+        result.setWechatMinigameRegisterRateDay(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_day")));
+        result.setWechatMinigameRegisterRateHour(ObjectUtil.toDecimal(record.get("wechat_minigame_register_rate_hour")));
+        result.setWechatMinigameArpuAll(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_all")));
+        result.setWechatMinigameArpuDay(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_day")));
+        result.setWechatMinigameArpuHour(ObjectUtil.toDecimal(record.get("wechat_minigame_arpu_hour")));
         result.setWechatMinigameRetentionCountTotal(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_total")));
         result.setWechatMinigameRetentionCountDay(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_day")));
         result.setWechatMinigameRetentionCountHour(ObjectUtil.toLong(record.get("wechat_minigame_retention_count_hour")));
@@ -1712,15 +1716,15 @@ public class PlanStatOfHourDWD {
         result.setOfficialAccountFollowCountTotal(ObjectUtil.toLong(record.get("official_account_follow_count_total")));
         result.setOfficialAccountFollowCountDay(ObjectUtil.toLong(record.get("official_account_follow_count_day")));
         result.setOfficialAccountFollowCountHour(ObjectUtil.toLong(record.get("official_account_follow_count_hour")));
-        result.setOfficialAccountFollowRateAll(ObjectUtil.toDouble(record.get("official_account_follow_rate_all")));
-        result.setOfficialAccountFollowRateDay(ObjectUtil.toDouble(record.get("official_account_follow_rate_day")));
-        result.setOfficialAccountFollowRateHour(ObjectUtil.toDouble(record.get("official_account_follow_rate_hour")));
+        result.setOfficialAccountFollowRateAll(ObjectUtil.toDecimal(record.get("official_account_follow_rate_all")));
+        result.setOfficialAccountFollowRateDay(ObjectUtil.toDecimal(record.get("official_account_follow_rate_day")));
+        result.setOfficialAccountFollowRateHour(ObjectUtil.toDecimal(record.get("official_account_follow_rate_hour")));
         result.setOfficialAccountRegisterUserCountTotal(ObjectUtil.toLong(record.get("official_account_register_user_count_total")));
         result.setOfficialAccountRegisterUserCountDay(ObjectUtil.toLong(record.get("official_account_register_user_count_day")));
         result.setOfficialAccountRegisterUserCountHour(ObjectUtil.toLong(record.get("official_account_register_user_count_hour")));
-        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDouble(record.get("official_account_register_rate_all")));
-        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDouble(record.get("official_account_register_rate_day")));
-        result.setOfficialAccountRegisterRateHour(ObjectUtil.toDouble(record.get("official_account_register_rate_hour")));
+        result.setOfficialAccountRegisterRateAll(ObjectUtil.toDecimal(record.get("official_account_register_rate_all")));
+        result.setOfficialAccountRegisterRateDay(ObjectUtil.toDecimal(record.get("official_account_register_rate_day")));
+        result.setOfficialAccountRegisterRateHour(ObjectUtil.toDecimal(record.get("official_account_register_rate_hour")));
         result.setOfficialAccountRegisterCostAll(ObjectUtil.toLong(record.get("official_account_register_cost_all")));
         result.setOfficialAccountRegisterCostDay(ObjectUtil.toLong(record.get("official_account_register_cost_day")));
         result.setOfficialAccountRegisterCostHour(ObjectUtil.toLong(record.get("official_account_register_cost_hour")));
@@ -1736,9 +1740,9 @@ public class PlanStatOfHourDWD {
         result.setOfficialAccountApplyUserCountTotal(ObjectUtil.toLong(record.get("official_account_apply_user_count_total")));
         result.setOfficialAccountApplyUserCountDay(ObjectUtil.toLong(record.get("official_account_apply_user_count_day")));
         result.setOfficialAccountApplyUserCountHour(ObjectUtil.toLong(record.get("official_account_apply_user_count_hour")));
-        result.setOfficialAccountApplyRateAll(ObjectUtil.toDouble(record.get("official_account_apply_rate_all")));
-        result.setOfficialAccountApplyRateDay(ObjectUtil.toDouble(record.get("official_account_apply_rate_day")));
-        result.setOfficialAccountApplyRateHour(ObjectUtil.toDouble(record.get("official_account_apply_rate_hour")));
+        result.setOfficialAccountApplyRateAll(ObjectUtil.toDecimal(record.get("official_account_apply_rate_all")));
+        result.setOfficialAccountApplyRateDay(ObjectUtil.toDecimal(record.get("official_account_apply_rate_day")));
+        result.setOfficialAccountApplyRateHour(ObjectUtil.toDecimal(record.get("official_account_apply_rate_hour")));
         result.setOfficialAccountApplyCostAll(ObjectUtil.toLong(record.get("official_account_apply_cost_all")));
         result.setOfficialAccountApplyCostDay(ObjectUtil.toLong(record.get("official_account_apply_cost_day")));
         result.setOfficialAccountApplyCostHour(ObjectUtil.toLong(record.get("official_account_apply_cost_hour")));
@@ -1757,9 +1761,9 @@ public class PlanStatOfHourDWD {
         result.setOfficialAccountOrderUserCountTotal(ObjectUtil.toLong(record.get("official_account_order_user_count_total")));
         result.setOfficialAccountOrderUserCountDay(ObjectUtil.toLong(record.get("official_account_order_user_count_day")));
         result.setOfficialAccountOrderUserCountHour(ObjectUtil.toLong(record.get("official_account_order_user_count_hour")));
-        result.setOfficialAccountOrderRateAll(ObjectUtil.toDouble(record.get("official_account_order_rate_all")));
-        result.setOfficialAccountOrderRateDay(ObjectUtil.toDouble(record.get("official_account_order_rate_day")));
-        result.setOfficialAccountOrderRateHour(ObjectUtil.toDouble(record.get("official_account_order_rate_hour")));
+        result.setOfficialAccountOrderRateAll(ObjectUtil.toDecimal(record.get("official_account_order_rate_all")));
+        result.setOfficialAccountOrderRateDay(ObjectUtil.toDecimal(record.get("official_account_order_rate_day")));
+        result.setOfficialAccountOrderRateHour(ObjectUtil.toDecimal(record.get("official_account_order_rate_hour")));
         result.setOfficialAccountOrderCostAll(ObjectUtil.toLong(record.get("official_account_order_cost_all")));
         result.setOfficialAccountOrderCostDay(ObjectUtil.toLong(record.get("official_account_order_cost_day")));
         result.setOfficialAccountOrderCostHour(ObjectUtil.toLong(record.get("official_account_order_cost_hour")));
@@ -1797,9 +1801,9 @@ public class PlanStatOfHourDWD {
     }
 
     public static void initValue(PlanStatOfHourDWD bean) {
-        bean.setCostDeviationRateTotal(0.0);
-        bean.setCostDeviationRateDay(0.0);
-        bean.setCostDeviationRateHour(0.0);
+        bean.setCostDeviationRateTotal(BigDecimal.ZERO);
+        bean.setCostDeviationRateDay(BigDecimal.ZERO);
+        bean.setCostDeviationRateHour(BigDecimal.ZERO);
         bean.setCostTotal(0L);
         bean.setCostDay(0L);
         bean.setCostHour(0L);
@@ -1812,22 +1816,22 @@ public class PlanStatOfHourDWD {
         bean.setThousandDisplayPriceAll(0L);
         bean.setThousandDisplayPriceDay(0L);
         bean.setThousandDisplayPriceHour(0L);
-        bean.setAvgViewPerUserHour(0.0);
+        bean.setAvgViewPerUserHour(BigDecimal.ZERO);
         bean.setValidClickCountTotal(0L);
         bean.setValidClickCountDay(0L);
         bean.setValidClickCountHour(0L);
-        bean.setCtrAll(0.0);
-        bean.setCtrDay(0.0);
-        bean.setCtrHour(0.0);
+        bean.setCtrAll(BigDecimal.ZERO);
+        bean.setCtrDay(BigDecimal.ZERO);
+        bean.setCtrHour(BigDecimal.ZERO);
         bean.setCpcAll(0L);
         bean.setCpcDay(0L);
         bean.setCpcHour(0L);
         bean.setValuableClickCountTotal(0L);
         bean.setValuableClickCountDay(0L);
         bean.setValuableClickCountHour(0L);
-        bean.setValuableClickRateAll(0.0);
-        bean.setValuableClickRateDay(0.0);
-        bean.setValuableClickRateHour(0.0);
+        bean.setValuableClickRateAll(BigDecimal.ZERO);
+        bean.setValuableClickRateDay(BigDecimal.ZERO);
+        bean.setValuableClickRateHour(BigDecimal.ZERO);
         bean.setValuableClickCostAll(0L);
         bean.setValuableClickCostDay(0L);
         bean.setValuableClickCostHour(0L);
@@ -1837,18 +1841,18 @@ public class PlanStatOfHourDWD {
         bean.setConversionsCostAll(0L);
         bean.setConversionsCostDay(0L);
         bean.setConversionsCostHour(0L);
-        bean.setConversionsRateAll(0.0);
-        bean.setConversionsRateDay(0.0);
-        bean.setConversionsRateHour(0.0);
+        bean.setConversionsRateAll(BigDecimal.ZERO);
+        bean.setConversionsRateDay(BigDecimal.ZERO);
+        bean.setConversionsRateHour(BigDecimal.ZERO);
         bean.setDeepConversionsCountTotal(0L);
         bean.setDeepConversionsCountDay(0L);
         bean.setDeepConversionsCountHour(0L);
         bean.setDeepConversionsCostAll(0L);
         bean.setDeepConversionsCostDay(0L);
         bean.setDeepConversionsCostHour(0L);
-        bean.setDeepConversionsRateAll(0.0);
-        bean.setDeepConversionsRateDay(0.0);
-        bean.setDeepConversionsRateHour(0.0);
+        bean.setDeepConversionsRateAll(BigDecimal.ZERO);
+        bean.setDeepConversionsRateDay(BigDecimal.ZERO);
+        bean.setDeepConversionsRateHour(BigDecimal.ZERO);
         bean.setOrderCountTotal(0L);
         bean.setOrderCountDay(0L);
         bean.setOrderCountHour(0L);
@@ -1858,9 +1862,9 @@ public class PlanStatOfHourDWD {
         bean.setWebOrderCostAll(0L);
         bean.setWebOrderCostDay(0L);
         bean.setWebOrderCostHour(0L);
-        bean.setOrderRateAll(0.0);
-        bean.setOrderRateDay(0.0);
-        bean.setOrderRateHour(0.0);
+        bean.setOrderRateAll(BigDecimal.ZERO);
+        bean.setOrderRateDay(BigDecimal.ZERO);
+        bean.setOrderRateHour(BigDecimal.ZERO);
         bean.setOrderAmountTotal(0L);
         bean.setOrderAmountDay(0L);
         bean.setOrderAmountHour(0L);
@@ -1870,9 +1874,9 @@ public class PlanStatOfHourDWD {
         bean.setOrderUnitPriceAll(0L);
         bean.setOrderUnitPriceDay(0L);
         bean.setOrderUnitPriceHour(0L);
-        bean.setOrderRoiAll(0.0);
-        bean.setOrderRoiDay(0.0);
-        bean.setOrderRoiHour(0.0);
+        bean.setOrderRoiAll(BigDecimal.ZERO);
+        bean.setOrderRoiDay(BigDecimal.ZERO);
+        bean.setOrderRoiHour(BigDecimal.ZERO);
         bean.setSignInCountTotal(0L);
         bean.setSignInCountDay(0L);
         bean.setSignInCountHour(0L);
@@ -1885,12 +1889,12 @@ public class PlanStatOfHourDWD {
         bean.setWechatMinigameRegisterCostAll(0L);
         bean.setWechatMinigameRegisterCostDay(0L);
         bean.setWechatMinigameRegisterCostHour(0L);
-        bean.setWechatMinigameRegisterRateAll(0.0);
-        bean.setWechatMinigameRegisterRateDay(0.0);
-        bean.setWechatMinigameRegisterRateHour(0.0);
-        bean.setWechatMinigameArpuAll(0.0);
-        bean.setWechatMinigameArpuDay(0.0);
-        bean.setWechatMinigameArpuHour(0.0);
+        bean.setWechatMinigameRegisterRateAll(BigDecimal.ZERO);
+        bean.setWechatMinigameRegisterRateDay(BigDecimal.ZERO);
+        bean.setWechatMinigameRegisterRateHour(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuAll(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuDay(BigDecimal.ZERO);
+        bean.setWechatMinigameArpuHour(BigDecimal.ZERO);
         bean.setWechatMinigameRetentionCountTotal(0L);
         bean.setWechatMinigameRetentionCountDay(0L);
         bean.setWechatMinigameRetentionCountHour(0L);
@@ -1903,15 +1907,15 @@ public class PlanStatOfHourDWD {
         bean.setOfficialAccountFollowCountTotal(0L);
         bean.setOfficialAccountFollowCountDay(0L);
         bean.setOfficialAccountFollowCountHour(0L);
-        bean.setOfficialAccountFollowRateAll(0.0);
-        bean.setOfficialAccountFollowRateDay(0.0);
-        bean.setOfficialAccountFollowRateHour(0.0);
+        bean.setOfficialAccountFollowRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountFollowRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountFollowRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountRegisterUserCountTotal(0L);
         bean.setOfficialAccountRegisterUserCountDay(0L);
         bean.setOfficialAccountRegisterUserCountHour(0L);
-        bean.setOfficialAccountRegisterRateAll(0.0);
-        bean.setOfficialAccountRegisterRateDay(0.0);
-        bean.setOfficialAccountRegisterRateHour(0.0);
+        bean.setOfficialAccountRegisterRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountRegisterRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountRegisterRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountRegisterCostAll(0L);
         bean.setOfficialAccountRegisterCostDay(0L);
         bean.setOfficialAccountRegisterCostHour(0L);
@@ -1927,9 +1931,9 @@ public class PlanStatOfHourDWD {
         bean.setOfficialAccountApplyUserCountTotal(0L);
         bean.setOfficialAccountApplyUserCountDay(0L);
         bean.setOfficialAccountApplyUserCountHour(0L);
-        bean.setOfficialAccountApplyRateAll(0.0);
-        bean.setOfficialAccountApplyRateDay(0.0);
-        bean.setOfficialAccountApplyRateHour(0.0);
+        bean.setOfficialAccountApplyRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountApplyRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountApplyRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountApplyCostAll(0L);
         bean.setOfficialAccountApplyCostDay(0L);
         bean.setOfficialAccountApplyCostHour(0L);
@@ -1948,9 +1952,9 @@ public class PlanStatOfHourDWD {
         bean.setOfficialAccountOrderUserCountTotal(0L);
         bean.setOfficialAccountOrderUserCountDay(0L);
         bean.setOfficialAccountOrderUserCountHour(0L);
-        bean.setOfficialAccountOrderRateAll(0.0);
-        bean.setOfficialAccountOrderRateDay(0.0);
-        bean.setOfficialAccountOrderRateHour(0.0);
+        bean.setOfficialAccountOrderRateAll(BigDecimal.ZERO);
+        bean.setOfficialAccountOrderRateDay(BigDecimal.ZERO);
+        bean.setOfficialAccountOrderRateHour(BigDecimal.ZERO);
         bean.setOfficialAccountOrderCostAll(0L);
         bean.setOfficialAccountOrderCostDay(0L);
         bean.setOfficialAccountOrderCostHour(0L);

+ 250 - 221
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/entity/PlanStatOfMinuteDWD.java

@@ -3,10 +3,12 @@ package flink.zanxiangnet.ad.monitoring.pojo.entity;
 import com.google.gson.annotations.SerializedName;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeColumn;
 import flink.zanxiangnet.ad.monitoring.maxcompute.bean.annotation.MaxComputeTable;
+import flink.zanxiangnet.ad.monitoring.util.NumberUtil;
 import flink.zanxiangnet.ad.monitoring.util.PlanUtil;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
 
+import java.math.BigDecimal;
 import java.util.*;
 
 /**
@@ -98,25 +100,25 @@ public class PlanStatOfMinuteDWD {
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_total")
-    private Double costDeviationRateTotal;
+    private BigDecimal costDeviationRateTotal;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_day")
-    private Double costDeviationRateDay;
+    private BigDecimal costDeviationRateDay;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_hour")
-    private Double costDeviationRateHour;
+    private BigDecimal costDeviationRateHour;
 
     /**
      * 当日成本偏差。反映广告今日的实际成本与目标成本直接的差异,注:该项成本相关数据按小时更新,与实时更新的「转化目标成本」数据存在出入属于正常情况。
      */
     @SerializedName("cost_deviation_rate_minute")
-    private Double costDeviationRateMinute;
+    private BigDecimal costDeviationRateMinute;
 
     /**
      * 消耗
@@ -218,25 +220,25 @@ public class PlanStatOfMinuteDWD {
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_all")
-    private Double avgViewPerUserAll;
+    private BigDecimal avgViewPerUserAll;
 
     /**
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_day")
-    private Double avgViewPerUserDay;
+    private BigDecimal avgViewPerUserDay;
 
     /**
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_hour")
-    private Double avgViewPerUserHour;
+    private BigDecimal avgViewPerUserHour;
 
     /**
      * 人均曝光次数。每个用户观看广告的平均次数。
      */
     @SerializedName("avg_view_per_user_minute")
-    private Double avgViewPerUserMinute;
+    private BigDecimal avgViewPerUserMinute;
 
     /**
      * 点击次数。用户在广告外层进行点击操作的次数。包括点击图片/视频,及朋友圈广告“文字链、头像、昵称、门店、选择按钮”等所有广告外层区域的点击。
@@ -266,25 +268,25 @@ public class PlanStatOfMinuteDWD {
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_all")
-    private Double ctrAll;
+    private BigDecimal ctrAll;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_day")
-    private Double ctrDay;
+    private BigDecimal ctrDay;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_hour")
-    private Double ctrHour;
+    private BigDecimal ctrHour;
 
     /**
      * 点击率。看到广告后执行点击操作的百分比。计算逻辑:广告点击次数/广告曝光次数。
      */
     @SerializedName("ctr_minute")
-    private Double ctrMinute;
+    private BigDecimal ctrMinute;
 
     /**
      * 点击均价。一次广告点击的平均花费。计算逻辑:广告花费/广告点击次数。
@@ -338,25 +340,25 @@ public class PlanStatOfMinuteDWD {
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_all")
-    private Double valuableClickRateAll;
+    private BigDecimal valuableClickRateAll;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_day")
-    private Double valuableClickRateDay;
+    private BigDecimal valuableClickRateDay;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_hour")
-    private Double valuableClickRateHour;
+    private BigDecimal valuableClickRateHour;
 
     /**
      * 可转化点击率。用户看到广告后执行可转化点击操作的百分比。计算逻辑:广告可转化点击次数/广告曝光次数。
      */
     @SerializedName("valuable_click_rate_minute")
-    private Double valuableClickRateMinute;
+    private BigDecimal valuableClickRateMinute;
 
     /**
      * 可转化点击成本。一次可转化点击的平均花费。计算逻辑:广告花费/可转化点击次数。
@@ -434,25 +436,25 @@ public class PlanStatOfMinuteDWD {
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_all")
-    private Double conversionsRateAll;
+    private BigDecimal conversionsRateAll;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_day")
-    private Double conversionsRateDay;
+    private BigDecimal conversionsRateDay;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_hour")
-    private Double conversionsRateHour;
+    private BigDecimal conversionsRateHour;
 
     /**
      * 目标转化率。朋友圈:转化目标量/可转化点击次数。公众号:转化目标量/点击次数。
      */
     @SerializedName("conversions_rate_minute")
-    private Double conversionsRateMinute;
+    private BigDecimal conversionsRateMinute;
 
     /**
      * 深度转化目标量-灰度中。根据您选择的深度智能优化目标,该广告对应的具体数量。部分需接入转化跟踪后可统计。
@@ -506,25 +508,25 @@ public class PlanStatOfMinuteDWD {
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_all")
-    private Double deepConversionsRateAll;
+    private BigDecimal deepConversionsRateAll;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_day")
-    private Double deepConversionsRateDay;
+    private BigDecimal deepConversionsRateDay;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_hour")
-    private Double deepConversionsRateHour;
+    private BigDecimal deepConversionsRateHour;
 
     /**
      * 深度目标转化率-灰度中。朋友圈:深度转化目标量/可转化点击次数。公众号:深度转化目标量/点击次数。指标随深度转化功能灰度中。接入转化跟踪后可统计。
      */
     @SerializedName("deep_conversions_rate_minute")
-    private Double deepConversionsRateMinute;
+    private BigDecimal deepConversionsRateMinute;
 
     /**
      * 下单量。用户通过该广告进行商品成交(如下单提交、在线支付)的次数。接入转化跟踪后可统计。
@@ -602,25 +604,25 @@ public class PlanStatOfMinuteDWD {
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_all")
-    private Double orderRateAll;
+    private BigDecimal orderRateAll;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_day")
-    private Double orderRateDay;
+    private BigDecimal orderRateDay;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_hour")
-    private Double orderRateHour;
+    private BigDecimal orderRateHour;
 
     /**
      * 下单率。一次点击到下单的转化率。
      */
     @SerializedName("order_rate_minute")
-    private Double orderRateMinute;
+    private BigDecimal orderRateMinute;
 
     /**
      * 下单金额。广告带来的总订单金额(即销售额)。接入转化跟踪后可统计。
@@ -698,25 +700,25 @@ public class PlanStatOfMinuteDWD {
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_all")
-    private Double orderRoiAll;
+    private BigDecimal orderRoiAll;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_day")
-    private Double orderRoiDay;
+    private BigDecimal orderRoiDay;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_hour")
-    private Double orderRoiHour;
+    private BigDecimal orderRoiHour;
 
     /**
      * 下单ROI。下单金额/广告花费。接入转化跟踪后可统计。
      */
     @SerializedName("order_roi_minute")
-    private Double orderRoiMinute;
+    private BigDecimal orderRoiMinute;
 
     /**
      * 签收次数。签收从广告主处购买的商品的次数。接入转化跟踪后可统计。
@@ -818,49 +820,49 @@ public class PlanStatOfMinuteDWD {
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_all")
-    private Double wechatMinigameRegisterRateAll;
+    private BigDecimal wechatMinigameRegisterRateAll;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_day")
-    private Double wechatMinigameRegisterRateDay;
+    private BigDecimal wechatMinigameRegisterRateDay;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_hour")
-    private Double wechatMinigameRegisterRateHour;
+    private BigDecimal wechatMinigameRegisterRateHour;
 
     /**
      * 小游戏注册率。一次点击到小游戏注册的转化率。
      */
     @SerializedName("wechat_minigame_register_rate_minute")
-    private Double wechatMinigameRegisterRateMinute;
+    private BigDecimal wechatMinigameRegisterRateMinute;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_all")
-    private Double wechatMinigameArpuAll;
+    private BigDecimal wechatMinigameArpuAll;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_day")
-    private Double wechatMinigameArpuDay;
+    private BigDecimal wechatMinigameArpuDay;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_hour")
-    private Double wechatMinigameArpuHour;
+    private BigDecimal wechatMinigameArpuHour;
 
     /**
      * 首日新增广告ARPU。广告带来的注册用户,在注册当日,产生的平均广告变现收入。注:该指标天更新,可以查看昨天及以前的数据。
      */
     @SerializedName("wechat_minigame_arpu_minute")
-    private Double wechatMinigameArpuMinute;
+    private BigDecimal wechatMinigameArpuMinute;
 
     /**
      * 小游戏次留人数。通过广告首次登录小游戏,并在第二天再次登录的独立用户数。接入转化跟踪后可统计。
@@ -962,25 +964,25 @@ public class PlanStatOfMinuteDWD {
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_all")
-    private Double officialAccountFollowRateAll;
+    private BigDecimal officialAccountFollowRateAll;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_day")
-    private Double officialAccountFollowRateDay;
+    private BigDecimal officialAccountFollowRateDay;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_hour")
-    private Double officialAccountFollowRateHour;
+    private BigDecimal officialAccountFollowRateHour;
 
     /**
      * 公众号关注率。一次点击到公众号关注的转化率。
      */
     @SerializedName("official_account_follow_rate_minute")
-    private Double officialAccountFollowRateMinute;
+    private BigDecimal officialAccountFollowRateMinute;
 
     /**
      * 公众号内注册人数。用户通过关注类广告关注公众号后,在公众号内部产生了广告主定义的注册行为的人数(UV)。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -1010,25 +1012,25 @@ public class PlanStatOfMinuteDWD {
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_all")
-    private Double officialAccountRegisterRateAll;
+    private BigDecimal officialAccountRegisterRateAll;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_day")
-    private Double officialAccountRegisterRateDay;
+    private BigDecimal officialAccountRegisterRateDay;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_hour")
-    private Double officialAccountRegisterRateHour;
+    private BigDecimal officialAccountRegisterRateHour;
 
     /**
      * 公众号内注册比例。公众号内注册独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_register_rate_minute")
-    private Double officialAccountRegisterRateMinute;
+    private BigDecimal officialAccountRegisterRateMinute;
 
     /**
      * 公众号内注册成本。广告花费/广告产生的注册行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放)。
@@ -1154,25 +1156,25 @@ public class PlanStatOfMinuteDWD {
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_all")
-    private Double officialAccountApplyRateAll;
+    private BigDecimal officialAccountApplyRateAll;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_day")
-    private Double officialAccountApplyRateDay;
+    private BigDecimal officialAccountApplyRateDay;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_hour")
-    private Double officialAccountApplyRateHour;
+    private BigDecimal officialAccountApplyRateHour;
 
     /**
      * 公众号内填单比例。公众号内填单的独立用户数/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放)。
      */
     @SerializedName("official_account_apply_rate_minute")
-    private Double officialAccountApplyRateMinute;
+    private BigDecimal officialAccountApplyRateMinute;
 
     /**
      * 公众号内填单成本。广告花费/广告产生的填单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1322,25 +1324,25 @@ public class PlanStatOfMinuteDWD {
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_all")
-    private Double officialAccountOrderRateAll;
+    private BigDecimal officialAccountOrderRateAll;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_day")
-    private Double officialAccountOrderRateDay;
+    private BigDecimal officialAccountOrderRateDay;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_hour")
-    private Double officialAccountOrderRateHour;
+    private BigDecimal officialAccountOrderRateHour;
 
     /**
      * 公众号内下单比例。公众号内下单独立用户数(UV)/公众号关注次数。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
      */
     @SerializedName("official_account_order_rate_minute")
-    private Double officialAccountOrderRateMinute;
+    private BigDecimal officialAccountOrderRateMinute;
 
     /**
      * 公众号内下单成本。广告花费/广告产生的下单行为数量。接入转化跟踪后可统计(公众号接入暂未全量开放) 。
@@ -1700,87 +1702,35 @@ public class PlanStatOfMinuteDWD {
             result.getAdIds().add(todayODS.getAdId());
             result.getAdGroupMap().computeIfAbsent(todayODS.getAdgroupId(), key -> new HashSet<>(3)).add(todayODS.getAdId());
 
-            result.setCostDeviationRateDay(result.getCostDeviationRateDay() + todayODS.getCostDeviationRate());
+            result.setCostDeviationRateDay(result.getCostDeviationRateDay().add(todayODS.getCostDeviationRate()));
             result.setCostDay(result.getCostDay() + todayODS.getCost());
             result.setCompensationAmountDay(result.getCompensationAmountDay() + todayODS.getCompensationAmount());
             result.setViewCountDay(result.getViewCountDay() + todayODS.getViewCount());
-            // 总消耗 / 总曝光
-            result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0 : (result.getCostDay() / result.getViewCountDay() * 1000));
             result.setValidClickCountDay(result.getValidClickCountDay() + todayODS.getValidClickCount());
-            // 广告点击次数 / 广告曝光次数
-            result.setCtrDay(result.getViewCountDay() == 0 ? 0.0 : result.getValidClickCountDay() / result.getViewCountDay());
-            // 广告花费/广告点击次数
-            result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValidClickCountDay());
             result.setValuableClickCountDay(result.getValuableClickCountDay() + todayODS.getValuableClickCount());
-            // 广告可转化点击次数/广告曝光次数
-            result.setValuableClickRateDay(result.getViewCountDay() == 0 ? 0.0 : result.getValuableClickCountDay() / result.getViewCountDay());
-            // 广告花费/可转化点击次数
-            result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : result.getCostDay() / result.getValuableClickCountDay());
             result.setConversionsCountDay(result.getConversionsCountDay() + todayODS.getConversionsCount());
-            // 广告花费/转化目标量
-            result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getConversionsCountDay());
-            // 公众号:转化目标量/点击次数。
-            result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getConversionsCountDay() / result.getValidClickCountDay());
             result.setDeepConversionsCountDay(result.getDeepConversionsCountDay() + todayODS.getDeepConversionsCount());
-            // 广告花费/深度转化目标量
-            result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : result.getCostDay() / result.getDeepConversionsCountDay());
-            // 深度转化目标量/可转化点击次数
-            result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? 0.0 : result.getDeepConversionsCountDay() / result.getValuableClickCountDay());
             result.setOrderCountDay(result.getOrderCountDay() + todayODS.getOrderCount());
             result.setFirstDayOrderCountDay(result.getFirstDayOrderCountDay() + todayODS.getFirstDayOrderCount());
-            // 广告花费/下单量
-            result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOrderCountDay());
-            // 下单量/点击次数
-            result.setOrderRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOrderCountDay() / result.getValidClickCountDay());
             result.setOrderAmountDay(result.getOrderAmountDay() + todayODS.getOrderAmount());
             result.setFirstDayOrderAmountDay(result.getFirstDayOrderAmountDay() + todayODS.getFirstDayOrderAmount());
-            // 下单金额/下单量
-            result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : result.getOrderAmountDay() / result.getOrderCountDay());
-            // 下单金额/广告花费
-            result.setOrderRoiDay(result.getCostDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getCostDay());
             result.setSignInCountDay(result.getSignInCountDay() + todayODS.getSignInCount());
             result.setScanFollowCountDay(result.getScanFollowCountDay() + todayODS.getScanFollowCount());
             result.setWechatAppRegisterUvDay(result.getWechatAppRegisterUvDay() + todayODS.getWechatAppRegisterUv());
-            // 广告消耗 / 小游戏注册人数
-            result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : result.getCostDay() / result.getWechatAppRegisterUvDay());
-            // 小游戏注册人数 / 广告点击次数
-            result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getWechatAppRegisterUvDay() / result.getValidClickCountDay());
-            // 总收益 / 总人数
-            result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? 0.0 : result.getOrderAmountDay() / result.getWechatAppRegisterUvDay());
             result.setWechatMinigameRetentionCountDay(result.getWechatMinigameRetentionCountDay() + todayODS.getWechatMinigameRetentionCount());
             result.setWechatMinigameCheckoutCountDay(result.getWechatMinigameCheckoutCountDay() + todayODS.getWechatMinigameCheckoutCount());
             result.setWechatMinigameCheckoutAmountDay(result.getWechatMinigameCheckoutAmountDay() + todayODS.getWechatMinigameCheckoutAmount());
             result.setOfficialAccountFollowCountDay(result.getOfficialAccountFollowCountDay() + todayODS.getOfficialAccountFollowCount());
-            // 关注次数 / 点击次数
-            result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? 0.0 : result.getOfficialAccountFollowCountDay() / result.getValidClickCountDay());
             result.setOfficialAccountRegisterUserCountDay(result.getOfficialAccountRegisterUserCountDay() + todayODS.getOfficialAccountRegisterUserCount());
-            // 公众号内注册人数 / 公众号关注次数
-            result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountDay() / result.getOfficialAccountFollowCountDay());
-            // 广告消耗 / 广告注册人数
-            result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountRegisterUserCountDay());
             result.setOfficialAccountRegisterAmountDay(result.getOfficialAccountRegisterAmountDay() + todayODS.getOfficialAccountRegisterAmount());
-            // 注册产生的订单金额累计/广告花费
-            result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountRegisterAmountDay() / result.getCostDay());
             result.setOfficialAccountApplyCountDay(result.getOfficialAccountApplyCountDay() + todayODS.getOfficialAccountApplyCount());
             result.setOfficialAccountApplyUserCountDay(result.getOfficialAccountApplyUserCountDay() + todayODS.getOfficialAccountApplyUserCount());
-            // 公众号内填单的独立用户数/公众号关注次数
-            result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountDay() / result.getOfficialAccountFollowCountDay());
-            // 广告花费/广告产生的填单行为数量
-            result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountApplyUserCountDay());
             result.setOfficialAccountApplyAmountDay(result.getOfficialAccountApplyAmountDay() + todayODS.getOfficialAccountApplyAmount());
-            // 填单产生的订单金额累计/广告花费
-            result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountApplyAmountDay() / result.getCostDay());
             result.setOfficialAccountOrderCountDay(result.getOfficialAccountOrderCountDay() + todayODS.getOfficialAccountOrderCount());
             result.setOfficialAccountFirstDayOrderCountDay(result.getOfficialAccountFirstDayOrderCountDay() + todayODS.getOfficialAccountFirstDayOrderCount());
             result.setOfficialAccountOrderUserCountDay(result.getOfficialAccountOrderUserCountDay() + todayODS.getOfficialAccountOrderUserCount());
-            // 公众号内下单独立用户数(UV)/公众号关注次数
-            result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountDay() / result.getOfficialAccountFollowCountDay());
-            // 广告花费/广告产生的下单行为数量
-            result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : result.getCostDay() / result.getOfficialAccountOrderCountDay());
             result.setOfficialAccountOrderAmountDay(result.getOfficialAccountOrderAmountDay() + todayODS.getOfficialAccountOrderAmount());
             result.setOfficialAccountFirstDayOrderAmountDay(result.getOfficialAccountFirstDayOrderAmountDay() + todayODS.getOfficialAccountFirstDayOrderAmount());
-            // 下单产生的订单金额累计/广告花费
-            result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : result.getOfficialAccountOrderAmountDay() / result.getCostDay());
             result.setOfficialAccountConsultCountDay(result.getOfficialAccountConsultCountDay() + todayODS.getOfficialAccountConsultCount());
             result.setOfficialAccountReaderCountDay(result.getOfficialAccountReaderCountDay() + todayODS.getOfficialAccountReaderCount());
             result.setOfficialAccountCreditApplyUserCountDay(result.getOfficialAccountCreditApplyUserCountDay() + todayODS.getOfficialAccountCreditApplyUserCount());
@@ -1788,6 +1738,59 @@ public class PlanStatOfMinuteDWD {
             result.setForwardCountDay(result.getForwardCountDay() + todayODS.getForwardCount());
             result.setForwardUserCountDay(result.getForwardUserCountDay() + todayODS.getForwardUserCount());
             result.setNoInterestCountDay(result.getNoInterestCountDay() + todayODS.getNoInterestCount());
+
+            // 总消耗 / 总曝光
+            result.setThousandDisplayPriceDay(result.getViewCountDay() == 0 ? 0 : NumberUtil.divideForAd(result.getCostDay(), result.getViewCountDay()).multiply(new BigDecimal(1000)).longValue());
+            // 广告点击次数 / 广告曝光次数
+            result.setCtrDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountDay(), result.getViewCountDay()));
+            // 广告花费/广告点击次数
+            result.setCpcDay(result.getValidClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValidClickCountDay()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateDay(result.getViewCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountDay(), result.getViewCountDay()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostDay(result.getValuableClickCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getValuableClickCountDay()));
+            // 广告花费/转化目标量
+            result.setConversionsCostDay(result.getConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getConversionsCountDay()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountDay(), result.getValidClickCountDay()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostDay(result.getDeepConversionsCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getDeepConversionsCountDay()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateDay(result.getValuableClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountDay(), result.getValuableClickCountDay()));
+            // 广告花费/下单量
+            result.setWebOrderCostDay(result.getOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOrderCountDay()));
+            // 下单量/点击次数
+            result.setOrderRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountDay(), result.getValidClickCountDay()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceDay(result.getOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountDay(), result.getOrderCountDay()));
+            // 下单金额/广告花费
+            result.setOrderRoiDay(result.getCostDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getCostDay()));
+            // 广告消耗 / 小游戏注册人数
+            result.setWechatMinigameRegisterCostDay(result.getWechatAppRegisterUvDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getWechatAppRegisterUvDay()));
+            // 小游戏注册人数 / 广告点击次数
+            result.setWechatMinigameRegisterRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvDay(), result.getValidClickCountDay()));
+            // 总收益 / 总人数
+            result.setWechatMinigameArpuDay(result.getWechatAppRegisterUvDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountDay(), result.getWechatAppRegisterUvDay()));
+            // 关注次数 / 点击次数
+            result.setOfficialAccountFollowRateDay(result.getValidClickCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountDay(), result.getValidClickCountDay()));
+            // 公众号内注册人数 / 公众号关注次数
+            result.setOfficialAccountRegisterRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            // 广告消耗 / 广告注册人数
+            result.setOfficialAccountRegisterCostDay(result.getOfficialAccountRegisterUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountRegisterUserCountDay()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountDay(), result.getCostDay()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostDay(result.getOfficialAccountApplyUserCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountApplyUserCountDay()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountDay(), result.getCostDay()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateDay(result.getOfficialAccountFollowCountDay() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountDay(), result.getOfficialAccountFollowCountDay()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostDay(result.getOfficialAccountOrderCountDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostDay(), result.getOfficialAccountOrderCountDay()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiDay(result.getCostDay() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountDay(), result.getCostDay()));
         }
         // 填充总数据
         if (beforeYesterdayDayDWD != null) {
@@ -1862,7 +1865,7 @@ public class PlanStatOfMinuteDWD {
             result.getAdIds().addAll(yesterdayMinuteDWD.getAdIds());
             PlanUtil.reduceAdGroup(result.getAdGroupMap(), yesterdayMinuteDWD.getAdGroupMap());
 
-            result.setCostDeviationRateTotal(result.getCostDeviationRateTotal() + yesterdayMinuteDWD.getCostDeviationRateDay());
+            result.setCostDeviationRateTotal(result.getCostDeviationRateTotal().add(yesterdayMinuteDWD.getCostDeviationRateDay()));
             result.setCostTotal(result.getCostTotal() + yesterdayMinuteDWD.getCostDay());
             result.setCompensationAmountTotal(result.getCompensationAmountTotal() + yesterdayMinuteDWD.getCompensationAmountDay());
             result.setViewCountTotal(result.getViewCountTotal() + yesterdayMinuteDWD.getViewCountDay());
@@ -1899,7 +1902,7 @@ public class PlanStatOfMinuteDWD {
             result.setForwardUserCountTotal(result.getForwardUserCountTotal() + yesterdayMinuteDWD.getForwardUserCountDay());
             result.setNoInterestCountTotal(result.getNoInterestCountTotal() + yesterdayMinuteDWD.getNoInterestCountDay());
         }
-        result.setCostDeviationRateTotal(result.getCostDeviationRateTotal() + result.getCostDeviationRateDay());
+        result.setCostDeviationRateTotal(result.getCostDeviationRateTotal().add(result.getCostDeviationRateDay()));
         result.setCostTotal(result.getCostTotal() + result.getCostDay());
         result.setCompensationAmountTotal(result.getCompensationAmountTotal() + result.getCompensationAmountDay());
         result.setViewCountTotal(result.getViewCountTotal() + result.getViewCountDay());
@@ -1936,116 +1939,88 @@ public class PlanStatOfMinuteDWD {
         result.setForwardUserCountTotal(result.getForwardUserCountTotal() + result.getForwardUserCountDay());
         result.setNoInterestCountTotal(result.getNoInterestCountTotal() + result.getNoInterestCountDay());
         // 总消耗 / 总曝光
-        result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : (result.getCostTotal() / result.getViewCountTotal() * 1000));
+        result.setThousandDisplayPriceAll(result.getViewCountTotal() == 0 ? 0 : NumberUtil.divideForAd(result.getCostTotal(), result.getViewCountTotal()).multiply(new BigDecimal(1000)).longValue());
         // 广告点击次数 / 广告曝光次数
-        result.setCtrAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValidClickCountTotal() / result.getViewCountTotal());
+        result.setCtrAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountTotal(), result.getViewCountTotal()));
         // 广告花费/广告点击次数
-        result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValidClickCountTotal());
+        result.setCpcAll(result.getValidClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValidClickCountTotal()));
         // 广告可转化点击次数/广告曝光次数
-        result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? 0.0 : result.getValuableClickCountTotal() / result.getViewCountTotal());
+        result.setValuableClickRateAll(result.getViewCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountTotal(), result.getViewCountTotal()));
         // 广告花费/可转化点击次数
-        result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : result.getCostTotal() / result.getValuableClickCountTotal());
+        result.setValuableClickCostAll(result.getValuableClickCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getValuableClickCountTotal()));
         // 广告花费/转化目标量
-        result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getConversionsCountTotal());
+        result.setConversionsCostAll(result.getConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getConversionsCountTotal()));
         // 公众号:转化目标量/点击次数。
-        result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getConversionsCountTotal() / result.getValidClickCountTotal());
+        result.setConversionsRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountTotal(), result.getValidClickCountTotal()));
         // 广告花费/深度转化目标量
-        result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : result.getCostTotal() / result.getDeepConversionsCountTotal());
+        result.setDeepConversionsCostAll(result.getDeepConversionsCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getDeepConversionsCountTotal()));
         // 深度转化目标量/可转化点击次数
-        result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? 0.0 : result.getDeepConversionsCountTotal() / result.getValuableClickCountTotal());
+        result.setDeepConversionsRateAll(result.getValuableClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountTotal(), result.getValuableClickCountTotal()));
         // 广告花费/下单量
-        result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOrderCountTotal());
+        result.setWebOrderCostAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOrderCountTotal()));
         // 下单量/点击次数
-        result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOrderCountTotal() / result.getValidClickCountTotal());
+        result.setOrderRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountTotal(), result.getValidClickCountTotal()));
         // 下单金额/下单量
-        result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : result.getOrderAmountTotal() / result.getOrderCountTotal());
+        result.setOrderUnitPriceAll(result.getOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountTotal(), result.getOrderCountTotal()));
         // 下单金额/广告花费
-        result.setOrderRoiAll(result.getCostTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getCostTotal());
+        result.setOrderRoiAll(result.getCostTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getCostTotal()));
         // 广告消耗 / 小游戏注册人数
-        result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : result.getCostTotal() / result.getWechatAppRegisterUvTotal());
+        result.setWechatMinigameRegisterCostAll(result.getWechatAppRegisterUvTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getWechatAppRegisterUvTotal()));
         // 小游戏注册人数 / 广告点击次数
-        result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getWechatAppRegisterUvTotal() / result.getValidClickCountTotal());
+        result.setWechatMinigameRegisterRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvTotal(), result.getValidClickCountTotal()));
         // 总收益 / 总人数
-        result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? 0.0 : result.getOrderAmountTotal() / result.getWechatAppRegisterUvTotal());
+        result.setWechatMinigameArpuAll(result.getWechatAppRegisterUvTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountTotal(), result.getWechatAppRegisterUvTotal()));
         // 关注次数 / 点击次数
-        result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? 0.0 : result.getOfficialAccountFollowCountTotal() / result.getValidClickCountTotal());
+        result.setOfficialAccountFollowRateAll(result.getValidClickCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountTotal(), result.getValidClickCountTotal()));
         // 公众号内注册人数 / 公众号关注次数
-        result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountRegisterUserCountTotal() / result.getOfficialAccountFollowCountTotal());
+        result.setOfficialAccountRegisterRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
         // 广告消耗 / 广告注册人数
-        result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountRegisterUserCountTotal());
+        result.setOfficialAccountRegisterCostAll(result.getOfficialAccountRegisterUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountRegisterUserCountTotal()));
         // 注册产生的订单金额累计/广告花费
-        result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountRegisterAmountTotal() / result.getCostTotal());
+        result.setOfficialAccountRegisterRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountTotal(), result.getCostTotal()));
         // 公众号内填单的独立用户数/公众号关注次数
-        result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountApplyUserCountTotal() / result.getOfficialAccountFollowCountTotal());
+        result.setOfficialAccountApplyRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
         // 广告花费/广告产生的填单行为数量
-        result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountApplyUserCountTotal());
+        result.setOfficialAccountApplyCostAll(result.getOfficialAccountApplyUserCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountApplyUserCountTotal()));
         // 填单产生的订单金额累计/广告花费
-        result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountApplyAmountTotal() / result.getCostTotal());
+        result.setOfficialAccountApplyRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountTotal(), result.getCostTotal()));
         // 公众号内下单独立用户数(UV)/公众号关注次数
-        result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? 0.0 : result.getOfficialAccountOrderUserCountTotal() / result.getOfficialAccountFollowCountTotal());
+        result.setOfficialAccountOrderRateAll(result.getOfficialAccountFollowCountTotal() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountTotal(), result.getOfficialAccountFollowCountTotal()));
         // 广告花费/广告产生的下单行为数量
-        result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : result.getCostTotal() / result.getOfficialAccountOrderCountTotal());
+        result.setOfficialAccountOrderCostAll(result.getOfficialAccountOrderCountTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostTotal(), result.getOfficialAccountOrderCountTotal()));
         // 下单产生的订单金额累计/广告花费
-        result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : result.getOfficialAccountOrderAmountTotal() / result.getCostTotal());
+        result.setOfficialAccountOrderRoiAll(result.getCostTotal() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountTotal(), result.getCostTotal()));
 
         // 上一次聚合的 5分钟数据
         if (lastMinuteDWD != null && lastMinuteDWD.getHour().equals(result.getHour())) {
-            result.setCostDeviationRateMinute(result.getCostDeviationRateHour() - lastMinuteDWD.getCostDeviationRateHour());
             result.setCostMinute(result.getCostHour() - lastMinuteDWD.getCostHour());
             result.setCompensationAmountMinute(result.getCompensationAmountHour() - lastMinuteDWD.getCompensationAmountHour());
             result.setViewCountMinute(result.getViewCountHour() - lastMinuteDWD.getViewCountHour());
-            result.setThousandDisplayPriceMinute(result.getThousandDisplayPriceHour() - lastMinuteDWD.getThousandDisplayPriceHour());
-            result.setAvgViewPerUserMinute(result.getAvgViewPerUserHour() - lastMinuteDWD.getAvgViewPerUserHour());
             result.setValidClickCountMinute(result.getValidClickCountHour() - lastMinuteDWD.getValidClickCountHour());
-            result.setCtrMinute(result.getCtrHour() - lastMinuteDWD.getCtrHour());
-            result.setCpcMinute(result.getCpcHour() - lastMinuteDWD.getCpcHour());
             result.setValuableClickCountMinute(result.getValuableClickCountHour() - lastMinuteDWD.getValuableClickCountHour());
-            result.setValuableClickRateMinute(result.getValuableClickRateHour() - lastMinuteDWD.getValuableClickRateHour());
-            result.setValuableClickCostMinute(result.getValuableClickCostHour() - lastMinuteDWD.getValuableClickCostHour());
             result.setConversionsCountMinute(result.getConversionsCountHour() - lastMinuteDWD.getConversionsCountHour());
-            result.setConversionsCostMinute(result.getConversionsCostHour() - lastMinuteDWD.getConversionsCostHour());
-            result.setConversionsRateMinute(result.getConversionsRateHour() - lastMinuteDWD.getConversionsRateHour());
             result.setDeepConversionsCountMinute(result.getDeepConversionsCountHour() - lastMinuteDWD.getDeepConversionsCountHour());
-            result.setDeepConversionsCostMinute(result.getDeepConversionsCostHour() - lastMinuteDWD.getDeepConversionsCostHour());
-            result.setDeepConversionsRateMinute(result.getDeepConversionsRateHour() - lastMinuteDWD.getDeepConversionsRateHour());
             result.setOrderCountMinute(result.getOrderCountHour() - lastMinuteDWD.getOrderCountHour());
             result.setFirstDayOrderCountMinute(result.getFirstDayOrderCountHour() - lastMinuteDWD.getFirstDayOrderCountHour());
-            result.setWebOrderCostMinute(result.getWebOrderCostHour() - lastMinuteDWD.getWebOrderCostHour());
-            result.setOrderRateMinute(result.getOrderRateHour() - lastMinuteDWD.getOrderRateHour());
             result.setOrderAmountMinute(result.getOrderAmountHour() - lastMinuteDWD.getOrderAmountHour());
             result.setFirstDayOrderAmountMinute(result.getFirstDayOrderAmountHour() - lastMinuteDWD.getFirstDayOrderAmountHour());
-            result.setOrderUnitPriceMinute(result.getOrderUnitPriceHour() - lastMinuteDWD.getOrderUnitPriceHour());
-            result.setOrderRoiMinute(result.getOrderRoiHour() - lastMinuteDWD.getOrderRoiHour());
             result.setSignInCountMinute(result.getSignInCountHour() - lastMinuteDWD.getSignInCountHour());
             result.setScanFollowCountMinute(result.getScanFollowCountHour() - lastMinuteDWD.getScanFollowCountHour());
             result.setWechatAppRegisterUvMinute(result.getWechatAppRegisterUvHour() - lastMinuteDWD.getWechatAppRegisterUvHour());
-            result.setWechatMinigameRegisterCostMinute(result.getWechatMinigameRegisterCostHour() - lastMinuteDWD.getWechatMinigameRegisterCostHour());
-            result.setWechatMinigameRegisterRateMinute(result.getWechatMinigameRegisterRateHour() - lastMinuteDWD.getWechatMinigameRegisterRateHour());
-            result.setWechatMinigameArpuMinute(result.getWechatMinigameArpuHour() - lastMinuteDWD.getWechatMinigameArpuHour());
             result.setWechatMinigameRetentionCountMinute(result.getWechatMinigameRetentionCountHour() - lastMinuteDWD.getWechatMinigameRetentionCountHour());
             result.setWechatMinigameCheckoutCountMinute(result.getWechatMinigameCheckoutCountHour() - lastMinuteDWD.getWechatMinigameCheckoutCountHour());
             result.setWechatMinigameCheckoutAmountMinute(result.getWechatMinigameCheckoutAmountHour() - lastMinuteDWD.getWechatMinigameCheckoutAmountHour());
             result.setOfficialAccountFollowCountMinute(result.getOfficialAccountFollowCountHour() - lastMinuteDWD.getOfficialAccountFollowCountHour());
-            result.setOfficialAccountFollowRateMinute(result.getOfficialAccountFollowRateHour() - lastMinuteDWD.getOfficialAccountFollowRateHour());
             result.setOfficialAccountRegisterUserCountMinute(result.getOfficialAccountRegisterUserCountHour() - lastMinuteDWD.getOfficialAccountRegisterUserCountHour());
-            result.setOfficialAccountRegisterRateMinute(result.getOfficialAccountRegisterRateHour() - lastMinuteDWD.getOfficialAccountRegisterRateHour());
-            result.setOfficialAccountRegisterCostMinute(result.getOfficialAccountRegisterCostHour() - lastMinuteDWD.getOfficialAccountRegisterCostHour());
             result.setOfficialAccountRegisterAmountMinute(result.getOfficialAccountRegisterAmountHour() - lastMinuteDWD.getOfficialAccountRegisterAmountHour());
-            result.setOfficialAccountRegisterRoiMinute(result.getOfficialAccountRegisterRoiHour() - lastMinuteDWD.getOfficialAccountRegisterRoiHour());
             result.setOfficialAccountApplyCountMinute(result.getOfficialAccountApplyCountHour() - lastMinuteDWD.getOfficialAccountApplyCountHour());
             result.setOfficialAccountApplyUserCountMinute(result.getOfficialAccountApplyUserCountHour() - lastMinuteDWD.getOfficialAccountApplyUserCountHour());
-            result.setOfficialAccountApplyRateMinute(result.getOfficialAccountApplyRateHour() - lastMinuteDWD.getOfficialAccountApplyRateHour());
-            result.setOfficialAccountApplyCostMinute(result.getOfficialAccountApplyCostHour() - lastMinuteDWD.getOfficialAccountApplyCostHour());
             result.setOfficialAccountApplyAmountMinute(result.getOfficialAccountApplyAmountHour() - lastMinuteDWD.getOfficialAccountApplyAmountHour());
-            result.setOfficialAccountApplyRoiMinute(result.getOfficialAccountApplyRoiHour() - lastMinuteDWD.getOfficialAccountApplyRoiHour());
             result.setOfficialAccountOrderCountMinute(result.getOfficialAccountOrderCountHour() - lastMinuteDWD.getOfficialAccountOrderCountHour());
             result.setOfficialAccountFirstDayOrderCountMinute(result.getOfficialAccountFirstDayOrderCountHour() - lastMinuteDWD.getOfficialAccountFirstDayOrderCountHour());
             result.setOfficialAccountOrderUserCountMinute(result.getOfficialAccountOrderUserCountHour() - lastMinuteDWD.getOfficialAccountOrderUserCountHour());
-            result.setOfficialAccountOrderRateMinute(result.getOfficialAccountOrderRateHour() - lastMinuteDWD.getOfficialAccountOrderRateHour());
-            result.setOfficialAccountOrderCostMinute(result.getOfficialAccountOrderCostHour() - lastMinuteDWD.getOfficialAccountOrderCostHour());
             result.setOfficialAccountOrderAmountMinute(result.getOfficialAccountOrderAmountHour() - lastMinuteDWD.getOfficialAccountOrderAmountHour());
             result.setOfficialAccountFirstDayOrderAmountMinute(result.getOfficialAccountFirstDayOrderAmountHour() - lastMinuteDWD.getOfficialAccountFirstDayOrderAmountHour());
-            result.setOfficialAccountOrderRoiMinute(result.getOfficialAccountOrderRoiHour() - lastMinuteDWD.getOfficialAccountOrderRoiHour());
             result.setOfficialAccountConsultCountMinute(result.getOfficialAccountConsultCountHour() - lastMinuteDWD.getOfficialAccountConsultCountHour());
             result.setOfficialAccountReaderCountMinute(result.getOfficialAccountReaderCountHour() - lastMinuteDWD.getOfficialAccountReaderCountHour());
             result.setOfficialAccountCreditApplyUserCountMinute(result.getOfficialAccountCreditApplyUserCountHour() - lastMinuteDWD.getOfficialAccountCreditApplyUserCountHour());
@@ -2053,6 +2028,60 @@ public class PlanStatOfMinuteDWD {
             result.setForwardCountMinute(result.getForwardCountHour() - lastMinuteDWD.getForwardCountHour());
             result.setForwardUserCountMinute(result.getForwardUserCountHour() - lastMinuteDWD.getForwardUserCountHour());
             result.setNoInterestCountMinute(result.getNoInterestCountHour() - lastMinuteDWD.getNoInterestCountHour());
+
+
+            // 消耗 / 曝光
+            result.setThousandDisplayPriceMinute(result.getViewCountMinute() == 0 ? 0 : NumberUtil.divideForAd(result.getCostMinute(), result.getViewCountMinute()).multiply(new BigDecimal(1000)).longValue());
+            // 广告点击次数 / 广告曝光次数
+            result.setCtrMinute(result.getViewCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValidClickCountMinute(), result.getViewCountMinute()));
+            // 广告花费/广告点击次数
+            result.setCpcMinute(result.getValidClickCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getValidClickCountMinute()));
+            // 广告可转化点击次数/广告曝光次数
+            result.setValuableClickRateMinute(result.getViewCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getValuableClickCountMinute(), result.getViewCountMinute()));
+            // 广告花费/可转化点击次数
+            result.setValuableClickCostMinute(result.getValuableClickCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getValuableClickCountMinute()));
+            // 广告花费/转化目标量
+            result.setConversionsCostMinute(result.getConversionsCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getConversionsCountMinute()));
+            // 公众号:转化目标量/点击次数。
+            result.setConversionsRateMinute(result.getValidClickCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getConversionsCountMinute(), result.getValidClickCountMinute()));
+            // 广告花费/深度转化目标量
+            result.setDeepConversionsCostMinute(result.getDeepConversionsCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getDeepConversionsCountMinute()));
+            // 深度转化目标量/可转化点击次数
+            result.setDeepConversionsRateMinute(result.getValuableClickCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getDeepConversionsCountMinute(), result.getValuableClickCountMinute()));
+            // 广告花费/下单量
+            result.setWebOrderCostMinute(result.getOrderCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getOrderCountMinute()));
+            // 下单量/点击次数
+            result.setOrderRateMinute(result.getValidClickCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderCountMinute(), result.getValidClickCountMinute()));
+            // 下单金额/下单量
+            result.setOrderUnitPriceMinute(result.getOrderCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getOrderAmountMinute(), result.getOrderCountMinute()));
+            // 下单金额/广告花费
+            result.setOrderRoiMinute(result.getCostMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountMinute(), result.getCostMinute()));
+            // 广告消耗 / 小游戏注册人数
+            result.setWechatMinigameRegisterCostMinute(result.getWechatAppRegisterUvMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getWechatAppRegisterUvMinute()));
+            // 小游戏注册人数 / 广告点击次数
+            result.setWechatMinigameRegisterRateMinute(result.getValidClickCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getWechatAppRegisterUvMinute(), result.getValidClickCountMinute()));
+            // 总收益 / 总人数
+            result.setWechatMinigameArpuMinute(result.getWechatAppRegisterUvMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOrderAmountMinute(), result.getWechatAppRegisterUvMinute()));
+            // 关注次数 / 点击次数
+            result.setOfficialAccountFollowRateMinute(result.getValidClickCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountFollowCountMinute(), result.getValidClickCountMinute()));
+            // 公众号内注册人数 / 公众号关注次数
+            result.setOfficialAccountRegisterRateMinute(result.getOfficialAccountFollowCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountRegisterUserCountMinute(), result.getOfficialAccountFollowCountMinute()));
+            // 广告消耗 / 广告注册人数
+            result.setOfficialAccountRegisterCostMinute(result.getOfficialAccountRegisterUserCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getOfficialAccountRegisterUserCountMinute()));
+            // 注册产生的订单金额累计/广告花费
+            result.setOfficialAccountRegisterRoiMinute(result.getCostMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountRegisterAmountMinute(), result.getCostMinute()));
+            // 公众号内填单的独立用户数/公众号关注次数
+            result.setOfficialAccountApplyRateMinute(result.getOfficialAccountFollowCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountApplyUserCountMinute(), result.getOfficialAccountFollowCountMinute()));
+            // 广告花费/广告产生的填单行为数量
+            result.setOfficialAccountApplyCostMinute(result.getOfficialAccountApplyUserCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getOfficialAccountApplyUserCountMinute()));
+            // 填单产生的订单金额累计/广告花费
+            result.setOfficialAccountApplyRoiMinute(result.getCostMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountApplyAmountMinute(), result.getCostMinute()));
+            // 公众号内下单独立用户数(UV)/公众号关注次数
+            result.setOfficialAccountOrderRateMinute(result.getOfficialAccountFollowCountMinute() == 0 ? BigDecimal.ZERO : NumberUtil.divideForAd(result.getOfficialAccountOrderUserCountMinute(), result.getOfficialAccountFollowCountMinute()));
+            // 广告花费/广告产生的下单行为数量
+            result.setOfficialAccountOrderCostMinute(result.getOfficialAccountOrderCountMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getCostMinute(), result.getOfficialAccountOrderCountMinute()));
+            // 下单产生的订单金额累计/广告花费
+            result.setOfficialAccountOrderRoiMinute(result.getCostMinute() == 0 ? 0 : NumberUtil.divideForMoney(result.getOfficialAccountOrderAmountMinute(), result.getCostMinute()));
         } else {
             result.setCostDeviationRateMinute(statODS.getCostDeviationRate());
             result.setCostMinute(statODS.getCost());
@@ -2124,10 +2153,10 @@ public class PlanStatOfMinuteDWD {
     }
 
     private static PlanStatOfMinuteDWD initValue(PlanStatOfMinuteDWD dwd) {
-        dwd.setCostDeviationRateTotal(0.0);
-        dwd.setCostDeviationRateDay(0.0);
-        dwd.setCostDeviationRateHour(0.0);
-        dwd.setCostDeviationRateMinute(0.0);
+        dwd.setCostDeviationRateTotal(BigDecimal.ZERO);
+        dwd.setCostDeviationRateDay(BigDecimal.ZERO);
+        dwd.setCostDeviationRateHour(BigDecimal.ZERO);
+        dwd.setCostDeviationRateMinute(BigDecimal.ZERO);
         dwd.setCostTotal(0L);
         dwd.setCostDay(0L);
         dwd.setCostHour(0L);
@@ -2144,18 +2173,18 @@ public class PlanStatOfMinuteDWD {
         dwd.setThousandDisplayPriceDay(0L);
         dwd.setThousandDisplayPriceHour(0L);
         dwd.setThousandDisplayPriceMinute(0L);
-        dwd.setAvgViewPerUserAll(0.0);
-        dwd.setAvgViewPerUserDay(0.0);
-        dwd.setAvgViewPerUserHour(0.0);
-        dwd.setAvgViewPerUserMinute(0.0);
+        dwd.setAvgViewPerUserAll(BigDecimal.ZERO);
+        dwd.setAvgViewPerUserDay(BigDecimal.ZERO);
+        dwd.setAvgViewPerUserHour(BigDecimal.ZERO);
+        dwd.setAvgViewPerUserMinute(BigDecimal.ZERO);
         dwd.setValidClickCountTotal(0L);
         dwd.setValidClickCountDay(0L);
         dwd.setValidClickCountHour(0L);
         dwd.setValidClickCountMinute(0L);
-        dwd.setCtrAll(0.0);
-        dwd.setCtrDay(0.0);
-        dwd.setCtrHour(0.0);
-        dwd.setCtrMinute(0.0);
+        dwd.setCtrAll(BigDecimal.ZERO);
+        dwd.setCtrDay(BigDecimal.ZERO);
+        dwd.setCtrHour(BigDecimal.ZERO);
+        dwd.setCtrMinute(BigDecimal.ZERO);
         dwd.setCpcAll(0L);
         dwd.setCpcDay(0L);
         dwd.setCpcHour(0L);
@@ -2164,10 +2193,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setValuableClickCountDay(0L);
         dwd.setValuableClickCountHour(0L);
         dwd.setValuableClickCountMinute(0L);
-        dwd.setValuableClickRateAll(0.0);
-        dwd.setValuableClickRateDay(0.0);
-        dwd.setValuableClickRateHour(0.0);
-        dwd.setValuableClickRateMinute(0.0);
+        dwd.setValuableClickRateAll(BigDecimal.ZERO);
+        dwd.setValuableClickRateDay(BigDecimal.ZERO);
+        dwd.setValuableClickRateHour(BigDecimal.ZERO);
+        dwd.setValuableClickRateMinute(BigDecimal.ZERO);
         dwd.setValuableClickCostAll(0L);
         dwd.setValuableClickCostDay(0L);
         dwd.setValuableClickCostHour(0L);
@@ -2180,10 +2209,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setConversionsCostDay(0L);
         dwd.setConversionsCostHour(0L);
         dwd.setConversionsCostMinute(0L);
-        dwd.setConversionsRateAll(0.0);
-        dwd.setConversionsRateDay(0.0);
-        dwd.setConversionsRateHour(0.0);
-        dwd.setConversionsRateMinute(0.0);
+        dwd.setConversionsRateAll(BigDecimal.ZERO);
+        dwd.setConversionsRateDay(BigDecimal.ZERO);
+        dwd.setConversionsRateHour(BigDecimal.ZERO);
+        dwd.setConversionsRateMinute(BigDecimal.ZERO);
         dwd.setDeepConversionsCountTotal(0L);
         dwd.setDeepConversionsCountDay(0L);
         dwd.setDeepConversionsCountHour(0L);
@@ -2192,10 +2221,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setDeepConversionsCostDay(0L);
         dwd.setDeepConversionsCostHour(0L);
         dwd.setDeepConversionsCostMinute(0L);
-        dwd.setDeepConversionsRateAll(0.0);
-        dwd.setDeepConversionsRateDay(0.0);
-        dwd.setDeepConversionsRateHour(0.0);
-        dwd.setDeepConversionsRateMinute(0.0);
+        dwd.setDeepConversionsRateAll(BigDecimal.ZERO);
+        dwd.setDeepConversionsRateDay(BigDecimal.ZERO);
+        dwd.setDeepConversionsRateHour(BigDecimal.ZERO);
+        dwd.setDeepConversionsRateMinute(BigDecimal.ZERO);
         dwd.setOrderCountTotal(0L);
         dwd.setOrderCountDay(0L);
         dwd.setOrderCountHour(0L);
@@ -2208,10 +2237,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setWebOrderCostDay(0L);
         dwd.setWebOrderCostHour(0L);
         dwd.setWebOrderCostMinute(0L);
-        dwd.setOrderRateAll(0.0);
-        dwd.setOrderRateDay(0.0);
-        dwd.setOrderRateHour(0.0);
-        dwd.setOrderRateMinute(0.0);
+        dwd.setOrderRateAll(BigDecimal.ZERO);
+        dwd.setOrderRateDay(BigDecimal.ZERO);
+        dwd.setOrderRateHour(BigDecimal.ZERO);
+        dwd.setOrderRateMinute(BigDecimal.ZERO);
         dwd.setOrderAmountTotal(0L);
         dwd.setOrderAmountDay(0L);
         dwd.setOrderAmountHour(0L);
@@ -2224,10 +2253,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setOrderUnitPriceDay(0L);
         dwd.setOrderUnitPriceHour(0L);
         dwd.setOrderUnitPriceMinute(0L);
-        dwd.setOrderRoiAll(0.0);
-        dwd.setOrderRoiDay(0.0);
-        dwd.setOrderRoiHour(0.0);
-        dwd.setOrderRoiMinute(0.0);
+        dwd.setOrderRoiAll(BigDecimal.ZERO);
+        dwd.setOrderRoiDay(BigDecimal.ZERO);
+        dwd.setOrderRoiHour(BigDecimal.ZERO);
+        dwd.setOrderRoiMinute(BigDecimal.ZERO);
         dwd.setSignInCountTotal(0L);
         dwd.setSignInCountDay(0L);
         dwd.setSignInCountHour(0L);
@@ -2244,14 +2273,14 @@ public class PlanStatOfMinuteDWD {
         dwd.setWechatMinigameRegisterCostDay(0L);
         dwd.setWechatMinigameRegisterCostHour(0L);
         dwd.setWechatMinigameRegisterCostMinute(0L);
-        dwd.setWechatMinigameRegisterRateAll(0.0);
-        dwd.setWechatMinigameRegisterRateDay(0.0);
-        dwd.setWechatMinigameRegisterRateHour(0.0);
-        dwd.setWechatMinigameRegisterRateMinute(0.0);
-        dwd.setWechatMinigameArpuAll(0.0);
-        dwd.setWechatMinigameArpuDay(0.0);
-        dwd.setWechatMinigameArpuHour(0.0);
-        dwd.setWechatMinigameArpuMinute(0.0);
+        dwd.setWechatMinigameRegisterRateAll(BigDecimal.ZERO);
+        dwd.setWechatMinigameRegisterRateDay(BigDecimal.ZERO);
+        dwd.setWechatMinigameRegisterRateHour(BigDecimal.ZERO);
+        dwd.setWechatMinigameRegisterRateMinute(BigDecimal.ZERO);
+        dwd.setWechatMinigameArpuAll(BigDecimal.ZERO);
+        dwd.setWechatMinigameArpuDay(BigDecimal.ZERO);
+        dwd.setWechatMinigameArpuHour(BigDecimal.ZERO);
+        dwd.setWechatMinigameArpuMinute(BigDecimal.ZERO);
         dwd.setWechatMinigameRetentionCountTotal(0L);
         dwd.setWechatMinigameRetentionCountDay(0L);
         dwd.setWechatMinigameRetentionCountHour(0L);
@@ -2268,18 +2297,18 @@ public class PlanStatOfMinuteDWD {
         dwd.setOfficialAccountFollowCountDay(0L);
         dwd.setOfficialAccountFollowCountHour(0L);
         dwd.setOfficialAccountFollowCountMinute(0L);
-        dwd.setOfficialAccountFollowRateAll(0.0);
-        dwd.setOfficialAccountFollowRateDay(0.0);
-        dwd.setOfficialAccountFollowRateHour(0.0);
-        dwd.setOfficialAccountFollowRateMinute(0.0);
+        dwd.setOfficialAccountFollowRateAll(BigDecimal.ZERO);
+        dwd.setOfficialAccountFollowRateDay(BigDecimal.ZERO);
+        dwd.setOfficialAccountFollowRateHour(BigDecimal.ZERO);
+        dwd.setOfficialAccountFollowRateMinute(BigDecimal.ZERO);
         dwd.setOfficialAccountRegisterUserCountTotal(0L);
         dwd.setOfficialAccountRegisterUserCountDay(0L);
         dwd.setOfficialAccountRegisterUserCountHour(0L);
         dwd.setOfficialAccountRegisterUserCountMinute(0L);
-        dwd.setOfficialAccountRegisterRateAll(0.0);
-        dwd.setOfficialAccountRegisterRateDay(0.0);
-        dwd.setOfficialAccountRegisterRateHour(0.0);
-        dwd.setOfficialAccountRegisterRateMinute(0.0);
+        dwd.setOfficialAccountRegisterRateAll(BigDecimal.ZERO);
+        dwd.setOfficialAccountRegisterRateDay(BigDecimal.ZERO);
+        dwd.setOfficialAccountRegisterRateHour(BigDecimal.ZERO);
+        dwd.setOfficialAccountRegisterRateMinute(BigDecimal.ZERO);
         dwd.setOfficialAccountRegisterCostAll(0L);
         dwd.setOfficialAccountRegisterCostDay(0L);
         dwd.setOfficialAccountRegisterCostHour(0L);
@@ -2300,10 +2329,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setOfficialAccountApplyUserCountDay(0L);
         dwd.setOfficialAccountApplyUserCountHour(0L);
         dwd.setOfficialAccountApplyUserCountMinute(0L);
-        dwd.setOfficialAccountApplyRateAll(0.0);
-        dwd.setOfficialAccountApplyRateDay(0.0);
-        dwd.setOfficialAccountApplyRateHour(0.0);
-        dwd.setOfficialAccountApplyRateMinute(0.0);
+        dwd.setOfficialAccountApplyRateAll(BigDecimal.ZERO);
+        dwd.setOfficialAccountApplyRateDay(BigDecimal.ZERO);
+        dwd.setOfficialAccountApplyRateHour(BigDecimal.ZERO);
+        dwd.setOfficialAccountApplyRateMinute(BigDecimal.ZERO);
         dwd.setOfficialAccountApplyCostAll(0L);
         dwd.setOfficialAccountApplyCostDay(0L);
         dwd.setOfficialAccountApplyCostHour(0L);
@@ -2328,10 +2357,10 @@ public class PlanStatOfMinuteDWD {
         dwd.setOfficialAccountOrderUserCountDay(0L);
         dwd.setOfficialAccountOrderUserCountHour(0L);
         dwd.setOfficialAccountOrderUserCountMinute(0L);
-        dwd.setOfficialAccountOrderRateAll(0.0);
-        dwd.setOfficialAccountOrderRateDay(0.0);
-        dwd.setOfficialAccountOrderRateHour(0.0);
-        dwd.setOfficialAccountOrderRateMinute(0.0);
+        dwd.setOfficialAccountOrderRateAll(BigDecimal.ZERO);
+        dwd.setOfficialAccountOrderRateDay(BigDecimal.ZERO);
+        dwd.setOfficialAccountOrderRateHour(BigDecimal.ZERO);
+        dwd.setOfficialAccountOrderRateMinute(BigDecimal.ZERO);
         dwd.setOfficialAccountOrderCostAll(0L);
         dwd.setOfficialAccountOrderCostDay(0L);
         dwd.setOfficialAccountOrderCostHour(0L);

+ 4 - 2
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/pojo/properties/ApplicationProperties.java

@@ -1,14 +1,16 @@
 package flink.zanxiangnet.ad.monitoring.pojo.properties;
 
 public class ApplicationProperties {
+    public static final String FLINK_PARALLELISM_DEFAULT = "flink.parallelism.default";
+    public static final String FLINK_PARALLELISM_KAFKA = "flink.parallelism.kafka";
+    public static final String FLINK_CHECKPOINT_SAVEPOINT = "flink.checkpoint.savePath";
+
     public static final String MAX_COMPUTE_ACCOUNT_ID = "maxCompute.accountId";
     public static final String MAX_COMPUTE_ACCOUNT_KEY = "maxCompute.accountKey";
     public static final String MAX_COMPUTE_ACCOUNT_ENDPOINT = "maxCompute.endpoint";
     public static final String MAX_COMPUTE_ACCOUNT_PROJECT_NAME = "maxCompute.projectName";
     public static final String MAX_COMPUTE_ACCOUNT_TUNNEL_ENDPOINT = "maxCompute.tunnelEndpoint";
 
-    public static final String CHECKPOINT_SAVEPOINT = "checkpoint.savePath";
-
     public static final String CK_DRIVER_CLASS_NAME = "clickhouse.driverClassName";
     public static final String CK_URL = "clickhouse.url";
     public static final String CK_USERNAME = "clickhouse.username";

+ 10 - 10
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostHourDayProcess.java

@@ -79,9 +79,9 @@ public class CostHourDayProcess extends ProcessWindowFunction<AdStatOfDayDWD, Co
         //小时-总点击量
         costHourDM.setValidClickCountHour(0);
         //总平均点击率
-        costHourDM.setCtrAll(adStatOfMinuteDWD.getCtrAll());
+        costHourDM.setCtrAll(adStatOfMinuteDWD.getCtrAll().doubleValue());
         //天-总平均点击率
-        costHourDM.setCtrDay(adStatOfMinuteDWD.getCtrDay());
+        costHourDM.setCtrDay(adStatOfMinuteDWD.getCtrDay().doubleValue());
         //小时-总平均点击率
         costHourDM.setCtrHour(0);
         //总点击均价
@@ -103,9 +103,9 @@ public class CostHourDayProcess extends ProcessWindowFunction<AdStatOfDayDWD, Co
         //小时-总目标平均转化成本
         costHourDM.setConversionsCostHour(0);
         //总平均转化率
-        costHourDM.setConversionsRateAll(adStatOfMinuteDWD.getConversionsRateAll());
+        costHourDM.setConversionsRateAll(adStatOfMinuteDWD.getConversionsRateAll().doubleValue());
         //天-总平均转化率
-        costHourDM.setConversionsRateDay(adStatOfMinuteDWD.getConversionsRateDay());
+        costHourDM.setConversionsRateDay(adStatOfMinuteDWD.getConversionsRateDay().doubleValue());
         //小时-总平均转化率
         costHourDM.setConversionsRateHour(0);
         //TODO:总首日下单roi
@@ -139,9 +139,9 @@ public class CostHourDayProcess extends ProcessWindowFunction<AdStatOfDayDWD, Co
         //小时-总平均下单成本
         costHourDM.setWebOrderCostHour(0);
         //总平均下单率
-        costHourDM.setWebOrderRateTotal(adStatOfMinuteDWD.getOrderRateAll());
+        costHourDM.setWebOrderRateTotal(adStatOfMinuteDWD.getOrderRateAll().doubleValue());
         //天-总平均下单率
-        costHourDM.setWebOrderRateDay(adStatOfMinuteDWD.getOrderRateDay());
+        costHourDM.setWebOrderRateDay(adStatOfMinuteDWD.getOrderRateDay().doubleValue());
         //小时-总平均下单率
         costHourDM.setWebOrderRateHour(0);
         //TODO:总平均下单量-----webordercount和ordercount是同一个东西吗
@@ -151,9 +151,9 @@ public class CostHourDayProcess extends ProcessWindowFunction<AdStatOfDayDWD, Co
         //小时-总平均下单量
         costHourDM.setWebOrderCountHour(0);
         //总下单ROI
-        costHourDM.setOrderRoiTotal(adStatOfMinuteDWD.getOrderRoiAll());
+        costHourDM.setOrderRoiTotal(adStatOfMinuteDWD.getOrderRoiAll().doubleValue());
         //天-总下单roi
-        costHourDM.setOrderRoiDay(adStatOfMinuteDWD.getOrderRoiDay());
+        costHourDM.setOrderRoiDay(adStatOfMinuteDWD.getOrderRoiDay().doubleValue());
         //小时-总下单roi
         costHourDM.setOrderRoiHour(0);
         //总平均下单客单价
@@ -175,9 +175,9 @@ public class CostHourDayProcess extends ProcessWindowFunction<AdStatOfDayDWD, Co
         //小时-总平均公众号关注成本
         costHourDM.setFromFollowCostHour(0);
         //TODO:总平均公众号关注率----确认是否对应
-        costHourDM.setFromFollowRateTotal(adStatOfMinuteDWD.getOfficialAccountFollowRateAll());
+        costHourDM.setFromFollowRateTotal(adStatOfMinuteDWD.getOfficialAccountFollowRateAll().doubleValue());
         //天-总平均公众号关注率
-        costHourDM.setFromFollowRateDay(adStatOfMinuteDWD.getOfficialAccountFollowRateDay());
+        costHourDM.setFromFollowRateDay(adStatOfMinuteDWD.getOfficialAccountFollowRateDay().doubleValue());
         //小时-总平均公众号关注率
         costHourDM.setFromFollowRateHour(0);
         //TODO:总注册数-----下面全是有问题的

+ 15 - 15
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostHourProcess.java

@@ -156,11 +156,11 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         //小时-总点击量
         costHourDM.setValidClickCountHour(adStatOfMinuteDWD.getValidClickCountHour());
         //总平均点击率
-        costHourDM.setCtrAll(adStatOfMinuteDWD.getCtrAll());
+        costHourDM.setCtrAll(adStatOfMinuteDWD.getCtrAll().doubleValue());
         //天-总平均点击率
-        costHourDM.setCtrDay(adStatOfMinuteDWD.getCtrDay());
+        costHourDM.setCtrDay(adStatOfMinuteDWD.getCtrDay().doubleValue());
         //小时-总平均点击率
-        costHourDM.setCtrHour(adStatOfMinuteDWD.getCtrHour());
+        costHourDM.setCtrHour(adStatOfMinuteDWD.getCtrHour().doubleValue());
         //总点击均价
         costHourDM.setCpcAll(adStatOfMinuteDWD.getCpcAll());
         //天-总点击均价
@@ -180,11 +180,11 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         //小时-总目标平均转化成本
         costHourDM.setConversionsCostHour(adStatOfMinuteDWD.getConversionsCostHour());
         //总平均转化率
-        costHourDM.setConversionsRateAll(adStatOfMinuteDWD.getConversionsRateAll());
+        costHourDM.setConversionsRateAll(adStatOfMinuteDWD.getConversionsRateAll().doubleValue());
         //天-总平均转化率
-        costHourDM.setConversionsRateDay(adStatOfMinuteDWD.getConversionsRateDay());
+        costHourDM.setConversionsRateDay(adStatOfMinuteDWD.getConversionsRateDay().doubleValue());
         //小时-总平均转化率
-        costHourDM.setConversionsRateHour(adStatOfMinuteDWD.getConversionsRateHour());
+        costHourDM.setConversionsRateHour(adStatOfMinuteDWD.getConversionsRateHour().doubleValue());
         //TODO:总首日下单roi
         costHourDM.setFirstDayOrderRoiTotal(0);
         //天-总首日下单roi
@@ -216,11 +216,11 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         //小时-总平均下单成本
         costHourDM.setWebOrderCostHour(adStatOfMinuteDWD.getWebOrderCostHour());
         //总平均下单率
-        costHourDM.setWebOrderRateTotal(adStatOfMinuteDWD.getOrderRateAll());
+        costHourDM.setWebOrderRateTotal(adStatOfMinuteDWD.getOrderRateAll().doubleValue());
         //天-总平均下单率
-        costHourDM.setWebOrderRateDay(adStatOfMinuteDWD.getOrderRateDay());
+        costHourDM.setWebOrderRateDay(adStatOfMinuteDWD.getOrderRateDay().doubleValue());
         //小时-总平均下单率
-        costHourDM.setWebOrderRateHour(adStatOfMinuteDWD.getOrderRateHour());
+        costHourDM.setWebOrderRateHour(adStatOfMinuteDWD.getOrderRateHour().doubleValue());
         //TODO:总平均下单量-----webordercount和ordercount是同一个东西吗
         costHourDM.setWebOrderCountTotal(adStatOfMinuteDWD.getOrderCountTotal());
         //天-总平均下单量
@@ -228,11 +228,11 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         //小时-总平均下单量
         costHourDM.setWebOrderCountHour(adStatOfMinuteDWD.getOrderCountHour());
         //总下单ROI
-        costHourDM.setOrderRoiTotal(adStatOfMinuteDWD.getOrderRoiAll());
+        costHourDM.setOrderRoiTotal(adStatOfMinuteDWD.getOrderRoiAll().doubleValue());
         //天-总下单roi
-        costHourDM.setOrderRoiDay(adStatOfMinuteDWD.getOrderRoiDay());
+        costHourDM.setOrderRoiDay(adStatOfMinuteDWD.getOrderRoiDay().doubleValue());
         //小时-总下单roi
-        costHourDM.setOrderRoiHour(adStatOfMinuteDWD.getOrderRoiHour());
+        costHourDM.setOrderRoiHour(adStatOfMinuteDWD.getOrderRoiHour().doubleValue());
         //总平均下单客单价
         costHourDM.setOrderUnitPriceTotal(adStatOfMinuteDWD.getOrderUnitPriceAll());
         //天-总平均下单客单价
@@ -252,11 +252,11 @@ public class CostHourProcess extends KeyedProcessFunction<Long, AdStatOfHourDWD,
         //小时-总平均公众号关注成本
         costHourDM.setFromFollowCostHour(adStatOfMinuteDWD.getOfficialAccountFollowCountHour() == 0 ? 0 : adStatOfMinuteDWD.getCostHour() / adStatOfMinuteDWD.getOfficialAccountFollowCountHour());
         //TODO:总平均公众号关注率----确认是否对应
-        costHourDM.setFromFollowRateTotal(adStatOfMinuteDWD.getOfficialAccountFollowRateAll());
+        costHourDM.setFromFollowRateTotal(adStatOfMinuteDWD.getOfficialAccountFollowRateAll().doubleValue());
         //天-总平均公众号关注率
-        costHourDM.setFromFollowRateDay(adStatOfMinuteDWD.getOfficialAccountFollowRateDay());
+        costHourDM.setFromFollowRateDay(adStatOfMinuteDWD.getOfficialAccountFollowRateDay().doubleValue());
         //小时-总平均公众号关注率
-        costHourDM.setFromFollowRateHour(adStatOfMinuteDWD.getOfficialAccountFollowRateHour());
+        costHourDM.setFromFollowRateHour(adStatOfMinuteDWD.getOfficialAccountFollowRateHour().doubleValue());
         //TODO:总注册数-----下面全是有问题的
         costHourDM.setWebRegisterCountTotal(adStatOfMinuteDWD.getOfficialAccountRegisterUserCountTotal());
         //天-总注册数

+ 5 - 5
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/process/CostMinuteProcess.java

@@ -133,7 +133,7 @@ public class CostMinuteProcess extends KeyedProcessFunction<Long, AdStatOfMinute
         //分钟-总点击量
         costMinuterDM.validClickCountMinute = adStatOfMinuteDWD.getValidClickCountMinute();
         //分钟-总平均点击率
-        costMinuterDM.ctrMinute = adStatOfMinuteDWD.getCtrMinute();
+        costMinuterDM.ctrMinute = adStatOfMinuteDWD.getCtrMinute().doubleValue();
         //分钟-总点击均价
         costMinuterDM.cpcMinute = adStatOfMinuteDWD.getCpcMinute();
         //分钟-总目标转化量
@@ -141,7 +141,7 @@ public class CostMinuteProcess extends KeyedProcessFunction<Long, AdStatOfMinute
         //分钟-总目标平均转化成本
         costMinuterDM.conversionsCostMinute = adStatOfMinuteDWD.getConversionsCostMinute();
         //分钟-总平均转化率
-        costMinuterDM.conversionsRateMinute = adStatOfMinuteDWD.getConversionsRateMinute();
+        costMinuterDM.conversionsRateMinute = adStatOfMinuteDWD.getConversionsRateMinute().doubleValue();
         //TODO:分钟-总首日下单roi
         costMinuterDM.firstDayOrderRoiMinute = 0;
         //分钟-总首日下单金额
@@ -153,11 +153,11 @@ public class CostMinuteProcess extends KeyedProcessFunction<Long, AdStatOfMinute
         //分钟-总平均下单成本
         costMinuterDM.webOrderCostMinute = adStatOfMinuteDWD.getWebOrderCostMinute();
         //分钟-总平均下单率
-        costMinuterDM.webOrderRateMinute = adStatOfMinuteDWD.getOrderRateMinute();
+        costMinuterDM.webOrderRateMinute = adStatOfMinuteDWD.getOrderRateMinute().doubleValue();
         //TODO:分钟-总平均下单量
         costMinuterDM.webOrderCountMinute = adStatOfMinuteDWD.getOrderCountMinute();
         //分钟-总下单roi
-        costMinuterDM.orderRoiMinute = adStatOfMinuteDWD.getOrderRoiMinute();
+        costMinuterDM.orderRoiMinute = adStatOfMinuteDWD.getOrderRoiMinute().doubleValue();
         //分钟-总平均下单客单价
         costMinuterDM.orderUnitPriceMinute = adStatOfMinuteDWD.getOrderUnitPriceMinute();
         //分钟-总公众号关注量
@@ -165,7 +165,7 @@ public class CostMinuteProcess extends KeyedProcessFunction<Long, AdStatOfMinute
         //TODO:分钟-总平均公众号关注成本
         costMinuterDM.fromFollowCostMinute = adStatOfMinuteDWD.getOfficialAccountFollowCountMinute() == 0 ? 0 : adStatOfMinuteDWD.getCostMinute() / adStatOfMinuteDWD.getOfficialAccountFollowCountMinute();
         //TODO:分钟-总平均公众号关注率
-        costMinuterDM.fromFollowRateMinute = adStatOfMinuteDWD.getOfficialAccountFollowRateMinute();
+        costMinuterDM.fromFollowRateMinute = adStatOfMinuteDWD.getOfficialAccountFollowRateMinute().doubleValue();
         //TODO:分钟-总注册数-----下面都有问题
         costMinuterDM.webRegisterCountMinute = adStatOfMinuteDWD.getOfficialAccountRegisterUserCountMinute();
         //分钟-总注册人数

+ 6 - 1
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/sink/TunnelBatchStreamSink.java

@@ -22,6 +22,7 @@ import org.springframework.util.CollectionUtils;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -90,7 +91,11 @@ public class TunnelBatchStreamSink<T, IN extends List<T>> extends RichSinkFuncti
                     continue;
                 }
                 Object obj = fieldInfo.getGetMethod().invoke(t);
-                record.set(fieldInfo.getColumnName(), obj);
+                if (obj instanceof BigDecimal) {
+                    record.set(fieldInfo.getColumnName(), ((BigDecimal) obj).doubleValue());
+                } else {
+                    record.set(fieldInfo.getColumnName(), obj);
+                }
             }
             // append只是写入内存
             pack.append(record);

+ 16 - 0
flink-ad-monitoring/src/main/java/flink/zanxiangnet/ad/monitoring/util/NumberUtil.java

@@ -1,6 +1,7 @@
 package flink.zanxiangnet.ad.monitoring.util;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 
 public class NumberUtil {
 
@@ -38,4 +39,19 @@ public class NumberUtil {
         }
         return val2 == null ? val1 : val1.add(val2);
     }
+
+    public static BigDecimal divideForAd(Long val1, Long val2) {
+        return divideForAd(val1, val2, 18);
+    }
+
+    public static Long divideForMoney(Long val1, Long val2) {
+        return divideForAd(val1, val2, 2).longValue();
+    }
+
+    public static BigDecimal divideForAd(Long val1, Long val2, int scale) {
+        if (val2 == 0 || val1 == 0) {
+            return BigDecimal.ZERO;
+        }
+        return new BigDecimal(val1).divide(new BigDecimal(val2), 18, RoundingMode.HALF_UP);
+    }
 }

Some files were not shown because too many files changed in this diff