在线版本

This commit is contained in:
670788339
2025-11-14 14:41:10 +08:00
parent d30853db33
commit 5848f431a4
2 changed files with 10 additions and 1 deletions

View File

@@ -1012,6 +1012,15 @@ public class CourseServiceImpl implements ICourseService {
} }
} }
}*/ }*/
if (!nowCourse.getSysVersion().equals(c.getSysVersion())) {
log.warn("乐观锁冲突 - 课程ID: {}, 期望版本: {}, 实际版本: {}",
c.getId(), c.getSysVersion(), nowCourse.getSysVersion());
// throw new RuntimeException("数据已被其他用户修改,请刷新页面后重试");
// 基本无概率同时修改同一课程 如有 以最后提交为准
c.setSysVersion(courseDao.getVersion(c.getId()));
}
courseDao.update(c); courseDao.update(c);
c.setSysVersion(courseDao.getVersion(c.getId())); c.setSysVersion(courseDao.getVersion(c.getId()));
full.getCourse().setSysVersion(c.getSysVersion()); full.getCourse().setSysVersion(c.getSysVersion());

View File

@@ -414,7 +414,7 @@ public class CourseTagServiceImpl implements ICourseTagService {
List<String> newTagIds = getTagIdsFromCourse(newCourse); List<String> newTagIds = getTagIdsFromCourse(newCourse);
log.info(" --- 旧标签 oldTagIds = {} " , oldTagIds); log.info(" --- 旧标签 oldTagIds = {} " , oldTagIds);
log.info(" --- 新修改 newTagIds = {} " , newTagIds); log.info(" --- 新修改 newTagIds = {} " , newTagIds);
if (oldCourse == null) { if (oldCourse == null || oldTagIds.isEmpty()) {
// 新增课程 - 处理所有新标签 // 新增课程 - 处理所有新标签
handleNewCourseTags(newCourse, newTagIds, userInfo); handleNewCourseTags(newCourse, newTagIds, userInfo);
} else { } else {