Browse Source

Merge branch 'dev' of GameCenter/game-center into master

zhimo 1 year ago
parent
commit
c0c3a29900
100 changed files with 3746 additions and 686 deletions
  1. 20 4
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AccountAgentDayController.java
  2. 0 38
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsAccountRechargeRankingController.java
  3. 0 37
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AdsAgentRechargeRankingController.java
  4. 13 13
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameDataController.java
  5. 2 3
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/OverallSummaryController.java
  6. 31 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RankingController.java
  7. 100 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/handler/GlobalExceptionHandler.java
  8. 2 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsAccountRechargeRankingListDTO.java
  9. 2 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsAgentRechargeRankingListDTO.java
  10. 3 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailListDTO.java
  11. 53 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AgentDayAgainDTO.java
  12. 12 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataAgainDayDTO.java
  13. 7 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataDayDTO.java
  14. 49 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataH5DTO.java
  15. 8 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataTotalDTO.java
  16. 7 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataWaterDTO.java
  17. 4 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayDTO.java
  18. 5 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayTotalDTO.java
  19. 5 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteTotalDTO.java
  20. 11 5
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/OverallSummaryDTO.java
  21. 2 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/RechargeRankingDTO.java
  22. 6 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAccountAgentDay.java
  23. 3 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAccountRechargeRanking.java
  24. 117 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAgentDayAgain.java
  25. 6 3
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAgentRechargeRanking.java
  26. 4 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynAmount.java
  27. 7 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGame.java
  28. 54 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGameBuy.java
  29. 54 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGameNature.java
  30. 66 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5LeadBuyGame.java
  31. 66 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5LeadNatureGame.java
  32. 66 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5NatureGame.java
  33. 66 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5PayGame.java
  34. 4 3
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsEverydayWater.java
  35. 10 5
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDay.java
  36. 17 13
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgain.java
  37. 16 13
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgainBuy.java
  38. 17 13
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgainNature.java
  39. 7 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsH5GameDay.java
  40. 6 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummary.java
  41. 71 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryAgent.java
  42. 84 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryAmount.java
  43. 72 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryCost.java
  44. 76 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryGame.java
  45. 71 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryUser.java
  46. 3 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsPlayerRechargeRanking.java
  47. 3 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AdsAccountRechargeRankingVO.java
  48. 9 9
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AdsAgentRechargeRankingVO.java
  49. 68 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AgentDayAgainVO.java
  50. 29 13
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataAgainDayVO.java
  51. 41 29
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataDayVO.java
  52. 123 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataH5VO.java
  53. 38 39
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataTotalVO.java
  54. 3 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataWaterVO.java
  55. 7 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GamePromoteDayVO.java
  56. 9 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GamePromoteTotalVO.java
  57. 2 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameRechargeRankingVO.java
  58. 69 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/H5BuyUserVO.java
  59. 69 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/H5NatureUserVO.java
  60. 7 2
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/OverallSummaryLineDataVO.java
  61. 20 15
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/OverallSummaryVO.java
  62. 6 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerRechargeRankingVO.java
  63. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerTemplateVO.java
  64. 1 1
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/RechargeTemplateVO.java
  65. 13 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAccountAgentDayService.java
  66. 4 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IGameDataService.java
  67. 275 26
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountAgentDayServiceImpl.java
  68. 43 21
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAccountRechargeRankingServiceImpl.java
  69. 45 24
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java
  70. 3 0
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailService.java
  71. 407 151
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java
  72. 165 26
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/OverallSummaryServiceImpl.java
  73. 24 15
      game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RankingServiceImpl.java
  74. 76 0
      game-data/game-data-serve/src/main/resources/logback.xml
  75. 1 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java
  76. 10 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/OrderController.java
  77. 12 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameUserRoleListParam.java
  78. 6 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/AgentChoiceVO.java
  79. 25 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameUserRoleListVO.java
  80. 209 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/OrderExcelVO.java
  81. 11 10
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IAgentService.java
  82. 10 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IOrderService.java
  83. 73 19
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java
  84. 17 13
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java
  85. 9 13
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java
  86. 55 16
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java
  87. 4 15
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserCardServiceImpl.java
  88. 14 17
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java
  89. 1 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Agent.java
  90. 71 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/UserVisitLog.java
  91. 12 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/UserVisitLogMapper.java
  92. 1 1
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java
  93. 1 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/adapter/ArgumentAdapter.java
  94. 53 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/PushController.java
  95. 0 38
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/RemitController.java
  96. 5 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/param/UserData.java
  97. 22 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/param/UserVisitLogParam.java
  98. 24 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IUserVisitLogService.java
  99. 138 7
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java
  100. 97 0
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserVisitLogServiceImpl.java

+ 20 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/AccountAgentDayController.java

@@ -1,9 +1,11 @@
 package com.zanxiang.game.data.serve.controller;
 
 import com.zanxiang.erp.security.annotation.PreAuthorize;
+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.vo.AgentDayAgainVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteDayTotalVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteDayVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteTotalVO;
@@ -13,7 +15,14 @@ import com.zanxiang.module.util.pojo.ResultVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
 
 @Api(tags = "推广数据")
 @RestController
@@ -23,23 +32,30 @@ public class AccountAgentDayController {
     private IAccountAgentDayService accountAgentDayService;
 
     @ApiOperation(value = "推广每日数据")
-//    @PreAuthorize(permissionKey = "gameData:accountAgent:day")
+    @PreAuthorize(permissionKey = "gameData:promote:day")
     @PostMapping("/day")
     public ResultVO<Page<GamePromoteDayVO>> accountAgentDay(@RequestBody GamePromoteDayDTO dto) {
         return ResultVO.ok(accountAgentDayService.accountAgentDay(dto));
     }
 
     @ApiOperation(value = "推广每日数据总计")
-    @PreAuthorize(permissionKey = "gameData:accountAgent:dayTotal")
+    @PreAuthorize(permissionKey = "gameData:promote:dayTotal")
     @PostMapping("/day/total")
     public ResultVO<GamePromoteDayTotalVO> accountAgentDayTotal(@RequestBody GamePromoteDayTotalDTO dto) {
         return ResultVO.ok(accountAgentDayService.accountAgentDayTotal(dto));
     }
 
     @ApiOperation(value = "推广总数据")
-//    @PreAuthorize(permissionKey = "gameData:accountAgent:total")
+    @PreAuthorize(permissionKey = "gameData:promote:total")
     @PostMapping("/total")
     public ResultVO<Page<GamePromoteTotalVO>> accountAgentTotal(@RequestBody GamePromoteTotalDTO dto) {
         return ResultVO.ok(accountAgentDayService.accountAgentTotal(dto));
     }
+
+    @ApiOperation(value = "推广渠道每日复充数据")
+    @PreAuthorize(permissionKey = "gameData:accountAgent:again")
+    @PostMapping("/again")
+    public ResultVO<Map<LocalDate, List<AgentDayAgainVO>>> accountAgentDayAgain(@RequestBody AgentDayAgainDTO dto) throws Exception {
+        return ResultVO.ok(accountAgentDayService.accountAgentDayAgain(dto));
+    }
 }

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

@@ -1,38 +0,0 @@
-package com.zanxiang.game.data.serve.controller;
-
-import com.zanxiang.erp.security.annotation.PreAuthorize;
-import com.zanxiang.game.data.serve.pojo.dto.AdsAccountRechargeRankingListDTO;
-import com.zanxiang.game.data.serve.pojo.vo.AdsAccountRechargeRankingVO;
-import com.zanxiang.game.data.serve.pojo.vo.AdsAgentRechargeRankingVO;
-import com.zanxiang.game.data.serve.service.IAdsAccountRechargeRankingService;
-import com.zanxiang.game.data.serve.utils.Page;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@Slf4j
-@Api(tags = {"账号充值排行榜"})
-@RestController
-@RequestMapping("/accountRechargeRanking")
-public class AdsAccountRechargeRankingController {
-
-    @Autowired
-    private IAdsAccountRechargeRankingService adsAccountRechargeRankingService;
-
-    @PreAuthorize(permissionKey = "gameData:accountRechargeRanking:list")
-    @ApiOperation(value = "推广账号充值排行榜")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = AdsAgentRechargeRankingVO.class)})
-    @PostMapping("/list")
-    public ResultVO<Page<AdsAccountRechargeRankingVO>> list(@Validated @RequestBody AdsAccountRechargeRankingListDTO dto) {
-        return ResultVO.ok(adsAccountRechargeRankingService.listOfPage(dto));
-    }
-}

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

@@ -1,37 +0,0 @@
-package com.zanxiang.game.data.serve.controller;
-
-import com.zanxiang.erp.security.annotation.PreAuthorize;
-import com.zanxiang.game.data.serve.pojo.dto.AdsAgentRechargeRankingListDTO;
-import com.zanxiang.game.data.serve.pojo.vo.AdsAgentRechargeRankingVO;
-import com.zanxiang.game.data.serve.service.IAdsAgentRechargeRankingService;
-import com.zanxiang.game.data.serve.utils.Page;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@Slf4j
-@Api(tags = {"渠道充值排行榜"})
-@RestController
-@RequestMapping("/agentRechargeRanking")
-public class AdsAgentRechargeRankingController {
-
-    @Autowired
-    private IAdsAgentRechargeRankingService adsAgentRechargeRankingService;
-
-    @PreAuthorize(permissionKey = "gameData:agentRechargeRanking:list")
-    @ApiOperation(value = "推广渠道充值排行榜")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = AdsAgentRechargeRankingVO.class)})
-    @PostMapping("/list")
-    public ResultVO<Page<AdsAgentRechargeRankingVO>> list(@Validated @RequestBody AdsAgentRechargeRankingListDTO dto) {
-        return ResultVO.ok(adsAgentRechargeRankingService.listOfPage(dto));
-    }
-}

+ 13 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameDataController.java

@@ -1,13 +1,8 @@
 package com.zanxiang.game.data.serve.controller;
 
-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.GameDataTotalDTO;
-import com.zanxiang.game.data.serve.pojo.dto.GameDataWaterDTO;
-import com.zanxiang.game.data.serve.pojo.vo.GameDataAgainDayVO;
-import com.zanxiang.game.data.serve.pojo.vo.GameDataDayVO;
-import com.zanxiang.game.data.serve.pojo.vo.GameDataTotalVO;
-import com.zanxiang.game.data.serve.pojo.vo.GameDataWaterVO;
+import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.data.serve.pojo.dto.*;
+import com.zanxiang.game.data.serve.pojo.vo.*;
 import com.zanxiang.game.data.serve.service.IGameDataService;
 import com.zanxiang.game.data.serve.utils.Page;
 import com.zanxiang.module.util.pojo.ResultVO;
@@ -41,16 +36,21 @@ public class GameDataController {
     private IGameDataService gameDataService;
 
     @ApiOperation(value = "游戏每日数据")
-    //@PreAuthorize(permissionKey = "gameData:adsGameDay:day")
+    @PreAuthorize(permissionKey = "gameData:adsGameDay:day")
     @PostMapping("/day")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameDataDayVO.class)})
     public ResultVO<Page<GameDataDayVO>> getGameDataDay(@RequestBody GameDataDayDTO dto) {
         return ResultVO.ok(gameDataService.getGameDataDay(dto));
     }
 
-
+    @ApiOperation(value = "h5游戏充值")
+    @PreAuthorize(permissionKey = "gameData:adsGameDay:h5")
+    @PostMapping("/h5")
+    public ResultVO<Page<GameDataH5VO>> getH5Recharge(@RequestBody GameDataH5DTO dto) {
+        return ResultVO.ok(gameDataService.getH5Recharge(dto));
+    }
     @ApiOperation(value = "游戏总数据")
-    //@PreAuthorize(permissionKey = "gameData:adsGameDay:total")
+    @PreAuthorize(permissionKey = "gameData:adsGameDay:total")
     @PostMapping("/total")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameDataTotalVO.class)})
     public ResultVO<Page<GameDataTotalVO>> getGameDataTotal(@RequestBody GameDataTotalDTO dto) {
@@ -58,14 +58,14 @@ public class GameDataController {
     }
 
     @ApiOperation(value = "每日流水贡献")
-    //@PreAuthorize(permissionKey = "gameData:adsGameDay:water")
+    @PreAuthorize(permissionKey = "gameData:adsGameDay:water")
     @PostMapping("/water")
     public ResultVO<Page<GameDataWaterVO>> getGameDataWater(@RequestBody GameDataWaterDTO dto) {
         return ResultVO.ok(gameDataService.getGameDataWater(dto));
     }
 
     @ApiOperation(value = "游戏每日复充数据")
-    //@PreAuthorize(permissionKey = "gameData:adsGameDay:again")
+    @PreAuthorize(permissionKey = "gameData:adsGameDay:again")
     @PostMapping("/again")
     public ResultVO<Map<LocalDate, List<GameDataAgainDayVO>>> getGameDataAgainDay(@RequestBody GameDataAgainDayDTO dto) throws Exception {
         return ResultVO.ok(gameDataService.getGameDataAgainDay(dto));

+ 2 - 3
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/OverallSummaryController.java

@@ -1,6 +1,5 @@
 package com.zanxiang.game.data.serve.controller;
 
-import com.zanxiang.erp.security.annotation.PreAuthorize;
 import com.zanxiang.game.data.serve.pojo.dto.OverallSummaryDTO;
 import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryLineDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryVO;
@@ -34,7 +33,7 @@ public class OverallSummaryController {
     private IOverallSummaryService overallSummaryService;
 
     @ApiOperation(value = "获取整体概况数据")
-    @PreAuthorize(permissionKey = "gameData:adsOverallSummary:totalData")
+    //@PreAuthorize(permissionKey = "gameData:adsOverallSummary:totalData")
     @PostMapping("/totalData")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = OverallSummaryVO.class)})
     public ResultVO<OverallSummaryVO> getOverallSummaryTotalData(@RequestBody OverallSummaryDTO dto) {
@@ -42,7 +41,7 @@ public class OverallSummaryController {
     }
 
     @ApiOperation(value = "获取折线图数据")
-    @PreAuthorize(permissionKey = "gameData:adsOverallSummary:lineData")
+    //@PreAuthorize(permissionKey = "gameData:adsOverallSummary:lineData")
     @PostMapping("/lineData")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = OverallSummaryLineDataVO.class, responseContainer = "list")})
     public ResultVO<List<OverallSummaryLineDataVO>> getOverallSummaryLineData(@RequestBody OverallSummaryDTO dto) {

+ 31 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RankingController.java

@@ -1,16 +1,25 @@
 package com.zanxiang.game.data.serve.controller;
 
 import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.data.serve.pojo.dto.AdsAccountRechargeRankingListDTO;
+import com.zanxiang.game.data.serve.pojo.dto.AdsAgentRechargeRankingListDTO;
 import com.zanxiang.game.data.serve.pojo.dto.GamePromoteDayDTO;
 import com.zanxiang.game.data.serve.pojo.dto.RechargeRankingDTO;
+import com.zanxiang.game.data.serve.pojo.vo.AdsAccountRechargeRankingVO;
+import com.zanxiang.game.data.serve.pojo.vo.AdsAgentRechargeRankingVO;
 import com.zanxiang.game.data.serve.pojo.vo.GameRechargeRankingVO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerRechargeRankingVO;
+import com.zanxiang.game.data.serve.service.IAdsAccountRechargeRankingService;
+import com.zanxiang.game.data.serve.service.IAdsAgentRechargeRankingService;
 import com.zanxiang.game.data.serve.service.IRankingService;
 import com.zanxiang.game.data.serve.utils.Page;
 import com.zanxiang.module.util.pojo.ResultVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,6 +32,11 @@ public class RankingController {
     @Autowired
     private IRankingService rankingService;
 
+    @Autowired
+    private IAdsAccountRechargeRankingService adsAccountRechargeRankingService;
+    @Autowired
+    private IAdsAgentRechargeRankingService adsAgentRechargeRankingService;
+
     @ApiOperation(value = "游戏充值排行榜")
     @PreAuthorize(permissionKey = "gameData:ranking:game")
     @PostMapping("/game")
@@ -31,9 +45,25 @@ public class RankingController {
     }
 
     @ApiOperation(value = "玩家充值排行榜")
-//    @PreAuthorize(permissionKey = "gameData:ranking:player")
+    @PreAuthorize(permissionKey = "gameData:ranking:player")
     @PostMapping("/player")
     public ResultVO<Page<PlayerRechargeRankingVO>> playerRanking(@RequestBody RechargeRankingDTO dto) {
         return ResultVO.ok(rankingService.playerRanking(dto));
     }
+
+    @PreAuthorize(permissionKey = "gameData:ranking:agent")
+    @ApiOperation(value = "推广渠道充值排行榜")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = AdsAgentRechargeRankingVO.class)})
+    @PostMapping("/agent")
+    public ResultVO<Page<AdsAgentRechargeRankingVO>> agent(@Validated @RequestBody AdsAgentRechargeRankingListDTO dto) {
+        return ResultVO.ok(adsAgentRechargeRankingService.listOfPage(dto));
+    }
+
+    @PreAuthorize(permissionKey = "gameData:ranking:account")
+    @ApiOperation(value = "推广账号充值排行榜")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = AdsAccountRechargeRankingVO.class)})
+    @PostMapping("/account")
+    public ResultVO<Page<AdsAccountRechargeRankingVO>> account(@Validated @RequestBody AdsAccountRechargeRankingListDTO dto) {
+        return ResultVO.ok(adsAccountRechargeRankingService.listOfPage(dto));
+    }
 }

+ 100 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/handler/GlobalExceptionHandler.java

@@ -0,0 +1,100 @@
+package com.zanxiang.game.data.serve.handler;
+
+import com.zanxiang.erp.security.exception.NoPermissionException;
+import com.zanxiang.module.util.DateUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import com.zanxiang.module.util.pojo.ResultVO;
+import com.zanxiang.module.web.util.ServletUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.validation.BindException;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
+
+import java.time.LocalDateTime;
+
+/**
+ * 全局异常代理
+ *
+ * @author bilingfeng
+ */
+@Slf4j
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+    /**
+     * 业务异常
+     */
+    @ExceptionHandler(BaseException.class)
+    public ResultVO<?> baseException(BaseException e) {
+        return ResultVO.fail(e.getMessage());
+    }
+
+    /**
+     * http method错误
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+    public ResultVO<?> methodNotSupportedException(HttpRequestMethodNotSupportedException e) {
+        log.error("URL:{}, 请求 method:{}, 支持的 method:{}", ServletUtil.getRequest().getRequestURL(), ServletUtil.getRequest().getMethod(), e.getSupportedMethods());
+        return ResultVO.fail("http method错误!");
+    }
+
+    /**
+     * 自定义参数校验错误
+     */
+    @ExceptionHandler(BindException.class)
+    public ResultVO<?> validatedBindException(BindException e) {
+        String message = e.getAllErrors().get(0).getDefaultMessage();
+        return ResultVO.fail(message);
+    }
+
+    /**
+     * 自定义参数校验错误
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public ResultVO<?> validExceptionHandler(MethodArgumentNotValidException e) {
+        String message = e.getBindingResult().getFieldError().getDefaultMessage();
+        return ResultVO.fail(message);
+    }
+
+    /**
+     * 自定义参数校验错误
+     */
+    @ExceptionHandler(HttpMessageNotReadableException.class)
+    public ResultVO<?> validExceptionHandler(HttpMessageNotReadableException e) {
+        log.error(e.getMessage(), e);
+        return ResultVO.fail("参数异常,请勿非法操作");
+    }
+
+    /**
+     * 参数类型不匹配导致转换异常
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(MethodArgumentTypeMismatchException.class)
+    public ResultVO<?> mismatchErrorHandler(MethodArgumentTypeMismatchException e) {
+        log.error("方法:{},字段:{},参数:{},错误信息:{}", e.getParameter().getMethod(), e.getName(), e.getValue(), e.getMessage());
+        return ResultVO.fail("请求参数异常,请勿非法操作");
+    }
+
+    /**
+     * 权限异常
+     */
+    @ExceptionHandler(NoPermissionException.class)
+    public ResultVO<?> preAuthorizeException(NoPermissionException e) {
+        return ResultVO.fail("没有权限,请联系管理员授权");
+    }
+
+    @ExceptionHandler(Exception.class)
+    public ResultVO<?> handleException(Exception e) {
+        log.error(e.getMessage(), e);
+        return ResultVO.fail(DateUtil.formatLocalDateTime(LocalDateTime.now()) + ": 服务异常,请联系管理员");
+    }
+}

+ 2 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsAccountRechargeRankingListDTO.java

