|
@@ -4,10 +4,12 @@ import api.common.pojo.common.ResponseBodyVO;
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
import api.common.pojo.constants.LogConstants;
|
|
|
import api.common.pojo.param.MinioParameter;
|
|
|
+import api.common.pojo.param.scene.SceneDeleteParam;
|
|
|
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.ScenePackagePO;
|
|
|
import api.common.pojo.po.system.SceneImportPO;
|
|
|
import api.common.util.ObjectUtil;
|
|
|
import api.common.util.ParamUtil;
|
|
@@ -218,48 +220,6 @@ public class SceneNaturalService {
|
|
|
String[][] selfBehavior = params.getSelfBehavior();//自车行为
|
|
|
String[][] targetBehavior = params.getTargetBehavior(); //目标行为
|
|
|
//判断下拉选项是否为空
|
|
|
- /* if(ObjectUtil.isNotNull(naturalName)||(naturalEnvironment!=null&&naturalEnvironment.length>0)||(road!=null&&road.length>0)
|
|
|
- ||(infrastructure!=null&&infrastructure.length>0)||(temporaryOperation!=null&&temporaryOperation.length>0)||(trafficCondition!=null&&trafficCondition.length>0)||
|
|
|
- (selfBehavior!=null&&selfBehavior.length>0)||(targetBehavior!=null&&targetBehavior.length>0)||(params.getIds()!=null&¶ms.getIds().length>0)){
|
|
|
- po.setXlk("1");
|
|
|
- }*/
|
|
|
- /* SceneNaturalParam poBq = new SceneNaturalParam();
|
|
|
- String[][] highSpeed=params.getHighSpeed() ;//高速
|
|
|
- String[][] ramp=params.getRamp();//匝道
|
|
|
- String[][] tunnel=params.getTunnel();//隧道
|
|
|
- String[][] cutIn=params.getCutIn();//切入
|
|
|
- String[][] cutOut=params.getCutOut();//切出
|
|
|
- String[][] laneChange=params.getLaneChange();//变道
|
|
|
- String[][] turnAround=params.getTurnAround();//掉头
|
|
|
- //判断标签是否为空
|
|
|
- if((highSpeed!=null&&highSpeed.length>0)||(ramp!=null&&ramp.length>0)
|
|
|
- ||(tunnel!=null&&tunnel.length>0)||(cutIn!=null&&cutIn.length>0)||(cutOut!=null&&cutOut.length>0)||
|
|
|
- (laneChange!=null&&laneChange.length>0)||(turnAround!=null&&turnAround.length>0)){
|
|
|
- po.setBq("1");
|
|
|
- }
|
|
|
-
|
|
|
- if (highSpeed != null && highSpeed.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(highSpeed, poBq);
|
|
|
- }
|
|
|
- if (ramp != null && ramp.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(ramp, poBq);
|
|
|
- }
|
|
|
- if (tunnel != null && tunnel.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(tunnel, poBq);
|
|
|
- }
|
|
|
- if (cutIn != null && cutIn.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(cutIn, poBq);
|
|
|
- }
|
|
|
- if (cutOut != null && cutOut.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(cutOut, poBq);
|
|
|
- } if (turnAround != null && turnAround.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(turnAround, poBq);
|
|
|
- }
|
|
|
- if (laneChange != null && laneChange.length > 0) {
|
|
|
- ParamUtil.arrConvertObj(laneChange, poBq);
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
if (ObjectUtil.isNotNull(params.getIds())) {
|
|
|
po.setIds(params.getIds());
|
|
|
}
|
|
@@ -306,43 +266,16 @@ public class SceneNaturalService {
|
|
|
}
|
|
|
|
|
|
//获取权限并赋值
|
|
|
- /* List<String> listType= systemUserSceneService.querySystemUserSceneByType(DictConstants.SCENE_NATURAL);
|
|
|
- if(listType!=null&&listType.size()>0){
|
|
|
- po.setAllIds(listType);
|
|
|
- }else{
|
|
|
- List<String> listA=new ArrayList<>();
|
|
|
- listA.add("没有权限");
|
|
|
- po.setAllIds(listA);
|
|
|
- }*/
|
|
|
- /* Map<String,SceneNaturalParam> map=new HashMap<String,SceneNaturalParam>();
|
|
|
- map.put("po",po);
|
|
|
- map.put("poBq",poBq);*/
|
|
|
- //List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(po);
|
|
|
- //只有标签,或下拉框,或者两者都为空
|
|
|
List<SceneNaturalPO> list = new ArrayList<>();
|
|
|
- /* if((po.getXlk().equals("0")&&po.getBq().equals("0"))||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
|
|
|
- list = sceneNaturalMapper.querySceneNaturalList(po);
|
|
|
- }else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBq(map);
|
|
|
- }else{
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndXlk(map);
|
|
|
- }*/
|
|
|
|
|
|
//添加权限
|
|
|
String roleCode = AuthUtil.getCurrentUserRoleCode();
|
|
|
String userId = AuthUtil.getCurrentUserId();
|
|
|
if (DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)) { //管理员账户
|
|
|
-/*
|
|
|
- if((po.getXlk().equals("0")&&po.getBq().equals("0"))||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
|
|
|
-*/
|
|
|
+
|
|
|
list = sceneNaturalMapper.querySceneNaturalList(po);
|
|
|
System.out.println(" //添加权限------" + list.size() + "------" + po);
|
|
|
- /*}else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBq(map);
|
|
|
- }else{
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndXlk(map);
|
|
|
- }
|
|
|
-*/
|
|
|
+
|
|
|
} else if (DictConstants.ROLE_CODE_SUBUESR.equals(roleCode)) {
|
|
|
//查询父账户
|
|
|
userId = AuthUtil.getCreateUserId();
|
|
@@ -354,29 +287,16 @@ public class SceneNaturalService {
|
|
|
} else {
|
|
|
list = sceneNaturalMapper.querySceneNaturalListByQx(po);
|
|
|
}
|
|
|
- /* }else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndQx(map);
|
|
|
- }else{
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndXlkAndQx(map);
|
|
|
- }
|
|
|
-*/
|
|
|
+
|
|
|
} else if (DictConstants.ROLE_CODE_UESR.equals(roleCode)) {
|
|
|
//查询普通账户
|
|
|
po.setUserId(userId);
|
|
|
- // poBq.setUserId(userId);
|
|
|
- // if((po.getXlk().equals("0")&&po.getBq().equals("0"))||(po.getXlk().equals("1")&&po.getBq().equals("0"))){
|
|
|
if (po.getShare().equals("0")) {
|
|
|
list = sceneNaturalMapper.querySceneNaturalList(po);
|
|
|
} else {
|
|
|
list = sceneNaturalMapper.querySceneNaturalListByQx(po);
|
|
|
- } /* }else if((po.getXlk().equals("0")&&po.getBq().equals("1"))) {
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndQx(map);
|
|
|
- }else{
|
|
|
- list = sceneNaturalMapper.querySceneNaturalListByBqAndXlkAndQx(map);
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
- //list = sceneNaturalMapper.querySceneNaturalListByBq(map);
|
|
|
- //List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(map);
|
|
|
for (SceneNaturalPO vo : list) {
|
|
|
if (vo.getRoadType().equals("高速")) {
|
|
|
if (ObjectUtil.isNull(vo.getLabel())) {
|
|
@@ -433,21 +353,24 @@ public class SceneNaturalService {
|
|
|
|
|
|
@SneakyThrows
|
|
|
public void deleteSceneNatural(SceneNaturalPO params) {
|
|
|
-
|
|
|
//1 获取参数
|
|
|
String sceneName = params.getNaturalName(); // 场景名称
|
|
|
//2 根据场景名称查询出同名的所有场景id,包括公有和私有
|
|
|
List<String> sceneIdList = sceneNaturalMapper.selectIdByName(sceneName);
|
|
|
for (String sceneId : sceneIdList) {
|
|
|
//3 将所有场景测试包指标中的该场景删除
|
|
|
-// scenePackageSublistMapper.updateSceneNaturalIdsBySceneId()
|
|
|
+ SceneDeleteParam param = new SceneDeleteParam();
|
|
|
+ param.setModifyTime(TimeUtil.getNowForMysql());
|
|
|
+ param.setSceneZrId(sceneId);
|
|
|
+ param.setModifyUserId(AuthUtil.getCurrentUserId());
|
|
|
+ scenePackageSublistMapper.updateScenePackageSublistById(param);
|
|
|
//4 将所有包含该场景的场景测试包状态为已禁用
|
|
|
scenePackageMapper.updateIsUnavailableByPackageId("1", sceneId);
|
|
|
}
|
|
|
//5 将所有场景包中的该场景删除
|
|
|
systemScenePackageSublistMapper.deleteBySceneName(sceneName);
|
|
|
//6 删除所有同名场景(包括公有和私有)
|
|
|
-// sceneNaturalMapper.deleteByName(sceneName);
|
|
|
+ sceneNaturalMapper.deleteByName(sceneName, AuthUtil.getCreateUserId());
|
|
|
//7 记录日志
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("sceneId", params.getNaturalId());
|