wcc 1 год назад
Родитель
Сommit
517b2358bd

+ 1 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsAccountRechargeRankingController.java

@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;

+ 1 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsAgentRechargeRankingController.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;

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

@@ -31,6 +31,12 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
 
     @Override
     public Page<AdsAccountRechargeRankingVO> listOfPage(AdsAccountRechargeRankingListDTO dto) {
+        if (StringUtils.isBlank(dto.getSortFiled())) {
+            dto.setSortFiled("cost");
+        }
+        if (StringUtils.isBlank(dto.getSortType())) {
+            dto.setSortType("desc");
+        }
         if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
             dto.setPitcherId(SecurityUtil.getUserId().toString());
         }
@@ -65,16 +71,16 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
         if (StringUtils.isNotBlank(dto.getPitcherId())) {
             cri.where().and(AdsAccountRechargeRanking::getPitcherId, "=", dto.getPitcherId());
         }
-        if(StringUtils.isNotBlank(dto.getAccountId())) {
+        if (StringUtils.isNotBlank(dto.getAccountId())) {
             cri.where().and(AdsAccountRechargeRanking::getAccountId, "=", dto.getAccountId());
         }
-        if(StringUtils.isNotBlank(dto.getGameId())) {
+        if (StringUtils.isNotBlank(dto.getGameId())) {
             cri.where().and(AdsAccountRechargeRanking::getGameId, "=", dto.getGameId());
         }
         if (StringUtils.isNotBlank(dto.getType())) {
             cri.where().and(AdsAccountRechargeRanking::getType, "=", dto.getType());
         }
-        cri.groupBy(AdsAccountRechargeRanking::getAccountId, AdsAccountRechargeRanking::getPitcherId, AdsAccountRechargeRanking::getType, AdsAccountRechargeRanking::getGameId);
+        cri.groupBy("account_id", "pitcher_id", "type", "game_id");
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(sqlStr + "$condition");
         sql.setPager(pager);

+ 7 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java

@@ -30,6 +30,12 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
     private Dao dao;
 
     public Page<AdsAgentRechargeRankingVO> listOfPage(AdsAgentRechargeRankingListDTO dto) {
+        if (StringUtils.isBlank(dto.getSortFiled())) {
+            dto.setSortFiled("today_amount");
+        }
+        if (StringUtils.isBlank(dto.getSortType())) {
+            dto.setSortType("desc");
+        }
         if (StringUtils.isBlank(dto.getPitcherId()) && !SecurityUtil.isManager()) {
             dto.setPitcherId(SecurityUtil.getUserId().toString());
         }
@@ -58,7 +64,7 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
         if (StringUtils.isNotBlank(dto.getType())) {
             cri.where().and(AdsAgentRechargeRanking::getType, "=", dto.getType());
         }
-        cri.groupBy(AdsAgentRechargeRanking::getAgentId, AdsAgentRechargeRanking::getPitcherId, AdsAgentRechargeRanking::getType);
+        cri.groupBy("agent_id", "pitcher_id", "type");
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(sqlStr + "$condition");
         sql.setPager(pager);