|
|
@ -30,6 +30,14 @@ public class PathServiceImpl extends ServiceImpl<PathMapper, Path> implements Pa |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean plan(int taskId, List<Path> pathList) { |
|
|
|
// 首先查询是否就是自定义路径,做修改操作 |
|
|
|
QueryWrapper<Path> pathQueryWrapper = new QueryWrapper<>(); |
|
|
|
pathQueryWrapper.eq("task_id", taskId); |
|
|
|
List<Path> list = this.list(pathQueryWrapper); |
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
// 有plan则删除 |
|
|
|
this.remove(pathQueryWrapper); |
|
|
|
} |
|
|
|
// 更改task表中的order为2 |
|
|
|
UpdateWrapper<Task> taskUpdateWrapper = new UpdateWrapper<>(); |
|
|
|
taskUpdateWrapper.eq("id", taskId); |
|
|
@ -37,13 +45,15 @@ public class PathServiceImpl extends ServiceImpl<PathMapper, Path> implements Pa |
|
|
|
.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); |
|
|
|
// // 删除已经上传的config |
|
|
|
// QueryWrapper<NuclearCoreConfig> nuclearCoreConfigQueryWrapper = new QueryWrapper<>(); |
|
|
|
// nuclearCoreConfigQueryWrapper.eq("task_id", taskId); |
|
|
|
// boolean remove = nuclearCoreConfigService.remove(nuclearCoreConfigQueryWrapper); |
|
|
|
// 保存自定义路径 |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
for(Path path : pathList) { |
|
|
|
path.setTaskId(taskId); |
|
|
|
} |
|
|
|
boolean b = this.saveBatch(pathList); |
|
|
|
return updateResult && b; |
|
|
|
} |
|
|
|
} |