Kaynağa Gözat

fix : excel日期格式修改2

bilingfeng 1 yıl önce
ebeveyn
işleme
145af4a98f

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <区服新增excel方式1> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <区服新增excel方式2> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 8 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServerServiceImpl.java

@@ -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 -> {