Bladeren bron

:fix:流水监控返回改为double,并删除百分号

zhangxianyu 1 jaar geleden
bovenliggende
commit
4295ffdff4

+ 3 - 3
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/FlowMonitorCountVo.java

@@ -17,19 +17,19 @@ public class FlowMonitorCountVo implements Serializable {
      * 消耗总计
      */
     @ApiModelProperty(value = "消耗总计")
-    private String costCount = "0";
+    private Double costCount = 0.0;
 
     /**
      * 充值总计
      */
     @ApiModelProperty(value = "充值总计")
-    private String amountCount = "0";
+    private Double amountCount = 0.0;
 
     /**
      * 回报率总计
      */
     @ApiModelProperty(value = "回报率总计")
-    private String recoveryCount = "0.00%";
+    private Double recoveryCount = 0.0;
 
 
 }

+ 13 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/FlowMonitorVO.java

@@ -48,68 +48,68 @@ public class FlowMonitorVO implements Serializable {
      * 10点充值金额
      */
     @ApiModelProperty(value = "10点充值金额")
-    private String tenAmount;
+    private Double tenAmount;
     /**
      * 10点环比
      */
     @ApiModelProperty(value = "10点环比")
-    private String tenRate;
+    private Double tenRate;
     /**
      * 10点回收率
      */
     @ApiModelProperty(value = "10点回收率")
-    private String tenRecovery;
+    private Double tenRecovery;
     /**
      * 14点充值金额
      */
     @ApiModelProperty(value = "14点充值金额")
-    private String fourteenAmount;
+    private Double fourteenAmount;
     /**
      * 14点环比
      */
     @ApiModelProperty(value = "14点环比")
-    private String fourteenRate;
+    private Double fourteenRate;
     /**
      * 14点回收率
      */
     @ApiModelProperty(value = "14点回收率")
-    private String fourteenRecovery;
+    private Double fourteenRecovery;
     /**
      * 17点充值金额
      */
     @ApiModelProperty(value = "17点充值金额")
-    private String seventeenAmount;
+    private Double seventeenAmount;
     /**
      * 17点环比
      */
     @ApiModelProperty(value = "17点环比")
-    private String seventeenRate;
+    private Double seventeenRate;
     /**
      * 17点回收率
      */
     @ApiModelProperty(value = "17点回收率")
-    private String seventeenRecovery;
+    private Double seventeenRecovery;
     /**
      * 24点充值金额
      */
     @ApiModelProperty(value = "24点充值金额")
-    private String twentyfourAmount;
+    private Double twentyfourAmount;
     /**
      * 24点环比
      */
     @ApiModelProperty(value = "24点环比")
-    private String twentyfourRate;
+    private Double twentyfourRate;
     /**
      * 24点回收率
      */
     @ApiModelProperty(value = "24点回收率")
-    private String twentyfourRecovery;
+    private Double twentyfourRecovery;
 
     /**
      * 消耗
      */
     @ApiModelProperty(value = "消耗")
-    private String costCount;
+    private Double costCount;
 
 
 }

+ 15 - 18
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java

