应用课程类,绑定课程。

beetlsql3-dev
Mlxa0324 2 years ago
parent f7c2a5a391
commit fd7090593c

@ -74,6 +74,7 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
@Autowired private ResourcesApplicationCourseDao resourcesApplicationCourseDao;
@Autowired private CoreUserService coreUserService;
@Autowired private CourseLabelService courseLabelService;
private final List<Future<Boolean>> results = new ArrayList<>();
@ -211,9 +212,13 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
CourseInfo courseInfo = courseInfoDao.single(courseInfoQuery.getCourseInfoId());
// 不管有没有绑定应用,都先删除
deleteByCourseInfoId(courseInfo.getCourseInfoId());
if(StringUtils.isNotBlank(courseInfoQuery.getResourcesApplicationIds())){
//删除以前的
deleteByCourseInfoId(courseInfo.getCourseInfoId());
CourseLabel courseLabel = courseLabelService.queryById(courseInfo.getCourseLabelId());
Assert.isTrue(courseLabel != null && "应用课程类".equals(courseLabel.getCourseLabelType()), "只有应用课程类的课程,才能绑定应用!");
List<ResourcesApplicationCourse> resourcesApplicationCourseList = new ArrayList<>();
String[] resourcesApplicationIds = courseInfoQuery.getResourcesApplicationIds().split(",");

@ -160,7 +160,10 @@ public class ResourcesQuestionController{
if (coreUser.isUniAdmin()) {
condition.setOrgIdPlural(join(Arrays.asList(coreUser.getOrgId(), 1L, null).toArray(), ","));
// 查询已经授权的课程ID
// 查询已经授权的课程ID。
// 应用课程查询resources_application_course表应用和课程的绑定关系
// 理论课程授权表universities_colleges_jurisdiction_curriculum_resources查询理论课程授权给院校的数据
// 考证类课程:查询,不需要二次授权
Serializable courseInfoIds = defaultIfNull(condition.getCourseInfoId(), condition.getCourseInfoIds());
Serializable ifNullCourseInfoIds = defaultIfNull(courseInfoIds,
universitiesCollegesJurisdictionCurriculumResourcesService.getAuthCourseInfoStrByOrgId(coreUser.getOrgId()));

@ -219,10 +219,10 @@ getAuthCourseInfoByOrgId
SELECT
tb.*
FROM
universities_colleges_jurisdiction_curriculum_resources t
course_info tb
left join universities_colleges_jurisdiction_curriculum_resources t ON tb.course_info_id = t.course_info_id
INNER JOIN universities_colleges ta ON t.universities_colleges_id = ta.universities_colleges_id
AND ta.universities_colleges_status = 1
INNER JOIN course_info tb ON tb.course_info_id = t.course_info_id
AND tb.course_info_status = 1
WHERE
1

Loading…
Cancel
Save