|
|
@ -1,12 +1,17 @@ |
|
|
|
package com.iflytop.nuclear.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.iflytop.nuclear.mapper.PathMapper; |
|
|
|
import com.iflytop.nuclear.mapper.TaskMapper; |
|
|
|
import com.iflytop.nuclear.model.NuclearCoreConfig; |
|
|
|
import com.iflytop.nuclear.model.Path; |
|
|
|
import com.iflytop.nuclear.model.Task; |
|
|
|
import com.iflytop.nuclear.service.NuclearCoreConfigService; |
|
|
|
import com.iflytop.nuclear.service.PathService; |
|
|
|
import com.iflytop.nuclear.service.TaskService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
@ -17,8 +22,28 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class PathServiceImpl extends ServiceImpl<PathMapper, Path> implements PathService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
TaskService taskService; |
|
|
|
@Autowired |
|
|
|
NuclearCoreConfigService nuclearCoreConfigService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean plan(List<Path> pathList) { |
|
|
|
public boolean plan(int taskId, List<Path> pathList) { |
|
|
|
// 更改task表中的order为2 |
|
|
|
UpdateWrapper<Task> taskUpdateWrapper = new UpdateWrapper<>(); |
|
|
|
taskUpdateWrapper.eq("id", taskId); |
|
|
|
Task task = Task.builder() |
|
|
|
.checkOrder(2) |
|
|
|
.build(); |
|
|
|
boolean updateResult = taskService.update(task, taskUpdateWrapper); |
|
|
|
// 删除已经上传的config |
|
|
|
QueryWrapper<NuclearCoreConfig> nuclearCoreConfigQueryWrapper = new QueryWrapper<>(); |
|
|
|
nuclearCoreConfigQueryWrapper.eq("task_id", taskId); |
|
|
|
boolean remove = nuclearCoreConfigService.remove(nuclearCoreConfigQueryWrapper); |
|
|
|
// 保存自定义路径 |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |