|
@@ -7,7 +7,8 @@ import com.zanxiang.game.data.serve.pojo.dto.AgentDayAgainDTO;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.GamePromoteDayDTO;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.GamePromoteDayTotalDTO;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.GamePromoteTotalDTO;
|
|
|
-import com.zanxiang.game.data.serve.pojo.entity.*;
|
|
|
+import com.zanxiang.game.data.serve.pojo.entity.AdsAccountAgentDay;
|
|
|
+import com.zanxiang.game.data.serve.pojo.entity.AdsAgentDayAgain;
|
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
|
import com.zanxiang.game.data.serve.service.IAccountAgentDayService;
|
|
@@ -35,13 +36,9 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
-
|
|
|
import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
@@ -495,11 +492,16 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
|
|
|
List<AdsAgentDayAgain> list = againSql.getList(AdsAgentDayAgain.class);
|
|
|
|
|
|
//创建Map记录数据
|
|
|
- Map<LocalDate, List<AgentDayAgainVO>> map = new HashMap<>();
|
|
|
+ Map<LocalDate, List<AgentDayAgainVO>> map = new TreeMap<>(
|
|
|
+ (o1, o2) -> o1.isBefore(o2) == true ? -1 : 1);
|
|
|
//有序存储每个list,每个list包含当天的所有充值次数的复充数据
|
|
|
List<List<AgentDayAgainVO>> tempList = new ArrayList<>();
|
|
|
//记录查询出的记录条数
|
|
|
int count = list.size();
|
|
|
+ //没有数据直接返回空结果
|
|
|
+ if (count == 0){
|
|
|
+ return map;
|
|
|
+ }
|
|
|
//初始化list
|
|
|
initList(tempList, count);
|
|
|
|
|
@@ -508,6 +510,8 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
|
|
|
//用来计算Ci
|
|
|
int ci = i + 1;
|
|
|
//第一天的所有充值次数都是先计算的
|
|
|
+ //充值次数
|
|
|
+ tempList.get(0).get(i).setCn("C" + ci);
|
|
|
AgentDayAgainVO tempVO = tempList.get(0).get(i);
|
|
|
//"原": Ci
|
|
|
tempList.get(0).get(i).setOriginal(getCnByNum(list.get(0), ci));
|
|
@@ -526,6 +530,8 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
|
|
|
|
|
|
//计算第2-n天的数据 复充次数i的数据
|
|
|
for (int j = 1; j < count; j++) {
|
|
|
+ //充值次数
|
|
|
+ tempList.get(j).get(i).setCn("C" + ci);
|
|
|
//"原":前一天的"现"
|
|
|
tempList.get(j).get(i).setOriginal(tempList.get(j - 1).get(i).getPresent());
|
|
|
//"现":当天的Ci - 当天的C(i+1)
|