|
@@ -24,7 +24,6 @@ import com.zanxiang.game.module.manage.service.IGameSupperService;
|
|
|
import com.zanxiang.game.module.mybatis.entity.GameServer;
|
|
|
import com.zanxiang.game.module.mybatis.entity.GameSupper;
|
|
|
import com.zanxiang.game.module.mybatis.mapper.GameServerMapper;
|
|
|
-import com.zanxiang.module.util.JsonUtil;
|
|
|
import com.zanxiang.module.util.bean.BeanUtil;
|
|
|
import com.zanxiang.module.util.excel.ExcelUtil;
|
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
@@ -90,24 +89,21 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
|
|
|
List<GameServer> gameServerList = new ArrayList<>();
|
|
|
List<String> mergeSerIdList = new ArrayList<>();
|
|
|
gameServerExcelList.forEach(excelDTO -> {
|
|
|
-
|
|
|
- log.error("excelDTO : {}", JsonUtil.toString(excelDTO));
|
|
|
-
|
|
|
-
|
|
|
Set<String> sonServerIdList = Arrays.stream(excelDTO.getServerIds().split(",")).collect(Collectors.toSet());
|
|
|
List<GameServer> sonServerList = super.list(new LambdaQueryWrapper<GameServer>()
|
|
|
.eq(GameServer::getGameId, gameId)
|
|
|
+ .eq(GameServer::getIsMerge, Boolean.FALSE)
|
|
|
.in(GameServer::getServerId, sonServerIdList));
|
|
|
+ if (CollectionUtils.isEmpty(sonServerList)) {
|
|
|
+ throw new BaseException("合服子服列表查询为空, 请检查子服列表是否存在错误id, 或者是否包含已参与过合服的区服");
|
|
|
+ }
|
|
|
+ if (!sonServerIdList.contains(excelDTO.getMainServerId())) {
|
|
|
+ throw new BaseException("合服主服id : " + excelDTO.getMainServerId() + "不存在子服id列表中, 请检查数据");
|
|
|
+ }
|
|
|
if (sonServerIdList.size() != sonServerList.size()) {
|
|
|
-
|
|
|
- log.error("sonServerIdList : {}, sonServerList : {}", sonServerIdList.toString(), sonServerList.toString());
|
|
|
-
|
|
|
-
|
|
|
List<String> collect = sonServerList.stream().map(GameServer::getServerId).collect(Collectors.toList());
|
|
|
List<String> list = sonServerIdList.stream().filter(son -> !collect.contains(son)).collect(Collectors.toList());
|
|
|
- if (!list.isEmpty()) {
|
|
|
- throw new BaseException("提交的子服中存在错误的区服id : " + list.toString());
|
|
|
- }
|
|
|
+ throw new BaseException("提交的子服中存在错误的区服id : " + list.toString());
|
|
|
}
|
|
|
Set<String> sourceServerIds = new HashSet<>();
|
|
|
sonServerList.forEach(gameServer -> {
|