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