@@ -12,6 +12,8 @@ public class AdsAccountRechargeRankingListDTO  extends BasePage {
 
     private LocalDate endDay;
 
+    private String sourceSystem;
+
     private String accountId;
 
     private String pitcherId;

+ 2 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsAgentRechargeRankingListDTO.java

@@ -12,6 +12,8 @@ public class AdsAgentRechargeRankingListDTO extends BasePage {
 
     private LocalDate endDay;
 
+    private String sourceSystem;
+
     private String agentId;
 
     private String pitcherId;

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AdsOrderDetailListDTO.java

@@ -16,6 +16,9 @@ public class AdsOrderDetailListDTO extends BasePage {
     @ApiModelProperty(notes = "订单创建时间")
     private LocalDateTime endOrderTime;
 
+    @ApiModelProperty(notes = "数据来源")
+    private String sourceSystem;
+
     @ApiModelProperty(notes = "订单号")
     private String orderId;
 

+ 53 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/AgentDayAgainDTO.java

@@ -0,0 +1,53 @@
+package com.zanxiang.game.data.serve.pojo.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDate;
+
+/**
+ * @author tianhua
+ * @time 2023/7/18
+ * @Description 前端传递的推广渠道每日复充查询条件
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class AgentDayAgainDTO {
+
+    /**
+     * 推广账号ID
+     */
+    @ApiModelProperty(value = "推广账号ID")
+    private Long accountId;
+
+    /**
+     * 渠道ID
+     */
+    @ApiModelProperty(value = "渠道ID")
+    private Long agentId;
+
+    /**
+     * 查询开始时间
+     */
+    @ApiModelProperty(value = "查询开始时间")
+    private LocalDate beginDate;
+
+    /**
+     * 查询结束时间
+     */
+    @ApiModelProperty(value = "查询结束时间(前端不需要传递)")
+    private LocalDate endDate;
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
+
+
+}

+ 12 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataAgainDayDTO.java

@@ -19,6 +19,12 @@ import java.time.LocalDate;
 @Builder
 public class GameDataAgainDayDTO {
 
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty(value = "游戏ID")
+    private Long gameId;
+
     /**
      * 游戏名称
      */
@@ -37,4 +43,10 @@ public class GameDataAgainDayDTO {
     @ApiModelProperty(value = "查询结束时间(前端不需要传递)")
     private LocalDate endDate;
 
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
+
 }

+ 7 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataDayDTO.java

@@ -7,7 +7,6 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.math.BigInteger;
 import java.time.LocalDate;
 
 /**
@@ -31,7 +30,7 @@ public class GameDataDayDTO extends BasePage {
      * 推广游戏应用类别
      */
     @ApiModelProperty(notes = "游戏类别")
-    private BigInteger gameClassify;
+    private Long gameClassify;
 
     /**
      * 注册时间(开始)
@@ -39,6 +38,12 @@ public class GameDataDayDTO extends BasePage {
     @ApiModelProperty(notes = "注册开始时间")
     private LocalDate registeredBeginDate;
 
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
+
     /**
      * 注册时间(结束)
      */

+ 49 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataH5DTO.java

@@ -0,0 +1,49 @@
+package com.zanxiang.game.data.serve.pojo.dto;
+
+import com.zanxiang.game.data.serve.pojo.base.BasePage;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDate;
+
+/**
+ * @author tianhua
+ * @time 2023/7/12
+ * @Description 游戏总数据前端查询参数实体
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class GameDataH5DTO extends BasePage {
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
+    @ApiModelProperty(notes = "充值开始时间")
+    private LocalDate rechargeBeginDate;
+
+    @ApiModelProperty(notes = "充值结束时间")
+    private LocalDate rechargeEndDate;
+
+    @ApiModelProperty(notes = "注册开始时间")
+    private LocalDate costBeginDate;
+
+    @ApiModelProperty(notes = "注册结束时间")
+    private LocalDate costEndDate;
+
+    @ApiModelProperty(notes = "排序字段")
+    private String sortFiled;
+
+    @ApiModelProperty(notes = "排序方式:升序asc;降序desc")
+    private String sortType;
+
+}

+ 8 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataTotalDTO.java

@@ -7,7 +7,7 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -31,7 +31,7 @@ public class GameDataTotalDTO extends BasePage {
      * 推广游戏应用类别
      */
     @ApiModelProperty(notes = "游戏类别")
-    private BigInteger gameClassify;
+    private Long gameClassify;
 
     /**
      * 注册时间(开始)
@@ -57,6 +57,12 @@ public class GameDataTotalDTO extends BasePage {
     @ApiModelProperty(notes = "充值结束时间")
     private LocalDate rechargeEndDate;
 
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
+
     /**
      * 排序字段
      */

+ 7 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GameDataWaterDTO.java

@@ -7,7 +7,7 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -27,6 +27,12 @@ public class GameDataWaterDTO extends BasePage {
     @ApiModelProperty(notes = "游戏名称")
     private String gameName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
     /**
      * 推广游戏应用类别
      */

+ 4 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayDTO.java

@@ -14,6 +14,8 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 public class GamePromoteDayDTO extends BasePage {
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     @ApiModelProperty(notes = "投手id")
     private Long sysUserId;
     @ApiModelProperty(notes = "推广账号ID")
@@ -25,6 +27,8 @@ public class GamePromoteDayDTO extends BasePage {
     @ApiModelProperty(notes = "cp名")
     private String cpName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
     @ApiModelProperty(notes = "游戏名")
     private String gameName;
     @ApiModelProperty(notes = "游戏应用类型")

+ 5 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteDayTotalDTO.java

@@ -13,6 +13,8 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 public class GamePromoteDayTotalDTO {
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     @ApiModelProperty(notes = "投手id")
     private Long sysUserId;
     @ApiModelProperty(notes = "推广账号ID")
@@ -24,6 +26,9 @@ public class GamePromoteDayTotalDTO {
     @ApiModelProperty(notes = "cp名")
     private String cpName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
     @ApiModelProperty(notes = "游戏名")
     private String gameName;
     @ApiModelProperty(notes = "游戏应用类型")

+ 5 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/GamePromoteTotalDTO.java

@@ -14,6 +14,8 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 public class GamePromoteTotalDTO extends BasePage {
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     @ApiModelProperty(notes = "投手id")
     private Long sysUserId;
     @ApiModelProperty(notes = "推广账号ID")
@@ -25,6 +27,9 @@ public class GamePromoteTotalDTO extends BasePage {
     @ApiModelProperty(notes = "cp名")
     private String cpName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
     @ApiModelProperty(notes = "游戏名")
     private String gameName;
     @ApiModelProperty(notes = "游戏应用类型")

+ 11 - 5
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/OverallSummaryDTO.java

@@ -8,7 +8,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -42,24 +42,30 @@ public class OverallSummaryDTO {
      * 渠道ID
      */
     @ApiModelProperty(value = "推广渠道")
-    private BigInteger agentId;
+    private Long agentId;
 
     /**
      * 游戏ID
      */
     @ApiModelProperty(value = "推广游戏")
-    private BigInteger gameId;
+    private Long gameId;
 
     /**
      * 投手ID
      */
     @ApiModelProperty(value = "投手")
-    private BigInteger pitcherId;
+    private Long pitcherId;
 
     /**
      * 广告账户ID
      */
     @ApiModelProperty(value = "推广账号")
-    private BigInteger accountId;
+    private Long accountId;
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
 
 }

+ 2 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/RechargeRankingDTO.java

@@ -21,6 +21,8 @@ public class RechargeRankingDTO extends BasePage{
     @ApiModelProperty(notes = "充值结束日期")
     private LocalDate endDay;
 
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     @ApiModelProperty(notes = "排序字段")
     private String sortFiled;
 

+ 6 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAccountAgentDay.java

@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
 @AllArgsConstructor
 @Builder
 @Table(AdsAccountAgentDay.TABLE_NAME)
-@PK({"dt", "accountId", "agentId"})
+@PK({"dt","sourceSystem", "accountId", "agentId"})
 public class AdsAccountAgentDay implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_account_agent_day";
@@ -36,6 +36,8 @@ public class AdsAccountAgentDay implements Serializable {
      */
     private LocalDate dt;
 
+    private String sourceSystem;
+
     /**
      * 推广账号
      */
@@ -82,6 +84,9 @@ public class AdsAccountAgentDay implements Serializable {
     @Column
     private String gameName;
 
+    @Column
+    private Long gameId;
+
     /**
      * 推广游戏类型
      */

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAccountRechargeRanking.java

@@ -35,6 +35,9 @@ public class AdsAccountRechargeRanking implements Serializable {
      */
     private LocalDate dt;
 
+    @Column
+    private String sourceSystem;
+
     /**
      * 推广账号
      */

+ 117 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAgentDayAgain.java

@@ -0,0 +1,117 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 推广渠道每日复充趋势
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgain.TABLE_NAME)
+@PK({"dt", "ddf", "accountId", "agentId", "sourceSystem"})
+public class AdsAgentDayAgain {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_agent_day_again";
+
+    /**
+     * 日期
+     */
+    private LocalDate dt;
+
+    /**
+     * 复充日期
+     */
+    private LocalDate ddf;
+
+    /**
+     * 推广账号ID
+     */
+    private Long accountId;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 渠道名称
+     */
+    @Column
+    private String agentName;
+
+    /**
+     * 充值一次
+     */
+    @Column
+    private Long c1;
+
+    /**
+     * 充值大于一次
+     */
+    @Column
+    private Long c2;
+
+    /**
+     * 充值大于两次
+     */
+    @Column
+    private Long c3;
+
+    /**
+     * 充值大于三次
+     */
+    @Column
+    private Long c4;
+
+    /**
+     * 充值大于四次
+     */
+    @Column
+    private Long c5;
+
+    /**
+     * 充值大于五次
+     */
+    @Column
+    private Long c6;
+
+    /**
+     * 充值大于十次
+     */
+    @Column
+    private Long c7;
+
+    /**
+     * 充值大于二十次
+     */
+    @Column
+    private Long c8;
+
+    /**
+     * 充值大于一百次
+     */
+    @Column
+    private Long c9;
+}

+ 6 - 3
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsAgentRechargeRanking.java

@@ -35,6 +35,9 @@ public class AdsAgentRechargeRanking implements Serializable {
      */
     private LocalDate dt;
 
+    @Column
+    private String sourceSystem;
+
     /**
      * 推广渠道账号
      */
@@ -74,19 +77,19 @@ public class AdsAgentRechargeRanking implements Serializable {
      * 累计充值今额
      */
     @Column
-    private BigDecimal newUserTotalRechargeAmount;
+    private BigDecimal totalRechargeAmount;
 
     /**
      * 累计充值人数
      */
     @Column
-    private Long newUserTotalRechargeNum;
+    private Long totalRechargeNum;
 
     /**
      * 累计充值次数
      */
     @Column
-    private Long newUserTotalRechargeCount;
+    private Long totalRechargeCount;
 
     /**
      * 平均单价

+ 4 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynAmount.java

@@ -24,7 +24,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsDaynAmount.TABLE_NAME)
-@PK({"dt", "accountId", "agentId"})
+@PK({"dt","sourceSystem", "accountId", "agentId"})
 public class AdsDaynAmount implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_dayn_amount";
@@ -34,6 +34,9 @@ public class AdsDaynAmount implements Serializable {
      */
     private LocalDate dt;
 
+
+    private String sourceSystem;
+
     /**
      * 推广账号
      */

+ 7 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGame.java

@@ -13,7 +13,7 @@ import java.time.LocalDate;
 
 /**
  * <p>
- * 游戏聚合表(按游戏聚合)
+ * 游戏聚合表(按游戏聚合)(总量)
  * </p>
  *
  * @author tianhua
@@ -25,7 +25,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsDaynGame.TABLE_NAME)
-@PK({"dt", "gameId"})
+@PK({"dt", "gameId", "sourceSystem"})
 public class AdsDaynGame implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_dayn_game";
@@ -40,6 +40,11 @@ public class AdsDaynGame implements Serializable {
      */
     private String gameId;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * 每一天的的充值金额,充值次数,充值人数
      */

+ 54 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGameBuy.java

@@ -0,0 +1,54 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 游戏聚合表(按游戏聚合)(买量)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynGameBuy.TABLE_NAME)
+@PK({"dt", "gameId", "sourceSystem"})
+public class AdsDaynGameBuy implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_game_buy";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * 游戏ID
+     */
+    private String gameId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 每一天的的充值金额,充值次数,充值人数
+     */
+    @Column
+    private String dayN;
+
+}

+ 54 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynGameNature.java

@@ -0,0 +1,54 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 游戏聚合表(按游戏聚合)(自然量)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynGameNature.TABLE_NAME)
+@PK({"dt", "gameId", "sourceSystem"})
+public class AdsDaynGameNature implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_game_nature";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * 游戏ID
+     */
+    private String gameId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 每一天的的充值金额,充值次数,充值人数
+     */
+    @Column
+    private String dayN;
+
+}

+ 66 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5LeadBuyGame.java

@@ -0,0 +1,66 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * h5买量导入游戏聚合表(按游戏聚合)
+ * </p>
+ *
+ * @author auto
+ * @since 2023-07-19
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynH5LeadBuyGame.TABLE_NAME)
+@PK({"dt","source_system", "h5_lead_buy_game_id", "h5_lead_buy_game_name"})
+public class AdsDaynH5LeadBuyGame implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_h5_lead_buy_game";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * h5买量导入游戏ID
+     */
+    private String h5LeadBuyGameId;
+
+    /**
+     * h5买量导入游戏名称
+     */
+    private String h5LeadBuyGameName;
+
+    /**
+     * 游戏类型
+     */
+    @Column
+    private String classify;
+
+    /**
+     * 每一天的的充值金额,充值次数,充值人数
+     */
+    @Column
+    private String dayN;
+
+
+}

+ 66 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5LeadNatureGame.java

@@ -0,0 +1,66 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * h5自然量导入游戏聚合表(按游戏聚合)
+ * </p>
+ *
+ * @author auto
+ * @since 2023-07-19
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynH5LeadNatureGame.TABLE_NAME)
+@PK({"dt","source_system", "h5_lead_nature_game_id", "h5_lead_nature_game_name"})
+public class AdsDaynH5LeadNatureGame implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_h5_lead_nature_game";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * h5自然量导入游戏ID
+     */
+    private String h5LeadNatureGameId;
+
+    /**
+     * h5自然量导入游戏名称
+     */
+    private String h5LeadNatureGameName;
+
+    /**
+     * 游戏类型
+     */
+    @Column
+    private String classify;
+
+    /**
+     * 每一天的的充值金额,充值次数,充值人数
+     */
+    @Column
+    private String dayN;
+
+
+}

+ 66 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5NatureGame.java

@@ -0,0 +1,66 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * h5自然量游戏聚合表(按游戏聚合)
+ * </p>
+ *
+ * @author auto
+ * @since 2023-07-19
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynH5NatureGame.TABLE_NAME)
+@PK({"dt", "source_system", "h5_nature_game_id","h5_nature_game_name"})
+public class AdsDaynH5NatureGame implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_h5_nature_game";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * h5自然量游戏ID
+     */
+    private String h5NatureGameId;
+
+    /**
+     * h5自然量游戏名称
+     */
+    private String h5NatureGameName;
+
+    /**
+     * 游戏类型
+     */
+    @Column
+    private String classify;
+
+    /**
+     * 每一天的的充值金额,充值人数
+     */
+    @Column
+    private String dayN;
+
+
+}

+ 66 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsDaynH5PayGame.java

@@ -0,0 +1,66 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * h5付费游戏聚合表(按游戏聚合)
+ * </p>
+ *
+ * @author auto
+ * @since 2023-07-19
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsDaynH5PayGame.TABLE_NAME)
+@PK({"dt", "source_system", "h5_game_id","h5_game_name"})
+public class AdsDaynH5PayGame implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_dayn_h5_pay_game";
+
+    /**
+     * 注册时间
+     */
+    private LocalDate dt;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * h5付费游戏ID
+     */
+    private String h5GameId;
+
+    /**
+     * h5付费游戏名称
+     */
+    private String h5GameName;
+
+    /**
+     * 游戏类型
+     */
+    @Column
+    private String classify;
+
+    /**
+     * 每一天的的充值金额,充值人数
+     */
+    @Column
+    private String dayN;
+
+
+}

+ 4 - 3
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsEverydayWater.java

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.pojo.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -25,6 +26,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsEverydayWater.TABLE_NAME)
+@PK({"dt", "gameId", "sourceSystem","userOrderBy"})
 public class AdsEverydayWater implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_everyday_water";
@@ -32,19 +34,18 @@ public class AdsEverydayWater implements Serializable {
     /**
      * 日期
      */
-    @Column
     private LocalDate dt;
 
+    private String sourceSystem;
+
     /**
      * 游戏ID
      */
-    @Column
     private Long gameId;
 
     /**
      * 玩家模板排序
      */
-    @Column
     private String userOrderBy;
 
     /**

+ 10 - 5
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDay.java

@@ -10,7 +10,7 @@ import org.nutz.dao.entity.annotation.Table;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -26,7 +26,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsGameDay.TABLE_NAME)
-@PK({"dt", "gameId", "gameName", "gameClassify"})
+@PK({"dt", "gameId", "gameName", "gameClassify", "sourceSystem"})
 public class AdsGameDay implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_game_day";
@@ -51,6 +51,11 @@ public class AdsGameDay implements Serializable {
      */
     private Long gameClassify;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * CP名称
      */
@@ -187,7 +192,7 @@ public class AdsGameDay implements Serializable {
      * 复充人数(总)
      */
     @Column
-    private BigInteger regOrderUserAgain;
+    private Long regOrderUserAgain;
 
     /**
      * 新增注册ARPU(总)
@@ -397,7 +402,7 @@ public class AdsGameDay implements Serializable {
      * 复充人数(买量)
      */
     @Column
-    private BigInteger buyRegOrderUserAgain;
+    private Long buyRegOrderUserAgain;
 
     /**
      * 新增注册ARPU(买量)
@@ -607,7 +612,7 @@ public class AdsGameDay implements Serializable {
      * 复充人数(自然量)
      */
     @Column
-    private BigInteger natureRegOrderUserAgain;
+    private Long natureRegOrderUserAgain;
 
     /**
      * 新增注册ARPU(自然量)

+ 17 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgain.java

@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.Column;
 import org.nutz.dao.entity.annotation.PK;
 import org.nutz.dao.entity.annotation.Table;
 
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -25,7 +25,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsGameDayAgain.TABLE_NAME)
-@PK({"dt","ddf","gameId","gameName"})
+@PK({"dt", "ddf", "gameId", "gameName", "sourceSystem"})
 public class AdsGameDayAgain {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_game_day_again";
@@ -43,67 +43,71 @@ public class AdsGameDayAgain {
     /**
      * 游戏ID
      */
-    private BigInteger gameId;
+    private Long gameId;
 
     /**
      * 游戏名称
      */
     private String gameName;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * 充值一次
      */
     @Column
-    private BigInteger c1;
+    private Long c1;
 
     /**
      * 充值大于一次
      */
     @Column
-    private BigInteger c2;
+    private Long c2;
 
     /**
      * 充值大于两次
      */
     @Column
-    private BigInteger c3;
+    private Long c3;
 
     /**
      * 充值大于三次
      */
     @Column
-    private BigInteger c4;
+    private Long c4;
 
     /**
      * 充值大于四次
      */
     @Column
-    private BigInteger c5;
+    private Long c5;
 
     /**
      * 充值大于五次
      */
     @Column
-    private BigInteger c6;
+    private Long c6;
 
     /**
      * 充值大于十次
      */
     @Column
-    private BigInteger c7;
+    private Long c7;
 
     /**
      * 充值大于二十次
      */
     @Column
-    private BigInteger c8;
+    private Long c8;
 
     /**
      * 充值大于一百次
      */
     @Column
-    private BigInteger c9;
-
+    private Long c9;
 
 
 }

+ 16 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgainBuy.java

@@ -8,7 +8,6 @@ import org.nutz.dao.entity.annotation.Column;
 import org.nutz.dao.entity.annotation.PK;
 import org.nutz.dao.entity.annotation.Table;
 
-import java.math.BigInteger;
 import java.time.LocalDate;
 
 /**
@@ -25,7 +24,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsGameDayAgainBuy.TABLE_NAME)
-@PK({"dt","ddf","gameId","gameName"})
+@PK({"dt", "ddf", "gameId", "gameName", "sourceSystem"})
 public class AdsGameDayAgainBuy {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_game_day_again_buy";
@@ -43,67 +42,71 @@ public class AdsGameDayAgainBuy {
     /**
      * 游戏ID
      */
-    private BigInteger gameId;
+    private Long gameId;
 
     /**
      * 游戏名称
      */
     private String gameName;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * 充值一次
      */
     @Column
-    private BigInteger buyC1;
+    private Long buyC1;
 
     /**
      * 充值大于一次
      */
     @Column
-    private BigInteger buyC2;
+    private Long buyC2;
 
     /**
      * 充值大于两次
      */
     @Column
-    private BigInteger buyC3;
+    private Long buyC3;
 
     /**
      * 充值大于三次
      */
     @Column
-    private BigInteger buyC4;
+    private Long buyC4;
 
     /**
      * 充值大于四次
      */
     @Column
-    private BigInteger buyC5;
+    private Long buyC5;
 
     /**
      * 充值大于五次
      */
     @Column
-    private BigInteger buyC6;
+    private Long buyC6;
 
     /**
      * 充值大于十次
      */
     @Column
-    private BigInteger buyC7;
+    private Long buyC7;
 
     /**
      * 充值大于二十次
      */
     @Column
-    private BigInteger buyC8;
+    private Long buyC8;
 
     /**
      * 充值大于一百次
      */
     @Column
-    private BigInteger buyC9;
-
+    private Long buyC9;
 
 
 }

+ 17 - 13
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsGameDayAgainNature.java

@@ -8,7 +8,7 @@ import org.nutz.dao.entity.annotation.Column;
 import org.nutz.dao.entity.annotation.PK;
 import org.nutz.dao.entity.annotation.Table;
 
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -25,7 +25,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsGameDayAgainNature.TABLE_NAME)
-@PK({"dt","ddf","gameId","gameName"})
+@PK({"dt", "ddf", "gameId", "gameName", "sourceSystem"})
 public class AdsGameDayAgainNature {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_game_day_again_nature";
@@ -43,67 +43,71 @@ public class AdsGameDayAgainNature {
     /**
      * 游戏ID
      */
-    private BigInteger gameId;
+    private Long gameId;
 
     /**
      * 游戏名称
      */
     private String gameName;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * 充值一次
      */
     @Column
-    private BigInteger natureC1;
+    private Long natureC1;
 
     /**
      * 充值大于一次
      */
     @Column
-    private BigInteger natureC2;
+    private Long natureC2;
 
     /**
      * 充值大于两次
      */
     @Column
-    private BigInteger natureC3;
+    private Long natureC3;
 
     /**
      * 充值大于三次
      */
     @Column
-    private BigInteger natureC4;
+    private Long natureC4;
 
     /**
      * 充值大于四次
      */
     @Column
-    private BigInteger natureC5;
+    private Long natureC5;
 
     /**
      * 充值大于五次
      */
     @Column
-    private BigInteger natureC6;
+    private Long natureC6;
 
     /**
      * 充值大于十次
      */
     @Column
-    private BigInteger natureC7;
+    private Long natureC7;
 
     /**
      * 充值大于二十次
      */
     @Column
-    private BigInteger natureC8;
+    private Long natureC8;
 
     /**
      * 充值大于一百次
      */
     @Column
-    private BigInteger natureC9;
-
+    private Long natureC9;
 
 
 }

+ 7 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsH5GameDay.java

@@ -25,7 +25,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsH5GameDay.TABLE_NAME)
-@PK({"dt", "gameId", "gameName", "gameClassify", "sourceSystem"})
+@PK({"id","dt", "gameId", "gameName", "gameClassify", "sourceSystem"})
 public class AdsH5GameDay implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_h5_game_day";
@@ -121,6 +121,9 @@ public class AdsH5GameDay implements Serializable {
     @Column
     private Long buyGameId;
 
+    @Column
+    private String buySourceSystem;
+
     /**
      * 游戏买量导入用户数据:游戏类别
      */
@@ -163,6 +166,9 @@ public class AdsH5GameDay implements Serializable {
     @Column
     private Long natureGameId;
 
+    @Column
+    private String natureSourceSystem;
+
     /**
      * 游戏官方导量用户数据:游戏类别
      */

+ 6 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummary.java

@@ -25,7 +25,7 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @Builder
 @Table(AdsOverallSummary.TABLE_NAME)
-@PK({"dt", "agentId", "accountId"})
+@PK({"dt", "agentId", "accountId", "sourceSystem"})
 public class AdsOverallSummary implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_overall_summary";
@@ -45,6 +45,11 @@ public class AdsOverallSummary implements Serializable {
      */
     private Long accountId;
 
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
     /**
      * 投手ID
      */

+ 71 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryAgent.java

@@ -0,0 +1,71 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 整体概况(渠道)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgainNature.TABLE_NAME)
+@PK({"dt", "agentId", "accountId", "sourceSystem"})
+public class AdsOverallSummaryAgent implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_overall_summary_agent";
+
+    /**
+     * 日期(投放日期)
+     */
+    private LocalDate dt;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * 广告账号
+     */
+    private Long accountId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 投手ID
+     */
+    @Column
+    private Long pitcherId;
+
+    /**
+     * 游戏ID
+     */
+    @Column
+    private Long gameId;
+
+    /**
+     * 新增渠道
+     */
+    @Column
+    private Long todayAgentCount;
+
+}

+ 84 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryAmount.java

@@ -0,0 +1,84 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 整体概况(充值)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgainNature.TABLE_NAME)
+@PK({"dt", "agentId", "accountId", "sourceSystem"})
+public class AdsOverallSummaryAmount implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_overall_summary_amount";
+
+    /**
+     * 日期(投放日期)
+     */
+    private LocalDate dt;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * 广告账号
+     */
+    private Long accountId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 投手ID
+     */
+    @Column
+    private Long pitcherId;
+
+    /**
+     * 游戏ID
+     */
+    @Column
+    private Long gameId;
+
+    /**
+     * 账面充值
+     */
+    @Column
+    private BigDecimal todayAmount;
+
+    /**
+     * 新用户充值
+     */
+    @Column
+    private BigDecimal todayNewUserAmount;
+
+    /**
+     * 首日新用户充值
+     */
+    @Column
+    private BigDecimal todayFirstNewUserAmount;
+
+}

