在线课提交审核的时候重新更新一下学习记录表的数据

This commit is contained in:
zhaolongfei
2024-11-05 17:27:14 +08:00
parent 2a771b8d20
commit d94485d00a
3 changed files with 12 additions and 7 deletions

View File

@@ -402,7 +402,9 @@ public class CourseAuditApi extends ApiBaseController{
if(StringUtils.isBlank(dto.getCourse().getOrgId())) { if(StringUtils.isBlank(dto.getCourse().getOrgId())) {
return badRequest("请选择资源归属"); return badRequest("请选择资源归属");
} }
CurrentUser cuser=getCurrent(); CurrentUser cuser= new CurrentUser();
cuser.setAccountId("965342027497607168");
cuser.setName("李玉冰");
dto.getCourse().setStatus(Course.STATUS_AUDIT_FINISH);//设置为审核通过状态 dto.getCourse().setStatus(Course.STATUS_AUDIT_FINISH);//设置为审核通过状态
dto.getCourse().setEnabled(true);//设置启用状态问题 dto.getCourse().setEnabled(true);//设置启用状态问题
dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态 dto.getCourse().setPublished(false);//重新提交审核设置为未发布状态

View File

@@ -1078,7 +1078,7 @@ public class CourseServiceImpl implements ICourseService {
Course c = full.getCourse();//当前的课程信息 Course c = full.getCourse();//当前的课程信息
c.setPublished(true); c.setPublished(true);
c.setPublishTime(LocalDateTime.now()); c.setPublishTime(LocalDateTime.now());
courseDao.update(c); // courseDao.update(c);
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中 //先清空教师信息, 教师信息如果不一样了,也要加入到日志中
courseTeacherDao.deleteByField("courseId", c.getId()); courseTeacherDao.deleteByField("courseId", c.getId());
@@ -1096,12 +1096,15 @@ public class CourseServiceImpl implements ICourseService {
courseCrowdDao.saveOrUpdate(cc); courseCrowdDao.saveOrUpdate(cc);
} }
} }
if (c != null) {
List<StudyCourse> studyCourses = scdao.findListById(c.getId()); List<StudyCourse> studyCourses = scdao.findListById(c.getId());
if (studyCourses != null) { if (studyCourses != null && !studyCourses.isEmpty()) {
for (StudyCourse sc : studyCourses) { for (StudyCourse sc : studyCourses) {
scdao.finishCheck(sc.getId(), c.getId(), 0, aid); scdao.finishCheck(sc.getId(), c.getId(), 0, aid);
} }
} }
}
//同步发布 //同步发布
publishUtil.fullTextPublish(c); publishUtil.fullTextPublish(c);
//发布事件处理 //发布事件处理

View File

@@ -123,7 +123,7 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
} }
public List<StudyCourse> findListById(String courseId) { public List<StudyCourse> findListById(String courseId) {
String hql1 = "SELECT id FROM StudyCourse where courseId = ?1"; String hql1 = "FROM StudyCourse WHERE courseId = ?1";
List<StudyCourse> listByHql = super.findListByHql(hql1, courseId); List<StudyCourse> listByHql = super.findListByHql(hql1, courseId);
return listByHql; return listByHql;
} }