diff --git a/src/main/java/club/joylink/rtss/entity/project/Project.java b/src/main/java/club/joylink/rtss/entity/project/Project.java index e95ea8c9d..2380e94c2 100644 --- a/src/main/java/club/joylink/rtss/entity/project/Project.java +++ b/src/main/java/club/joylink/rtss/entity/project/Project.java @@ -114,7 +114,7 @@ public class Project { @JsonIgnore public static boolean isDefault(String code) { - return DEFAULT_PROJECT_LABEL.contains(code); + return StringUtils.isEmpty(code) || DEFAULT_PROJECT_LABEL.contains(code); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/dcmd/service/DisCmdSendService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/dcmd/service/DisCmdSendService.java index 926268bba..8f9f26da9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/dcmd/service/DisCmdSendService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/dcmd/service/DisCmdSendService.java @@ -13,6 +13,7 @@ import club.joylink.rtss.websocket.StompMessageService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -33,7 +34,7 @@ public class DisCmdSendService { */ public void autoSendUnread(Simulation simulation, String userId) { SimulationMember member = simulation.querySimulationMemberByUserId(userId); - if (null == member) return; + if (null == member || member.getDevice() == null) return; DisCmdDb db = commonService.getCmdDb(simulation); try { db.lock(); @@ -168,7 +169,7 @@ public class DisCmdSendService { //机车号 String trainCode = to.getCode(); List trains = simulation.getRepository().getOnlineTrainList().stream().filter(tr -> { - return tr.getTripNumber().equals(trainNum)&&tr.getGroupNumber().equals(trainCode); + return tr.getTripNumber().equals(trainNum) && tr.getGroupNumber().equals(trainCode); }).collect(Collectors.toList()); if (null != trains && !trains.isEmpty()) { VirtualRealityTrain train = trains.get(0);