Commit c7ffd697 authored by 黎博's avatar 黎博

关闭项目时,将对应的项目部署状态也改成0

parent 3523c7d6
...@@ -312,6 +312,18 @@ public class PipelineController { ...@@ -312,6 +312,18 @@ public class PipelineController {
if (!dingRobotService.updateById(dingRobot)) { if (!dingRobotService.updateById(dingRobot)) {
return JsonResult.buildErrorStateResult("更新状态失败!", false); return JsonResult.buildErrorStateResult("更新状态失败!", false);
} }
// 同时将pipline里的项目置为不可用
if (status == 2) {
QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>();
pipelineQueryWrapper.eq("ding_robot_id", dingRobotId);
List<Pipeline> pipelineList = pipelineService.list(pipelineQueryWrapper);
if (pipelineList.size() > 0) {
for (Pipeline pipeline: pipelineList) {
pipeline.setEnable(0);
pipelineService.updateById(pipeline);
}
}
}
return JsonResult.buildSuccessResult("更新状态成功!", true); return JsonResult.buildSuccessResult("更新状态成功!", true);
} catch (Exception e) { } catch (Exception e) {
return JsonResult.buildErrorStateResult("更新状态失败!", false); return JsonResult.buildErrorStateResult("更新状态失败!", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment