修改删除接口
This commit is contained in:
parent
37a8d34467
commit
3bce0390c0
|
|
@ -204,6 +204,17 @@ public class TaskPlanServiceImpl implements ITaskPlanService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteTaskPlan(Long planId) {
|
public boolean deleteTaskPlan(Long planId) {
|
||||||
|
// 先获取该计划下的所有任务
|
||||||
|
List<Task> tasks = taskDomain.getTaskByPlanId(planId);
|
||||||
|
|
||||||
|
// 删除所有状态为待执行的任务
|
||||||
|
for (Task task : tasks) {
|
||||||
|
if (task.getStatus() == StatusEnum.PENDING) {
|
||||||
|
taskDomain.deleteTask(task.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最后删除任务计划
|
||||||
return taskPlanDomain.deleteTaskPlan(planId);
|
return taskPlanDomain.deleteTaskPlan(planId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue