wcc 1 ano atrás
pai
commit
907ea479fc

+ 9 - 5
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAccountRechargeRankingServiceImpl.java

@@ -3,8 +3,6 @@ package com.zanxiang.game.data.serve.service.impl;
 import com.google.common.base.CaseFormat;
 import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.data.serve.pojo.dto.AdsAccountRechargeRankingListDTO;
-import com.zanxiang.game.data.serve.pojo.entity.AdsAccountRechargeRanking;
-import com.zanxiang.game.data.serve.pojo.entity.AdsAgentRechargeRanking;
 import com.zanxiang.game.data.serve.pojo.vo.AdsAccountRechargeRankingVO;
 import com.zanxiang.game.data.serve.service.IAdsAccountRechargeRankingService;
 import com.zanxiang.game.data.serve.utils.Page;
@@ -102,9 +100,15 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
         List<AdsAccountRechargeRankingVO> result = sql.getList(AdsAccountRechargeRankingVO.class);
         if (CollectionUtils.isNotEmpty(result)) {
             result.forEach(vo -> {
-                vo.setClickRate(NumberUtil.multiply100(vo.getClickRate()).setScale(2, RoundingMode.HALF_UP));
-                vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
-                vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                if (vo.getClickRate() != null) {
+                    vo.setClickRate(NumberUtil.multiply100(vo.getClickRate()).setScale(2, RoundingMode.HALF_UP));
+                }
+                if (vo.getAvgAmount() != null) {
+                    vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
+                }
+                if (vo.getRoi() != null) {
+                    vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                }
             });
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
             int size = result.size();

+ 6 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java

@@ -86,8 +86,12 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
         List<AdsAgentRechargeRankingVO> result = sql.getList(AdsAgentRechargeRankingVO.class);
         if (CollectionUtils.isNotEmpty(result)) {
             result.forEach(vo -> {
-                vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
-                vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                if (vo.getAvgAmount() != null) {
+                    vo.setAvgAmount(vo.getAvgAmount().setScale(2, RoundingMode.HALF_UP));
+                }
+                if (vo.getRoi() != null) {
+                    vo.setRoi(NumberUtil.multiply100(vo.getRoi()).setScale(2, RoundingMode.HALF_UP));
+                }
             });
             int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
             int size = result.size();