第一次修改

master
小萌新 4 months ago
parent ee50cd8316
commit 0855a4ca66
  1. 5
      src/main/java/com/teaching/backend/service/impl/chapter/ChapterServiceImpl.java

@ -194,19 +194,18 @@ public class ChapterServiceImpl extends ServiceImpl<ChapterMapper, Chapter> impl
} catch (Exception e) {
throw new RuntimeException("复制数据出错", e);
}
System.out.println(chapter);
String pid = chapter.getPid();
if (pid == null || pid.isEmpty()) {
System.out.println("这是新增的一个父节点");
chapter.setCreateTime(LocalDateTime.now());
chapter.setUpdateTime(LocalDateTime.now());
this.save(chapter);
} else {
System.out.println("这是新增的一个子节点");
Chapter parentChapter = this.getById(pid);
if (parentChapter != null) {

Loading…
Cancel
Save