|
|
|
@ -11,23 +11,23 @@ import cn.jlw.aliPay.utils.StringUtils;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.jlw.dao.CourseInfoDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.ResourcesInfoDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeCourseInfoDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeResourcesInfoDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.CourseInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.ResourcesInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeCourseInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeResourcesInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.enums.GlobalUpStatusEnum;
|
|
|
|
|
import com.ibeetl.jlw.enums.MoveEnum;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesInfoQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeResourcesInfoQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeResourcesQuestionQuery;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.beetl.sql.core.SqlId;
|
|
|
|
|
import org.beetl.sql.core.engine.PageQuery;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -63,6 +63,10 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo> {
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseMergeResourcesInfoDao teacherOpenCourseMergeResourcesInfoDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
@Lazy
|
|
|
|
|
private TeacherOpenCourseService teacherOpenCourseService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PageQuery<ResourcesInfo> queryByCondition(PageQuery query) {
|
|
|
|
|
PageQuery ret = resourcesInfoDao.queryByCondition(query);
|
|
|
|
@ -215,12 +219,21 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo> {
|
|
|
|
|
.lambdaQuery(TeacherOpenCourseMergeResourcesInfo.class)
|
|
|
|
|
.andEq(TeacherOpenCourseMergeResourcesInfo::getTeacherOpenCourseMergeResourcesInfoId,s)
|
|
|
|
|
.single();
|
|
|
|
|
if (!ObjectUtil.isEmpty(teacherOpenCourseMergeResourcesInfo)) {
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourse teacherOpenCourse = new TeacherOpenCourse();
|
|
|
|
|
teacherOpenCourse.setTeacherOpenCourseId(teacherOpenCourseMergeResourcesInfo.getTeacherOpenCourseId());
|
|
|
|
|
List<TeacherOpenCourse> teacherOpenCourses = teacherOpenCourseService.getValues(teacherOpenCourse);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(teacherOpenCourses) && teacherOpenCourses.get(0).getEndTime().getTime() >= new Date().getTime()){
|
|
|
|
|
Assert.isTrue(false, "课程在使用中");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(teacherOpenCourseMergeResourcesInfo)) {
|
|
|
|
|
TeacherOpenCourseMergeResourcesInfo updateQuery = new TeacherOpenCourseMergeResourcesInfo();
|
|
|
|
|
updateQuery.setResourcesInfoStatus(GlobalUpStatusEnum.DEL);
|
|
|
|
|
updateQuery.setTeacherOpenCourseMergeResourcesInfoId(teacherOpenCourseMergeResourcesInfo.getTeacherOpenCourseMergeResourcesInfoId());
|
|
|
|
|
teacherOpenCourseMergeResourcesInfoDao.upsertByTemplate(updateQuery);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|