@@ -5232,7 +5232,7 @@ public class GameDataServiceImpl implements IGameDataService {
         //根据维度选择 子表父表
         String costTable = "game_ads.ads_recharge_monitoring_cost";
         String orderTable = "game_ads.ads_recharge_monitoring_amount";
-        if (dto.getGameDimension()!=null&&dto.getGameDimension() != 1) {
+        if (dto.getGameDimension() != null && dto.getGameDimension() != 1) {
             costTable = "game_ads_parent.ads_recharge_monitoring_cost_parent";
             orderTable = "game_ads_parent.ads_recharge_monitoring_amount_parent";
         }
@@ -5269,21 +5269,18 @@ public class GameDataServiceImpl implements IGameDataService {
         if (CollectionUtils.isEmpty(records)) {
             return vo;
         }
-        BigDecimal amountCount = new BigDecimal(BigInteger.ZERO);
+        Double amountCount = 0.0;
         //取出24点充值,累计
         for (FlowMonitorVO record : records) {
-            BigDecimal bigDecimal = new BigDecimal(record.getTwentyfourAmount());
-            amountCount = amountCount.add(bigDecimal);
+            amountCount += record.getTwentyfourAmount();
         }
-
+        vo.setAmountCount(amountCount);
         //取出总消耗
-        String costCountStr  = records.get(0).getCostCount();
+        Double costCountStr = records.get(0).getCostCount();
         vo.setCostCount(costCountStr);
-        BigDecimal costCount = new BigDecimal(costCountStr);
         //用充值总数/总消耗
-        if(amountCount.compareTo(BigDecimal.ZERO)!=0){
-            vo.setRecoveryCount(amountCount.divide(costCount,RoundingMode.CEILING)+"%");
-            vo.setAmountCount(amountCount.toString());
+        if (amountCount != 0) {
+            vo.setRecoveryCount((amountCount / costCountStr)*100);
         }
         return vo;
     }
@@ -5364,17 +5361,17 @@ public class GameDataServiceImpl implements IGameDataService {
                                           b.maxDay,
                                           a.day,
                                           a.ten_amount, 
-                                          CONCAT(ROUND(a.ten_rate,2)*100,'%') as ten_rate,  -- 10点环比
-                                          CONCAT(ROUND(IF(ten_amount>0,ten_amount/b.costCount,ten_amount),2)*100,'%') as ten_recovery, -- 10点回报率(充值/消耗)
+                                          ROUND(a.ten_rate,2)*100 as ten_rate,  -- 10点环比
+                                          ROUND(IF(ten_amount>0,ten_amount/b.costCount,ten_amount),2)*100 as ten_recovery, -- 10点回报率(充值/消耗)
                                           a.fourteen_amount, -- 14点充值
-                                          CONCAT(ROUND(a.fourteen_rate,2)*100,'%') as fourteen_rate,  -- 14点环比
-                                          CONCAT(ROUND(IF(fourteen_amount>0,fourteen_amount/b.costCount,fourteen_amount),2)*100,'%') as fourteen_recovery, -- 14点回报率
+                                          ROUND(a.fourteen_rate,2)*100 as fourteen_rate,  -- 14点环比
+                                          ROUND(IF(fourteen_amount>0,fourteen_amount/b.costCount,fourteen_amount),2)*100 as fourteen_recovery, -- 14点回报率
                                           a.seventeen_amount, -- 17点充值
-                                          CONCAT(ROUND(a.seventeen_rate,2)*100,'%') as seventeen_rate,  -- 17点环比
-                                          CONCAT(ROUND(IF(seventeen_amount>0,seventeen_amount/b.costCount,seventeen_amount),2)*100,'%') as seventeen_recovery, -- 17点回报率
+                                          ROUND(a.seventeen_rate,2)*100 as seventeen_rate,  -- 17点环比
+                                          ROUND(IF(seventeen_amount>0,seventeen_amount/b.costCount,seventeen_amount),2)*100 as seventeen_recovery, -- 17点回报率
                                           a.twentyfour_amount, -- 24点充值
-                                          CONCAT(ROUND(a.twentyfour_rate,2)*100,'%') as twentyfour_rate,  -- 24点环比
-                                          CONCAT(ROUND(IF(twentyfour_amount>0,twentyfour_amount/b.costCount,twentyfour_amount),2)*100,'%') as twentyfour_recovery, -- 24点回报率
+                                          ROUND(a.twentyfour_rate,2)*100 as twentyfour_rate,  -- 24点环比
+                                          ROUND(IF(twentyfour_amount>0,twentyfour_amount/b.costCount,twentyfour_amount),2)*100 as twentyfour_recovery, -- 24点回报率
                                           b.costCount,
                                           a.pitcher_id, -- 投手id
                                           a.pitcher_name, -- 投手名称