|
@@ -989,10 +989,10 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
if (StringUtils.isBlank(dto.getSortFiled())) {
|
|
|
criA.getOrderBy().orderBy("a.create_time", dto.getSortType());
|
|
|
} else {
|
|
|
- if(dto.getSortFiled().equals("ip_role_count_filter")){
|
|
|
+ if (dto.getSortFiled().equals("ip_role_count_filter")) {
|
|
|
dto.setSortFiled("role_count_group_filters_count");
|
|
|
}
|
|
|
- if(dto.getSortFiled().equals("role_user_ip_count_filter")){
|
|
|
+ if (dto.getSortFiled().equals("role_user_ip_count_filter")) {
|
|
|
dto.setSortFiled("role_user_group_filters_count");
|
|
|
}
|
|
|
criA.getOrderBy().orderBy(dto.getSortFiled(), dto.getSortType());
|
|
@@ -1043,7 +1043,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
dto.setSortType(OrderByEnum.DESC.getOrderType());
|
|
|
}
|
|
|
if (StringUtils.isBlank(dto.getSortFiled())) {
|
|
|
- criA.getOrderBy().orderBy("role_total_amount", dto.getSortType());
|
|
|
+ criA.getOrderBy().orderBy("roleTotalAmount", dto.getSortType());
|
|
|
} else {
|
|
|
criA.getOrderBy().orderBy(dto.getSortFiled(), dto.getSortType());
|
|
|
}
|
|
@@ -1121,6 +1121,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
group by ip
|
|
|
""";
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map> userDetailList(RoleIpInfoParamDTO dto) {
|
|
|
if (dto.getRoleId() == null) {
|
|
@@ -1162,23 +1163,23 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
}
|
|
|
Map map = maps.get(0);
|
|
|
String filedRoleId = "role_count_group";
|
|
|
- if(dto.getExcludeUserType()==1){
|
|
|
+ if (dto.getExcludeUserType() == 1) {
|
|
|
filedRoleId = "role_count_group_filters";
|
|
|
}
|
|
|
String roleIdStr = String.valueOf(map.get(filedRoleId));
|
|
|
- if (StringUtils.isEmpty(roleIdStr)|| roleIdStr.equals("[]")) {
|
|
|
+ if (StringUtils.isEmpty(roleIdStr) || roleIdStr.equals("[]")) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
- if(dto.getExcludeUserType()==1){
|
|
|
+ if (dto.getExcludeUserType() == 1) {
|
|
|
roleIdStr = roleIdStr.replaceAll("[\\[\\]\"]", "");
|
|
|
}
|
|
|
- return baseService.roleDetailList(Arrays.stream(roleIdStr.split(",")).map(String::trim).map(Long::valueOf).collect(Collectors.toList()),dto);
|
|
|
+ return baseService.roleDetailList(Arrays.stream(roleIdStr.split(",")).map(String::trim).map(Long::valueOf).collect(Collectors.toList()), dto);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map> roleDetailList(List<Long> roleId,RoleIpInfoParamDTO roleIpInfoParamDTO) {
|
|
|
+ public List<Map> roleDetailList(List<Long> roleId, RoleIpInfoParamDTO roleIpInfoParamDTO) {
|
|
|
Criteria criteria = Cnd.cri();
|
|
|
- criteria.where().andInList("role_id",roleId);
|
|
|
+ criteria.where().andInList("role_id", roleId);
|
|
|
String roleDetailListSql = getRoleDetailList(criteria);
|
|
|
Sql sql = Sqls.create(roleDetailListSql);
|
|
|
sql.setCallback(Sqls.callback.maps());
|
|
@@ -1253,6 +1254,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
group by b.id) a
|
|
|
""" + orderCriteria;
|
|
|
}
|
|
|
+
|
|
|
private String getRoleDetailList(Criteria criteria) {
|
|
|
return """
|
|
|
select role_id roleId ,any_value(role_name) roleName,game_id gameId,any_value(game_name) gameName,ip,server_id serverId,any_value(server_name) serverName,user_id userId,any_value(user_name) userName from game_ads.role_ip_monitor
|
|
@@ -1260,6 +1262,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
group by role_id,game_id,ip,server_id,user_id
|
|
|
""";
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* ipRoleCount 同ip的角色数量
|
|
|
*/
|
|
@@ -1278,19 +1281,19 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
|
|
|
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,
|
|
|
- server_id as serverId ,server_name as serverName ,create_time as createTime,IFNULL(b.role_total_amount,0) as roleTotalAmount
|
|
|
- from dm_game_order.t_game_user_role a
|
|
|
- left join game_ads.ads_role_amount b on a.role_id = b.role_id
|
|
|
+ select a.country as country,a.role_id as roleId,a.user_id as userId ,a.role_name as roleName ,a.role_level as roleLevel ,combat_num as combatNum,
|
|
|
+ a.server_id as serverId ,a.server_name as serverName ,create_time as createTime,IFNULL(b.amount,0) as roleTotalAmount
|
|
|
+ from dm_game_order.t_game_user_role a
|
|
|
+ left join game_dw.dw_order_day_amount b on a.role_id = b.role_id
|
|
|
""" + criA;
|
|
|
}
|
|
|
|
|
|
private String getGameCountryRoleCountSql(Criteria criA) {
|
|
|
return """
|
|
|
- select count(1) from ( 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,
|
|
|
- server_id as serverId ,server_name as serverName ,create_time as createTime,IFNULL(b.role_total_amount,0) as roleTotalAmount
|
|
|
+ select count(1) from ( select a.country as country,a.role_id as roleId,a.user_id as userId ,a.role_name as roleName ,a.role_level as roleLevel ,a.combat_num as combatNum,
|
|
|
+ a.server_id as serverId ,a.server_name as serverName ,a.create_time as createTime,IFNULL(b.amount,0) as roleTotalAmount
|
|
|
from dm_game_order.t_game_user_role a
|
|
|
- left join game_ads.ads_role_amount b on a.role_id = b.role_id
|
|
|
+ left join game_dw.dw_order_day_amount b on a.role_id = b.role_id
|
|
|
""" + criA + """
|
|
|
) a
|
|
|
""";
|
|
@@ -1459,14 +1462,14 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
|
|
|
private String getIpInfoListCountSql(Criteria criA) {
|
|
|
return """
|
|
|
- select count(1) from ( SELECT
|
|
|
- a.*,
|
|
|
- a.role_count_group_filters_count as ip_role_count_filter,
|
|
|
- a.role_user_group_filters_count as role_user_ip_count_filter,
|
|
|
- game.game_name
|
|
|
- FROM game_ads.role_ip_monitor a
|
|
|
- LEFT JOIN dm_game_order.t_game game ON a.game_id = game.id AND game.source_system = 'ZX_ONE'
|
|
|
- """+criA+"""
|
|
|
+ select count(1) from ( SELECT
|
|
|
+ a.*,
|
|
|
+ a.role_count_group_filters_count as ip_role_count_filter,
|
|
|
+ a.role_user_group_filters_count as role_user_ip_count_filter,
|
|
|
+ game.game_name
|
|
|
+ FROM game_ads.role_ip_monitor a
|
|
|
+ LEFT JOIN dm_game_order.t_game game ON a.game_id = game.id AND game.source_system = 'ZX_ONE'
|
|
|
+ """ + criA + """
|
|
|
) a
|
|
|
""";
|
|
|
}
|