|
@@ -117,43 +117,43 @@ public class SceneImportService {
|
|
|
String sceneType = sceneImportPO.getSceneType();
|
|
|
//获取场景id的list集合
|
|
|
String sceneNames = sceneImportPO.getSceneNames();
|
|
|
- if(ObjectUtil.isNull(sceneNames)){
|
|
|
+ if (ObjectUtil.isNull(sceneNames)) {
|
|
|
sceneImportMapper.deleteImportTask(sceneImportPO);
|
|
|
- }else{
|
|
|
- String[] listIds = sceneNames.split(",");
|
|
|
- //2 根据任务id删除相关联的所有同名任务
|
|
|
- if (DictConstants.SCENE_NATURAL.equals(sceneType)) {
|
|
|
- sceneImportMapper.deleteNaturalByTaskId(sceneImportPO);
|
|
|
- SceneNaturalPO sceneNaturalPO = new SceneNaturalPO();
|
|
|
- for (String id : listIds) {
|
|
|
- sceneNaturalPO.setNaturalName(id);
|
|
|
- sceneNaturalService.deleteSceneNatural(sceneNaturalPO);
|
|
|
- }
|
|
|
- } else if (DictConstants.SCENE_STANDARD.equals(sceneType)) {
|
|
|
- sceneImportMapper.deleteStandardsByTaskId(sceneImportPO);
|
|
|
- StandardsRegulationsPO standardsRegulationsPO = new StandardsRegulationsPO();
|
|
|
- for (String id : listIds) {
|
|
|
- standardsRegulationsPO.setSceneName(id);
|
|
|
- standardsRegulationsService.deleteStandardsRegulations(standardsRegulationsPO);
|
|
|
- }
|
|
|
- } else if (DictConstants.SCENE_ACCIDENT.equals(sceneType)) {
|
|
|
- sceneImportMapper.deleteAccidentByTaskId(sceneImportPO);
|
|
|
- SceneAccidentPO sceneAccidentPO = new SceneAccidentPO();
|
|
|
- for (String id : listIds) {
|
|
|
- sceneAccidentPO.setSceneName(id);
|
|
|
- sceneAccidentService.deleteSceneAccidentList(sceneAccidentPO);
|
|
|
- }
|
|
|
- } else if (DictConstants.SCENE_GENERAL.equals(sceneType)) {
|
|
|
+ } else {
|
|
|
+ String[] listIds = sceneNames.split(",");
|
|
|
+ //2 根据任务id删除相关联的所有同名任务
|
|
|
+ if (DictConstants.SCENE_NATURAL.equals(sceneType)) {
|
|
|
+ sceneImportMapper.deleteNaturalByTaskId(sceneImportPO);
|
|
|
+ SceneNaturalPO sceneNaturalPO = new SceneNaturalPO();
|
|
|
+ for (String id : listIds) {
|
|
|
+ sceneNaturalPO.setNaturalName(id);
|
|
|
+ sceneNaturalService.deleteSceneNatural(sceneNaturalPO);
|
|
|
+ }
|
|
|
+ } else if (DictConstants.SCENE_STANDARD.equals(sceneType)) {
|
|
|
+ sceneImportMapper.deleteStandardsByTaskId(sceneImportPO);
|
|
|
+ StandardsRegulationsPO standardsRegulationsPO = new StandardsRegulationsPO();
|
|
|
+ for (String id : listIds) {
|
|
|
+ standardsRegulationsPO.setSceneName(id);
|
|
|
+ standardsRegulationsService.deleteStandardsRegulations(standardsRegulationsPO);
|
|
|
+ }
|
|
|
+ } else if (DictConstants.SCENE_ACCIDENT.equals(sceneType)) {
|
|
|
+ sceneImportMapper.deleteAccidentByTaskId(sceneImportPO);
|
|
|
+ SceneAccidentPO sceneAccidentPO = new SceneAccidentPO();
|
|
|
+ for (String id : listIds) {
|
|
|
+ sceneAccidentPO.setSceneName(id);
|
|
|
+ sceneAccidentService.deleteSceneAccidentList(sceneAccidentPO);
|
|
|
+ }
|
|
|
+ } else if (DictConstants.SCENE_GENERAL.equals(sceneType)) {
|
|
|
// sceneImportMapper.deleteNaturalByTaskId(sceneImportPO);
|
|
|
- sceneImportMapper.deleteImportTask(sceneImportPO);
|
|
|
- SceneGeneralTemplatePO po = new SceneGeneralTemplatePO();
|
|
|
- for (String id : listIds) {
|
|
|
- po.setSceneId(id);
|
|
|
- sceneGeneralTemplateService.deleteSceneGeneralTemplateById(po);
|
|
|
+ sceneImportMapper.deleteImportTask(sceneImportPO);
|
|
|
+ SceneGeneralTemplatePO po = new SceneGeneralTemplatePO();
|
|
|
+ for (String id : listIds) {
|
|
|
+ po.setSceneId(id);
|
|
|
+ sceneGeneralTemplateService.deleteSceneGeneralTemplateById(po);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("场景类型错误:" + sceneType);
|
|
|
}
|
|
|
- } else {
|
|
|
- throw new RuntimeException("场景类型错误:" + sceneType);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|