|
@@ -557,7 +557,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
if (vehicleBaseInfoVo != null) {
|
|
|
projectDetailsVo.setVehicleName(vehicleBaseInfoVo.getVehicleName());
|
|
|
projectDetailsVo.setVehicleDescribe(vehicleBaseInfoVo.getDescription());
|
|
|
- projectDetailsVo.setVehicleTopView(vehicleBaseInfoVo.getVehicleTopView());
|
|
|
+ projectDetailsVo.setVehicleTopView(vehicleBaseInfoVo.getVehicleFrontView());
|
|
|
|
|
|
}
|
|
|
projectDetailsVo.setSensorCameraList(sensorCameraList);
|
|
@@ -3698,7 +3698,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO updateAutomaticRunState(SimulationManualProjectParam param) {
|
|
|
+ public ResponseBodyVO<String> updateAutomaticRunState(SimulationManualProjectParam param) {
|
|
|
String id = param.getId();
|
|
|
String automaticRunState = param.getAutomaticRunState();
|
|
|
Optional.ofNullable(id).orElseThrow(() -> new RuntimeException("id 不能为空。"));
|
|
@@ -3712,31 +3712,30 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//1 判断算法是否已经被删除
|
|
|
String isDeleted = algorithmMapper.selectIsDeletedById(algorithmId);
|
|
|
if (DictConstants.IS_DELETED.equals(isDeleted)) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "算法已被删除,无法启动项目。", null);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "算法已被删除,无法启动项目。", null);
|
|
|
}
|
|
|
- //检查算法版本
|
|
|
- //获取数据库中的算法版本
|
|
|
- AlgorithmPO aPo = algorithmMapper.selectDetailsById(algorithmId);
|
|
|
- String gitVersion = aPo.getGitVersion();
|
|
|
- //获取当前算法版本
|
|
|
+// //获取数据库中的算法版本
|
|
|
+// AlgorithmPO aPo = algorithmMapper.selectDetailsById(algorithmId);
|
|
|
+// String gitVersion = aPo.getGitVersion();
|
|
|
+// //获取当前算法版本
|
|
|
String currentGitVersion = algorithmService.getGitVersion(algorithmId);
|
|
|
- boolean isRun = false; //判断是否启动运行
|
|
|
- //首次获取版本
|
|
|
- if (StringUtil.isEmpty(gitVersion)) {
|
|
|
- isRun = true;
|
|
|
- } else {
|
|
|
- //非首次,比对版本,校验是否执行任务
|
|
|
- if (!gitVersion.equals(currentGitVersion)) {
|
|
|
- isRun = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (isRun) { //启动运行
|
|
|
- simulationAutomaticProjectMapper.updateAutomaticRunState(param);
|
|
|
- AlgorithmParameter algorithmParam = new AlgorithmParameter();
|
|
|
- algorithmParam.setId(algorithmId);
|
|
|
- algorithmParam.setGitVersion(currentGitVersion);
|
|
|
- runProject(algorithmParam, param, po);
|
|
|
- }
|
|
|
+// boolean isRun = false; //判断是否启动运行
|
|
|
+// //首次获取版本
|
|
|
+// if (StringUtil.isEmpty(gitVersion)) {
|
|
|
+// isRun = true;
|
|
|
+// } else {
|
|
|
+// //非首次,比对版本,校验是否执行任务
|
|
|
+// if (!gitVersion.equals(currentGitVersion)) {
|
|
|
+// isRun = true;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (isRun) { //启动运行
|
|
|
+ simulationAutomaticProjectMapper.updateAutomaticRunState(param);
|
|
|
+ AlgorithmParameter algorithmParam = new AlgorithmParameter();
|
|
|
+ algorithmParam.setId(algorithmId);
|
|
|
+ algorithmParam.setGitVersion(currentGitVersion);
|
|
|
+ runProject(algorithmParam, param, po);
|
|
|
+// }
|
|
|
} else if ("1".equals(param.getAutomaticRunState())) { // 停止
|
|
|
simulationAutomaticProjectMapper.updateAutomaticRunState(param);
|
|
|
//推送定时请求
|
|
@@ -3984,18 +3983,22 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectAutomaticProjectById(SimulationManualProjectParam param) {
|
|
|
+ public ResponseBodyVO<SimulationManualProjectSingleVo> selectAutomaticProjectById(SimulationManualProjectParam param) {
|
|
|
|
|
|
if (isEmpty(param.getId())) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "id不能为空");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "id不能为空");
|
|
|
}
|
|
|
SimulationAutomaticProjectPo po = simulationAutomaticProjectMapper.selectById(param.getId());
|
|
|
if (po == null) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ }
|
|
|
+ String deletedName = algorithmMapper.selectDeletedById(po.getAlgorithm());
|
|
|
+ if(StringUtil.isNotEmpty(deletedName)){
|
|
|
+ po.setAlgorithm(deletedName+"(已删除)");
|
|
|
}
|
|
|
SimulationManualProjectSingleVo vo = new SimulationManualProjectSingleVo();
|
|
|
convertPoToVo(po, vo);
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, vo);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, vo);
|
|
|
|
|
|
}
|
|
|
|