|
@@ -8,7 +8,6 @@ import api.common.pojo.param.scene.SceneImportParam;
|
|
|
import api.common.pojo.param.scene.SceneNaturalNewParam;
|
|
|
import api.common.pojo.param.scene.SceneNaturalParam;
|
|
|
import api.common.pojo.po.scene.SceneNaturalPO;
|
|
|
-import api.common.pojo.po.scene.ScenePackageSublistPO;
|
|
|
import api.common.pojo.po.system.SceneImportPO;
|
|
|
import api.common.util.ObjectUtil;
|
|
|
import api.common.util.ParamUtil;
|
|
@@ -16,11 +15,7 @@ import api.common.util.TimeUtil;
|
|
|
import com.css.simulation.resource.common.utils.AuthUtil;
|
|
|
import com.css.simulation.resource.feign.FileDownService;
|
|
|
import com.css.simulation.resource.log.service.LogService;
|
|
|
-import com.css.simulation.resource.scene.mapper.SceneNaturalMapper;
|
|
|
-import com.css.simulation.resource.scene.mapper.ScenePackageMapper;
|
|
|
-import com.css.simulation.resource.scene.mapper.ScenePackageSublistMapper;
|
|
|
-import com.css.simulation.resource.scene.mapper.SystemScenePackageMapper;
|
|
|
-import com.css.simulation.resource.system.service.DictService;
|
|
|
+import com.css.simulation.resource.scene.mapper.*;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
@@ -31,7 +26,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
@@ -46,12 +40,13 @@ public class SceneNaturalService {
|
|
|
private ScenePackageMapper scenePackageMapper;
|
|
|
@Resource
|
|
|
private SystemScenePackageMapper systemScenePackageMapper;
|
|
|
+ @Resource
|
|
|
+ private SystemScenePackageSublistMapper systemScenePackageSublistMapper;
|
|
|
+
|
|
|
@Resource
|
|
|
private LogService logService;
|
|
|
@Resource
|
|
|
private FileDownService fileDownService;
|
|
|
- @Resource
|
|
|
- private DictService dictService;
|
|
|
|
|
|
/**
|
|
|
* 获取自然驾驶场景数据:包括切分数据和标注数据
|
|
@@ -440,29 +435,20 @@ public class SceneNaturalService {
|
|
|
public void deleteSceneNatural(SceneNaturalPO params) {
|
|
|
|
|
|
//1 获取参数
|
|
|
- String sceneId = params.getNaturalId(); // 场景id
|
|
|
String sceneName = params.getNaturalName(); // 场景名称
|
|
|
- //2 根据场景id查询所有指标id和场景测试包id
|
|
|
- List<ScenePackageSublistPO> scenePackageSublistPOS = scenePackageSublistMapper.selectIdByNaturalId(sceneId);
|
|
|
- List<String> sceneIdList = scenePackageSublistPOS.stream().map(ScenePackageSublistPO::getId).collect(Collectors.toList());
|
|
|
- Set<String> sceneTestPackageIdSet = scenePackageSublistPOS.stream().map(ScenePackageSublistPO::getRootId).collect(Collectors.toSet());
|
|
|
- //3 删除场景测试包中的场景
|
|
|
- for (String sceneIdTemp : sceneIdList) {
|
|
|
- scenePackageSublistMapper.updateSceneNaturalIdsBySceneId(sceneIdTemp);
|
|
|
- }
|
|
|
- //4 修改场景测试包状态为已禁用
|
|
|
-
|
|
|
-
|
|
|
- //4 根据参数名称查询场景包所有 id
|
|
|
- //5 删除场景包中的场景兵修改场景数量
|
|
|
-
|
|
|
-
|
|
|
- params.setIsDeleted("1");
|
|
|
- params.setModifyTime(TimeUtil.getNowForMysql());
|
|
|
- params.setModifyUserId(AuthUtil.getCurrentUserId());
|
|
|
- sceneNaturalMapper.deleteSceneNatural(params);
|
|
|
-
|
|
|
- // 日志
|
|
|
+ //2 根据场景名称查询出同名的所有场景id,包括公有和私有
|
|
|
+ List<String> sceneIdList = sceneNaturalMapper.selectIdByName(sceneName);
|
|
|
+ for (String sceneId : sceneIdList) {
|
|
|
+ //3 将所有场景测试包指标中的该场景删除
|
|
|
+// scenePackageSublistMapper.updateSceneNaturalIdsBySceneId()
|
|
|
+ //4 将所有包含该场景的场景测试包状态为已禁用
|
|
|
+ scenePackageMapper.updateIsUnavailableByPackageId("1", sceneId);
|
|
|
+ }
|
|
|
+ //5 将所有场景包中的该场景删除
|
|
|
+ systemScenePackageSublistMapper.deleteBySceneName(sceneName);
|
|
|
+ //6 删除所有同名场景(包括公有和私有)
|
|
|
+ sceneNaturalMapper.deleteByName(sceneName);
|
|
|
+ //7 记录日志
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("sceneId", params.getNaturalId());
|
|
|
map.put("sceneName", params.getNaturalName());
|