|
@@ -8,6 +8,7 @@ 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,6 +17,8 @@ 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.fasterxml.jackson.databind.JsonNode;
|
|
@@ -24,11 +27,11 @@ import com.github.pagehelper.util.StringUtil;
|
|
|
import feign.Response;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
@@ -38,14 +41,17 @@ public class SceneNaturalService {
|
|
|
@Resource
|
|
|
private SceneNaturalMapper sceneNaturalMapper;
|
|
|
@Resource
|
|
|
+ private ScenePackageSublistMapper scenePackageSublistMapper;
|
|
|
+ @Resource
|
|
|
+ private ScenePackageMapper scenePackageMapper;
|
|
|
+ @Resource
|
|
|
private SystemScenePackageMapper systemScenePackageMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- LogService logService;
|
|
|
+ @Resource
|
|
|
+ private LogService logService;
|
|
|
@Resource
|
|
|
private FileDownService fileDownService;
|
|
|
- @Autowired
|
|
|
- DictService dictService;
|
|
|
+ @Resource
|
|
|
+ private DictService dictService;
|
|
|
|
|
|
/**
|
|
|
* 获取自然驾驶场景数据:包括切分数据和标注数据
|
|
@@ -430,11 +436,33 @@ public class SceneNaturalService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
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);
|
|
|
+
|
|
|
+ // 日志
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("sceneId", params.getNaturalId());
|
|
|
map.put("sceneName", params.getNaturalName());
|