Переглянути джерело

feat:1、游戏帮派下拉框列表

zhangxianyu 1 місяць тому
батько
коміт
8b974ce62b

+ 10 - 3
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/RoleManageController.java

@@ -67,11 +67,18 @@ public class RoleManageController {
         return ResultVO.ok(roleManageService.ipInfoListOfPage(dto));
     }
 
-    @ApiOperation(value = "游戏帮派数据列表")
+    @ApiOperation(value = "游戏帮派列表")
     @PreAuthorize(permissionKey = "roleManage:gameCountry:list")
     @PostMapping("/gameCountryList")
-    public ResultVO<Map<String, List<RoleGameCountryVO>>> gameCountryList(@Valid @RequestBody GameCountryParamDTO dto) {
-        return ResultVO.ok(roleManageService.gameCountryList(dto));
+    public ResultVO<List<String>> gameCountryList() {
+        return ResultVO.ok(roleManageService.gameCountryList());
+    }
+
+    @ApiOperation(value = "游戏帮派数据列表")
+    @PreAuthorize(permissionKey = "roleManage:gameCountry:dataList")
+    @PostMapping("/gameCountryDataList")
+    public ResultVO<Map<String, List<RoleGameCountryVO>>> gameCountryDataList(@Valid @RequestBody GameCountryParamDTO dto) {
+        return ResultVO.ok(roleManageService.gameCountryDataList(dto));
     }
 
     @ApiOperation(value = "游戏帮派角色列表")

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

@@ -1,5 +1,6 @@
 package com.zanxiang.game.data.serve.pojo.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -14,16 +15,22 @@ import java.math.BigDecimal;
 @Data
 public class RoleGameCountryVO {
 
+    @ApiModelProperty(value = "帮派")
     private String country;
 
+    @ApiModelProperty(value = "帮派等级类型")
     private Integer countryLevel;
 
+    @ApiModelProperty(value = "角色充值金额")
     private BigDecimal roleTotalAmount;
 
+    @ApiModelProperty(value = "角色总数")
     private Long roleCount;
 
-    private Long active_count;
+    @ApiModelProperty(value = "今日活跃角色数量")
+    private Long activeCount;
 
+    @ApiModelProperty(value = "区服id")
     private String serverId;
 
     private String cs;

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

@@ -63,7 +63,7 @@ public interface IRoleManageService {
      * @param dto
      * @return
      */
-    Map<String, List<RoleGameCountryVO>> gameCountryList(GameCountryParamDTO dto);
+    Map<String, List<RoleGameCountryVO>> gameCountryDataList(GameCountryParamDTO dto);
 
     /**
      * 游戏帮派角色列表
@@ -71,4 +71,10 @@ public interface IRoleManageService {
      * @return
      */
     Page<Map> gameCountryRoleList(RoleGameCountryParamDTO dto);
+
+    /**
+     * 游戏帮派列表
+     * @return
+     */
+    List<String> gameCountryList();
 }

+ 19 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/RoleManageServiceImpl.java

@@ -29,7 +29,6 @@ import org.nutz.dao.Sqls;
 import org.nutz.dao.pager.Pager;
 import org.nutz.dao.sql.Criteria;
 import org.nutz.dao.sql.Sql;
-import org.nutz.dao.util.cri.SimpleCriteria;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StopWatch;
@@ -998,7 +997,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
     }
 
     @Override
-    public Map<String, List<RoleGameCountryVO>> gameCountryList(GameCountryParamDTO dto) {
+    public Map<String, List<RoleGameCountryVO>> gameCountryDataList(GameCountryParamDTO dto) {
         //创建查询条件
         Criteria criA = getSqlByQuery(dto);
         String gameCountryListSql = getGameCountryListSql(criA);
@@ -1047,6 +1046,22 @@ public class RoleManageServiceImpl implements IRoleManageService {
         return new Page<>(list, pager);
     }
 
+    @Override
+    public List<String> gameCountryList() {
+        String countryListSql = getCountryListSql();
+        Sql sql = Sqls.create(countryListSql);
+        sql.setCallback(Sqls.callback.strList());
+        dao.execute(sql);
+        List<String> list = sql.getList(String.class);
+        return list;
+    }
+
+    private String getCountryListSql() {
+        return """
+                select country from dm_game_order.t_server_country
+                """;
+    }
+
     private String getGameCountryRoleListSql(Criteria criA) {
         return """
                 select a.country as country,a.role_id as roleId,user_id as userId ,role_name as roleName ,role_level as roleLevel ,combat_num as combatNum,
@@ -1081,7 +1096,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
         Criteria criA = Cnd.cri();
         //如果帮派为空就取4个帮派
         if (CollectionUtils.isEmpty(dto.getGameCountryList())) {
-            String countryListSql = getCountryListSql(dto);
+            String countryListSql = getCountryDataListSql(dto);
             Sql sql = Sqls.create(countryListSql);
             sql.setCallback(Sqls.callback.strList());
             dao.execute(sql);
@@ -1129,7 +1144,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
                 """;
     }
 
-    private String getCountryListSql(GameCountryParamDTO dto) {
+    private String getCountryDataListSql(GameCountryParamDTO dto) {
         Criteria criA = Cnd.cri();
         if (CollectionUtils.isNotEmpty(dto.getGameId())) {
             criA.where().andInList("game_id", dto.getGameId());