+ 72 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryCost.java

@@ -0,0 +1,72 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 整体概况(消耗)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgainNature.TABLE_NAME)
+@PK({"dt", "agentId", "accountId", "sourceSystem"})
+public class AdsOverallSummaryCost implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_overall_summary_cost";
+
+    /**
+     * 日期(投放日期)
+     */
+    private LocalDate dt;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * 广告账号
+     */
+    private Long accountId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 投手ID
+     */
+    @Column
+    private Long pitcherId;
+
+    /**
+     * 游戏ID
+     */
+    @Column
+    private Long gameId;
+
+    /**
+     * 消耗
+     */
+    @Column
+    private BigDecimal todayCost;
+
+}

+ 76 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryGame.java

@@ -0,0 +1,76 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 整体概况(游戏在投数量)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgainNature.TABLE_NAME)
+@PK({"dt", "agentId", "pitcherId", "accountId", "sourceSystem"})
+public class AdsOverallSummaryGame implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_overall_summary_game";
+
+    /**
+     * 日期(投放日期)
+     */
+    private LocalDate dt;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * 广告账号
+     */
+    private Long accountId;
+
+    /**
+     * 投手ID
+     */
+    private Long pitcherId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 投手名字
+     */
+    @Column
+    private Long pitcherName;
+
+    /**
+     * 游戏ID
+     */
+    @Column
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @Column
+    private Long gameName;
+
+}

+ 71 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsOverallSummaryUser.java

@@ -0,0 +1,71 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * <p>
+ * 整体概况(玩家)
+ * </p>
+ *
+ * @author tianhua
+ * @time 2023/7/11
+ * @Description
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+@Table(AdsGameDayAgainNature.TABLE_NAME)
+@PK({"dt", "agentId", "accountId", "sourceSystem"})
+public class AdsOverallSummaryUser implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "ads_overall_summary_user";
+
+    /**
+     * 日期(投放日期)
+     */
+    private LocalDate dt;
+
+    /**
+     * 渠道ID
+     */
+    private Long agentId;
+
+    /**
+     * 广告账号
+     */
+    private Long accountId;
+
+    /**
+     * SDK来源
+     */
+    private String sourceSystem;
+
+    /**
+     * 投手ID
+     */
+    @Column
+    private Long pitcherId;
+
+    /**
+     * 游戏ID
+     */
+    @Column
+    private Long gameId;
+
+    /**
+     * 新增玩家数量
+     */
+    @Column
+    private Long todayUserCount;
+
+}

+ 3 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/AdsPlayerRechargeRanking.java

@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
 @AllArgsConstructor
 @Builder
 @Table(AdsPlayerRechargeRanking.TABLE_NAME)
