mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
课程审核增加三条记录的问题
This commit is contained in:
@@ -42,6 +42,7 @@ import com.xboe.module.course.entity.CourseTeacher;
|
||||
import com.xboe.module.course.entity.CourseUpdateLog;
|
||||
import com.xboe.module.course.service.ICourseContentService;
|
||||
import com.xboe.module.course.service.ICourseCrowdService;
|
||||
import com.xboe.module.course.service.ICourseHRBPAuditService;
|
||||
import com.xboe.module.course.service.ICourseSectionService;
|
||||
import com.xboe.module.course.service.ICourseService;
|
||||
import com.xboe.module.course.service.ICourseTeacherService;
|
||||
@@ -94,6 +95,9 @@ public class CourseManageApi extends ApiBaseController{
|
||||
@Resource
|
||||
private IUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ICourseHRBPAuditService hrbpAuditService;
|
||||
|
||||
/**
|
||||
* 管理列表的查询
|
||||
* @param pager
|
||||
@@ -430,12 +434,13 @@ public class CourseManageApi extends ApiBaseController{
|
||||
// }
|
||||
// }
|
||||
//检查课程内容的完整性
|
||||
|
||||
|
||||
//填充必要的信息
|
||||
//fillCourseData(dto.getCourse());
|
||||
|
||||
try {
|
||||
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(dto.getCourse().getId());
|
||||
if(hrbpAudit!=null) {
|
||||
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||
}
|
||||
if(!isLocalDevelopment()) {
|
||||
//转化用户id
|
||||
User u = userService.getByUserNo(dto.getAuditUser().getCode());
|
||||
@@ -468,7 +473,7 @@ public class CourseManageApi extends ApiBaseController{
|
||||
//邮件发送
|
||||
String email=dto.getAuditUser().getEmail();
|
||||
if(!isLocalDevelopment()) {
|
||||
//只是非高度模式下才可以发送
|
||||
//只是非开发模式下才可以发送
|
||||
service.sendMail(email,"课程审核提醒", htmlEmail,"数字化学习平台");
|
||||
}
|
||||
|
||||
@@ -536,6 +541,10 @@ public class CourseManageApi extends ApiBaseController{
|
||||
}
|
||||
|
||||
try {
|
||||
CourseHRBPAudit hrbpAudit = hrbpAuditService.hasAuditing(audit.getCourseId());
|
||||
if(hrbpAudit!=null) {
|
||||
return badRequest("此课程中已有审核,不能再提交审核,如修改请先撤回");
|
||||
}
|
||||
|
||||
if(!isLocalDevelopment()) {
|
||||
//转化用户id
|
||||
|
||||
@@ -22,6 +22,13 @@ public interface ICourseHRBPAuditService {
|
||||
* */
|
||||
//void audit(String id,Integer status,String remark);
|
||||
|
||||
/**
|
||||
* 检查课程是否已经在审核中了
|
||||
* @param courseId
|
||||
* @return
|
||||
*/
|
||||
CourseHRBPAudit hasAuditing(String courseId);
|
||||
|
||||
/**
|
||||
* 根据课程、id获取课程的审核记录
|
||||
* @param info 审核信息
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.core.orm.UpdateBuilder;
|
||||
import com.xboe.module.course.dao.CourseHRBPAuditDao;
|
||||
import com.xboe.module.course.dto.CourseHRBPAuditDto;
|
||||
import com.xboe.module.course.entity.Course;
|
||||
@@ -158,4 +157,11 @@ public class CourseHRBPAuditServiceImpl implements ICourseHRBPAuditService {
|
||||
return rs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CourseHRBPAudit hasAuditing(String courseId) {
|
||||
//未审核的
|
||||
CourseHRBPAudit hrbp = courseHRBPAuditDao.findOne(FieldFilters.eq("courseId", courseId),FieldFilters.eq("status", 1));
|
||||
return hrbp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -603,6 +603,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
public void submit(CourseFullDto full) throws Exception {
|
||||
|
||||
Course c=full.getCourse();//当前的课程信息
|
||||
//提交审核,不再记录修改日志
|
||||
// Course nowCourse=courseDao.get(c.getId());//修改之前的课程信息
|
||||
// //审核不保存日志了
|
||||
// StringBuffer stringBuffer = new StringBuffer("[");
|
||||
@@ -625,21 +626,21 @@ public class CourseServiceImpl implements ICourseService {
|
||||
full.getCourse().setSysVersion(c.getSysVersion());
|
||||
|
||||
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
||||
// courseTeacherDao.deleteByField("courseId", c.getId());
|
||||
// if(full.getTeachers()!=null && !full.getTeachers().isEmpty()) {
|
||||
// for(CourseTeacher ct : full.getTeachers()) {
|
||||
// ct.setCourseId(c.getId());
|
||||
// courseTeacherDao.saveOrUpdate(ct);
|
||||
// }
|
||||
// }
|
||||
// //先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||
// courseCrowdDao.deleteByField("courseId", c.getId());
|
||||
// if(full.getCrowds()!=null && !full.getCrowds().isEmpty()) {
|
||||
// for(CourseCrowd cc : full.getCrowds()) {
|
||||
// cc.setCourseId(c.getId());
|
||||
// courseCrowdDao.saveOrUpdate(cc);
|
||||
// }
|
||||
// }
|
||||
courseTeacherDao.deleteByField("courseId", c.getId());
|
||||
if(full.getTeachers()!=null && !full.getTeachers().isEmpty()) {
|
||||
for(CourseTeacher ct : full.getTeachers()) {
|
||||
ct.setCourseId(c.getId());
|
||||
courseTeacherDao.saveOrUpdate(ct);
|
||||
}
|
||||
}
|
||||
//先清空受众信息,受众信息如果不一样了,也要加入到日志中
|
||||
courseCrowdDao.deleteByField("courseId", c.getId());
|
||||
if(full.getCrowds()!=null && !full.getCrowds().isEmpty()) {
|
||||
for(CourseCrowd cc : full.getCrowds()) {
|
||||
cc.setCourseId(c.getId());
|
||||
courseCrowdDao.saveOrUpdate(cc);
|
||||
}
|
||||
}
|
||||
//保存审核信息
|
||||
CourseHRBPAudit hrbpAudit=new CourseHRBPAudit();
|
||||
hrbpAudit.setCourseId(c.getId());
|
||||
|
||||
Reference in New Issue
Block a user