标签创建移除旧版本部分代码

This commit is contained in:
670788339
2025-11-14 09:59:27 +08:00
parent f4d5dd03df
commit d30853db33
3 changed files with 18 additions and 4 deletions

View File

@@ -422,10 +422,21 @@ public class CourseAuditApi extends ApiBaseController{
dto.getCourse().setEnabled(true);//设置启用状态问题
dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态
try {
log.info("-------- 标签相关开始 ------- 课程ID = {} " , dto.getCourse().getId());
log.info("------课程提审-- 标签相关开始 ------- 课程ID = {} " , dto.getCourse().getId());
Course oldCourse = StringUtils.isBlank(dto.getCourse().getId()) ? null : courseService.get(dto.getCourse().getId());
if(oldCourse!=null && StringUtils.isNotEmpty(oldCourse.getTags())){
String[] tagArray = oldCourse.getTags().split(",");
// 检查每个元素是否为纯数字
for (String tag : tagArray) {
if (!tag.matches("\\d+")) { // 使用正则表达式检查是否为纯数字
log.info("-------- 不是纯数字 ------- tag = {} " , tag);
oldCourse.setTags(null); // 兼容
break;
}
}
}
tagService.updateTags(oldCourse,dto.getCourse(),cuser);
log.info("-------- 标签相关结束 -------");
log.info("-----课程提审--- 标签相关结束 -------");
courseService.submitAndPublish(dto,cuser.getAccountId(),cuser.getName());
log.info("---------------在线课开始同步到讲师管理 ------- token = " + token);

View File

@@ -286,16 +286,19 @@ public class CourseManageApi extends ApiBaseController{
log.info("-------- 标签相关开始 ------- 课程ID = {} " , dto.getCourse().getId());
CurrentUser userInfo = getCurrent();
Course oldCourse = StringUtils.isBlank(dto.getCourse().getId()) ? null : courseService.get(dto.getCourse().getId());
log.info("-------- 标签相关 ------- oldtags = {} " , oldCourse.getTags());
if(oldCourse!=null && StringUtils.isNotEmpty(oldCourse.getTags())){
String[] tagArray = oldCourse.getTags().split(",");
// 检查每个元素是否为纯数字
for (String tag : tagArray) {
if (!tag.matches("\\d+")) { // 使用正则表达式检查是否为纯数字
log.info("-------- 不是纯数字 ------- tag = {} " , tag);
oldCourse.setTags(null); // 兼容
break;
}
}
}
log.info("-------- 标签相关 updateTags ------- oldtags = {} " , oldCourse.getTags());
tagService.updateTags(oldCourse,dto.getCourse(),userInfo);
log.info("-------- 标签相关结束 -------");

View File

@@ -997,7 +997,7 @@ public class CourseServiceImpl implements ICourseService {
if (c.getVisible() == null) {
c.setVisible(true);
}
if (c.getTags() != null && !c.getTags().isEmpty()){
/*if (c.getTags() != null && !c.getTags().isEmpty()){
CourseTagRelationDto courseTagRelationDto = new CourseTagRelationDto();
courseTagRelationDto.setCourseId(c.getId());
courseTagRelationDto.setSysType1(c.getSysType1());
@@ -1011,7 +1011,7 @@ public class CourseServiceImpl implements ICourseService {
courseTagService.createTag(courseTagRelationDto);
}
}
}
}*/
courseDao.update(c);
c.setSysVersion(courseDao.getVersion(c.getId()));
full.getCourse().setSysVersion(c.getSysVersion());