|
@@ -3708,8 +3708,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
simulationAutomaticProjectMapper.updateAutomaticRunState(param);
|
|
|
SimulationAutomaticProjectPo po = simulationAutomaticProjectMapper.selectById(id); // 查询父项目信息
|
|
|
String algorithmId = po.getAlgorithm();
|
|
|
- if ("0".equals(param.getAutomaticRunState())) {
|
|
|
- //启动
|
|
|
+ if ("0".equals(param.getAutomaticRunState())) { // 启动
|
|
|
+ //1 判断算法是否已经被删除
|
|
|
+ String isDeleted = algorithmMapper.selectIsDeletedById(algorithmId);
|
|
|
+ if (DictConstants.IS_DELETED.equals(isDeleted)) {
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "算法已被删除,无法启动项目。", null);
|
|
|
+ }
|
|
|
//检查算法版本
|
|
|
//获取数据库中的算法版本
|
|
|
AlgorithmPO aPo = algorithmMapper.selectDetailsById(algorithmId);
|
|
@@ -3732,8 +3736,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
algorithmParam.setGitVersion(currentGitVersion);
|
|
|
runProject(algorithmParam, param, po);
|
|
|
}
|
|
|
- } else if ("1".equals(param.getAutomaticRunState())) {
|
|
|
- //停止
|
|
|
+ } else if ("1".equals(param.getAutomaticRunState())) { // 停止
|
|
|
//推送定时请求
|
|
|
projectTaskStop(po);
|
|
|
}
|