【增加点击初始化清除人员操作,编制时找不到列车问题】

This commit is contained in:
weizhihong 2023-11-27 17:56:27 +08:00
parent 28c74a75cd
commit 700d95e4a7
3 changed files with 539 additions and 492 deletions

View File

@ -310,6 +310,9 @@ public class SimulationDataRepository {
public MapElement getByCode(String code) {
MapElement mapElement = this.deviceMap.get(code);
if (Objects.isNull(mapElement)) {
mapElement = this.vrDeviceMap.get(code);
}
if (Objects.isNull(mapElement)) {
throw new SimulationException(SimulationExceptionType.System_Fault,
String.format("地图数据异常不存在code为[%s]的数据", code));

View File

@ -314,15 +314,18 @@ public class MemberManager {
}
// 删除在原始数据中不存在的成员
List<SimulationMember> members = simulation.getSimulationMembers();
Map<String, SimulationMember> simMemberMap = new HashMap<>(members.size());
for (SimulationMember m : members) {
if (!originMemberMap.containsKey(m.getId())) {
simulation.removeSimulationMember(m.getId());
simMemberMap.put(m.getId(), m);
if (originMemberMap.containsKey(m.getId())) {
continue;
}
simulation.removeSimulationMember(m.getId());
}
// 加入额外的成员
if (!CollectionUtils.isEmpty(memberPOS)) {
for (SimulationMemberPO p : memberPOS) {
if (originMemberMap.containsKey(p.getId())) {
if (simMemberMap.containsKey(p.getId())) {
continue;
}
MapElement mapElement = null;