Browse Source

自定义路径规划

main
maochaoying 2 years ago
parent
commit
ae9f019021
  1. 6
      src/main/java/com/iflytop/nuclear/model/Path.java
  2. 24
      src/main/java/com/iflytop/nuclear/service/impl/PathServiceImpl.java
  3. BIN
      uploadfiles/xlsx/20230707/堆芯模版-24.xlsx

6
src/main/java/com/iflytop/nuclear/model/Path.java

@ -27,6 +27,8 @@ public class Path {
@TableField("task_id") @TableField("task_id")
private int taskId; private int taskId;
@TableField("order")
private int order;
@TableField("order_number")
private int orderNumber;
private int number;
} }

24
src/main/java/com/iflytop/nuclear/service/impl/PathServiceImpl.java

@ -30,6 +30,14 @@ public class PathServiceImpl extends ServiceImpl<PathMapper, Path> implements Pa
@Override @Override
public boolean plan(int taskId, List<Path> pathList) { 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 // 更改task表中的order为2
UpdateWrapper<Task> taskUpdateWrapper = new UpdateWrapper<>(); UpdateWrapper<Task> taskUpdateWrapper = new UpdateWrapper<>();
taskUpdateWrapper.eq("id", taskId); taskUpdateWrapper.eq("id", taskId);
@ -37,13 +45,15 @@ public class PathServiceImpl extends ServiceImpl<PathMapper, Path> implements Pa
.checkOrder(2) .checkOrder(2)
.build(); .build();
boolean updateResult = taskService.update(task, taskUpdateWrapper); 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;
} }
} }

BIN
uploadfiles/xlsx/20230707/堆芯模版-24.xlsx

Loading…
Cancel
Save