|
@@ -1,6 +1,8 @@
|
|
|
package com.zanxiang.game.data.serve.service.impl;
|
|
|
|
|
|
import com.google.common.base.CaseFormat;
|
|
|
+import com.zanxiang.erp.base.ErpServer;
|
|
|
+import com.zanxiang.erp.base.rpc.ISysUserRpc;
|
|
|
import com.zanxiang.game.data.serve.component.DataPowerComponent;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.*;
|
|
|
import com.zanxiang.game.data.serve.pojo.entity.AdsGameServerDay;
|
|
@@ -11,15 +13,19 @@ import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
|
import com.zanxiang.game.data.serve.service.IGameServerService;
|
|
|
import com.zanxiang.game.data.serve.utils.Page;
|
|
|
+import com.zanxiang.module.util.pojo.ResultVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.nutz.dao.Cnd;
|
|
|
import org.nutz.dao.Dao;
|
|
|
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.SqlExpression;
|
|
|
+import org.nutz.dao.util.cri.Static;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import reactor.util.function.Tuple2;
|
|
@@ -41,6 +47,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class GameServerServiceImpl implements IGameServerService {
|
|
|
|
|
|
+ @DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
|
|
|
+ private ISysUserRpc sysUserRpc;
|
|
|
+
|
|
|
//存储映射的List
|
|
|
private static final List<Tuple2<Field, Field>> dayNFieldMapList;
|
|
|
private static final List<Tuple2<Field, Field>> dayNTotalFieldMapList;
|
|
@@ -539,7 +548,15 @@ public class GameServerServiceImpl implements IGameServerService {
|
|
|
.filter(field -> field.getName().contains("daRetention"))
|
|
|
.peek(field -> field.setAccessible(true))
|
|
|
.toList();
|
|
|
-
|
|
|
+ //把所有gsIds取出来用,拼起来
|
|
|
+ String gsIds = vos.stream().map(GSGameServerDayVO::getGsIds).collect(Collectors.joining(","));
|
|
|
+ ResultVO<Map<Long, String>> userMap = null;
|
|
|
+ if(StringUtils.isNotEmpty(gsIds)){
|
|
|
+ //转换为Long类型
|
|
|
+ List<Long> userIds = Arrays.stream(gsIds.split(",")).map(Long::parseLong).toList();
|
|
|
+ //发送RPC接口查询所有用户
|
|
|
+ userMap = sysUserRpc.getUserNameByIds(userIds);
|
|
|
+ }
|
|
|
for (GSGameServerDayVO vo : vos) {
|
|
|
List<GSGameServerDayRVO> rDataList = collect.get(vo.getSourceSystem() + vo.getServerId() + vo.getParentGameId());
|
|
|
for (int i = 0; i < fieldList.size(); i++) {
|
|
@@ -575,6 +592,12 @@ public class GameServerServiceImpl implements IGameServerService {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
}
|
|
|
+ if(userMap != null && userMap.getData() != null&&StringUtils.isNotEmpty(vo.getGsIds())){
|
|
|
+ Map<Long, String> data = userMap.getData();
|
|
|
+ List<Long> userIds = Arrays.stream(vo.getGsIds().split(",")).map(Long::parseLong).toList();
|
|
|
+ String gsNames = userIds.stream().map(data::get).collect(Collectors.joining(","));
|
|
|
+ vo.setGsNames(gsNames);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
return new Page<>(vos, pager);
|
|
@@ -793,6 +816,9 @@ public class GameServerServiceImpl implements IGameServerService {
|
|
|
if (StringUtils.isNotEmpty(dto.getServerName())) {
|
|
|
cri.where().andLike("a.server_name", dto.getServerName());
|
|
|
}
|
|
|
+ if(dto.getGsId()!=null){
|
|
|
+ cri.where().and(new Static("find_in_set("+dto.getGsId()+",a.gs_ids)"));
|
|
|
+ }
|
|
|
return cri;
|
|
|
}
|
|
|
|