修改Dom配置;修改地图功能生成的Dom配置

This commit is contained in:
joylink_zhangsai 2022-11-29 10:35:18 +08:00
parent f77404029b
commit 8e1bf07869
4 changed files with 46 additions and 11 deletions

View File

@ -65,6 +65,15 @@ public class MapFunctionController {
rtsMapFunctionService.delete(id);
}
/**
* 批量删除地图功能
*/
@Role(RoleEnum.Admin)
@DeleteMapping("/batch/{mapId}")
public void batchDelete(@PathVariable long mapId) {
rtsMapFunctionService.batchDelete(mapId);
}
/**
* 更新地图系统
*/

View File

@ -40,4 +40,9 @@ public interface RtsMapFunctionService {
* @return 一些特殊的但是算不上异常的信息
*/
List<String> generateLpf(long mapId, long creatorId);
/**
* 批量删除地图下所有地图功能
*/
void batchDelete(long mapId);
}

View File

@ -169,6 +169,13 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return msgList;
}
@Override
public void batchDelete(long mapId) {
RtsMapFunctionExample rtsMapFunctionExample = new RtsMapFunctionExample();
rtsMapFunctionExample.createCriteria().andMapIdEqualTo(mapId);
rtsMapFunctionDAO.deleteByExample(rtsMapFunctionExample);
}
private RtsMapFunctionCreateVO buildCreateVO(long mapId, String name, String desc, Simulation.Type simType,
Map<SimulationWorkParamVO.Item, String> itemMap, SimulationWorkParamVO.DomConfigVO domConfig) {
RtsMapFunctionCreateVO createVO = new RtsMapFunctionCreateVO();
@ -214,7 +221,8 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleRoleType(true)
.singleMember(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, dispatcherOptional.get().getId());
@ -232,7 +240,8 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleRoleType(true)
.singleMember(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, stationSupervisorOptional.get().getId());
@ -253,7 +262,8 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleRoleType(true)
.singleMember(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, memberOptional.get().getId());
@ -273,6 +283,7 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleMember(true)
.hasTraining(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, dispatcherOptional.get().getId());
@ -292,6 +303,7 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleMember(true)
.hasTraining(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, stationSupervisorOptional.get().getId());
@ -309,7 +321,6 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleMember(true)
.hasExam(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
@ -328,7 +339,6 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleMember(true)
.hasExam(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
@ -351,6 +361,7 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.isJoint(true)
.hasMemberManager(true)
.build();
return buildCreateVO(mapId, name, name, simType, itemMap, domConfig);
};
@ -369,7 +380,9 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, dispatcherOptional.get().getId());
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.trainingDesign(true).build();
.trainingDesign(true)
.hasMemberManager(true)
.build();
return buildCreateVO(mapId, name, name, simType, itemMap, domConfig);
};
@ -416,7 +429,8 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleRoleType(true)
.singleMember(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, dispatcherOptional.get().getId());
@ -434,7 +448,8 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
return null;
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.singleRoleType(true)
.singleMember(true)
.hasMemberManager(true)
.build();
Map<SimulationWorkParamVO.Item, String> itemMap = new HashMap<>();
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, stationSupervisorOptional.get().getId());
@ -456,6 +471,7 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.isJoint(true)
.hasMemberManager(true)
.build();
return buildCreateVO(mapId, name, name, simType, itemMap, domConfig);
};
@ -474,7 +490,9 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService {
itemMap.put(SimulationWorkParamVO.Item.DEFAULT_MEMBER, dispatcherOptional.get().getId());
}
SimulationWorkParamVO.DomConfigVO domConfig = SimulationWorkParamVO.DomConfigVO.builder()
.trainingDesign(true).build();
.trainingDesign(true)
.hasMemberManager(true)
.build();
return buildCreateVO(mapId, name, name, simType, itemMap, domConfig);
};

View File

@ -85,6 +85,9 @@ public class SimulationWorkParamVO {
@AllArgsConstructor
@Builder
public static class DomConfigVO {
/**
* 单成员类型
*/
private boolean singleMember;
private boolean singleClient;
@ -108,8 +111,8 @@ public class SimulationWorkParamVO {
private boolean hasDeviceManager;
/**
* 单角色类型仿真
* 有成员管理功能
*/
private boolean singleRoleType;
private boolean hasMemberManager;
}
}