【生成实训删除组织筛选】

This commit is contained in:
weizhihong 2023-04-13 18:28:16 +08:00
parent 2de8ff955b
commit 81cfda9d20
2 changed files with 0 additions and 11 deletions

View File

@ -235,7 +235,6 @@ public class Training2RuleService {
mapRuleIdMap.forEach((k, v) -> { mapRuleIdMap.forEach((k, v) -> {
// 地图信息 // 地图信息
MapInfo mapInfo = mapInfoDAO.selectByPrimaryKey(k); MapInfo mapInfo = mapInfoDAO.selectByPrimaryKey(k);
String projectCode = StringUtils.isEmpty(mapInfo.getProjectCode()) ? Project.DEFAULT.name() : mapInfo.getProjectCode();
// 规则列表 // 规则列表
RtsTraining2RuleExample rtsTraining2RuleExample = new RtsTraining2RuleExample(); RtsTraining2RuleExample rtsTraining2RuleExample = new RtsTraining2RuleExample();
rtsTraining2RuleExample.createCriteria().andIdIn(v).andLineCodeEqualTo(mapInfo.getLineCode()); rtsTraining2RuleExample.createCriteria().andIdIn(v).andLineCodeEqualTo(mapInfo.getLineCode());
@ -254,10 +253,6 @@ public class Training2RuleService {
List<Long> delTrainingIdList = publishedTraining2DAO.selectTrainingIdByRuleNameAndMapId(ruleNameMapList, k); List<Long> delTrainingIdList = publishedTraining2DAO.selectTrainingIdByRuleNameAndMapId(ruleNameMapList, k);
try { try {
Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false); Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false);
if (!Objects.equals(projectCode, simulation.getProjectVO().getValue())) {
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapInfo.getProjectCode()); // 纠正仿真的默认项目信息
simulation.setProjectVO(projectVO);
}
errorMsgList.addAll(generateTraining(simulation, ruleList, delTrainingIdList, delPublishTrainingByIds)); errorMsgList.addAll(generateTraining(simulation, ruleList, delTrainingIdList, delPublishTrainingByIds));
} catch (Exception e) { } catch (Exception e) {
log.error("创建仿真失败", e); log.error("创建仿真失败", e);
@ -284,11 +279,6 @@ public class Training2RuleService {
if (!CollectionUtils.isEmpty(entities) && !CollectionUtils.isEmpty(lineCodeRuleMap.get(mapInfo.getLineCode()))) { if (!CollectionUtils.isEmpty(entities) && !CollectionUtils.isEmpty(lineCodeRuleMap.get(mapInfo.getLineCode()))) {
try { try {
Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false); Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false);
String projectCode = StringUtils.isEmpty(mapInfo.getProjectCode()) ? Project.DEFAULT.name() : mapInfo.getProjectCode();
if (!Objects.equals(projectCode, simulation.getProjectVO().getValue())) {
ProjectVO projectVO = projectService.queryLoginProjectByCode(mapInfo.getProjectCode()); // 纠正仿真的默认项目信息
simulation.setProjectVO(projectVO);
}
if (CollectionUtils.isEmpty(deleteTrainingIdMap)) { if (CollectionUtils.isEmpty(deleteTrainingIdMap)) {
errorMsgList.addAll(generateTraining(simulation, lineCodeRuleMap.get(mapInfo.getLineCode()), null, delPublishTrainingByMapId)); errorMsgList.addAll(generateTraining(simulation, lineCodeRuleMap.get(mapInfo.getLineCode()), null, delPublishTrainingByMapId));
} else { } else {

View File

@ -110,7 +110,6 @@ public class Training2Rule {
if (name != null) { if (name != null) {
copyTraining2.setName(PropertyValueRule.resolveContentFormat(name, simulation, mapElement)); copyTraining2.setName(PropertyValueRule.resolveContentFormat(name, simulation, mapElement));
} }
copyTraining2.setOrgId(simulation.getProjectVO().getDefaultOrg());
if (locationRule != null) { if (locationRule != null) {
copyTraining2.setMapLocationJson(locationRule.doHandle(simulation, mapElement)); copyTraining2.setMapLocationJson(locationRule.doHandle(simulation, mapElement));
} }