Explorar o código

修改内容:整体概况修改

lth hai 1 ano
pai
achega
1816480d25

+ 4 - 5
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/GameDataController.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.GameDataAgainDayDTO;
 import com.zanxiang.game.data.serve.pojo.dto.GameDataDayDTO;
 import com.zanxiang.game.data.serve.pojo.dto.GameDataTotalDTO;
@@ -42,7 +41,7 @@ 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) {
@@ -51,7 +50,7 @@ public class GameDataController {
 
 
     @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) {
@@ -59,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));

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

@@ -45,4 +45,16 @@ public class GameDataDayDTO extends BasePage {
     @ApiModelProperty(notes = "注册结束时间")
     private LocalDate registeredEndDate;
 
+    /**
+     * 排序字段
+     */
+    @ApiModelProperty(notes = "排序字段")
+    private String sortFiled;
+
+    /**
+     * 排序方式:升序asc;降序desc
+     */
+    @ApiModelProperty(notes = "排序方式:升序asc;降序desc")
+    private String sortType;
+
 }

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

@@ -57,4 +57,16 @@ public class GameDataTotalDTO extends BasePage {
     @ApiModelProperty(notes = "充值结束时间")
     private LocalDate rechargeEndDate;
 
+    /**
+     * 排序字段
+     */
+    @ApiModelProperty(notes = "排序字段")
+    private String sortFiled;
+
+    /**
+     * 排序方式:升序asc;降序desc
+     */
+    @ApiModelProperty(notes = "排序方式:升序asc;降序desc")
+    private String sortType;
+
 }

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

@@ -54,7 +54,7 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
                 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_new_player_amount)/SUM(x.today_total_cost),0) total_roi
+                IFNULL(SUM(x.today_amount)/SUM(x.today_total_cost),0) total_roi
                 FROM ads_overall_summary x
                 """ + totalDataConString);
 
@@ -101,19 +101,23 @@ public class OverallSummaryServiceImpl implements IOverallSummaryService {
 
         //7日和30日Roi数据需要手动计算
         //7日内新用户累计充值
-        BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayNewPlayerAmount", myCondition(dto, false, 7));
+        BigDecimal d7NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 7));
         //7日内总消耗
         BigDecimal d7TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 7));
         //cost 查询出的结果为null或者为0.00 设置为默认值0
-        overallSummaryVO.setD7TotalRoi((d7TotalCost == null || BigDecimal.ZERO.compareTo(d7TotalCost) == 0) ? BigDecimal.ZERO : d7NewPlayerAmount.divide(d7TotalCost, 4, RoundingMode.HALF_UP));
+        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", "todayNewPlayerAmount", myCondition(dto, false, 30));
+        BigDecimal d30NewPlayerAmount = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayAmount", myCondition(dto, false, 30));
         //30日内总消耗
         BigDecimal d30TotalCost = (BigDecimal) dao.func2(AdsOverallSummary.class, "sum", "todayTotalCost", myCondition(dto, false, 30));
         //计算30日Roi
         //cost 查询出的结果为null或者为0.00 设置为默认值0
-        overallSummaryVO.setD30TotalRoi((d30TotalCost == null || BigDecimal.ZERO.compareTo(d30TotalCost) == 0) ? BigDecimal.ZERO : d30NewPlayerAmount.divide(d30TotalCost, 4, RoundingMode.HALF_UP));
+        overallSummaryVO.setD30TotalRoi((d30TotalCost == null || BigDecimal.ZERO.compareTo(d30TotalCost) == 0) ? BigDecimal.ZERO : d30NewPlayerAmount.multiply(BigDecimal.valueOf(100)).divide(d30TotalCost, 4, RoundingMode.HALF_UP));
+
+        //计算百分比
+        overallSummaryVO.setFirstRoi(overallSummaryVO.getFirstRoi().multiply(BigDecimal.valueOf(100)));
+        overallSummaryVO.setTotalRoi(overallSummaryVO.getTotalRoi().multiply(BigDecimal.valueOf(100)));
 
         return overallSummaryVO;
     }