|
@@ -2,11 +2,7 @@ package com.zanxiang.game.data.serve.service.impl;
|
|
|
|
|
|
import com.google.common.base.CaseFormat;
|
|
import com.google.common.base.CaseFormat;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
-import com.zanxiang.game.data.serve.pojo.dto.GameDataAgainDayDTO;
|
|
|
|
-import com.zanxiang.game.data.serve.pojo.dto.GameDataDayDTO;
|
|
|
|
-import com.zanxiang.game.data.serve.pojo.dto.GameDataH5DTO;
|
|
|
|
-import com.zanxiang.game.data.serve.pojo.dto.GameDataTotalDTO;
|
|
|
|
-import com.zanxiang.game.data.serve.pojo.dto.GameDataWaterDTO;
|
|
|
|
|
|
+import com.zanxiang.game.data.serve.pojo.dto.*;
|
|
import com.zanxiang.game.data.serve.pojo.entity.*;
|
|
import com.zanxiang.game.data.serve.pojo.entity.*;
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
@@ -37,9 +33,8 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.beans.PropertyDescriptor;
|
|
import java.beans.PropertyDescriptor;
|
|
-import java.lang.reflect.Method;
|
|
|
|
|
|
+import java.lang.reflect.Field;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-
|
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -119,14 +114,16 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
|
|
|
List<GameDataDayVO> gameDataDayVOList = list.stream().map(vo -> {
|
|
List<GameDataDayVO> gameDataDayVOList = list.stream().map(vo -> {
|
|
//买量数据
|
|
//买量数据
|
|
- String[] buyAmountD1 = vo.getBuyAmountD1().split("/");
|
|
|
|
|
|
+ /*String[] buyAmountD1 = vo.getBuyAmountD1().split("/");
|
|
vo.setBuyAmountD1Trend(RechargeTrendVO.builder()
|
|
vo.setBuyAmountD1Trend(RechargeTrendVO.builder()
|
|
.rechargeMoney(new BigDecimal(buyAmountD1[0]))
|
|
.rechargeMoney(new BigDecimal(buyAmountD1[0]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD1[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD1[1]))
|
|
.increase(new BigDecimal(buyAmountD1[2]))
|
|
.increase(new BigDecimal(buyAmountD1[2]))
|
|
.back(new BigDecimal(buyAmountD1[3]))
|
|
.back(new BigDecimal(buyAmountD1[3]))
|
|
.multiples(new BigDecimal(buyAmountD1[4]))
|
|
.multiples(new BigDecimal(buyAmountD1[4]))
|
|
- .build());
|
|
|
|
|
|
+ .build());*/
|
|
|
|
+ setAgainContentByNum(vo, "D1", "buy");
|
|
|
|
+
|
|
|
|
|
|
String[] buyAmountD3 = vo.getBuyAmountD3().split("/");
|
|
String[] buyAmountD3 = vo.getBuyAmountD3().split("/");
|
|
vo.setBuyAmountD3Trend(RechargeTrendVO.builder()
|
|
vo.setBuyAmountD3Trend(RechargeTrendVO.builder()
|
|
@@ -134,7 +131,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountD3[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD3[1]))
|
|
.increase(new BigDecimal(buyAmountD3[2]))
|
|
.increase(new BigDecimal(buyAmountD3[2]))
|
|
.back(new BigDecimal(buyAmountD3[3]))
|
|
.back(new BigDecimal(buyAmountD3[3]))
|
|
- .multiples(new BigDecimal(buyAmountD3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountD3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountD5 = vo.getBuyAmountD5().split("/");
|
|
String[] buyAmountD5 = vo.getBuyAmountD5().split("/");
|
|
@@ -143,7 +140,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountD5[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD5[1]))
|
|
.increase(new BigDecimal(buyAmountD5[2]))
|
|
.increase(new BigDecimal(buyAmountD5[2]))
|
|
.back(new BigDecimal(buyAmountD5[3]))
|
|
.back(new BigDecimal(buyAmountD5[3]))
|
|
- .multiples(new BigDecimal(buyAmountD5[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountD5[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountD7 = vo.getBuyAmountD7().split("/");
|
|
String[] buyAmountD7 = vo.getBuyAmountD7().split("/");
|
|
@@ -152,7 +149,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountD7[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD7[1]))
|
|
.increase(new BigDecimal(buyAmountD7[2]))
|
|
.increase(new BigDecimal(buyAmountD7[2]))
|
|
.back(new BigDecimal(buyAmountD7[3]))
|
|
.back(new BigDecimal(buyAmountD7[3]))
|
|
- .multiples(new BigDecimal(buyAmountD7[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountD7[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountD15 = vo.getBuyAmountD15().split("/");
|
|
String[] buyAmountD15 = vo.getBuyAmountD15().split("/");
|
|
@@ -161,7 +158,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountD15[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountD15[1]))
|
|
.increase(new BigDecimal(buyAmountD15[2]))
|
|
.increase(new BigDecimal(buyAmountD15[2]))
|
|
.back(new BigDecimal(buyAmountD15[3]))
|
|
.back(new BigDecimal(buyAmountD15[3]))
|
|
- .multiples(new BigDecimal(buyAmountD15[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountD15[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountM1 = vo.getBuyAmountM1().split("/");
|
|
String[] buyAmountM1 = vo.getBuyAmountM1().split("/");
|
|
@@ -170,7 +167,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountM1[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountM1[1]))
|
|
.increase(new BigDecimal(buyAmountM1[2]))
|
|
.increase(new BigDecimal(buyAmountM1[2]))
|
|
.back(new BigDecimal(buyAmountM1[3]))
|
|
.back(new BigDecimal(buyAmountM1[3]))
|
|
- .multiples(new BigDecimal(buyAmountM1[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountM1[4]).setScale(2,RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountM2 = vo.getBuyAmountM2().split("/");
|
|
String[] buyAmountM2 = vo.getBuyAmountM2().split("/");
|
|
@@ -179,7 +176,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountM2[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountM2[1]))
|
|
.increase(new BigDecimal(buyAmountM2[2]))
|
|
.increase(new BigDecimal(buyAmountM2[2]))
|
|
.back(new BigDecimal(buyAmountM2[3]))
|
|
.back(new BigDecimal(buyAmountM2[3]))
|
|
- .multiples(new BigDecimal(buyAmountM2[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountM2[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountM3 = vo.getBuyAmountM3().split("/");
|
|
String[] buyAmountM3 = vo.getBuyAmountM3().split("/");
|
|
@@ -188,7 +185,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountM3[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountM3[1]))
|
|
.increase(new BigDecimal(buyAmountM3[2]))
|
|
.increase(new BigDecimal(buyAmountM3[2]))
|
|
.back(new BigDecimal(buyAmountM3[3]))
|
|
.back(new BigDecimal(buyAmountM3[3]))
|
|
- .multiples(new BigDecimal(buyAmountM3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountM3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountM6 = vo.getBuyAmountM6().split("/");
|
|
String[] buyAmountM6 = vo.getBuyAmountM6().split("/");
|
|
@@ -197,7 +194,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountM6[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountM6[1]))
|
|
.increase(new BigDecimal(buyAmountM6[2]))
|
|
.increase(new BigDecimal(buyAmountM6[2]))
|
|
.back(new BigDecimal(buyAmountM6[3]))
|
|
.back(new BigDecimal(buyAmountM6[3]))
|
|
- .multiples(new BigDecimal(buyAmountM6[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountM6[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] buyAmountSum = vo.getBuyAmountSum().split("/");
|
|
String[] buyAmountSum = vo.getBuyAmountSum().split("/");
|
|
@@ -206,7 +203,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(buyAmountSum[1]))
|
|
.rechargeUserCount(Long.valueOf(buyAmountSum[1]))
|
|
.increase(new BigDecimal(buyAmountSum[2]))
|
|
.increase(new BigDecimal(buyAmountSum[2]))
|
|
.back(new BigDecimal(buyAmountSum[3]))
|
|
.back(new BigDecimal(buyAmountSum[3]))
|
|
- .multiples(new BigDecimal(buyAmountSum[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(buyAmountSum[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
//自然量数据
|
|
//自然量数据
|
|
@@ -216,7 +213,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountD1[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountD1[1]))
|
|
.increase(new BigDecimal(natureAmountD1[2]))
|
|
.increase(new BigDecimal(natureAmountD1[2]))
|
|
.back(new BigDecimal(natureAmountD1[3]))
|
|
.back(new BigDecimal(natureAmountD1[3]))
|
|
- .multiples(new BigDecimal(natureAmountD1[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountD1[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountD3 = vo.getNatureAmountD3().split("/");
|
|
String[] natureAmountD3 = vo.getNatureAmountD3().split("/");
|
|
@@ -225,7 +222,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountD3[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountD3[1]))
|
|
.increase(new BigDecimal(natureAmountD3[2]))
|
|
.increase(new BigDecimal(natureAmountD3[2]))
|
|
.back(new BigDecimal(natureAmountD3[3]))
|
|
.back(new BigDecimal(natureAmountD3[3]))
|
|
- .multiples(new BigDecimal(natureAmountD3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountD3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountD5 = vo.getNatureAmountD5().split("/");
|
|
String[] natureAmountD5 = vo.getNatureAmountD5().split("/");
|
|
@@ -234,7 +231,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountD5[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountD5[1]))
|
|
.increase(new BigDecimal(natureAmountD5[2]))
|
|
.increase(new BigDecimal(natureAmountD5[2]))
|
|
.back(new BigDecimal(natureAmountD5[3]))
|
|
.back(new BigDecimal(natureAmountD5[3]))
|
|
- .multiples(new BigDecimal(natureAmountD5[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountD5[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountD7 = vo.getNatureAmountD7().split("/");
|
|
String[] natureAmountD7 = vo.getNatureAmountD7().split("/");
|
|
@@ -243,7 +240,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountD7[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountD7[1]))
|
|
.increase(new BigDecimal(natureAmountD7[2]))
|
|
.increase(new BigDecimal(natureAmountD7[2]))
|
|
.back(new BigDecimal(natureAmountD7[3]))
|
|
.back(new BigDecimal(natureAmountD7[3]))
|
|
- .multiples(new BigDecimal(natureAmountD7[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountD7[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountD15 = vo.getNatureAmountD15().split("/");
|
|
String[] natureAmountD15 = vo.getNatureAmountD15().split("/");
|
|
@@ -252,7 +249,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountD15[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountD15[1]))
|
|
.increase(new BigDecimal(natureAmountD15[2]))
|
|
.increase(new BigDecimal(natureAmountD15[2]))
|
|
.back(new BigDecimal(natureAmountD15[3]))
|
|
.back(new BigDecimal(natureAmountD15[3]))
|
|
- .multiples(new BigDecimal(natureAmountD15[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountD15[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountM1 = vo.getNatureAmountM1().split("/");
|
|
String[] natureAmountM1 = vo.getNatureAmountM1().split("/");
|
|
@@ -261,7 +258,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountM1[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountM1[1]))
|
|
.increase(new BigDecimal(natureAmountM1[2]))
|
|
.increase(new BigDecimal(natureAmountM1[2]))
|
|
.back(new BigDecimal(natureAmountM1[3]))
|
|
.back(new BigDecimal(natureAmountM1[3]))
|
|
- .multiples(new BigDecimal(natureAmountM1[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountM1[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountM2 = vo.getNatureAmountM2().split("/");
|
|
String[] natureAmountM2 = vo.getNatureAmountM2().split("/");
|
|
@@ -270,7 +267,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountM2[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountM2[1]))
|
|
.increase(new BigDecimal(natureAmountM2[2]))
|
|
.increase(new BigDecimal(natureAmountM2[2]))
|
|
.back(new BigDecimal(natureAmountM2[3]))
|
|
.back(new BigDecimal(natureAmountM2[3]))
|
|
- .multiples(new BigDecimal(natureAmountM2[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountM2[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountM3 = vo.getNatureAmountM3().split("/");
|
|
String[] natureAmountM3 = vo.getNatureAmountM3().split("/");
|
|
@@ -279,7 +276,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountM3[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountM3[1]))
|
|
.increase(new BigDecimal(natureAmountM3[2]))
|
|
.increase(new BigDecimal(natureAmountM3[2]))
|
|
.back(new BigDecimal(natureAmountM3[3]))
|
|
.back(new BigDecimal(natureAmountM3[3]))
|
|
- .multiples(new BigDecimal(natureAmountM3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountM3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountM6 = vo.getNatureAmountM6().split("/");
|
|
String[] natureAmountM6 = vo.getNatureAmountM6().split("/");
|
|
@@ -288,7 +285,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountM6[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountM6[1]))
|
|
.increase(new BigDecimal(natureAmountM6[2]))
|
|
.increase(new BigDecimal(natureAmountM6[2]))
|
|
.back(new BigDecimal(natureAmountM6[3]))
|
|
.back(new BigDecimal(natureAmountM6[3]))
|
|
- .multiples(new BigDecimal(natureAmountM6[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountM6[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] natureAmountSum = vo.getNatureAmountSum().split("/");
|
|
String[] natureAmountSum = vo.getNatureAmountSum().split("/");
|
|
@@ -297,18 +294,20 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(natureAmountSum[1]))
|
|
.rechargeUserCount(Long.valueOf(natureAmountSum[1]))
|
|
.increase(new BigDecimal(natureAmountSum[2]))
|
|
.increase(new BigDecimal(natureAmountSum[2]))
|
|
.back(new BigDecimal(natureAmountSum[3]))
|
|
.back(new BigDecimal(natureAmountSum[3]))
|
|
- .multiples(new BigDecimal(natureAmountSum[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(natureAmountSum[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
//总量数据
|
|
//总量数据
|
|
- String[] amountD1 = vo.getAmountD1().split("/");
|
|
|
|
|
|
+ /*String[] amountD1 = vo.getAmountD1().split("/");
|
|
vo.setAmountD1Trend(RechargeTrendVO.builder()
|
|
vo.setAmountD1Trend(RechargeTrendVO.builder()
|
|
.rechargeMoney(new BigDecimal(amountD1[0]))
|
|
.rechargeMoney(new BigDecimal(amountD1[0]))
|
|
.rechargeUserCount(Long.valueOf(amountD1[1]))
|
|
.rechargeUserCount(Long.valueOf(amountD1[1]))
|
|
.increase(new BigDecimal(amountD1[2]))
|
|
.increase(new BigDecimal(amountD1[2]))
|
|
.back(new BigDecimal(amountD1[3]))
|
|
.back(new BigDecimal(amountD1[3]))
|
|
- .multiples(new BigDecimal(amountD1[4]))
|
|
|
|
- .build());
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountD1[4]).setScale(2,RoundingMode.HALF_UP))
|
|
|
|
+ .build());*/
|
|
|
|
+ setAgainContentByNum(vo, "D1", "");
|
|
|
|
+
|
|
|
|
|
|
String[] amountD3 = vo.getAmountD3().split("/");
|
|
String[] amountD3 = vo.getAmountD3().split("/");
|
|
vo.setAmountD3Trend(RechargeTrendVO.builder()
|
|
vo.setAmountD3Trend(RechargeTrendVO.builder()
|
|
@@ -316,7 +315,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountD3[1]))
|
|
.rechargeUserCount(Long.valueOf(amountD3[1]))
|
|
.increase(new BigDecimal(amountD3[2]))
|
|
.increase(new BigDecimal(amountD3[2]))
|
|
.back(new BigDecimal(amountD3[3]))
|
|
.back(new BigDecimal(amountD3[3]))
|
|
- .multiples(new BigDecimal(amountD3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountD3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountD5 = vo.getAmountD5().split("/");
|
|
String[] amountD5 = vo.getAmountD5().split("/");
|
|
@@ -325,7 +324,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountD5[1]))
|
|
.rechargeUserCount(Long.valueOf(amountD5[1]))
|
|
.increase(new BigDecimal(amountD5[2]))
|
|
.increase(new BigDecimal(amountD5[2]))
|
|
.back(new BigDecimal(amountD5[3]))
|
|
.back(new BigDecimal(amountD5[3]))
|
|
- .multiples(new BigDecimal(amountD5[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountD5[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountD7 = vo.getAmountD7().split("/");
|
|
String[] amountD7 = vo.getAmountD7().split("/");
|
|
@@ -334,7 +333,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountD7[1]))
|
|
.rechargeUserCount(Long.valueOf(amountD7[1]))
|
|
.increase(new BigDecimal(amountD7[2]))
|
|
.increase(new BigDecimal(amountD7[2]))
|
|
.back(new BigDecimal(amountD7[3]))
|
|
.back(new BigDecimal(amountD7[3]))
|
|
- .multiples(new BigDecimal(amountD7[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountD7[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountD15 = vo.getAmountD15().split("/");
|
|
String[] amountD15 = vo.getAmountD15().split("/");
|
|
@@ -343,7 +342,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountD15[1]))
|
|
.rechargeUserCount(Long.valueOf(amountD15[1]))
|
|
.increase(new BigDecimal(amountD15[2]))
|
|
.increase(new BigDecimal(amountD15[2]))
|
|
.back(new BigDecimal(amountD15[3]))
|
|
.back(new BigDecimal(amountD15[3]))
|
|
- .multiples(new BigDecimal(amountD15[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountD15[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountM1 = vo.getAmountM1().split("/");
|
|
String[] amountM1 = vo.getAmountM1().split("/");
|
|
@@ -352,7 +351,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountM1[1]))
|
|
.rechargeUserCount(Long.valueOf(amountM1[1]))
|
|
.increase(new BigDecimal(amountM1[2]))
|
|
.increase(new BigDecimal(amountM1[2]))
|
|
.back(new BigDecimal(amountM1[3]))
|
|
.back(new BigDecimal(amountM1[3]))
|
|
- .multiples(new BigDecimal(amountM1[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountM1[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountM2 = vo.getAmountM2().split("/");
|
|
String[] amountM2 = vo.getAmountM2().split("/");
|
|
@@ -361,7 +360,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountM2[1]))
|
|
.rechargeUserCount(Long.valueOf(amountM2[1]))
|
|
.increase(new BigDecimal(amountM2[2]))
|
|
.increase(new BigDecimal(amountM2[2]))
|
|
.back(new BigDecimal(amountM2[3]))
|
|
.back(new BigDecimal(amountM2[3]))
|
|
- .multiples(new BigDecimal(amountM2[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountM2[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountM3 = vo.getAmountM3().split("/");
|
|
String[] amountM3 = vo.getAmountM3().split("/");
|
|
@@ -370,7 +369,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountM3[1]))
|
|
.rechargeUserCount(Long.valueOf(amountM3[1]))
|
|
.increase(new BigDecimal(amountM3[2]))
|
|
.increase(new BigDecimal(amountM3[2]))
|
|
.back(new BigDecimal(amountM3[3]))
|
|
.back(new BigDecimal(amountM3[3]))
|
|
- .multiples(new BigDecimal(amountM3[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountM3[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountM6 = vo.getAmountM6().split("/");
|
|
String[] amountM6 = vo.getAmountM6().split("/");
|
|
@@ -379,7 +378,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountM6[1]))
|
|
.rechargeUserCount(Long.valueOf(amountM6[1]))
|
|
.increase(new BigDecimal(amountM6[2]))
|
|
.increase(new BigDecimal(amountM6[2]))
|
|
.back(new BigDecimal(amountM6[3]))
|
|
.back(new BigDecimal(amountM6[3]))
|
|
- .multiples(new BigDecimal(amountM6[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountM6[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
String[] amountSum = vo.getAmountSum().split("/");
|
|
String[] amountSum = vo.getAmountSum().split("/");
|
|
@@ -388,7 +387,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
.rechargeUserCount(Long.valueOf(amountSum[1]))
|
|
.rechargeUserCount(Long.valueOf(amountSum[1]))
|
|
.increase(new BigDecimal(amountSum[2]))
|
|
.increase(new BigDecimal(amountSum[2]))
|
|
.back(new BigDecimal(amountSum[3]))
|
|
.back(new BigDecimal(amountSum[3]))
|
|
- .multiples(new BigDecimal(amountSum[4]))
|
|
|
|
|
|
+ .multiples(new BigDecimal(amountSum[4]).setScale(2,RoundingMode.HALF_UP))
|
|
.build());
|
|
.build());
|
|
|
|
|
|
return vo;
|
|
return vo;
|
|
@@ -398,6 +397,45 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
return new Page<>(gameDataDayVOList, pager);
|
|
return new Page<>(gameDataDayVOList, pager);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 游戏每日数据总计
|
|
|
|
+ * @param dto 前端传递的查询条件
|
|
|
|
+ * @return 返回给前端的总计数据实体
|
|
|
|
+ */
|
|
|
|
+ public GameDataDayTotalVO getGameDataDayTotal(GameDataDayTotalDTO dto) {
|
|
|
|
+
|
|
|
|
+ //如果没有传入查询时间默认查询当天
|
|
|
|
+ if (dto.getRegisteredBeginDate() == null || dto.getRegisteredEndDate() == null) {
|
|
|
|
+ dto.setRegisteredEndDate(LocalDate.now());
|
|
|
|
+ dto.setRegisteredEndDate(LocalDate.now());
|
|
|
|
+ }
|
|
|
|
+ //新增查询条件
|
|
|
|
+ Criteria cri = Cnd.cri();
|
|
|
|
+ if (dto.getGameId() != null) {
|
|
|
|
+ //拼接游戏id
|
|
|
|
+ cri.where().andEquals("game_id", dto.getGameId());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getGameName())) {
|
|
|
|
+ //拼接游戏名称
|
|
|
|
+ cri.where().andEquals("game_name", dto.getGameName());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
|
|
+ //拼接SDK来源
|
|
|
|
+ cri.where().andEquals("source_system", dto.getSourceSystem());
|
|
|
|
+ }
|
|
|
|
+ if (dto.getRegisteredBeginDate() != null && dto.getRegisteredEndDate() != null) {
|
|
|
|
+ //拼接查询时间
|
|
|
|
+ cri.where().andBetween("dt", dto.getRegisteredBeginDate(), dto.getRegisteredEndDate());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //Sql gameDataDayTotalsql =
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 游戏总数据
|
|
* 游戏总数据
|
|
*
|
|
*
|
|
@@ -1044,25 +1082,69 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
/**
|
|
/**
|
|
* 通过反射来获取Cn的值
|
|
* 通过反射来获取Cn的值
|
|
*
|
|
*
|
|
- * @param dto 数据库查询出来的原始数据对象实体
|
|
|
|
|
|
+ * @param vo 数据库查询出来的原始数据对象实体
|
|
* @param num 1-9
|
|
* @param num 1-9
|
|
* @return Cn
|
|
* @return Cn
|
|
*/
|
|
*/
|
|
- private Long getCnByNum(Object dto, int num) {
|
|
|
|
|
|
+ private Long getCnByNum(Object vo, int num) {
|
|
try {
|
|
try {
|
|
- Method m1 = null;
|
|
|
|
- //不同对象获取的方法不同
|
|
|
|
- if (dto instanceof AdsGameDayAgain) {
|
|
|
|
- m1 = AdsGameDayAgain.class.getDeclaredMethod(String.format("getC%s", num));
|
|
|
|
- } else if (dto instanceof AdsGameDayAgainBuy) {
|
|
|
|
- m1 = AdsGameDayAgainBuy.class.getDeclaredMethod(String.format("getBuyC%s", num));
|
|
|
|
- } else if (dto instanceof AdsGameDayAgainNature) {
|
|
|
|
- m1 = AdsGameDayAgainNature.class.getDeclaredMethod(String.format("getNatureC%s", num));
|
|
|
|
|
|
+
|
|
|
|
+ Field f = null;
|
|
|
|
+ if (vo instanceof AdsGameDayAgain) {
|
|
|
|
+ f = AdsGameDayAgain.class.getDeclaredField(String.format("c%s", num));
|
|
|
|
+ } else if (vo instanceof AdsGameDayAgainBuy) {
|
|
|
|
+ f = AdsGameDayAgainBuy.class.getDeclaredField(String.format("buyC%s", num));
|
|
|
|
+ } else if (vo instanceof AdsGameDayAgainNature) {
|
|
|
|
+ f = AdsGameDayAgainNature.class.getDeclaredField(String.format("natureC%s", num));
|
|
}
|
|
}
|
|
|
|
+ f.setAccessible(true);
|
|
//返回对应的Cn值
|
|
//返回对应的Cn值
|
|
- return (Long) m1.invoke(dto);
|
|
|
|
|
|
+ return (Long) f.get(vo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new BaseException("get方法出错,映射出错");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过反射使用set方法 得到复充趋势的值
|
|
|
|
+ *
|
|
|
|
+ * @param vo 需要操作的对象
|
|
|
|
+ * @param timeType D1-D30 , M1-M6
|
|
|
|
+ * @param tableType buy、nature 总
|
|
|
|
+ */
|
|
|
|
+ private void setAgainContentByNum(GameDataDayVO vo, String timeType, String tableType) {
|
|
|
|
+ try {
|
|
|
|
+ //反射得到复充趋势数据字符串
|
|
|
|
+ Field f;
|
|
|
|
+ if (StringUtils.isNotBlank(tableType)) {
|
|
|
|
+ f = vo.getClass().getDeclaredField(tableType + "Amount" + timeType);
|
|
|
|
+ } else {
|
|
|
|
+ f = vo.getClass().getDeclaredField("amount" + timeType);
|
|
|
|
+ }
|
|
|
|
+ f.setAccessible(true);
|
|
|
|
+ //分割数据
|
|
|
|
+ String[] strs = f.get(vo).toString().split("/");
|
|
|
|
+
|
|
|
|
+ //反射得到set方法
|
|
|
|
+ Field field;
|
|
|
|
+ if (StringUtils.isNotBlank(tableType)) {
|
|
|
|
+ field = vo.getClass().getDeclaredField(tableType + "Amount" + timeType + "Trend");
|
|
|
|
+ } else {
|
|
|
|
+ field = vo.getClass().getDeclaredField("amount" + timeType + "Trend");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ field.setAccessible(true);
|
|
|
|
+ //赋值
|
|
|
|
+ field.set(vo, RechargeTrendVO.builder()
|
|
|
|
+ .rechargeMoney(new BigDecimal(strs[0]))
|
|
|
|
+ .rechargeUserCount(Long.valueOf(strs[1]))
|
|
|
|
+ .increase(new BigDecimal(strs[2]))
|
|
|
|
+ .back(new BigDecimal(strs[3]))
|
|
|
|
+ .multiples(new BigDecimal(strs[4]).setScale(2,RoundingMode.HALF_UP))
|
|
|
|
+ .build());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new BaseException("发生错误");
|
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ throw new BaseException("get/set 方法出错,映射出错");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|