-@PK({"dt", "playerId"})
+@PK({"dt","sourceSystem", "playerId"})
 public class AdsPlayerRechargeRanking implements Serializable {
     private static final long serialVersionUID = 1L;
     public static final String TABLE_NAME = "ads_player_recharge_ranking";
@@ -36,6 +36,8 @@ public class AdsPlayerRechargeRanking implements Serializable {
      */
     private LocalDate dt;
 
+    private String sourceSystem;
+
     /**
      * 玩家ID
      */

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

@@ -17,6 +17,9 @@ public class AdsAccountRechargeRankingVO {
     @ApiModelProperty(notes = "推广账号媒体")
     private String type;
 
+    @ApiModelProperty(notes = "投手ID")
+    private String pitcherId;
+
     @ApiModelProperty(notes = "投手名称")
     private String pitcher;
 

+ 9 - 9
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AdsAgentRechargeRankingVO.java

@@ -17,6 +17,9 @@ public class AdsAgentRechargeRankingVO {
     @ApiModelProperty(notes = "推广渠道名称")
     private String agentName;
 
+    @ApiModelProperty(notes = "投手ID")
+    private String pitcherId;
+
     @ApiModelProperty(notes = "投手")
     private String pitcher;
 
@@ -26,24 +29,21 @@ public class AdsAgentRechargeRankingVO {
     @ApiModelProperty(notes = "当天充值金额")
     private BigDecimal todayAmount;
 
-    @ApiModelProperty(notes = "累计充值额")
-    private BigDecimal totalAmount;
+    @ApiModelProperty(notes = "累计充值额")
+    private BigDecimal totalRechargeAmount;
 
     @ApiModelProperty(notes = "累计充值人数")
-    private Long totalRechargeUserCount;
+    private Long totalRechargeNum;
 
     @ApiModelProperty(notes = "累计充值次数")
     private Long totalRechargeCount;
 
+    @ApiModelProperty(notes = "累计消耗")
+    private Long totalCost;
+
     @ApiModelProperty(notes = "平均单价")
     private BigDecimal avgAmount;
 
-    @ApiModelProperty(notes = "注册人数")
-    private Long regUserCount;
-
-    @ApiModelProperty(notes = "累计消耗")
-    private BigDecimal totalCost;
-
     @ApiModelProperty(notes = "回本率")
     private BigDecimal roi;
 }

+ 68 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/AgentDayAgainVO.java

@@ -0,0 +1,68 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * @author tianhua
+ * @time 2023/7/22
+ * @Description 传递给前端的推广每日复充趋势实体
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class AgentDayAgainVO {
+
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(value =
+            """
+            C1 -> 充值一次
+            C2 -> 充值大于一次
+            C3 -> 充值大于两次
+            C4 -> 充值大于三次
+            C5 -> 充值大于四次
+            C6 -> 充值大于五次
+            C7 -> 充值大于十次
+            C8 -> 充值大于二十次
+            """)
+    private String cn;
+
+    /**
+     * 原
+     */
+    @ApiModelProperty(value = "原(总量)")
+    private Long original;
+
+    /**
+     * 现
+     */
+    @ApiModelProperty(value = "现(总量)")
+    private Long present;
+
+    /**
+     * 增
+     */
+    @ApiModelProperty(value = "增(总量)")
+    private Long increase;
+
+    /**
+     * 移
+     */
+    @ApiModelProperty(value = "移(总量)")
+    private Long decrease;
+
+    /**
+     * 比
+     */
+    @ApiModelProperty(value = "比(总量)")
+    private BigDecimal rate;
+
+}

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

@@ -7,7 +7,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
+
 
 /**
  * @author tianhua
@@ -20,29 +20,45 @@ import java.math.BigInteger;
 @Builder
 public class GameDataAgainDayVO {
 
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(value =
+            """
+            C1 -> 充值一次
+            C2 -> 充值大于一次
+            C3 -> 充值大于两次
+            C4 -> 充值大于三次
+            C5 -> 充值大于四次
+            C6 -> 充值大于五次
+            C7 -> 充值大于十次
+            C8 -> 充值大于二十次
+            """)
+    private String cn;
+
     /**
      * 原(总量)
      */
     @ApiModelProperty(value = "原(总量)")
-    private BigInteger original;
+    private Long original;
 
     /**
      * 现(总量)
      */
     @ApiModelProperty(value = "现(总量)")
-    private BigInteger present;
+    private Long present;
 
     /**
      * 增(总量)
      */
     @ApiModelProperty(value = "增(总量)")
-    private BigInteger increase;
+    private Long increase;
 
     /**
      * 移(总量)
      */
     @ApiModelProperty(value = "移(总量)")
-    private BigInteger decrease;
+    private Long decrease;
 
     /**
      * 比(总量)
@@ -54,25 +70,25 @@ public class GameDataAgainDayVO {
      * 原(买量)
      */
     @ApiModelProperty(value = "原(买量)")
-    private BigInteger buyOriginal;
+    private Long buyOriginal;
 
     /**
      * 现(买量)
      */
     @ApiModelProperty(value = "现(买量)")
-    private BigInteger buyPresent;
+    private Long buyPresent;
 
     /**
      * 增(买量)
      */
     @ApiModelProperty(value = "增(买量)")
-    private BigInteger buyIncrease;
+    private Long buyIncrease;
 
     /**
      * 移(买量)
      */
     @ApiModelProperty(value = "移(买量)")
-    private BigInteger buyDecrease;
+    private Long buyDecrease;
 
     /**
      * 比(买量)
@@ -84,25 +100,25 @@ public class GameDataAgainDayVO {
      * 原(自然量)
      */
     @ApiModelProperty(value = "原(自然量)")
-    private BigInteger natureOriginal;
+    private Long natureOriginal;
 
     /**
      * 现(自然量)
      */
     @ApiModelProperty(value = "现(自然量)")
-    private BigInteger naturePresent;
+    private Long naturePresent;
 
     /**
      * 增(自然量)
      */
     @ApiModelProperty(value = "增(自然量)")
-    private BigInteger natureIncrease;
+    private Long natureIncrease;
 
     /**
      * 移(自然量)
      */
     @ApiModelProperty(value = "移(自然量)")
-    private BigInteger natureDecrease;
+    private Long natureDecrease;
 
     /**
      * 比(自然量)

+ 41 - 29
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataDayVO.java

@@ -7,7 +7,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 
 /**
@@ -21,6 +21,12 @@ import java.time.LocalDate;
 @Builder
 public class GameDataDayVO {
 
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty(value = "游戏ID")
+    private Long gameId;
+
     /**
      * 推广游戏名称
      */
@@ -31,7 +37,13 @@ public class GameDataDayVO {
      * 推广游戏应用类型
      */
     @ApiModelProperty(value = "游戏类型")
-    private BigInteger gameClassify;
+    private Long gameClassify;
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty(value = "SDK来源")
+    private String sourceSystem;
 
     /**
      * 注册时间
@@ -43,31 +55,31 @@ public class GameDataDayVO {
      * 买量注册人数
      */
     @ApiModelProperty(value = "注册人数(买量)")
-    private BigInteger buyRegNum;
+    private Long buyRegNum;
 
     /**
      * 自然量注册人数
      */
     @ApiModelProperty(value = "注册人数(自然量)")
-    private BigInteger natureRegNum;
+    private Long natureRegNum;
 
     /**
      * 注册人数(总)
      */
     @ApiModelProperty(value = "注册人数(总量)")
-    private BigInteger regNum;
+    private Long regNum;
 
     /**
      * 首日新用户充值次数(买量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(买量)")
-    private BigInteger buyFirstNewUserAmountCount;
+    private Long buyFirstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(买量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(买量)")
-    private BigInteger buyFirstNewUserAmountNum;
+    private Long buyFirstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(买量)
@@ -79,13 +91,13 @@ public class GameDataDayVO {
      * 老用户充值次数(买量)
      */
     @ApiModelProperty(value = "老用户充值次数(买量)")
-    private BigInteger buyOldUserCount;
+    private Long buyOldUserCount;
 
     /**
      * 老用户充值人数(买量)
      */
     @ApiModelProperty(value = "老用户充值人数(买量)")
-    private BigInteger buyOldUserNum;
+    private Long buyOldUserNum;
 
     /**
      * 老用户充值金额(买量)
@@ -97,13 +109,13 @@ public class GameDataDayVO {
      * 账面充值次数(买量)
      */
     @ApiModelProperty(value = "账面充值次数(买量)")
-    private BigInteger buyAmountCount;
+    private Long buyAmountCount;
 
     /**
      * 账面充值人数(买量)
      */
     @ApiModelProperty(value = "账面充值人数(买量)")
-    private BigInteger buyAmountNum;
+    private Long buyAmountNum;
 
     /**
      * 账面充值金额(买量)
@@ -115,13 +127,13 @@ public class GameDataDayVO {
      * 新用户累计充值次数(买量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(买量)")
-    private BigInteger buyNewUserTotalAmountCount;
+    private Long buyNewUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(买量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(买量)")
-    private BigInteger buyNewUserTotalAmountNum;
+    private Long buyNewUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(买量)
@@ -199,13 +211,13 @@ public class GameDataDayVO {
      * 首日新用户充值次数(自然量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(自然量)")
-    private BigInteger natureFirstNewUserAmountCount;
+    private Long natureFirstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(自然量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(自然量)")
-    private BigInteger natureFirstNewUserAmountNum;
+    private Long natureFirstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(自然量)
@@ -217,13 +229,13 @@ public class GameDataDayVO {
      * 老用户充值次数(自然量)
      */
     @ApiModelProperty(value = "老用户充值次数(自然量)")
-    private BigInteger natureOldUserCount;
+    private Long natureOldUserCount;
 
     /**
      * 老用户充值人数(自然量)
      */
     @ApiModelProperty(value = "老用户充值人数(自然量)")
-    private BigInteger natureOldUserNum;
+    private Long natureOldUserNum;
 
     /**
      * 老用户充值金额(自然量)
@@ -235,13 +247,13 @@ public class GameDataDayVO {
      * 账面充值次数(自然量)
      */
     @ApiModelProperty(value = "账面充值次数(自然量)")
-    private BigInteger natureAmountCount;
+    private Long natureAmountCount;
 
     /**
      * 账面充值人数(自然量)
      */
     @ApiModelProperty(value = "账面充值人数(自然量)")
-    private BigInteger natureAmountNum;
+    private Long natureAmountNum;
 
     /**
      * 账面充值金额(自然量)
@@ -253,13 +265,13 @@ public class GameDataDayVO {
      * 新用户累计充值次数(自然量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(自然量)")
-    private BigInteger natureNewUserTotalAmountCount;
+    private Long natureNewUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(自然量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(自然量)")
-    private BigInteger natureNewUserTotalAmountNum;
+    private Long natureNewUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(自然量)
@@ -337,13 +349,13 @@ public class GameDataDayVO {
      * 首日新用户充值次数(总量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(总量)")
-    private BigInteger firstNewUserAmountCount;
+    private Long firstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(总量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(总量)")
-    private BigInteger firstNewUserAmountNum;
+    private Long firstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(总量)
@@ -355,13 +367,13 @@ public class GameDataDayVO {
      * 老用户充值次数(总量)
      */
     @ApiModelProperty(value = "老用户充值次数(总量)")
-    private BigInteger oldUserCount;
+    private Long oldUserCount;
 
     /**
      * 老用户充值人数(总量)
      */
     @ApiModelProperty(value = "老用户充值人数(总量)")
-    private BigInteger oldUserNum;
+    private Long oldUserNum;
 
     /**
      * 老用户充值金额(总量)
@@ -373,13 +385,13 @@ public class GameDataDayVO {
      * 账面充值次数(总量)
      */
     @ApiModelProperty(value = "账面充值次数(总量)")
-    private BigInteger amountCount;
+    private Long amountCount;
 
     /**
      * 账面充值人数(总量)
      */
     @ApiModelProperty(value = "账面充值人数(总量)")
-    private BigInteger amountNum;
+    private Long amountNum;
 
     /**
      * 账面充值金额(总量)
@@ -391,13 +403,13 @@ public class GameDataDayVO {
      * 新用户累计充值次数(总量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(总量)")
-    private BigInteger newUserTotalAmountCount;
+    private Long newUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(总量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(总量)")
-    private BigInteger newUserTotalAmountNum;
+    private Long newUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(总量)

+ 123 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataH5VO.java

@@ -0,0 +1,123 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.nutz.dao.entity.annotation.Column;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ * @author tianhua
+ * @time 2023/7/12
+ * @Description 返回给前端的游戏总数据实体
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class GameDataH5VO {
+    /**
+     * ID
+     */
+    private String id;
+
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty("游戏ID")
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty("游戏名称")
+    private String gameName;
+
+    /**
+     * 游戏来源
+     */
+    @ApiModelProperty("游戏来源")
+    private String sourceSystem;
+
+    @ApiModelProperty("H5游戏新用户充值金额")
+    private BigDecimal h5NewUserRechargeMoney;
+
+    @ApiModelProperty("H5游戏新用户充值人数")
+    private Long h5NewUserRechargeNum;
+
+    /**
+     * H5游戏至今充值金额(买量)
+     */
+    @ApiModelProperty("可排序:H5游戏至今充值金额(买量)")
+    private BigDecimal h5BuyNewUserTotalAmount;
+
+    /**
+     * H5游戏至今充值人数(买量)
+     */
+    @ApiModelProperty("可排序:H5游戏至今充值人数(买量)")
+    private Long h5BuyNewUserTotalAmountNum;
+
+    /**
+     * H5游戏账面充值金额(买量)
+     */
+    @ApiModelProperty("H5游戏账面充值金额(买量)")
+    private BigDecimal h5BuyAmount;
+
+    /**
+     * H5游戏账面充值人数(买量)
+     */
+    @ApiModelProperty("H5游戏账面充值人数(买量)")
+    private Long h5BuyAmountNum;
+
+    @ApiModelProperty("H5自然量新用户充值金额(自然量)")
+    private BigDecimal h5NewUserNatureRechargeMoney;
+
+    @ApiModelProperty("H5自然量新用户充额比例(自然量)=H5自然量新用户充值金额/H5游戏新用户充值金额")
+    private BigDecimal h5NewUserNatureRechargeRate;
+
+    @ApiModelProperty("H5自然量新用户充值人数(自然量)")
+    private Long h5NewUserNatureRechargeNum;
+
+    @ApiModelProperty("H5自然量新用户比例=H5自然量新用户充值人数/H5游戏新用户充值人数")
+    private BigDecimal h5NewUserNatureNewUserRate;
+
+    /**
+     * H5自然量至今充值金额(自然量)
+     */
+    @ApiModelProperty("可排序:H5自然量至今充值金额(自然量)")
+    private BigDecimal h5NatureNewUserTotalAmount;
+
+    /**
+     * H5自然量至今充值金额比例(自然量)
+     */
+    @ApiModelProperty("可排序:H5自然量至今充值金额比例(自然量)")
+    private BigDecimal h5NatureNewUserTotalAmountRate;
+
+    /**
+     * H5自然量至今充值人数(自然量)
+     */
+    @ApiModelProperty("可排序:H5自然量至今充值人数(自然量)")
+    private Long h5NatureNewUserTotalAmountNum;
+
+    /**
+     * H5自然量账面充值金额(自然量)
+     */
+    @ApiModelProperty("H5自然量账面充值金额(自然量)")
+    private BigDecimal h5NatureAmount;
+
+    /**
+     * H5自然量账面充值人数(自然量)
+     */
+    @ApiModelProperty("H5自然量账面充值人数(自然量)")
+    private Long h5NatureAmountNum;
+
+    private List<H5BuyUserVO> h5BuyUserVOList;
+
+    private List<H5NatureUserVO> h5NatureUserVOList;
+
+}

+ 38 - 39
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameDataTotalVO.java

@@ -7,7 +7,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
 
 /**
  * @author tianhua
@@ -24,7 +23,7 @@ public class GameDataTotalVO {
      * 游戏id(前端不显示)
      */
     @ApiModelProperty(value = "游戏Id(前端不显示)")
-    private BigInteger gameId;
+    private Long gameId;
 
     /**
      * 推广游戏名称
@@ -36,37 +35,37 @@ public class GameDataTotalVO {
      * 推广游戏应用类型
      */
     @ApiModelProperty(value = "游戏类型")
-    private BigInteger gameClassify;
+    private Long gameClassify;
 
     /**
      * 买量注册人数
      */
     @ApiModelProperty(value = "注册人数(买量)")
-    private BigInteger buyRegNum;
+    private Long buyRegNum;
 
     /**
      * 自然量注册人数
      */
     @ApiModelProperty(value = "注册人数(自然量)")
-    private BigInteger natureRegNum;
+    private Long natureRegNum;
 
     /**
      * 注册人数(总)
      */
     @ApiModelProperty(value = "注册人数(总量)")
-    private BigInteger regNum;
+    private Long regNum;
 
     /**
      * 新用户充值次数(买量)
      */
     @ApiModelProperty(value = "新用户充值次数(买量)")
-    private BigInteger buyNewUserAmountCount;
+    private Long buyNewUserAmountCount;
 
     /**
      * 新用户充值人数(买量)
      */
     @ApiModelProperty(value = "新用户充值人数(买量)")
-    private BigInteger buyNewUserAmountNum;
+    private Long buyNewUserAmountNum;
 
     /**
      * 新用户充值金额(买量)
@@ -78,13 +77,13 @@ public class GameDataTotalVO {
      * 首日新用户充值次数(买量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(买量)")
-    private BigInteger buyFirstNewUserAmountCount;
+    private Long buyFirstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(买量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(买量)")
-    private BigInteger buyFirstNewUserAmountNum;
+    private Long buyFirstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(买量)
@@ -96,13 +95,13 @@ public class GameDataTotalVO {
      * 老用户充值次数(买量)
      */
     @ApiModelProperty(value = "老用户充值次数(买量)")
-    private BigInteger buyOldUserCount;
+    private Long buyOldUserCount;
 
     /**
      * 老用户充值人数(买量)
      */
     @ApiModelProperty(value = "老用户充值人数(买量)")
-    private BigInteger buyOldUserNum;
+    private Long buyOldUserNum;
 
     /**
      * 老用户充值金额(买量)
@@ -114,13 +113,13 @@ public class GameDataTotalVO {
      * 账面充值次数(买量)
      */
     @ApiModelProperty(value = "账面充值次数(买量)")
-    private BigInteger buyAmountCount;
+    private Long buyAmountCount;
 
     /**
      * 账面充值人数(买量)
      */
     @ApiModelProperty(value = "账面充值人数(买量)")
-    private BigInteger buyAmountNum;
+    private Long buyAmountNum;
 
     /**
      * 账面充值金额(买量)
@@ -132,13 +131,13 @@ public class GameDataTotalVO {
      * 新用户累计充值次数(买量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(买量)")
-    private BigInteger buyNewUserTotalAmountCount;
+    private Long buyNewUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(买量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(买量)")
-    private BigInteger buyNewUserTotalAmountNum;
+    private Long buyNewUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(买量)
@@ -216,7 +215,7 @@ public class GameDataTotalVO {
      * 新用户复充人数(买量)(前端不需要显示)
      */
     @ApiModelProperty(value = "新用户复充人数(买量)(前端不需要显示)")
-    private BigInteger buyNewUserAgainNum;
+    private Long buyNewUserAgainNum;
 
     /**
      * 新增注册ARPU(买量)
@@ -252,13 +251,13 @@ public class GameDataTotalVO {
      * 新用户充值次数(自然量)
      */
     @ApiModelProperty(value = "新用户充值次数(自然量)")
-    private BigInteger natureNewUserAmountCount;
+    private Long natureNewUserAmountCount;
 
     /**
      * 新用户充值人数(自然量)
      */
     @ApiModelProperty(value = "新用户充值人数(自然量)")
-    private BigInteger natureNewUserAmountNum;
+    private Long natureNewUserAmountNum;
 
     /**
      * 新用户充值金额(自然量)
@@ -270,13 +269,13 @@ public class GameDataTotalVO {
      * 首日新用户充值次数(自然量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(自然量)")
-    private BigInteger natureFirstNewUserAmountCount;
+    private Long natureFirstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(自然量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(自然量)")
-    private BigInteger natureFirstNewUserAmountNum;
+    private Long natureFirstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(自然量)
@@ -288,13 +287,13 @@ public class GameDataTotalVO {
      * 老用户充值次数(自然量)
      */
     @ApiModelProperty(value = "老用户充值次数(自然量)")
-    private BigInteger natureOldUserCount;
+    private Long natureOldUserCount;
 
     /**
      * 老用户充值人数(自然量)
      */
     @ApiModelProperty(value = "老用户充值人数(自然量)")
-    private BigInteger natureOldUserNum;
+    private Long natureOldUserNum;
 
     /**
      * 老用户充值金额(自然量)
@@ -306,13 +305,13 @@ public class GameDataTotalVO {
      * 账面充值次数(自然量)
      */
     @ApiModelProperty(value = "账面充值次数(自然量)")
-    private BigInteger natureAmountCount;
+    private Long natureAmountCount;
 
     /**
      * 账面充值人数(自然量)
      */
     @ApiModelProperty(value = "账面充值人数(自然量)")
-    private BigInteger natureAmountNum;
+    private Long natureAmountNum;
 
     /**
      * 账面充值金额(自然量)
@@ -324,13 +323,13 @@ public class GameDataTotalVO {
      * 新用户累计充值次数(自然量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(自然量)")
-    private BigInteger natureNewUserTotalAmountCount;
+    private Long natureNewUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(自然量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(自然量)")
-    private BigInteger natureNewUserTotalAmountNum;
+    private Long natureNewUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(自然量)
@@ -408,7 +407,7 @@ public class GameDataTotalVO {
      * 新用户复充人数(自然量)(前端不需要显示)
      */
     @ApiModelProperty(value = "新用户复充人数(自然量)(前端不需要显示)")
-    private BigInteger natureNewUserAgainNum;
+    private Long natureNewUserAgainNum;
 
     /**
      * 新增注册ARPU(自然量)
@@ -444,13 +443,13 @@ public class GameDataTotalVO {
      * 新用户充值次数(总量)
      */
     @ApiModelProperty(value = "新用户充值次数(总量)")
-    private BigInteger newUserAmountCount;
+    private Long newUserAmountCount;
 
     /**
      * 新用户充值人数(总量)
      */
     @ApiModelProperty(value = "新用户充值人数(总量)")
-    private BigInteger newUserAmountNum;
+    private Long newUserAmountNum;
 
     /**
      * 新用户充值金额(总量)
@@ -462,13 +461,13 @@ public class GameDataTotalVO {
      * 首日新用户充值次数(总量)
      */
     @ApiModelProperty(value = "首日新用户充值次数(总量)")
-    private BigInteger firstNewUserAmountCount;
+    private Long firstNewUserAmountCount;
 
     /**
      * 首日新用户充值人数(总量)
      */
     @ApiModelProperty(value = "首日新用户充值人数(总量)")
-    private BigInteger firstNewUserAmountNum;
+    private Long firstNewUserAmountNum;
 
     /**
      * 首日新用户充值金额(总量)
@@ -480,13 +479,13 @@ public class GameDataTotalVO {
      * 老用户充值次数(总量)
      */
     @ApiModelProperty(value = "老用户充值次数(总量)")
-    private BigInteger oldUserCount;
+    private Long oldUserCount;
 
     /**
      * 老用户充值人数(总量)
      */
     @ApiModelProperty(value = "老用户充值人数(总量)")
-    private BigInteger oldUserNum;
+    private Long oldUserNum;
 
     /**
      * 老用户充值金额(总量)
@@ -498,13 +497,13 @@ public class GameDataTotalVO {
      * 账面充值次数(总量)
      */
     @ApiModelProperty(value = "账面充值次数(总量)")
-    private BigInteger amountCount;
+    private Long amountCount;
 
     /**
      * 账面充值人数(总量)
      */
     @ApiModelProperty(value = "账面充值人数(总量)")
-    private BigInteger amountNum;
+    private Long amountNum;
 
     /**
      * 账面充值金额(总量)
@@ -516,13 +515,13 @@ public class GameDataTotalVO {
      * 新用户累计充值次数(总量)
      */
     @ApiModelProperty(value = "新用户累计充值次数(总量)")
-    private BigInteger newUserTotalAmountCount;
+    private Long newUserTotalAmountCount;
 
     /**
      * 新用户累计充值人数(总量)
      */
     @ApiModelProperty(value = "新用户累计充值人数(总量)")
-    private BigInteger newUserTotalAmountNum;
+    private Long newUserTotalAmountNum;
 
     /**
      * 新用户累计充值金额(总量)
@@ -600,7 +599,7 @@ public class GameDataTotalVO {
      * 新用户复充人数(总量)(前端不需要显示)
      */
     @ApiModelProperty(value = "新用户复充人数(总量)(前端不需要显示)")
-    private BigInteger newUserAgainNum;
+    private Long newUserAgainNum;
 
     /**
      * 新增注册ARPU(总量)

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

@@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
 import org.nutz.dao.entity.annotation.Column;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
+
 import java.time.LocalDate;
 import java.util.List;
 
@@ -23,6 +23,8 @@ import java.util.List;
 @Builder
 public class GameDataWaterVO {
     private Long id;
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     /**
      * 游戏ID
      */

+ 7 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GamePromoteDayVO.java

@@ -15,7 +15,11 @@ import java.time.LocalDate;
 @Builder
 public class GamePromoteDayVO {
     private String id;
+    @ApiModelProperty(notes = "日期")
+    private LocalDate dt;
 
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
     @ApiModelProperty(notes = "渠道id")
     private Long agentId;
 
@@ -31,6 +35,9 @@ public class GamePromoteDayVO {
     @ApiModelProperty(notes = "cp名")
     private String cpName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
     @ApiModelProperty(notes = "游戏名")
     private String gameName;
     @ApiModelProperty(notes = "游戏应用类型")

+ 9 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GamePromoteTotalVO.java

@@ -16,9 +16,15 @@ import java.time.LocalDate;
 public class GamePromoteTotalVO {
     private String id;
 
+    @ApiModelProperty(notes = "sdk来源")
+    private String sourceSystem;
+
     @ApiModelProperty(notes = "渠道id")
     private Long agentId;
 
+    @ApiModelProperty(notes = "渠道名称")
+    private String agentName;
+
     @ApiModelProperty(notes = "推广账号ID")
     private String accountId;
 
@@ -28,6 +34,9 @@ public class GamePromoteTotalVO {
     @ApiModelProperty(notes = "cp名")
     private String cpName;
 
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
     @ApiModelProperty(notes = "游戏名")
     private String gameName;
     @ApiModelProperty(notes = "游戏应用类型")

+ 2 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/GameRechargeRankingVO.java

@@ -16,6 +16,8 @@ import java.time.LocalDate;
 @Builder
 public class GameRechargeRankingVO {
     private String id;
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
 
     /**
      * 游戏ID

+ 69 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/H5BuyUserVO.java

@@ -0,0 +1,69 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * @author tianhua
+ * @time 2023/7/12
+ * @Description 返回给前端的游戏总数据实体
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class H5BuyUserVO {
+    private String buySourceSystem;
+    /**
+     * 游戏买量导入用户数据:游戏名称
+     */
+    @ApiModelProperty("游戏买量导入用户数据:游戏名称")
+    private String buyGameName;
+
+    /**
+     * 游戏买量导入用户数据:游戏ID
+     */
+    @ApiModelProperty("游戏买量导入用户数据:游戏ID")
+    private Long buyGameId;
+
+    /**
+     * 游戏买量导入用户数据:游戏类别
+     */
+    @ApiModelProperty("游戏买量导入用户数据:游戏类别")
+    private Long buyClassify;
+
+    @ApiModelProperty("游戏买量导入用户数据:新用户充值金额")
+    private BigDecimal newUserRechargeMoney;
+
+    @ApiModelProperty("游戏买量导入用户数据:新用户充值人数")
+    private Long newUserRechargeNum;
+
+    /**
+     * 游戏买量导入用户数据:累计充值金额
+     */
+    @ApiModelProperty("游戏买量导入用户数据:累计充值金额")
+    private BigDecimal h5LeadBuyNewUserTotalAmount;
+
+    /**
+     * 游戏买量导入用户数据:累计充值人数
+     */
+    @ApiModelProperty("游戏买量导入用户数据:累计充值人数")
+    private Long h5LeadBuyNewUserTotalAmountNum;
+
+    /**
+     * 游戏买量导入用户数据:账面充值金额
+     */
+    @ApiModelProperty("游戏买量导入用户数据:账面充值金额")
+    private BigDecimal h5LeadBuyAmount;
+
+    /**
+     * 游戏买量导入用户数据:账面充值人数
+     */
+    @ApiModelProperty("游戏买量导入用户数据:账面充值人数")
+    private Long h5LeadBuyAmountNum;
+}

+ 69 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/H5NatureUserVO.java

@@ -0,0 +1,69 @@
+package com.zanxiang.game.data.serve.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * @author tianhua
+ * @time 2023/7/12
+ * @Description 返回给前端的游戏总数据实体
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class H5NatureUserVO {
+    private String natureSourceSystem;
+    /**
+     * 游戏官方导量用户数据:游戏名称
+     */
+    @ApiModelProperty("游戏官方导量用户数据:游戏名称")
+    private String natureGameName;
+
+    /**
+     * 游戏官方导量用户数据:游戏ID
+     */
+    @ApiModelProperty("游戏官方导量用户数据:游戏ID")
+    private Long natureGameId;
+
+    /**
+     * 游戏官方导量用户数据:游戏类别
+     */
+    @ApiModelProperty("游戏官方导量用户数据:游戏类别")
+    private Long natureClassify;
+
+    @ApiModelProperty("游戏买量导入用户数据:新用户充值金额")
+    private BigDecimal newUserRechargeMoney;
+
+    @ApiModelProperty("游戏买量导入用户数据:新用户充值人数")
+    private Long newUserRechargeNum;
+
+    /**
+     * 游戏官方导量用户数据:累计充值金额
+     */
+    @ApiModelProperty("游戏官方导量用户数据:累计充值金额")
+    private BigDecimal h5LeadNatureNewUserTotalAmount;
+
+    /**
+     * 游戏官方导量用户数据:累计充值人数
+     */
+    @ApiModelProperty("游戏官方导量用户数据:累计充值人数")
+    private Long h5LeadNatureNewUserTotalAmountNum;
+
+    /**
+     * 游戏官方导量用户数据:账面充值金额
+     */
+    @ApiModelProperty("游戏官方导量用户数据:账面充值金额")
+    private BigDecimal h5LeadNatureAmount;
+
+    /**
+     * 游戏官方导量用户数据:账面充值人数
+     */
+    @ApiModelProperty("游戏官方导量用户数据:账面充值人数")
+    private Long h5LeadNatureAmountNum;
+}

+ 7 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/OverallSummaryLineDataVO.java

@@ -7,7 +7,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.time.LocalDate;
 
 /**
@@ -61,6 +60,12 @@ public class OverallSummaryLineDataVO {
      * 新增用户
      */
     @ApiModelProperty(value = "新增用户")
-    private BigInteger playerAccount;
+    private Long playerAccount;
+
+    /**
+     * 首日新用户充值(总计)(前端不需要展示)
+     */
+    @ApiModelProperty(value = "首日新用户充值(前端不需要展示)")
+    private BigDecimal firstNewUserAmount;
 
 }

+ 20 - 15
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/OverallSummaryVO.java

@@ -7,7 +7,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
-import java.math.BigInteger;
 
 /**
  * @author tianhua
@@ -24,19 +23,19 @@ public class OverallSummaryVO {
      * 玩家总计
      */
     @ApiModelProperty(value = "玩家总计")
-    private BigInteger totalPlayers;
+    private Long totalPlayers;
 
     /**
      * 今日新增玩家数量
      */
     @ApiModelProperty(value = "今日新增玩家数量")
-    private BigInteger todayPlayerCount;
+    private Long todayPlayerCount;
 
     /**
      * 昨日新增玩家数量
      */
     @ApiModelProperty(value = "昨日新增玩家数量")
-    private BigInteger yesterdayPlayerCount;
+    private Long yesterdayPlayerCount;
 
     /**
      * 累计消耗
@@ -90,37 +89,37 @@ public class OverallSummaryVO {
      * 总渠道数
      */
     @ApiModelProperty(value = "渠道总计")
-    private BigInteger totalAgentCount;
+    private Long totalAgentCount;
 
     /**
      * 今日新增渠道数量
      */
     @ApiModelProperty(value = "今日新增渠道数量")
-    private BigInteger todayAgentCount;
+    private Long todayAgentCount;
 
     /**
      * 昨日新增渠道数量
      */
     @ApiModelProperty(value = "昨日新增渠道数量")
-    private BigInteger yesterdayAgentCount;
+    private Long yesterdayAgentCount;
 
     /**
      * 游戏总计
      */
-    @ApiModelProperty(value = "游戏总")
-    private BigInteger totalGameCount;
+    @ApiModelProperty(value = "游戏总投数")
+    private Long totalGameCount;
 
     /**
-     * 今日新增游戏数量
+     * 今日在投游戏数量
      */
-    @ApiModelProperty(value = "今日新增游戏数量")
-    private BigInteger todayGameCount;
+    @ApiModelProperty(value = "今日在投游戏数量")
+    private Long todayGameCount;
 
     /**
-     * 昨日新增游戏数量
+     * 昨日在投游戏数量
      */
-    @ApiModelProperty(value = "昨日新增游戏数量")
-    private BigInteger yesterdayGameCount;
+    @ApiModelProperty(value = "昨日在投游戏数量")
+    private Long yesterdayGameCount;
 
     /**
      * 总回本率
@@ -146,4 +145,10 @@ public class OverallSummaryVO {
     @ApiModelProperty(value = "30日回本率")
     private BigDecimal d30TotalRoi;
 
+    /**
+     * 首日新用户充值(总计)(前端不需要展示)
+     */
+    @ApiModelProperty(value = "首日新用户充值(前端不需要展示)")
+    private BigDecimal firstNewUserAmount;
+
 }

+ 6 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerRechargeRankingVO.java

@@ -23,6 +23,9 @@ public class PlayerRechargeRankingVO {
     @ApiModelProperty("玩家ID")
     private Long playerId;
 
+    @ApiModelProperty(notes = "SDK来源")
+    private String sourceSystem;
+
     /**
      * 玩家账号
      */
@@ -35,6 +38,9 @@ public class PlayerRechargeRankingVO {
     @ApiModelProperty("注册渠道ID")
     private Long regAgentId;
 
+    @ApiModelProperty("注册渠道名称")
+    private String regAgentName;
+
     /**
      * 注册时间
      */

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerTemplateVO.java

@@ -22,7 +22,7 @@ public class PlayerTemplateVO {
      * 玩家模板排序
      */
     @ApiModelProperty("玩家模板排序")
-    private String userOrderBy;
+    private Integer userOrderBy;
 
     /**
      * 用户ID

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/RechargeTemplateVO.java

@@ -22,7 +22,7 @@ public class RechargeTemplateVO {
      * 充值模板排序
      */
     @ApiModelProperty("充值模板排序")
-    private String amountOrderBy;
+    private Integer amountOrderBy;
 
     /**
      * 充值挡位

+ 13 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IAccountAgentDayService.java

@@ -1,13 +1,19 @@
 package com.zanxiang.game.data.serve.service;
 
+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.vo.AgentDayAgainVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteDayTotalVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteDayVO;
 import com.zanxiang.game.data.serve.pojo.vo.GamePromoteTotalVO;
 import com.zanxiang.game.data.serve.utils.Page;
 
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+
 public interface IAccountAgentDayService {
     /**
      * 推广每日数据
@@ -29,4 +35,11 @@ public interface IAccountAgentDayService {
      * @return
      */
     Page<GamePromoteTotalVO> accountAgentTotal(GamePromoteTotalDTO dto);
+
+    /**
+     * 推广每日复充趋势
+     * @param dto
+     * @return
+     */
+    Map<LocalDate, List<AgentDayAgainVO>> accountAgentDayAgain(AgentDayAgainDTO dto);
 }

+ 4 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IGameDataService.java

@@ -2,10 +2,12 @@ package com.zanxiang.game.data.serve.service;
 
 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.vo.GameDataAgainDayVO;
 import com.zanxiang.game.data.serve.pojo.vo.GameDataDayVO;
+import com.zanxiang.game.data.serve.pojo.vo.GameDataH5VO;
 import com.zanxiang.game.data.serve.pojo.vo.GameDataTotalVO;
 import com.zanxiang.game.data.serve.pojo.vo.GameDataWaterVO;
 import com.zanxiang.game.data.serve.utils.Page;
@@ -44,4 +46,6 @@ public interface IGameDataService {
      */
     Map<LocalDate, List<GameDataAgainDayVO>> getGameDataAgainDay(GameDataAgainDayDTO dto) throws Exception;
 
+
+    Page<GameDataH5VO> getH5Recharge(GameDataH5DTO dto);
 }

+ 275 - 26
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AccountAgentDayServiceImpl.java

@@ -3,20 +3,22 @@ package com.zanxiang.game.data.serve.service.impl;
 import com.google.common.base.CaseFormat;
 import com.google.gson.Gson;
 import com.zanxiang.erp.security.util.SecurityUtil;
+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.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.GamePromoteDayTotalVO;
-import com.zanxiang.game.data.serve.pojo.vo.GamePromoteDayVO;
-import com.zanxiang.game.data.serve.pojo.vo.GamePromoteTotalVO;
-import com.zanxiang.game.data.serve.pojo.vo.RechargeTrendVO;
+import com.zanxiang.game.data.serve.pojo.vo.*;
 import com.zanxiang.game.data.serve.service.IAccountAgentDayService;
 import com.zanxiang.game.data.serve.utils.Page;
 import com.zanxiang.module.util.DateUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.nutz.dao.Cnd;
@@ -24,6 +26,7 @@ import org.nutz.dao.Dao;
 import org.nutz.dao.Sqls;
 import org.nutz.dao.entity.Entity;
 import org.nutz.dao.pager.Pager;
+import org.nutz.dao.sql.Criteria;
 import org.nutz.dao.sql.Sql;
 import org.nutz.dao.util.Daos;
 import org.nutz.dao.util.cri.SimpleCriteria;
@@ -31,13 +34,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 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
@@ -80,6 +81,9 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (StringUtils.isNotBlank(dto.getGameName())) {
             cri.where().andLike("game_name", dto.getGameName());
         }
+        if (null != dto.getGameId()) {
+            cri.where().andEquals("game_id", dto.getGameId());
+        }
         if (StringUtils.isNotBlank(dto.getGameType())) {
             cri.where().andEquals("game_type", dto.getGameType());
         }
@@ -89,6 +93,9 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (null != dto.getEndDay()) {
             cri.where().and("dt", "<=", dto.getEndDay());
         }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(accountAgentDaySql() + "$condition");
         sql.setPager(pager);
@@ -221,12 +228,18 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (StringUtils.isNotBlank(dto.getGameType())) {
             cri.where().andEquals("game_type", dto.getGameType());
         }
+        if (null != dto.getGameId()) {
+            cri.where().andEquals("game_id", dto.getGameId());
+        }
         if (null != dto.getBeginDay()) {
             cri.where().and("dt", ">=", dto.getBeginDay());
         }
         if (null != dto.getEndDay()) {
             cri.where().and("dt", "<=", dto.getEndDay());
         }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
         Sql sql = Sqls.queryEntity(accountAgentDayTotalSql() + "$condition");
         Entity<GamePromoteDayTotalVO> entity = dao.getEntity(GamePromoteDayTotalVO.class);
         sql.setEntity(entity).setCondition(cri);
@@ -281,14 +294,18 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         if (null != dto.getCostEndDay()) {
             cri.where().and("a.dt", "<=", dto.getCostEndDay());
         }
-        cri.groupBy("a.account_id,a.agent_id");
+        if (null != dto.getGameId()) {
+            cri.where().andEquals("a.game_id", dto.getGameId());
+        }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("a.source_system", dto.getSourceSystem());
+        }
+        cri.groupBy("a.account_id,a.agent_id,a.source_system");
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(accountAgentTotalSql() + "$condition");
         sql.setPager(pager);
         Entity<GamePromoteTotalVO> entity = dao.getEntity(GamePromoteTotalVO.class);
         sql.setEntity(entity).setCondition(cri);
-        sql.setParam("rechargeBeginDay", dto.getRechargeBeginDay());
-        sql.setParam("rechargeEndDay", dto.getRechargeEndDay());
         dao.execute(sql);
         Sql sqlCount = Sqls.queryEntity("select count(*) from ads_account_agent_day a " + "$condition");
         sqlCount.setCondition(cri);
@@ -300,14 +317,61 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         dayNMap.put("beginDay", dto.getCostBeginDay());
         dayNMap.put("endDay", dto.getCostEndDay());
 
+        String show = """
+                    select
+                    ifnull(sum(amount_count),0) as show_recharge_count,
+                    ifnull(sum(amount_num),0) as show_recharge_user,
+                    ifnull(sum(amount),0) as show_recharge_money,
+                    round(if(sum(amount_count) > 0, sum(amount) / sum(amount_count), 0), 4) as avg_show_user_recharge,
+                    round(if(sum(amount_num) > 0, sum(amount) / sum(amount_num), 0), 4) as show_recharge_arpu
+                    from
+                    ads_account_agent_day
+                    where
+                    source_system = @sourceSystem
+                    and agent_id = @agentId
+                    and account_id = @accountId
+                    and dt >= @rechargeBeginDay
+                    and dt <= @rechargeEndDay
+                    group by
+                    account_id,agent_id,source_system
+                    """;
+        Sql showSql = Sqls.queryEntity(show);
+        Entity<ShowRecharge> showEntity = dao.getEntity(ShowRecharge.class);
+        showSql.setEntity(showEntity);
+        showSql.setParam("rechargeBeginDay", dto.getRechargeBeginDay());
+        showSql.setParam("rechargeEndDay", dto.getRechargeEndDay());
         //循环总数据的每条数据
         List<GamePromoteTotalVO> hasRechargeDayList = list.stream().map(item -> {
-            Sql sqlDayN = Sqls.queryString("select dayN from ads_dayn_amount where " +
-                    "dt>=@beginDay and dt<=@endDay " +
-                    "and account_id = @accountId " +
-                    "and agent_id = @agentId");
+            showSql.setParam("sourceSystem", item.getSourceSystem());
+            showSql.setParam("agentId", item.getAgentId());
+            showSql.setParam("accountId", item.getAccountId());
+            dao.execute(showSql);
+            ShowRecharge showRecharge = showSql.getObject(ShowRecharge.class);
+            if (null != showRecharge){
+                item.setShowRechargeArpu(showRecharge.showRechargeArpu);
+                item.setShowRechargeCount(showRecharge.getShowRechargeCount());
+                item.setShowRechargeMoney(showRecharge.showRechargeMoney);
+                item.setShowRechargeUser(showRecharge.getShowRechargeUser());
+                item.setAvgShowUserRecharge(showRecharge.avgShowUserRecharge);
+            }else {
+                item.setShowRechargeArpu(BigDecimal.ZERO);
+                item.setShowRechargeCount(0L);
+                item.setShowRechargeMoney(BigDecimal.ZERO);
+                item.setShowRechargeUser(0L);
+                item.setAvgShowUserRecharge(BigDecimal.ZERO);
+            }
+            Sql sqlDayN = Sqls.queryString("""
+                    select dayN
+                    from ads_dayn_amount 
+                    where
+                    dt>=@beginDay and dt<=@endDay
+                    and account_id = @accountId
+                    and agent_id = @agentId
+                    and source_system = @sourceSystem
+                    """);
             dayNMap.put("accountId", item.getAccountId());
             dayNMap.put("agentId", item.getAgentId());
+            dayNMap.put("sourceSystem", item.getSourceSystem());
             sqlDayN.setParams(dayNMap);
             dao.execute(sqlDayN);
             List<String> dayNList = sqlDayN.getList(String.class);
@@ -384,6 +448,181 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         return new Page<>(hasRechargeDayList, pager);
     }
 
+    @Override
+    public Map<LocalDate, List<AgentDayAgainVO>> accountAgentDayAgain(AgentDayAgainDTO dto) {
+
+        //如果查询时间不传递默认从今天开始查询
+        if (dto.getBeginDate() == null) {
+            dto.setBeginDate(LocalDate.now());
+        }
+        //判断开始时间后的30天是否超过当前日期
+        if (dto.getBeginDate().plusDays(30).isAfter(LocalDate.now())) {
+            //只查询到当前的数据
+            dto.setEndDate(LocalDate.now());
+        } else {
+            //只考虑30天的数据
+            dto.setEndDate(dto.getBeginDate().plusDays(30));
+        }
+        //拼接查询条件
+        Criteria cri = Cnd.cri();
+        if (dto.getAccountId() != null){
+            cri.where().andEquals("account_id",dto.getAccountId());
+        }
+        if (dto.getAgentId() != null){
+            cri.where().andEquals("agent_id",dto.getAgentId());
+        }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            //拼接SDK来源
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        if (dto.getBeginDate() != null) {
+            cri.where().andEquals("dt", dto.getBeginDate());
+            cri.where().andBetween("ddf", dto.getBeginDate(), dto.getEndDate());
+        }
+        //按 "ddf" 升序排序
+        cri.getOrderBy().asc("ddf");
+
+        //获取推广每日复充表的查询结果
+        Sql againSql = Sqls.create( agentDayAgainSql() + cri);
+        againSql.setCallback(Sqls.callback.entities());
+        againSql.setEntity(dao.getEntity(AdsAgentDayAgain.class));
+        //执行sql
+        dao.execute(againSql);
+        //获取到原始数据list
+        List<AdsAgentDayAgain> list = againSql.getList(AdsAgentDayAgain.class);
+
+        //创建Map记录数据
+        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);
+
+        //外层循环8次 表示不同复充次数的数据
+        for (int i = 0; i < 8; i++) {
+            //用来计算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));
+            //"增":初始为 0
+            tempList.get(0).get(i).setIncrease(0L);
+            //"移":下一个充值次数的Ci 即C(i+1)
+            tempList.get(0).get(i).setDecrease(getCnByNum(list.get(0), ci + 1));
+            //"现":公式计算 = 原 + 增 - 移
+            tempList.get(0).get(i).setPresent(
+                    tempVO.getOriginal()+(tempVO.getIncrease())-(tempVO.getDecrease())
+            );
+            //"比"
+            tempList.get(0).get(i).setRate(getCnByNum(list.get(0), 1).compareTo(0L) == 0 ? BigDecimal.ZERO :
+                    BigDecimal.valueOf(tempVO.getPresent().doubleValue() / getCnByNum(list.get(0), 1).doubleValue()).setScale(4, RoundingMode.HALF_UP)
+            );
+
+            //计算第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)
+                tempList.get(j).get(i).setPresent(
+                        getCnByNum(list.get(j), ci)-(getCnByNum(list.get(j), ci + 1)));
+                //"增":当天的Ci - 前一天的Ci
+                tempList.get(j).get(i).setIncrease(
+                        getCnByNum(list.get(j), ci)-(getCnByNum(list.get(j - 1), ci)));
+                //"移":当天的C(i+1) - 前一天的C(i+1)
+                tempList.get(j).get(i).setDecrease(
+                        getCnByNum(list.get(j), ci + 1)-(getCnByNum(list.get(j - 1), ci + 1)));
+                //"比":当天的现 / 前一天的C1
+                tempList.get(j).get(i).setRate(getCnByNum(list.get(j - 1), 1).compareTo(0L) == 0 ? BigDecimal.ZERO :
+                        BigDecimal.valueOf(tempList.get(j).get(i).getPresent().doubleValue() / getCnByNum(list.get(j - 1), 1).doubleValue()).setScale(4, RoundingMode.HALF_UP));
+            }
+        }
+        //赋值时间数据
+        for (int i = 0; i < tempList.size(); i++) {
+            map.put(list.get(i).getDdf(), tempList.get(i));
+        }
+
+        return map;
+    }
+
+    /**
+     * 初始化List数据
+     * @param list 需要初始化的数据
+     * @param num 多少天的数据
+     */
+    private void initList(List<List<AgentDayAgainVO>> list, Integer num) {
+        //外层循环 num 次 表示多少天的数据
+        for (int i = 0; i < num; i++) {
+            list.add(new ArrayList<>());
+            //内层循环8次 一共初始化8种复充次数数据对象
+            for (int j = 0; j < 8; j++) {
+                list.get(i).add(
+                        AgentDayAgainVO.builder()
+                                .decrease(0L)
+                                .increase(0L)
+                                .original(0L)
+                                .present(0L)
+                                .rate(BigDecimal.ZERO)
+                                .build()
+                );
+            }
+        }
+    }
+
+    /**
+     * 通过反射来获取Cn的值
+     * @param dto 数据库查询出来的原始数据对象实体
+     * @param num 1-9
+     * @return Cn
+     */
+    private Long getCnByNum(Object dto, int num) {
+        try {
+            Method m1 = AdsAgentDayAgain.class.getDeclaredMethod(String.format("getC%s", num));
+            //返回对应的Cn值
+            return (Long) m1.invoke(dto);
+        } catch (Exception e) {
+            throw new BaseException("发生错误");
+        }
+    }
+
+    /**
+     * 推广每日复充趋势sql
+     * @return
+     */
+    private String agentDayAgainSql() {
+        return """
+                SELECT
+                    dt,
+                    ddf,
+                    account_id,
+                    agent_id,
+                    agent_name,
+                    source_system,
+                    c1,
+                    c2,
+                    c3,
+                    c4,
+                    c5,
+                    c6,
+                    c7,
+                    c8,
+                    c9
+                FROM
+                    ads_agent_day_again
+                """;
+    }
+
     /**
      * 推广每日数据SQL
      * @return
@@ -391,13 +630,16 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
     private String accountAgentDaySql() {
         return """
                 select
+                    dt,
                 	concat( dt, account_id, agent_id ) AS id,
+                	source_system,
                 	agent_id,
                 	agent_name,
                 	account_id,
                 	agent_id,
                 	pitcher AS sys_user_name,
                 	game_cp AS cp_name,
+                	game_id,
                 	game_name,
                 	game_type,
                 	dt AS cost_day,
@@ -569,12 +811,14 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         return """
                 select
                 	concat(a.account_id, a.agent_id) as id,
+                	a.source_system,
                 	a.account_id,
                 	a.agent_id,
                 	max(a.agent_name) as agent_name,
                 	max(a.account_type) as account_type,
                 	max(a.pitcher) as sys_user_name,
                 	max(a.game_cp) as cp_name,
+                	max(a.game_id) as game_id,
                 	max(a.game_name) as game_name,
                 	max(a.game_type) as game_type,
                 	max(a.pitcher_id) as sys_user_id,
@@ -611,9 +855,6 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
                 	sum(a.first_new_user_amount_count) as user_recharge_count,
                 	sum(a.first_new_user_amount_num) as user_recharge_user,
                 	sum(a.first_new_user_amount) as user_recharge_money,
-                	ifnull(sum(b.amount_count),0) as show_recharge_count,
-                	ifnull(sum(b.amount_num),0) as show_recharge_user,
-                	ifnull(sum(b.amount),0) as show_recharge_money,
                 	sum(a.old_amount_count) as old_user_recharge_count,
                 	sum(a.old_amount_num) as old_user_recharge_user,
                 	sum(a.old_amount) as old_user_recharge_money,
@@ -635,24 +876,16 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
                 	round(if(sum(a.register_num) > 0, sum(a.new_user_total_amount_num) / sum(a.register_num), 0), 4) as today_recharge_rate,
                 	round(if(sum(a.first_new_user_amount_count) > 0, sum(a.first_new_user_amount) / sum(a.first_new_user_amount_count), 0), 4) as avg_first_user_recharge,
                 	round(if(sum(a.new_user_total_amount_count) > 0, sum(a.new_user_total_amount) / sum(a.new_user_total_amount_count), 0), 4) as avg_today_recharge,
-                	round(if(sum(b.amount_count) > 0, sum(b.amount) / sum(b.amount_count), 0), 4) as avg_show_user_recharge,
                 	round(if(sum(a.first_new_user_amount_num) > 0, sum(a.cost) / sum(a.first_new_user_amount_num), 0), 4) as first_recharge_cost,
                 	round(if(sum(a.new_user_total_amount_num) > 0, sum(a.cost) / sum(a.new_user_total_amount_num), 0), 4) as today_recharge_cost,
                 	round(if(sum(a.new_user_total_amount_num) > 0, sum(a.reg_order_user_again) / sum(a.new_user_total_amount_num), 0), 4) as today_repeat_recharge_rate,
                 	round(if(sum(a.register_num) > 0, sum(a.new_user_total_amount) / sum(a.register_num), 0), 4) as new_reg_arpu,
                 	round(if(sum(a.first_new_user_amount_num) > 0, sum(a.first_new_user_amount) / sum(a.first_new_user_amount_num), 0), 4) as first_recharge_arpu,
                 	round(if(sum(a.new_user_total_amount_num) > 0, sum(a.new_user_total_amount) / sum(a.new_user_total_amount_num), 0), 4) as today_recharge_arpu,
-                	round(if(sum(a.amount_num) > 0, sum(a.amount) / sum(a.amount_num), 0), 4) as show_recharge_arpu,
                 	sum(a.hundred_user_num) as hundred_user_num,
                 	round(if(sum(a.hundred_user_num) > 0, sum(a.cost) / sum(a.hundred_user_num), 0), 4) as hundred_user_num_cost
                 from
                 	ads_account_agent_day a
-                left join game_ads.ads_account_agent_day b on
-                	b.pitcher_id = a.pitcher_id
-                	and b.agent_id = a.agent_id
-                	and b.account_id = a.account_id
-                	and b.dt >= @rechargeBeginDay
-                	and b.dt <= @rechargeEndDay
                 """;
     }
 
@@ -664,4 +897,20 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
         private Long rechargeNum;
         private Long repeatNum;
     }
+
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @Builder
+    public static class ShowRecharge{
+        private Long showRechargeCount;
+
+        private Long showRechargeUser;
+
+        private BigDecimal showRechargeMoney;
+
+        private BigDecimal avgShowUserRecharge;
+
+        private BigDecimal showRechargeArpu;
+    }
 }

+ 43 - 21
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAccountRechargeRankingServiceImpl.java

@@ -3,11 +3,12 @@ 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.vo.AdsAccountRechargeRankingVO;
 import com.zanxiang.game.data.serve.service.IAdsAccountRechargeRankingService;
 import com.zanxiang.game.data.serve.utils.Page;
+import com.zanxiang.module.util.NumberUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.nutz.dao.Cnd;
 import org.nutz.dao.Dao;
@@ -20,6 +21,7 @@ import org.nutz.dao.util.cri.SimpleCriteria;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.RoundingMode;
 import java.util.List;
 
 @Slf4j
@@ -31,18 +33,24 @@ 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());
         }
         Pager pager = dto.toPage();
         String sqlStr = """
-                select account_id, pitcher_id, max(pitcher) as pitcher, `type`, game_id, max(game_name), max(game_classify) as game_classify , max(game_cp) as game_cp,
+                select account_id, pitcher_id, max(pitcher) as pitcher, `type`, game_id, max(game_name) as game_name, max(game_classify) as game_classify , max(game_cp) as game_cp,
                 sum(cost) as cost,
                 sum(ad_count) as ad_count,
                 sum(view_count) as view_count,
                 sum(click_count) as click_count,
                 sum(click_count) / sum(view_count) as click_rate,
-                if(sum(view_count) > 0, sum(cost)/sum(view_count) * 1000, '--') as thousand_display_price,
+                if(sum(view_count) > 0, sum(cost)/sum(view_count) * 1000, '0') as thousand_display_price,
                 sum(reg_user_cnt) as reg_user_cnt,
                 sum(cost) / sum(reg_user_cnt) as reg_cost,
                 sum(first_role) as first_role,
@@ -60,39 +68,53 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
                 """;
         SimpleCriteria cri = Cnd.cri();
         if (null != dto.getBeginDay() && null != dto.getEndDay()) {
-            cri.where().and(AdsAccountRechargeRanking::getDt, ">=", dto.getBeginDay()).and(AdsAccountRechargeRanking::getDt, "<=", dto.getEndDay());
+            cri.where().and("dt", ">=", dto.getBeginDay()).and("dt", "<=", dto.getEndDay());
         }
         if (StringUtils.isNotBlank(dto.getPitcherId())) {
-            cri.where().and(AdsAccountRechargeRanking::getPitcherId, "=", dto.getPitcherId());
+            cri.where().and("pitcher_id", "=", dto.getPitcherId());
         }
-        if(StringUtils.isNotBlank(dto.getAccountId())) {
-            cri.where().and(AdsAccountRechargeRanking::getAccountId, "=", dto.getAccountId());
+        if (StringUtils.isNotBlank(dto.getAccountId())) {
+            cri.where().and("account_id", "=", dto.getAccountId());
         }
-        if(StringUtils.isNotBlank(dto.getGameId())) {
-            cri.where().and(AdsAccountRechargeRanking::getGameId, "=", dto.getGameId());
+        if (StringUtils.isNotBlank(dto.getGameId())) {
+            cri.where().and("game_id", "=", dto.getGameId());
         }
         if (StringUtils.isNotBlank(dto.getType())) {
-            cri.where().and(AdsAccountRechargeRanking::getType, "=", dto.getType());
+            cri.where().and("type", "=", dto.getType());
         }
-        cri.groupBy(AdsAccountRechargeRanking::getAccountId, AdsAccountRechargeRanking::getPitcherId, AdsAccountRechargeRanking::getType, AdsAccountRechargeRanking::getGameId);
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().and("source_system", "=", dto.getSourceSystem());
+        }
+        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);
 
         Entity<AdsAccountRechargeRankingVO> entity = dao.getEntity(AdsAccountRechargeRankingVO.class);
         sql.setEntity(entity).setCondition(cri);
+        // 查询总数居条数
+        pager.setRecordCount(((Long) Daos.queryCount(dao, sql)).intValue());
+        // 分页查询数据
+        sql.setPager(pager);
         dao.execute(sql);
 
-
-        Sql pagerSql = Sqls.queryEntity("select count(*) from ads_agent_recharge_ranking " + "$condition");
-        pagerSql.setCondition(cri);
-        pager.setRecordCount(((Long) Daos.queryCount(dao, pagerSql)).intValue());
-
         List<AdsAccountRechargeRankingVO> result = sql.getList(AdsAccountRechargeRankingVO.class);
-        int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
-        int size = result.size();
-        while (--size >= 0) {
-            result.get(size).setIndex(beginIndex + size);
+        if (CollectionUtils.isNotEmpty(result)) {
+            result.forEach(vo -> {
+                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();
+            while (--size >= 0) {
+                result.get(size).setIndex(beginIndex + size);
+            }
         }
         return new Page<>(result, pager);
     }

+ 45 - 24
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsAgentRechargeRankingServiceImpl.java

@@ -7,19 +7,23 @@ import com.zanxiang.game.data.serve.pojo.entity.AdsAgentRechargeRanking;
 import com.zanxiang.game.data.serve.pojo.vo.AdsAgentRechargeRankingVO;
 import com.zanxiang.game.data.serve.service.IAdsAgentRechargeRankingService;
 import com.zanxiang.game.data.serve.utils.Page;
+import com.zanxiang.module.util.NumberUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.nutz.dao.Cnd;
 import org.nutz.dao.Dao;
 import org.nutz.dao.Sqls;
 import org.nutz.dao.entity.Entity;
 import org.nutz.dao.pager.Pager;
+import org.nutz.dao.sql.Criteria;
 import org.nutz.dao.sql.Sql;
 import org.nutz.dao.util.Daos;
-import org.nutz.dao.util.cri.SimpleCriteria;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.List;
 
 @Slf4j
@@ -30,6 +34,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());
         }
@@ -37,46 +47,57 @@ public class AdsAgentRechargeRankingServiceImpl implements IAdsAgentRechargeRank
         String sqlStr = """
                 select agent_id, max(agent_name) as agent_name, pitcher_id, max(pitcher) as pitcher, `type`,
                 sum(today_amount) as today_amount,
-                sum(new_user_total_recharge_amount) as new_user_total_recharge_amount,
-                sum(new_user_total_recharge_num) as new_user_total_recharge_num,
-                sum(new_user_total_recharge_count) as new_user_total_recharge_count,
-                sum(total_cost) as total_cost,
-                sum(new_user_total_recharge_amount) / sum(new_user_total_recharge_count) as avg_amount,
-                if (sum(total_cost) > 0, sum(new_user_total_recharge_amount) / sum(total_cost), 'xx') as roi
+                max(total_recharge_amount) as total_recharge_amount,
+                max(total_recharge_num) as total_recharge_num,
+                max(total_recharge_count) as total_recharge_count,
+                max(total_cost) as total_cost,
+                max(total_recharge_amount) / max(total_recharge_count) as avg_amount,
+                if (sum(total_cost) > 0, max(total_recharge_amount) / sum(total_cost), '0') as roi
                 from ads_agent_recharge_ranking
                 """;
-        SimpleCriteria cri = Cnd.cri();
+        Criteria cri = Cnd.cri();
         if (null != dto.getBeginDay() && null != dto.getEndDay()) {
-            cri.where().and(AdsAgentRechargeRanking::getDt, ">=", dto.getBeginDay()).and(AdsAgentRechargeRanking::getDt, "<=", dto.getEndDay());
+            cri.where().and("dt", ">=", dto.getBeginDay()).and("dt", "<=", dto.getEndDay());
         }
         if (StringUtils.isNotBlank(dto.getAgentId())) {
-            cri.where().and(AdsAgentRechargeRanking::getAgentId, "=", dto.getAgentId());
+            cri.where().and("agent_id", "=", dto.getAgentId());
         }
         if (StringUtils.isNotBlank(dto.getPitcherId())) {
-            cri.where().and(AdsAgentRechargeRanking::getPitcherId, "=", dto.getPitcherId());
+            cri.where().and("pitcher_id", "=", dto.getPitcherId());
         }
         if (StringUtils.isNotBlank(dto.getType())) {
-            cri.where().and(AdsAgentRechargeRanking::getType, "=", dto.getType());
+            cri.where().and("type", "=", dto.getType());
         }
-        cri.groupBy(AdsAgentRechargeRanking::getAgentId, AdsAgentRechargeRanking::getPitcherId, AdsAgentRechargeRanking::getType);
-        cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().and("source_system", "=", dto.getSourceSystem());
+        }
+        cri.getGroupBy().groupBy("agent_id", "pitcher_id", "type");
+        cri.getOrderBy().orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(sqlStr + "$condition");
-        sql.setPager(pager);
 
         Entity<AdsAgentRechargeRankingVO> entity = dao.getEntity(AdsAgentRechargeRankingVO.class);
         sql.setEntity(entity).setCondition(cri);
+        // 查询分页总数据
+        pager.setRecordCount(((Long) Daos.queryCount(dao, sql)).intValue());
+        // 分页查询数据
+        sql.setPager(pager);
         dao.execute(sql);
 
-
-        Sql pagerSql = Sqls.queryEntity("select count(*) from ads_agent_recharge_ranking " + "$condition");
-        pagerSql.setCondition(cri);
-        pager.setRecordCount(((Long) Daos.queryCount(dao, pagerSql)).intValue());
-
         List<AdsAgentRechargeRankingVO> result = sql.getList(AdsAgentRechargeRankingVO.class);
-        int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
-        int size = result.size();
-        while (--size >= 0) {
-            result.get(size).setIndex(beginIndex + size);
+        if (CollectionUtils.isNotEmpty(result)) {
+            result.forEach(vo -> {
+                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();
+            while (--size >= 0) {
+                result.get(size).setIndex(beginIndex + size);
+            }
         }
         return new Page<>(result, pager);
     }

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/AdsOrderDetailService.java

@@ -40,6 +40,9 @@ public class AdsOrderDetailService implements IAdsOrderDetailService {
         if (dto.getEndOrderTime() != null) {
             cnd.and(AdsOrderDetail::getOrderCreateTime, "<=", dto.getEndOrderTime());
         }
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cnd.and(AdsOrderDetail::getSourceSystem, "=", dto.getSourceSystem());
+        }
         if (StringUtils.isNotBlank(dto.getOrderId())) {
             cnd.and(AdsOrderDetail::getOrderId, "=", dto.getOrderId());
         }

File diff suppressed because it is too large
+ 407 - 151
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameDataServiceImpl.java


+ 165 - 26
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/OverallSummaryServiceImpl.java

@@ -1,12 +1,12 @@
 package com.zanxiang.game.data.serve.service.impl;
 
-import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.data.serve.pojo.dto.OverallSummaryDTO;
 import com.zanxiang.game.data.serve.pojo.entity.AdsOverallSummary;
 import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryLineDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.OverallSummaryVO;
 import com.zanxiang.game.data.serve.service.IOverallSummaryService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.nutz.dao.Cnd;
 import org.nutz.dao.Condition;
 import org.nutz.dao.Dao;
@@ -21,7 +21,6 @@ import org.springframework.stereotype.Service;
 
 import java.beans.PropertyDescriptor;
 import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.temporal.ChronoUnit;
@@ -42,8 +41,8 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
     @Override
     public OverallSummaryVO getOverallSummaryTotalData(OverallSummaryDTO dto) {
 
-        //获取查询条件 整体数据查询 不需要日期
-        Condition totalDataCon = myCondition(dto, false, -1);
+        //获取查询条件 整体数据查询 不需要日期 需要gameId
+        Condition totalDataCon = myCondition(dto, true, false, -1);
         //查询条件转换为sql语句 设置映射 Entity为 AdsOverallSummary对象
         String totalDataConString = totalDataCon.toSql(dao.getEntity(AdsOverallSummary.class));
         //自定义sql语句
@@ -53,7 +52,6 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
                 IFNULL(SUM(x.today_total_cost),0) total_cost ,
                 IFNULL(SUM(x.today_amount),0) total_amount ,
                 IFNULL(SUM(x.today_agent_count),0) total_agent_count ,
-                IFNULL(SUM(x.today_game_count),0) total_game_count ,
                 IFNULL(SUM(x.today_amount)/SUM(x.today_total_cost),0) total_roi
                 FROM ads_overall_summary x
                 """ + totalDataConString);
@@ -67,7 +65,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
         OverallSummaryVO totalDataVO = totalDataSql.getObject(OverallSummaryVO.class);
 
         //获取查询条件 查询今日数据 需要按当前日期查询
-        Condition todayDataCon = myCondition(dto, false, 1);
+        Condition todayDataCon = myCondition(dto, true, false, 1);
         //查询条件转换为sql语句 设置映射 Entity为 AdsOverallSummary对象
         String todayDataConString = todayDataCon.toSql(dao.getEntity(AdsOverallSummary.class));
         Sql todayDataSql = Sqls.create("""
@@ -82,8 +80,6 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
                 IFNULL(SUM(x.yesterday_amount),0) yesterday_amount ,
                 IFNULL(SUM(x.today_agent_count),0) today_agent_count ,
                 IFNULL(SUM(x.yesterday_agent_count),0) yesterday_agent_count ,
-                IFNULL(SUM(x.today_game_count),0) today_game_count ,
-                IFNULL(SUM(x.yesterday_game_count),0) yesterday_game_count ,
                 IFNULL(SUM(x.first_new_user_amount)/SUM(x.today_total_cost),0) first_roi
                 FROM ads_overall_summary x
                 """ + todayDataConString);
@@ -101,16 +97,16 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
 
         //7日和30日Roi数据需要手动计算
         //7日内新用户累计充值
-        BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 7));
+        BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, true, false, 7));
         //7日内总消耗
-        BigDecimal d7TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 7));
+        BigDecimal d7TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, true, false, 7));
         //cost 查询出的结果为null或者为0.00 设置为默认值0
         overallSummaryVO.setD7TotalRoi((d7TotalCost == null || BigDecimal.ZERO.compareTo(d7TotalCost) == 0) ? BigDecimal.ZERO : d7NewPlayerAmount.multiply(BigDecimal.valueOf(100)).divide(d7TotalCost, 4, RoundingMode.HALF_UP));
 
         //30日内新用户累计充值
-        BigDecimal d30NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 30));
+        BigDecimal d30NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, true, false, 30));
         //30日内总消耗
-        BigDecimal d30TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 30));
+        BigDecimal d30TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, true, false, 30));
         //计算30日Roi
         //cost 查询出的结果为null或者为0.00 设置为默认值0
         overallSummaryVO.setD30TotalRoi((d30TotalCost == null || BigDecimal.ZERO.compareTo(d30TotalCost) == 0) ? BigDecimal.ZERO : d30NewPlayerAmount.multiply(BigDecimal.valueOf(100)).divide(d30TotalCost, 4, RoundingMode.HALF_UP));
@@ -119,6 +115,52 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
         overallSummaryVO.setFirstRoi(overallSummaryVO.getFirstRoi().multiply(BigDecimal.valueOf(100)));
         overallSummaryVO.setTotalRoi(overallSummaryVO.getTotalRoi().multiply(BigDecimal.valueOf(100)));
 
+        //计算总计条件
+        Condition totalCri = myCondition(dto, true, false, -1);
+        //计算今日数据条件
+        Condition todayCri = myCondition(dto, true, false, 1);
+        //计算昨日数据条件
+        Condition yesterdayCri = myCondition(dto, true, false, 0);
+
+        //计算游戏数量相关数据
+        //查询总投游戏数量
+        overallSummaryVO.setTotalGameCount(getResultBySql(2, null, myCondition(dto, false, false, -1)));
+        //查询今日在投游戏数量
+        overallSummaryVO.setTodayGameCount(getResultBySql(2, null, myCondition(dto, false, false, 1)));
+        //查询昨日在投游戏数量
+        overallSummaryVO.setYesterdayGameCount(getResultBySql(2, null, myCondition(dto, false, false, 0)));
+
+        //计算玩家数量相关数据
+        //查询玩家总计数
+        overallSummaryVO.setTotalPlayers(getResultBySql(1, "today_user_count-ads_overall_summary_user", totalCri));
+        //查询今日新增玩家总计数
+        overallSummaryVO.setTodayPlayerCount(getResultBySql(1, "today_user_count-ads_overall_summary_user", todayCri));
+        //查询昨日新增玩家总计数
+        overallSummaryVO.setYesterdayPlayerCount(getResultBySql(1, "today_user_count-ads_overall_summary_user", yesterdayCri));
+
+        //计算渠道数量相关数据
+        //查询渠道总计数
+        overallSummaryVO.setTotalAgentCount(getResultBySql(1, "today_agent_count-ads_overall_summary_agent", totalCri));
+        //查询今日新增渠道
+        overallSummaryVO.setTotalAgentCount(getResultBySql(1, "today_agent_count-ads_overall_summary_agent", todayCri));
+        //查询昨日新增渠道
+        overallSummaryVO.setTotalAgentCount(getResultBySql(1, "today_agent_count-ads_overall_summary_agent", yesterdayCri));
+
+        //计算充值相关数据
+        //查询充值总计
+        overallSummaryVO.setTotalAmount(getResultBySql("today_amount-ads_overall_summary_amount",totalCri));
+        //查询今日充值
+        overallSummaryVO.setTodayAmount(getResultBySql("today_amount-ads_overall_summary_amount",totalCri));
+        //查询昨日充值
+
+
+
+
+
+
+
+
+
         return overallSummaryVO;
     }
 
@@ -126,7 +168,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
     public List<OverallSummaryLineDataVO> getOverallSummaryLineData(OverallSummaryDTO dto) {
 
         //根据条件获取数据
-        Condition lineCon = myCondition(dto, true, -1);
+        Condition lineCon = myCondition(dto, true, true, -1);
         //查询条件变为字符串
         String lineConString = lineCon.toSql(dao.getEntity(AdsOverallSummary.class));
         //自定义sql语句 加上条件字符串
@@ -156,43 +198,65 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
     /**
      * 自定义查询条件
      *
-     * @param dto         前端传递的查询参数实体
+     * @param dto           前端传递的查询参数实体
+     * @param needGameId    是否需要拼接gameId查询条件
      * @param needLocalDate 是否拼接日期查询条件
      * @param queryDays     拼接需要查询数据的天数条件(给今日昨日、首日Roi、7日Roi以及30日Roi使用)
      * @return Condition 查询条件
      */
-    private Condition myCondition(OverallSummaryDTO dto, Boolean needLocalDate, Integer queryDays) {
+    private Condition myCondition(OverallSummaryDTO dto, Boolean needGameId, Boolean needLocalDate, Integer queryDays) {
 
         Criteria cri = Cnd.cri();
         //默认查询条件
-        if (dto.getGameId() != null) {
+        if (dto.getGameId() != null && needGameId) {
             //拼接游戏查询条件
-            cri.where().andEquals("gameId", dto.getGameId());
+            cri.where().andEquals("game_id", dto.getGameId());
         }
         if (dto.getAgentId() != null) {
             //拼接渠道查询条件
-            cri.where().andEquals("agentId", dto.getAgentId());
+            cri.where().andEquals("agent_id", dto.getAgentId());
         }
         if (dto.getAccountId() != null) {
             //拼接广告账户查询条件
-            cri.where().andEquals("accountId", dto.getAccountId());
+            cri.where().andEquals("account_id", dto.getAccountId());
         }
-        //前端传递 pitcherId 根据 pitcherId 查询
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            //拼接查询 sdk 来源条件
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        /*//前端传递 pitcherId 根据 pitcherId 查询
         if (dto.getPitcherId() != null) {
             //拼接投手查询条件
-            cri.where().andEquals("pitcherId", dto.getPitcherId());
+            cri.where().andEquals("pitcher_id", dto.getPitcherId());
         } else if (SecurityUtil.isManager()) {
             //前端没有传递 pitcherId 参数并且是管理员 查看所有数据 排除掉 pitcherId = -2 的数据
-            cri.where().andNotEquals("pitcherId", -2);
+            cri.where().andNotEquals("pitcher_id", -2);
         } else {
             //前端没有传递 pitcherId 并且不是管理员 只能看自己的数据
-            cri.where().andEquals("pitcherId", SecurityUtil.getUserId());
+            cri.where().andEquals("pitcher_id", SecurityUtil.getUserId());
+        }*/
+
+        /**
+         * 测试
+         */
+        //前端传递 pitcherId 根据 pitcherId 查询
+        if (dto.getPitcherId() != null) {
+            //拼接投手查询条件
+            cri.where().andEquals("pitcher_id", dto.getPitcherId());
+        } else {
+            cri.where().andNotEquals("pitcher_id", -2);
         }
 
+
         //根据参数拼接条件
         switch (queryDays) {
+            //前一天时间
+            case 0 -> cri.where().andEquals("dt", LocalDate.now().minusDays(1));
+            //当天时间
             case 1 -> cri.where().andEquals("dt", LocalDate.now());
+            //7天时间
             case 7 -> cri.where().andBetween("dt", LocalDate.now().minusDays(7), LocalDate.now());
+            //30天时间
             case 30 -> cri.where().andBetween("dt", LocalDate.now().minusDays(30), LocalDate.now());
             default -> {
             }
@@ -254,8 +318,8 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
      * 检查前端查询日期内的数据是否在数据库中都存在
      * 不存在要设置默认值 0
      *
-     * @param list  需要判断的list
-     * @param dto 前端传递的查询参数实体
+     * @param list 需要判断的list
+     * @param dto  前端传递的查询参数实体
      * @return 返回给前端的折线图数据 list
      */
     private List<OverallSummaryLineDataVO> checkAllDateData(List<OverallSummaryLineDataVO> list, OverallSummaryDTO dto) {
@@ -291,7 +355,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
                         .natureAmount(BigDecimal.ZERO)
                         .cost(BigDecimal.ZERO)
                         .firstRoi(BigDecimal.ZERO)
-                        .playerAccount(BigInteger.ZERO)
+                        .playerAccount(0L)
                         .build());
             }
         }
@@ -301,5 +365,80 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
         return list;
     }
 
+    /**
+     * 共用的查询方法
+     *
+     * @param type        查询的字段类型 {1 -> 查询其他表long类型数据 ; 2 -> 查询游戏在投数量表}
+     * @param queryString 参数字符串 格式:"xxx-xxx" 前面代表查询的字段 后面代表查询的表名
+     * @param cri         查询条件
+     * @return 查询结果 Long
+     */
+    private Long getResultBySql(int type, String queryString, Condition cri) {
+        //创建sql
+        Sql sql;
+        if (type == 1) {
+            sql = Sqls.create(sumByItemsAndTablesSql() + cri);
+            //设置查询字段及表名
+            sql.params().set("item", queryString.split("-")[0]);
+            sql.vars().set("tableName", queryString.split("-")[1]);
+        } else {
+            sql = Sqls.create(gameCountSql() + cri);
+        }
+        //设置回传对象
+        sql.setCallback(Sqls.callback.longValue());
+        //执行sql
+        dao.execute(sql);
+        //返回结果
+        return sql.getLong();
+    }
+
+    /**
+     * 共用的查询方法
+     *
+     * @param queryString 参数字符串 格式:"xxx-xxx" 前面代表查询的字段 后面代表查询的表名
+     * @param cri         查询条件
+     * @return 查询结果 BigDecimal
+     */
+    private BigDecimal getResultBySql(String queryString, Condition cri) {
+        //创建sql
+        Sql sql = Sqls.create(sumByItemsAndTablesSql() + cri);
+        //设置查询字段及表名
+        sql.params().set("item", queryString.split("-")[0]);
+        sql.vars().set("tableName", queryString.split("-")[1]);
+
+        //设置回传对象
+        sql.setCallback(Sqls.callback.doubleValue());
+        //执行sql
+        dao.execute(sql);
+        //返回结果
+        return BigDecimal.valueOf(sql.getDouble()).setScale(2, RoundingMode.HALF_UP);
+    }
+
+    /**
+     * 共用的gameCount sql语句
+     *
+     * @return String
+     */
+    private String gameCountSql() {
+        return """
+                SELECT
+                    COUNT(DISTINCT game_id)
+                FROM
+                    game_ads.ads_game_push_num
+                """;
+    }
+
+    /**
+     * 共用计算总计sql
+     */
+    private String sumByItemsAndTablesSql() {
+        return """
+                SELECT
+                    SUM(@item)
+                FROM
+                    $tableName
+                """;
+    }
+
 
 }

+ 24 - 15
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RankingServiceImpl.java

@@ -40,7 +40,11 @@ public class RankingServiceImpl implements IRankingService {
         if (null != dto.getBeginDay() && null != dto.getEndDay()){
             cri.where().and("dt",">=",dto.getBeginDay()).and("dt","<=",dto.getEndDay());
         }
-        cri.groupBy("game_id");
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        cri.where().andNotEquals("today_amount",0);
+        cri.groupBy("source_system,game_id");
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(gameRankingSql() + "$condition");
         sql.setPager(pager);
@@ -57,6 +61,7 @@ public class RankingServiceImpl implements IRankingService {
     private String gameRankingSql() {
         return """
                 select
+                source_system,
                 max(game_id) as id,
                 max(game_id) as game_id,
                 max(game_name) as game_name,
@@ -64,15 +69,15 @@ public class RankingServiceImpl implements IRankingService {
                 sum(today_amount) as today_amount,
                 sum(today_buy_amount) as today_buy_amount,
                 sum(today_nature_amount) as today_nature_amount,
-                sum(total_amount) as total_amount,
-                sum(total_buy_amount) as total_buy_amount,
-                sum(total_nature_amount) as total_nature_amount,
-                round(if(sum(total_recharge_count) > 0, sum(total_amount) / sum(total_recharge_count), 0), 2) as avg_amount,
+                max(total_amount) as total_amount,
+                max(total_buy_amount) as total_buy_amount,
+                max(total_nature_amount) as total_nature_amount,
+                max(avg_amount) as avg_amount,
                 sum(reg_user_count) as reg_user_count,
-                sum(total_recharge_user_count) as total_recharge_user_count,
-                sum(total_recharge_count) as total_recharge_count,
-                sum(total_cost) as total_cost,
-                round(if(sum(total_cost) > 0, sum(total_buy_amount) / sum(total_cost), 0), 4) as total_roi
+                max(total_recharge_user_count) as total_recharge_user_count,
+                max(total_recharge_count) as total_recharge_count,
+                max(total_cost) as total_cost,
+                max(total_roi) as total_roi
                 from ads_game_recharge_ranking
                 """;
     }
@@ -91,7 +96,10 @@ public class RankingServiceImpl implements IRankingService {
         if (null != dto.getBeginDay() && null != dto.getEndDay()){
             cri.where().and("dt",">=",dto.getBeginDay()).and("dt","<=",dto.getEndDay());
         }
-        cri.groupBy("player_id");
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        cri.groupBy("source_system,player_id");
         cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
         Sql sql = Sqls.queryEntity(playerRankingSql() + "$condition");
         sql.setPager(pager);
@@ -108,6 +116,7 @@ public class RankingServiceImpl implements IRankingService {
     private String playerRankingSql() {
         return """
                 select
+                source_system,
                 max(player_id) as id,
                 max(player_id) as player_id,
                 max(player_account_id) as player_account_id,
@@ -118,11 +127,11 @@ public class RankingServiceImpl implements IRankingService {
                 max(reg_game_name) as reg_game_name,
                 max(player_os) as player_os,
                 sum(today_total_amount) as today_total_amount,
-                sum(first_amount) as first_amount,
-                sum(last_amount) as last_amount,
-                sum(total_amount) as total_amount,
-                round(if(sum(total_amount_count) > 0, sum(total_amount) / sum(total_amount_count), 0), 2) as avg_amount,
-                sum(total_amount_count) as total_amount_count,
+                max(first_amount) as first_amount,
+                max(last_amount) as last_amount,
+                max(total_amount) as total_amount,
+                max(avg_amount) as avg_amount,
+                max(total_amount_count) as total_amount_count,
                 max(last_amount_game_id) as last_amount_game_id,
                 max(last_amount_game_name) as last_amount_game_name,
                 max(last_amount_time) as last_amount_time

+ 76 - 0
game-data/game-data-serve/src/main/resources/logback.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="false" scanPeriod="60 seconds" debug="false">
+    <!-- 日志存放路径 -->
+    <property name="log.path" value="${user.home}/logs"/>
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
+    :ss} %-5level ${springAppName:-} %thread %logger %msg%n"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="com.zanxiang" level="info"/>
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn"/>
+
+    <root level="info">
+        <appender-ref ref="console"/>
+    </root>
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info"/>
+        <appender-ref ref="file_error"/>
+    </root>
+
+</configuration>

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 删掉dubbo的group> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, SDK后台功能修改优化> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 10 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/OrderController.java

@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author : lingfeng
  * @time : 2022-11-07
@@ -51,4 +53,12 @@ public class OrderController {
     public ResultVO<IPage<LogPayCpVO>> callCpList(@Validated @RequestBody PayCallCpLogParam param) {
         return ResultVO.ok(logPayCpService.callCpList(param));
     }
+
+    @ApiOperation(value = "订单Excel下载")
+    @PostMapping(value = "/list/excel")
+    @PreAuthorize(permissionKey = "manage:order:orderExcel")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功")})
+    public void getOrderExcel(@Validated @RequestBody OrderParam param, HttpServletResponse response) {
+        orderService.getOrderExcel(param, response);
+    }
 }

+ 12 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameUserRoleListParam.java

@@ -81,6 +81,18 @@ public class GameUserRoleListParam extends BaseListDTO<GameUserRole> {
     @ApiModelProperty(notes = "注册渠道对应的id")
     private Long channelId;
 
+    /**
+     * 归因推广账号
+     */
+    @ApiModelProperty(notes = "归因推广账号")
+    private String accountId;
+
+    /**
+     * 归因投放人员
+     */
+    @ApiModelProperty(notes = "归因投放人员")
+    private String pitcherId;
+
     /**
      * 操作系统对应的id
      */

+ 6 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/AgentChoiceVO.java

@@ -1,6 +1,9 @@
 package com.zanxiang.game.module.manage.pojo.vo;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * @author : lingfeng
@@ -8,6 +11,9 @@ import lombok.Data;
  * @description : 推广渠道
  */
 @Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
 public class AgentChoiceVO {
 
     /**

+ 25 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameUserRoleListVO.java

@@ -183,4 +183,29 @@ public class GameUserRoleListVO {
      */
     @ApiModelProperty(notes = "最近充值时间")
     private LocalDateTime lastRechargeTime;
+
+    /**
+     * 归因投放人员id
+     */
+    @ApiModelProperty(notes = "归因投放人员id")
+    private Long pitcherId;
+
+    /**
+     * 归因投放人员名字
+     */
+    @ApiModelProperty(notes = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ApiModelProperty(notes = "归因推广账号id")
+    private Long accountId;
+
+    /**
+     * 归因推广账号类型(1:腾讯、2:头条)
+     */
+    @ApiModelProperty(notes = "归因推广账号类型(1:腾讯、2:头条)")
+    private Integer accountType;
+
 }

+ 209 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/OrderExcelVO.java

@@ -0,0 +1,209 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import com.zanxiang.module.util.excel.ExcelAnno;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-25
+ * @description : 订单
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class OrderExcelVO {
+
+    /**
+     * 日期
+     */
+    @ExcelAnno(title = "日期")
+    private LocalDate dateTime;
+
+    /**
+     * 订单id
+     */
+    @ExcelAnno(title = "订单id")
+    private String orderId;
+
+    /**
+     * cp订单号
+     */
+    @ExcelAnno(title = "cp订单号")
+    private String cpOrderId;
+
+    /**
+     * 商户订单号
+     */
+    @ExcelAnno(title = "商户订单号")
+    private String merchantOrderNo;
+
+    /**
+     * 玩家ID
+     */
+    @ExcelAnno(title = "玩家ID")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ExcelAnno(title = "玩家账号")
+    private String username;
+
+    /**
+     * 注册时间
+     */
+    @ExcelAnno(title = "注册时间")
+    private LocalDateTime regTime;
+
+    /**
+     * 渠道名称
+     */
+    @ExcelAnno(title = "渠道名称")
+    private String agentName;
+
+    /**
+     * cp名称
+     */
+    @ExcelAnno(title = "cp名称")
+    private String cpName;
+
+    /**
+     * 归因投放人员名字
+     */
+    @ExcelAnno(title = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ExcelAnno(title = "归因推广账号id")
+    private Long accountId;
+
+    /**
+     * 推广账号类型(1:腾讯、2:头条)
+     */
+    @ExcelAnno(title = "推广账号类型(1:腾讯、2:头条)")
+    private Integer accountType;
+
+    /**
+     * 游戏名称
+     */
+    @ExcelAnno(title = "游戏名称")
+    private String gameName;
+
+    /**
+     * 游戏类型
+     */
+    @ExcelAnno(title = "游戏类型名称")
+    private String gameCategoryName;
+
+    /**
+     * 产品名称
+     */
+    @ExcelAnno(title = "产品名称")
+    private String productName;
+
+    /**
+     * 订单金额
+     */
+    @ExcelAnno(title = "订单金额")
+    private BigDecimal amount;
+
+    /**
+     * 订单实付金额
+     */
+    @ExcelAnno(title = "订单实付金额")
+    private BigDecimal realAmount;
+
+    /**
+     * 支付方式
+     */
+    @ExcelAnno(title = "支付方式名称")
+    private String payWayName;
+
+    /**
+     * 支付场景
+     */
+    @ExcelAnno(title = "支付场景名称")
+    private String payDeviceName;
+
+    /**
+     * 商户号
+     */
+    @ExcelAnno(title = "商户号")
+    private String merchantNo;
+
+    /**
+     * 商户名称
+     */
+    @ExcelAnno(title = "商户名称")
+    private String merchantName;
+
+    /**
+     * 所在服务器名称
+     */
+    @ExcelAnno(title = "所在服务器名称")
+    private String serverName;
+
+    /**
+     * 角色名称
+     */
+    @ExcelAnno(title = "角色名称")
+    private String roleName;
+
+    /**
+     * 角色等级
+     */
+    @ExcelAnno(title = "角色等级")
+    private Long roleLevel;
+
+    /**
+     * 客户端操作系统, android, ios, windows, mac
+     */
+    @ExcelAnno(title = "客户端操作系统, android, ios, windows, mac")
+    private String deviceSystem;
+
+    /**
+     * 创建时间
+     */
+    @ExcelAnno(title = "创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 支付时间
+     */
+    @ExcelAnno(title = "支付时间")
+    private LocalDateTime payTime;
+
+    /**
+     * cp最后通知时间
+     */
+    @ExcelAnno(title = "cp最后通知时间")
+    private LocalDateTime lastCpNotifyTime;
+
+    /**
+     * 支付状态,1待支付,2 支付成功,-1 已取消
+     */
+    @ExcelAnno(title = "支付状态,1待支付,2 支付成功,-1 已取消")
+    private Integer status;
+
+    /**
+     * CP通知状态,1为待处理,2为成功,-1为失败
+     */
+    @ExcelAnno(title = "CP通知状态,1为待处理,2为成功,-1为失败")
+    private Integer cpStatus;
+
+    /**
+     * 是否首充 0 否 1 是
+     */
+    @ExcelAnno(title = "是否首充 0 否 1 是")
+    private Integer isFirstRecharge;
+}

+ 11 - 10
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IAgentService.java

@@ -9,6 +9,7 @@ import com.zanxiang.game.module.manage.pojo.vo.AgentAccountChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.AgentChoiceVO;
 import com.zanxiang.game.module.manage.pojo.vo.AgentVO;
 import com.zanxiang.game.module.mybatis.entity.Agent;
+import reactor.util.function.Tuple2;
 
 import java.util.List;
 
@@ -33,16 +34,6 @@ public interface IAgentService extends IService<Agent> {
      */
     boolean add(AgentAddParam param);
 
-    /**
-     * 通过账户和投手id查询渠道id列表
-     *
-     * @param account   账户
-     * @param pitcherId 投手id
-     * @param agentId   代理人身份证
-     * @return {@link List}<{@link AgentDTO}>
-     */
-    List<AgentDTO> listUserAgent(String account, String pitcherId, Long agentId);
-
     /**
      * 配置将状态
      *
@@ -61,6 +52,16 @@ public interface IAgentService extends IService<Agent> {
      */
     boolean configBackPolicy(List<Long> agentIdList, Long backPolicyId);
 
+    /**
+     * 获取用户渠道列表
+     *
+     * @param account   账户
+     * @param pitcherId 投手id
+     * @param agentId   代理人身份证
+     * @return {@link Tuple2}<{@link List}<{@link Long}>, {@link List}<{@link AgentDTO}>>
+     */
+    Tuple2<List<Long>, List<AgentDTO>> getUserAgent(String account, String pitcherId, Long agentId);
+
     /**
      * 渠道账号选择接口
      *

+ 10 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IOrderService.java

@@ -8,6 +8,8 @@ import com.zanxiang.game.module.manage.pojo.vo.OrderListVO;
 import com.zanxiang.game.module.manage.pojo.vo.UserOrderListVO;
 import com.zanxiang.game.module.mybatis.entity.Order;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author : lingfeng
  * @time : 2022-07-05
@@ -30,4 +32,12 @@ public interface IOrderService extends IService<Order> {
      * @return {@link OrderListVO}
      */
     OrderListVO orderList(OrderParam param);
+
+    /**
+     * 订单excel下载
+     *
+     * @param param    参数
+     * @param response 响应
+     */
+    void getOrderExcel(OrderParam param, HttpServletResponse response);
 }

+ 73 - 19
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -10,13 +10,14 @@ import com.zanxiang.advertising.tencent.base.pojo.vo.UserActionSetRpcVO;
 import com.zanxiang.advertising.tencent.base.rpc.IAdAccountRpc;
 import com.zanxiang.advertising.tencent.base.rpc.IUserActionSetRpc;
 import com.zanxiang.erp.base.ErpServer;
+import com.zanxiang.erp.base.rpc.ISysUserGroupRpc;
 import com.zanxiang.erp.base.rpc.ISysUserRpc;
 import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.back.base.ServerInfo;
 import com.zanxiang.game.back.base.pojo.vo.GameBackPolicyRpcVO;
 import com.zanxiang.game.back.base.rpc.IGameBackPolicyRpc;
-import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
 import com.zanxiang.game.module.base.pojo.enums.AccountTypeEnum;
+import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
 import com.zanxiang.game.module.manage.pojo.params.AgentAddParam;
 import com.zanxiang.game.module.manage.pojo.params.AgentListParam;
 import com.zanxiang.game.module.manage.pojo.vo.AgentAccountChoiceVO;
@@ -37,6 +38,8 @@ import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import reactor.util.function.Tuple2;
+import reactor.util.function.Tuples;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -66,6 +69,9 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
     @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
     private IGameBackPolicyRpc gameBackPolicyRpc;
 
+    @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
+    private ISysUserGroupRpc sysUserGroupRpc;
+
     @Override
     public IPage<AgentVO> listOfPage(AgentListParam param) {
         IPage<Agent> agentIPage = page(param.toPage(), new LambdaQueryWrapper<Agent>()
@@ -144,9 +150,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         Set<Long> userIds = new HashSet<>(1);
         Set<Long> backPolicyIds = new HashSet<>();
         agentList.forEach(agent -> {
+            AccountTypeEnum accountType = AccountTypeEnum.getByValue(agent.getAccountType());
             gameIds.add(agent.getGameId());
-            if (AccountTypeEnum.TENCENT_H5.getValue().equals(agent.getAccountType())
-                    || AccountTypeEnum.TENCENT_MINI_GAME.getValue().equals(agent.getAccountType())) {
+            if (AccountTypeEnum.TENCENT_H5 == accountType
+                    || AccountTypeEnum.TENCENT_MINI_GAME == accountType) {
                 txAccountIds.add(agent.getAccountId());
             }
             userIds.add(agent.getCreateBy());
@@ -184,9 +191,32 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         }).collect(Collectors.toList());
     }
 
+    private AgentVO toVOSimple(Agent agent) {
+        AccountTypeEnum accountType = AccountTypeEnum.getByValue(agent.getAccountType());
+        AgentVO vo = BeanUtil.copy(agent, AgentVO.class);
+        if (accountType == AccountTypeEnum.BYTE) {
+            vo.setAgentKey("?agentKey=" + agent.getAgentKey());
+        } else if (accountType == AccountTypeEnum.TENCENT_H5 || accountType == AccountTypeEnum.TENCENT_MINI_GAME) {
+            vo.setAgentKey("?state=" + agent.getAgentKey());
+        }
+        return vo;
+    }
+
     @Override
-    public List<AgentDTO> listUserAgent(String account, String pitcherId, Long agentId) {
+    public Tuple2<List<Long>, List<AgentDTO>> getUserAgent(String account, String pitcherId, Long agentId) {
+        //自然量查询
+        if (Objects.equals(agentId, Agent.DEFAULT_AGENT)) {
+            //管理员
+            if (SecurityUtil.isManager()) {
+                return Tuples.of(Collections.singletonList(Agent.DEFAULT_AGENT), Collections.emptyList());
+            } else {
+                //非管理员不允许查询自然量
+                return Tuples.of(Collections.emptyList(), Collections.emptyList());
+            }
+        }
+        //渠道列表
         List<Agent> agentList;
+        List<AgentDTO> agentDTOList = new ArrayList<>();
         //超管权限
         if (SecurityUtil.isManager()) {
             agentList = super.list(new LambdaQueryWrapper<Agent>()
@@ -194,22 +224,44 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
                     .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
                     .eq(agentId != null, Agent::getId, agentId));
         } else {
-            agentList = super.list(new LambdaQueryWrapper<Agent>()
-                    .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
-                    .eq(Agent::getCreateBy, Strings.isBlank(pitcherId) ? SecurityUtil.getUserId() : pitcherId)
-                    .eq(agentId != null, Agent::getId, agentId));
+            //判断是否是组长
+            List<Long> memberUserIdList = sysUserGroupRpc.memberUserId(SecurityUtil.getCompanyId(), SecurityUtil.getUserId()).getData();
+            //组长, 可查看自己或者组员数据
+            if (CollectionUtils.isNotEmpty(memberUserIdList)) {
+                agentList = super.list(new LambdaQueryWrapper<Agent>()
+                        .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
+                        .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
+                        .in(Strings.isBlank(pitcherId), Agent::getCreateBy, memberUserIdList)
+                        .eq(agentId != null, Agent::getId, agentId));
+            } else {
+                //组员, 只允许查看自己的数据
+                agentList = super.list(new LambdaQueryWrapper<Agent>()
+                        .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
+                        .eq(Agent::getCreateBy, SecurityUtil.getUserId())
+                        .eq(agentId != null, Agent::getId, agentId));
+            }
         }
-        if (CollectionUtils.isEmpty(agentList)) {
-            return Collections.emptyList();
+        if (CollectionUtils.isNotEmpty(agentList)) {
+            //设置归属投手
+            List<Long> createByList = agentList.stream().map(Agent::getCreateBy).collect(Collectors.toList());
+            Map<Long, String> userMap = sysUserRpc.getUserNameByIds(createByList).getData();
+            agentDTOList = agentList.stream().map(agent -> {
+                AgentDTO agentDTO = BeanUtil.copy(agent, AgentDTO.class);
+                agentDTO.setCreateByName(userMap.get(agent.getCreateBy()));
+                return agentDTO;
+            }).collect(Collectors.toList());
         }
-        //设置归属投手
-        List<Long> createByList = agentList.stream().map(Agent::getCreateBy).collect(Collectors.toList());
-        Map<Long, String> userMap = sysUserRpc.getUserNameByIds(createByList).getData();
-        return agentList.stream().map(agent -> {
-            AgentDTO agentDTO = BeanUtil.copy(agent, AgentDTO.class);
-            agentDTO.setCreateByName(userMap.get(agent.getCreateBy()));
-            return agentDTO;
-        }).collect(Collectors.toList());
+        //根据条件, 匹配渠道
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
+            return Tuples.of(Collections.emptyList(), Collections.emptyList());
+        }
+        //渠道id列表
+        List<Long> agentIds = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
+        //管理员可见自然量数据
+        if (SecurityUtil.isManager() && Strings.isBlank(account) && Strings.isBlank(pitcherId) && agentId == null) {
+            agentIds.add(Agent.DEFAULT_AGENT);
+        }
+        return Tuples.of(agentIds, agentDTOList);
     }
 
     @Override
@@ -221,8 +273,10 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 
     @Override
     public List<AgentChoiceVO> agentChoiceList() {
-        return super.list(new LambdaQueryWrapper<Agent>()
+        List<AgentChoiceVO> choiceVOList = super.list(new LambdaQueryWrapper<Agent>()
                 .eq(!SecurityUtil.isManager(), Agent::getCreateBy, SecurityUtil.getUserId())
         ).stream().map(agent -> BeanUtil.copy(agent, AgentChoiceVO.class)).collect(Collectors.toList());
+        choiceVOList.add(AgentChoiceVO.builder().id(Agent.DEFAULT_AGENT).agentName(Agent.DEFAULT_AGENT_NAME).build());
+        return choiceVOList;
     }
 }

+ 17 - 13
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.GameUserRoleListParam;
@@ -22,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -98,18 +98,13 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
-        //渠道列表
-        List<AgentDTO> agentDTOList = agentService.listUserAgent(null, null, param.getChannelId());
-        //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIdList = tuple2.getT1();
+        List<AgentDTO> agentDTOList = tuple2.getT2();
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
-        //渠道id
-        List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
-        //管理员可见自然量数据
-        if (SecurityUtil.isManager() && param.getChannelId() == null) {
-            agentIdList.add(Agent.DEFAULT_AGENT);
-        }
         //玩家条件处理
         Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
                 param.getNickname(), param.getRegIp());
@@ -125,7 +120,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
                 .eq(Strings.isNotBlank(param.getServerName()), GameUserRole::getServerName, param.getServerName())
-                .eq(Strings.isNotBlank(param.getRoleName()), GameUserRole::getRoleName, param.getRoleName())
+                .like(Strings.isNotBlank(param.getRoleName()), GameUserRole::getRoleName, param.getRoleName())
                 .in(gameMap != null, GameUserRole::getGameId, gameMap != null ? gameMap.keySet() : null)
                 .eq(Strings.isNotBlank(param.getOs()), GameUserRole::getOs, param.getOs())
                 .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUserRole::getRechargeCount, 0)
@@ -157,7 +152,16 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
             gameUserRoleListVO.setRegTime(userDTO.getCreateTime());
             gameUserRoleListVO.setAgentId(userDTO.getAgentId());
             AgentDTO agentDTO = agentMap.get(userDTO.getAgentId());
-            gameUserRoleListVO.setAgentName(agentDTO == null ? null : agentDTO.getAgentName());
+            if (agentDTO != null) {
+                gameUserRoleListVO.setAgentName(agentDTO.getAgentName());
+                gameUserRoleListVO.setAccountId(agentDTO.getAccountId());
+                gameUserRoleListVO.setPitcherId(agentDTO.getCreateBy());
+                gameUserRoleListVO.setPitcherName(agentDTO.getCreateByName());
+                gameUserRoleListVO.setAccountType(agentDTO.getAccountType());
+            }
+            if (Objects.equals(Agent.DEFAULT_AGENT, gameUserRoleListVO.getAgentId())) {
+                gameUserRoleListVO.setAgentName(Agent.DEFAULT_AGENT_NAME);
+            }
         }
         GameDTO gameDTO = CollectionUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserRoleListVO.getGameId());
         if (gameDTO == null) {

+ 9 - 13
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
 import com.zanxiang.game.module.manage.pojo.dto.CpDTO;
@@ -20,9 +19,9 @@ import com.zanxiang.game.module.mybatis.entity.GameUser;
 import com.zanxiang.game.module.mybatis.mapper.GameUserMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -62,19 +61,13 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
-        //渠道列表
-        List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
-        //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIdList = tuple2.getT1();
+        List<AgentDTO> agentDTOList = tuple2.getT2();
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
-        //渠道id
-        List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
-        //管理员可见自然量数据
-        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
-                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
-            agentIdList.add(Agent.DEFAULT_AGENT);
-        }
         //玩家条件处理
         Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
                 param.getNickname(), null);
@@ -121,6 +114,9 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
                 gameUserListVO.setPitcherName(agentDTO.getCreateByName());
                 gameUserListVO.setAccountId(agentDTO.getAccountId());
             }
+            if (Objects.equals(Agent.DEFAULT_AGENT, userDTO.getAgentId())) {
+                gameUserListVO.setAgentName(Agent.DEFAULT_AGENT_NAME);
+            }
         }
         GameDTO gameDTO;
         if (CollectionUtils.isNotEmpty(gameMap) && gameMap.containsKey(gameUserListVO.getGameId())) {

+ 55 - 16
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
@@ -12,6 +13,7 @@ import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.OrderParam;
 import com.zanxiang.game.module.manage.pojo.params.UserOrderListParam;
+import com.zanxiang.game.module.manage.pojo.vo.OrderExcelVO;
 import com.zanxiang.game.module.manage.pojo.vo.OrderListVO;
 import com.zanxiang.game.module.manage.pojo.vo.OrderVO;
 import com.zanxiang.game.module.manage.pojo.vo.UserOrderListVO;
@@ -21,18 +23,20 @@ import com.zanxiang.game.module.mybatis.entity.Order;
 import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.mapper.OrderMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
+import com.zanxiang.module.util.excel.ExcelUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import com.zanxiang.module.web.util.WebExcelUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import reactor.util.function.Tuple2;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -96,19 +100,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     @Override
     public OrderListVO orderList(OrderParam param) {
-        //渠道列表
-        List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
-        //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIds = tuple2.getT1();
+        if (CollectionUtils.isEmpty(agentIds)) {
             return new OrderListVO(param.toPage().getSize());
         }
-        //渠道id列表
-        List<Long> agentIds = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
-        //管理员可见自然量数据
-        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
-                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
-            agentIds.add(Agent.DEFAULT_AGENT);
-        }
         //查询用户id和名字条件
         List<Long> userIds = null;
         if (Strings.isBlank(param.getUserId()) && Strings.isNotBlank(param.getUsername())) {
@@ -139,7 +136,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         List<Long> userIdList = orderListVOList.stream().map(OrderVO::getUserId).collect(Collectors.toList());
         Map<Long, UserDTO> userMap = userService.getByUserIds(userIdList);
         //渠道
-        Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
+        Map<Long, AgentDTO> agentMap = tuple2.getT2().stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //游戏信息
         Map<Long, GameDTO> gameMap = gameService.gameMap(orderListVOList.stream()
                 .map(OrderVO::getGameId).collect(Collectors.toSet()));
@@ -173,6 +170,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             orderVO.setAccountType(agentDTO.getAccountType());
             orderVO.setAgentName(agentDTO.getAgentName());
         }
+        if (Objects.equals(orderVO.getAgentId(), Agent.DEFAULT_AGENT)) {
+            orderVO.setAgentName(Agent.DEFAULT_AGENT_NAME);
+        }
         //CP名称
         CpDTO cpDTO = cpMap.get(orderVO.getCpId());
         orderVO.setCpName(cpDTO == null ? null : cpDTO.getCpName());
@@ -225,4 +225,43 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         }
         return BeanUtil.copy(order, OrderVO.class);
     }
+
+    @Override
+    public void getOrderExcel(OrderParam param, HttpServletResponse response) {
+        if (!SecurityUtil.isAdmin()) {
+            throw new BaseException("没有下载权限");
+        }
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIds = tuple2.getT1();
+        List<AgentDTO> agentDTOList = tuple2.getT2();
+        //查询用户id和名字条件
+        List<User> userList = new ArrayList<>();
+        if (Strings.isBlank(param.getUserId()) && Strings.isNotBlank(param.getUsername())) {
+            userList = userService.list(new LambdaQueryWrapper<User>()
+                    .like(User::getUsername, param.getUsername()));
+        }
+        final List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
+        //excel下载
+        WebExcelUtil.httpExport(response, "游戏订单", OrderExcelVO.class, ((pageNumber, pageSize) -> {
+            //查询订单
+            List<OrderVO> orderVOList = page(new Page<>(pageNumber, pageSize), this.getListWrapper(param, agentIds, userIds, "*"))
+                    .convert(this::orderToVo).getRecords();
+            //商户列表
+            Map<String, PayMerchantDTO> payMerchantMap = payMerchantService.payMerchantMap();
+            //cp信息
+            Map<Long, CpDTO> cpMap = cpService.cpMap();
+            //玩家信息
+            List<Long> userIdList = orderVOList.stream().map(OrderVO::getUserId).collect(Collectors.toList());
+            Map<Long, UserDTO> userMap = userService.getByUserIds(userIdList);
+            //游戏信息
+            Map<Long, GameDTO> gameMap = gameService.gameMap(orderVOList.stream().map(OrderVO::getGameId).collect(Collectors.toSet()));
+            //渠道
+            Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
+            //字段信息补充更新
+            orderVOList.forEach(vo -> this.toVO(vo, userMap, gameMap, cpMap, agentMap, payMerchantMap));
+            //excel字段赋值
+            return orderVOList.stream().map(orderVO -> BeanUtil.copy(orderVO, OrderExcelVO.class)).collect(Collectors.toList());
+        }), ExcelUtil.DEFAULT_MAX_DATA_SIZE);
+    }
 }

+ 4 - 15
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserCardServiceImpl.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
 import com.zanxiang.game.module.manage.pojo.dto.UserDTO;
 import com.zanxiang.game.module.manage.pojo.params.UserNameAuthListParam;
@@ -14,7 +13,6 @@ import com.zanxiang.game.module.manage.pojo.vo.UserCardVO;
 import com.zanxiang.game.module.manage.service.IAgentService;
 import com.zanxiang.game.module.manage.service.IUserCardService;
 import com.zanxiang.game.module.manage.service.IUserService;
-import com.zanxiang.game.module.mybatis.entity.Agent;
 import com.zanxiang.game.module.mybatis.entity.UserCard;
 import com.zanxiang.game.module.mybatis.mapper.UserCardMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
@@ -22,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -29,7 +28,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -48,18 +46,9 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
 
     @Override
     public IPage<UserCardVO> getUserCardList(UserNameAuthListParam param) {
-        //渠道列表
-        List<AgentDTO> agentDTOList = agentService.listUserAgent(null, null, null);
-        //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
-            return new Page<>();
-        }
-        //渠道id
-        List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
-        //管理员可见自然量数据
-        if (SecurityUtil.isManager()) {
-            agentIdList.add(Agent.DEFAULT_AGENT);
-        }
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(null, null, null);
+        List<Long> agentIdList = tuple2.getT1();
         //玩家条件处理
         Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
                 param.getNickname(), null);

+ 14 - 17
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
 import com.zanxiang.game.module.manage.pojo.dto.CpDTO;
@@ -30,6 +29,7 @@ import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -69,21 +69,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
-        //渠道列表
-        List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
-        //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIdList = tuple2.getT1();
+        List<AgentDTO> agentDTOList = tuple2.getT2();
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
-        //渠道id列表
-        List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
-        //管理员可见自然量数据
-        if (SecurityUtil.isManager() && Strings.isBlank(param.getAccountId())
-                && Strings.isBlank(param.getPitcherId()) && param.getChannelId() == null) {
-            agentIdList.add(Agent.DEFAULT_AGENT);
-        }
         Map<Long, CpDTO> cpMap = cpService.cpMap();
-        Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<User>().lambda()
                 .eq(param.getUserId() != null, User::getId, param.getUserId())
@@ -105,10 +98,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 .eq(param.getStatus() != null, User::getStatus, param.getStatus())
                 .in(CollectionUtils.isNotEmpty(agentIdList), User::getAgentId, agentIdList)
                 .orderByDesc(User::getCreateTime)
-        ).convert(u -> this.toVo(u, gameMap, cpMap, agentMap));
+        ).convert(u -> this.toVo(u, gameMap, cpMap, agentDTOList));
     }
 
-    private UserListVO toVo(User user, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap, Map<Long, AgentDTO> agentMap) {
+    private UserListVO toVo(User user, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap, List<AgentDTO> agentDTOList) {
         UserListVO userListVO = BeanUtil.copy(user, UserListVO.class);
         if (Objects.isNull(userListVO)) {
             return null;
@@ -117,14 +110,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         userListVO.setMobile(user.getShowPhoneNum());
         userListVO.setRegIp(user.getIp());
         //渠道信息
-        AgentDTO agentDTO = agentMap.get(userListVO.getAgentId());
+        AgentDTO agentDTO = agentDTOList.stream().filter(dto -> Objects.equals(dto.getId(), userListVO.getAgentId()))
+                .findFirst().orElse(null);
         if (agentDTO != null) {
             userListVO.setAgentName(agentDTO.getAgentName());
-            userListVO.setAccountId(agentDTO.getAccountId());
             userListVO.setPitcherId(agentDTO.getCreateBy());
             userListVO.setPitcherName(agentDTO.getCreateByName());
+            userListVO.setAccountId(agentDTO.getAccountId());
             userListVO.setAccountType(agentDTO.getAccountType());
         }
+        if (Objects.equals(Agent.DEFAULT_AGENT, userListVO.getAgentId())) {
+            userListVO.setAgentName(Agent.DEFAULT_AGENT_NAME);
+        }
         //游戏信息
         GameDTO gameDTO = CollectionUtils.isNotEmpty(gameMap) ? gameMap.get(userListVO.getGameId()) : gameService.getById(userListVO.getGameId());
         if (gameDTO != null) {

+ 1 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/Agent.java

@@ -27,6 +27,7 @@ public class Agent implements Serializable {
     private static final long serialVersionUID = 1L;
 
     public static final Long DEFAULT_AGENT = 0L;
+    public static final String DEFAULT_AGENT_NAME = "自然量";
 
     public static final Integer PUT_STATUS_ING = 1;
     public static final Integer PUT_STATUS_STOP = 2;

+ 71 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/UserVisitLog.java

@@ -0,0 +1,71 @@
+package com.zanxiang.game.module.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-24
+ * @description : 用户访问下载地址记录
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("t_user_visit_log")
+public class UserVisitLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    private Long gameId;
+
+    /**
+     * 渠道id
+     */
+    private Long agentId;
+
+    /**
+     * 访问ip
+     */
+    private String ip;
+
+    /**
+     * 访问ua
+     */
+    private String ua;
+
+    /**
+     * 访问链接
+     */
+    private String url;
+
+    /**
+     * 链接参数
+     */
+    private String channel;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 12 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/UserVisitLogMapper.java

@@ -0,0 +1,12 @@
+package com.zanxiang.game.module.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.game.module.mybatis.entity.UserVisitLog;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-24
+ * @description : ${description}
+ */
+public interface UserVisitLogMapper extends BaseMapper<UserVisitLog> {
+}

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <dubbo升级3.0, 用户渠道记录逻辑代码提交01> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <dubbo升级3.0, 提交用户访问下载地址提交记录接口> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 1 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/adapter/ArgumentAdapter.java

@@ -67,6 +67,7 @@ public class ArgumentAdapter implements HandlerMethodArgumentResolver {
         UserData data = UserData.builder()
                 .gameId(gameExt.getGameId())
                 .ip(IpUtil.getRealIp(request))
+                .ua(request.getHeader("User-Agent"))
                 .deviceType(deviceType)
                 .deviceSystem(request.getHeader("os"))
                 .mac(request.getHeader("mac"))

+ 53 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/PushController.java

@@ -0,0 +1,53 @@
+package com.zanxiang.game.module.sdk.controller;
+
+import com.zanxiang.game.module.sdk.annotation.UnSignCheck;
+import com.zanxiang.game.module.sdk.pojo.param.GameRemitLogParam;
+import com.zanxiang.game.module.sdk.pojo.param.UserVisitLogParam;
+import com.zanxiang.game.module.sdk.service.IGameRemitLogService;
+import com.zanxiang.game.module.sdk.service.IUserVisitLogService;
+import com.zanxiang.module.util.pojo.ResultVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-17
+ * @description : 消息推送接收
+ */
+@Api(tags = "消息推送接收接口")
+@RestController
+@RequestMapping(value = "/api")
+public class PushController {
+
+    @Autowired
+    private IGameRemitLogService gameRemitLogService;
+
+    @Autowired
+    private IUserVisitLogService userVisitLogService;
+
+    @UnSignCheck
+    @ApiOperation(value = "游戏提现记录日志推送")
+    @PostMapping("/remit/log/push")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
+    public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GameRemitLogParam param) {
+        return ResultVO.ok(gameRemitLogService.addOrUpdate(param));
+    }
+
+    @UnSignCheck
+    @ApiOperation(value = "用户下载地址访问记录")
+    @PostMapping("/visit/log/push")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
+    public ResultVO<Boolean> visitLogCreate(@Validated @RequestBody UserVisitLogParam param,
+                                            @RequestHeader(name = "User-Agent") String userAgent,
+                                            HttpServletRequest httpServletRequest) {
+        return ResultVO.ok(userVisitLogService.visitLogCreate(param.getUrl(), userAgent, httpServletRequest));
+    }
+
+}

+ 0 - 38
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/controller/RemitController.java

@@ -1,38 +0,0 @@
-package com.zanxiang.game.module.sdk.controller;
-
-import com.zanxiang.game.module.sdk.annotation.UnSignCheck;
-import com.zanxiang.game.module.sdk.pojo.param.GameRemitLogParam;
-import com.zanxiang.game.module.sdk.service.IGameRemitLogService;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author : lingfeng
- * @time : 2023-07-17
- * @description : 提现
- */
-@Api(tags = "注册登录接口")
-@RestController
-@RequestMapping(value = "/api/remit")
-public class RemitController {
-
-    @Autowired
-    private IGameRemitLogService gameRemitLogService;
-
-    @UnSignCheck
-    @ApiOperation(value = "游戏提现记录日志推送")
-    @PostMapping("/log/push")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-    public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GameRemitLogParam param) {
-        return ResultVO.ok(gameRemitLogService.addOrUpdate(param));
-    }
-}

+ 5 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/param/UserData.java

@@ -35,6 +35,11 @@ public class UserData implements Serializable {
      */
     private String ip;
 
+    /**
+     * 客户端ua
+     */
+    private String ua;
+
     /**
      * token
      */

+ 22 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/param/UserVisitLogParam.java

@@ -0,0 +1,22 @@
+package com.zanxiang.game.module.sdk.pojo.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-24
+ * @description : 访问信息
+ */
+@Data
+public class UserVisitLogParam {
+
+    /**
+     * 访问url
+     */
+    @NotBlank(message = "访问url不可为空")
+    @ApiModelProperty(notes = "访问url")
+    private String url;
+}

+ 24 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/IUserVisitLogService.java

@@ -0,0 +1,24 @@
+package com.zanxiang.game.module.sdk.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.mybatis.entity.UserVisitLog;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-24
+ * @description : 用户下载地址访问记录
+ */
+public interface IUserVisitLogService extends IService<UserVisitLog> {
+
+    /**
+     * 访问日志创建
+     *
+     * @param url                url
+     * @param userAgent          用户代理
+     * @param httpServletRequest http servlet请求
+     * @return boolean
+     */
+    boolean visitLogCreate(String url, String userAgent, HttpServletRequest httpServletRequest);
+}

+ 138 - 7
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/AgentServiceImpl.java

@@ -5,11 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.game.module.mybatis.entity.Agent;
-import com.zanxiang.game.module.mybatis.entity.User;
-import com.zanxiang.game.module.mybatis.entity.UserLoginLog;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.module.mybatis.entity.*;
 import com.zanxiang.game.module.mybatis.mapper.AgentMapper;
+import com.zanxiang.game.module.sdk.pojo.param.UserData;
 import com.zanxiang.game.module.sdk.service.*;
+import com.zanxiang.module.util.DateUtil;
 import com.zanxiang.module.util.JsonUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.logging.log4j.util.Strings;
@@ -19,10 +20,7 @@ import reactor.util.function.Tuple3;
 import reactor.util.function.Tuples;
 
 import java.time.LocalDateTime;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author bilingfeng
@@ -43,6 +41,15 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
     @Autowired
     private IUserAgentLogService userAgentLogService;
 
+    @Autowired
+    private IUserVisitLogService userVisitLogService;
+
+    @Autowired
+    private IGameService gameService;
+
+    @Autowired
+    private IGameExtService gameExtService;
+
     @Override
     public void userAgentUpdate(User user, String channel) {
         log.error("用户登录接收到的渠道参数 userId : {}, channel : {}", user.getId(), channel);
@@ -112,6 +119,130 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         return Tuples.of(agent.getId(), urlParamMap, Strings.isBlank(shareUserId) ? Strings.EMPTY : shareUserId);
     }
 
+    public Tuple3<Long, Map<String, String>, String> getUserAgentId(UserData userData) {
+        GameExt gameExt = gameExtService.getByGameId(userData.getGameId());
+        Game game = gameService.getById(userData.getGameId());
+        String channel = userData.getChannel();
+
+        if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_APP.getId())
+                && !Objects.equals(gameExt.getAdCallBackSwitch(), Boolean.TRUE)){
+
+        }
+
+
+
+        log.error("用户注册接收到的渠道参数 channel : {}", channel);
+        if (Strings.isBlank(channel)) {
+            return Tuples.of(0L, Collections.emptyMap(), Strings.EMPTY);
+        }
+        //数据解析
+        Map<String, String> urlParamMap = this.channelTransform(channel);
+        String shareUserId = urlParamMap.get("shareUserId");
+        //查询渠道
+        Agent agent = null;
+        if (Strings.isNotBlank(shareUserId)) {
+            User user = userService.getById(Long.valueOf(shareUserId));
+            if (user != null) {
+                agent = super.getById(user.getAgentId());
+            }
+        } else {
+            agent = this.getAgentByKey(urlParamMap);
+        }
+        if (agent == null) {
+
+
+
+
+
+
+            return Tuples.of(0L, Collections.emptyMap(), Strings.isBlank(shareUserId) ? Strings.EMPTY : shareUserId);
+        }
+        return Tuples.of(agent.getId(), urlParamMap, Strings.isBlank(shareUserId) ? Strings.EMPTY : shareUserId);
+    }
+
+    public Long getUserAgentIda(UserData userData) {
+        //当前时间
+        LocalDateTime regTime = LocalDateTime.now();
+        // 0. 优先前置策略, 单独判断ip是否只有一个用户, 只有一个用户则是该用户
+        List<UserVisitLog> userVisitLogList = userVisitLogService.list(new LambdaQueryWrapper<UserVisitLog>()
+                .eq(UserVisitLog::getIp, userData.getIp()));
+        if (CollectionUtils.isNotEmpty(userVisitLogList) && userVisitLogList.size() == 1) {
+            return userVisitLogList.get(0).getAgentId();
+        }
+        // 1. 策略一 : 根据 ip + ua 精准匹配用户
+        userVisitLogList = userVisitLogService.list(new LambdaQueryWrapper<UserVisitLog>()
+                .eq(UserVisitLog::getIp, userData.getIp())
+                .eq(UserVisitLog::getUa, userData)
+                .le(UserVisitLog::getCreateTime, regTime));
+        // 判断通过策略一是否拿到数据, 筛选出访问时间与注册时间最接近的
+        if (CollectionUtils.isNotEmpty(userVisitLogList)) {
+            UserVisitLog lastUserCall = this.getLastUserCall(userVisitLogList, regTime);
+            return lastUserCall == null ? null : lastUserCall.getAgentId();
+        }
+        // 2. 策略二 : 根据 ip + regTime 模糊匹配用户, 数据误差在15分钟以内
+        userVisitLogList = userVisitLogService.list(new LambdaQueryWrapper<UserVisitLog>()
+                .eq(UserVisitLog::getIp, userData.getIp())
+                .ge(UserVisitLog::getCreateTime, regTime.minusMinutes(15))
+                .le(UserVisitLog::getCreateTime, regTime));
+        // 判断通过策略二是否拿到数据, 筛选出访问时间与注册时间最接近的
+        if (CollectionUtils.isNotEmpty(userVisitLogList)) {
+            UserVisitLog lastUserCall = this.getLastUserCall(userVisitLogList, regTime);
+            return lastUserCall == null ? null : lastUserCall.getAgentId();
+        }
+        // 3. 策略三 : 根据 ua + regTime 模糊匹配用户, 数据误差在15分钟以内
+        userVisitLogList = userVisitLogService.list(new LambdaQueryWrapper<UserVisitLog>()
+                .eq(UserVisitLog::getUa, userData.getUa())
+                .ge(UserVisitLog::getCreateTime, regTime.minusMinutes(15))
+                .le(UserVisitLog::getCreateTime, regTime));
+        // 判断通过策略三是否拿到数据, 筛选出访问时间与注册时间最接近的
+        if (CollectionUtils.isNotEmpty(userVisitLogList)) {
+            UserVisitLog lastUserCall = this.getLastUserCall(userVisitLogList, regTime);
+            return lastUserCall == null ? null : lastUserCall.getAgentId();
+        }
+        // 4. 策略四 : 根据 regTime 模糊匹配用户, 数据误差在15分钟以内, 此策略为兜底策略
+        userVisitLogList = userVisitLogService.list(new LambdaQueryWrapper<UserVisitLog>()
+                .ge(UserVisitLog::getCreateTime, regTime.minusMinutes(15))
+                .le(UserVisitLog::getCreateTime, regTime));
+        if (CollectionUtils.isNotEmpty(userVisitLogList)) {
+            UserVisitLog lastUserCall = this.getLastUserCall(userVisitLogList, regTime);
+            return lastUserCall == null ? null : lastUserCall.getAgentId();
+        }
+        return null;
+    }
+
+    /**
+     * 对比获取访问时间与注册时间最接近的访问记录
+     *
+     * @param regTime          用户注册时间
+     * @param userVisitLogList 用户访问日志列表
+     * @return {@link UserVisitLog}
+     */
+    private UserVisitLog getLastUserCall(List<UserVisitLog> userVisitLogList, LocalDateTime regTime) {
+        //只匹配到一个用户, 直接返回
+        if (userVisitLogList.size() == 1) {
+            return userVisitLogList.get(0);
+        }
+        //注册时间转换毫秒
+        long regTimeMill = DateUtil.localDateTimeToMilli(regTime);
+        //用户访问时间与注册时间差
+        Map<Long, Long> timeDiffMap = new HashMap<>(userVisitLogList.size());
+        //循环用户列表
+        userVisitLogList.forEach(user -> {
+            //用户访问时间
+            LocalDateTime createTime = user.getCreateTime();
+            //用户访问时间转换
+            long createTimeMill = DateUtil.localDateTimeToMilli(createTime);
+            //计算时间差, 并添加到集合
+            timeDiffMap.put(user.getId(), regTimeMill - createTimeMill);
+        });
+        //取出map中最小的value值对应的key值
+        List<Map.Entry<Long, Long>> list = new ArrayList<>(timeDiffMap.entrySet());
+        list.sort(Comparator.comparingLong(Map.Entry::getValue));
+        Long minId = list.get(0).getKey();
+        //过滤出对应的对象返回
+        return userVisitLogList.stream().filter(user -> Objects.equals(user.getId(), minId)).findFirst().orElse(null);
+    }
+
     private Agent getAgentByKey(Map<String, String> urlParamMap) {
         //参数不存在
         if (CollectionUtils.isEmpty(urlParamMap)) {

+ 97 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserVisitLogServiceImpl.java

@@ -0,0 +1,97 @@
+package com.zanxiang.game.module.sdk.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.mybatis.entity.Agent;
+import com.zanxiang.game.module.mybatis.entity.UserVisitLog;
+import com.zanxiang.game.module.mybatis.mapper.UserVisitLogMapper;
+import com.zanxiang.game.module.sdk.service.IAgentService;
+import com.zanxiang.game.module.sdk.service.IUserVisitLogService;
+import com.zanxiang.module.web.util.IpUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.net.URLDecoder;
+import java.time.LocalDateTime;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-07-24
+ * @description : 用户下载地址访问记录
+ */
+@Slf4j
+@Service
+public class UserVisitLogServiceImpl extends ServiceImpl<UserVisitLogMapper, UserVisitLog> implements IUserVisitLogService {
+
+    @Autowired
+    private IAgentService agentService;
+
+    @Override
+    public boolean visitLogCreate(String url, String userAgent, HttpServletRequest httpServletRequest) {
+        //解析url
+        Map<String, String> urlParamMap = this.getUrlParameter(url);
+        //获取渠道标识
+        String state = urlParamMap.get("agentId");
+        if (Strings.isBlank(state)) {
+            state = urlParamMap.get("agentKey");
+        }
+        final String agentSign = state;
+        //查询渠道信息
+        Agent agent = agentService.getOne(new LambdaQueryWrapper<Agent>()
+                .and(qw -> qw.eq(Agent::getAgentKey, agentSign).or().eq(Agent::getId, agentSign)));
+        //保存访问记录
+        return super.save(UserVisitLog.builder()
+                .gameId(agent == null ? null : agent.getGameId())
+                .agentId(agent == null ? null : agent.getId())
+                .ip(IpUtil.getRealIp(httpServletRequest))
+                .ua(userAgent)
+                .url(urlParamMap.get("url"))
+                .channel(urlParamMap.get("channel"))
+                .createTime(LocalDateTime.now())
+                .updateTime(LocalDateTime.now())
+                .build());
+    }
+
+    /**
+     * 解析头条的url的host和参数
+     *
+     * @param url : 请求的url
+     * @return : 返回url中携带的参数的和host地址
+     */
+    private Map<String, String> getUrlParameter(String url) {
+        //参数判断
+        if (Strings.isBlank(url)) {
+            return Collections.emptyMap();
+        }
+        //没有拼接参数
+        if (url.indexOf('?') == -1) {
+            return Collections.singletonMap("url", url);
+        }
+        //参数map
+        Map<String, String> map = new HashMap<>(5);
+        try {
+            final String charset = "utf-8";
+            url = URLDecoder.decode(url, charset);
+            //添加url的host
+            map.put("url", url.substring(0, url.indexOf('?')));
+            map.put("channel", url.substring(url.indexOf('?') + 1));
+            //解析参数
+            final String contents = url.substring(url.indexOf('?') + 1);
+            String[] keyValues = contents.split("&");
+            for (String keyValue : keyValues) {
+                String key = keyValue.substring(0, keyValue.indexOf("="));
+                String value = keyValue.substring(keyValue.indexOf("=") + 1);
+                map.put(key, value);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+}

Some files were not shown because too many files changed in this diff