|
|
|
@ -1,13 +1,14 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.jlw.dao.CourseInfoDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.UniversitiesCollegesJurisdictionCurriculumResourcesDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.CourseInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionCurriculumResources;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.ResourcesCourseInfoAuthDetailsVO;
|
|
|
|
|
import com.ibeetl.jlw.web.query.CourseInfoQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionCurriculumResourcesQuery;
|
|
|
|
|
import org.beetl.sql.core.SQLManager;
|
|
|
|
|
import org.beetl.sql.core.SQLReady;
|
|
|
|
@ -19,8 +20,12 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.collection.ListUtil.empty;
|
|
|
|
|
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
|
|
|
|
|
import static com.ibeetl.admin.core.util.StreamUtils.listJoin;
|
|
|
|
|
import static java.util.stream.Collectors.groupingBy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -166,16 +171,35 @@ public class UniversitiesCollegesJurisdictionCurriculumResourcesService extends
|
|
|
|
|
*/
|
|
|
|
|
@Cacheable(value = "cache:core:getResourcesCourseInfoAuthDetails", key="#orgId", cacheManager="cacheManager1Hour")
|
|
|
|
|
public ResourcesCourseInfoAuthDetailsVO getResourcesCourseInfoAuthDetails(Long orgId) {
|
|
|
|
|
ResourcesCourseInfoAuthDetailsVO authDetailsVO = sqlManager.executeQueryOne(
|
|
|
|
|
new SQLReady("SELECT ? as org_id", orgId), ResourcesCourseInfoAuthDetailsVO.class);
|
|
|
|
|
return authDetailsVO;
|
|
|
|
|
// 超管
|
|
|
|
|
if (orgId == 1) {
|
|
|
|
|
CourseInfoQuery courseInfoQuery = new CourseInfoQuery();
|
|
|
|
|
courseInfoQuery.setCourseLabelType("理论课程类,应用课程类,考证课程类");
|
|
|
|
|
courseInfoQuery.setCourseInfoStatus(1);
|
|
|
|
|
List<CourseInfo> courseInfoList = sqlManager.getMapper(CourseInfoDao.class).getCourseInfoValues(courseInfoQuery);
|
|
|
|
|
Map<String, List<CourseInfo>> stringListMap = courseInfoList.stream().collect(groupingBy(CourseInfo::getCourseLabelType));
|
|
|
|
|
|
|
|
|
|
ResourcesCourseInfoAuthDetailsVO authDetailsVO = new ResourcesCourseInfoAuthDetailsVO();
|
|
|
|
|
authDetailsVO.setCourseInfoId(-1L);
|
|
|
|
|
authDetailsVO.setOrgId(1L);
|
|
|
|
|
authDetailsVO.setApplicationCourseList(defaultIfNull(stringListMap.get("应用课程类"), empty()));
|
|
|
|
|
authDetailsVO.setTheoryCourseList(defaultIfNull(stringListMap.get("理论课程类"), empty()));
|
|
|
|
|
authDetailsVO.setTextualResearchCourseList(defaultIfNull(stringListMap.get("考证课程类"), empty()));
|
|
|
|
|
return authDetailsVO;
|
|
|
|
|
}
|
|
|
|
|
// 其他身份
|
|
|
|
|
else {
|
|
|
|
|
ResourcesCourseInfoAuthDetailsVO authDetailsVO = sqlManager.executeQueryOne(
|
|
|
|
|
new SQLReady("SELECT ? as org_id", orgId), ResourcesCourseInfoAuthDetailsVO.class);
|
|
|
|
|
return authDetailsVO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取过期的所有授权
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuth(){
|
|
|
|
|
return universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuth();
|
|
|
|
|
public List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthUnUpdateStatus(){
|
|
|
|
|
return universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuthUnUpdateStatus();
|
|
|
|
|
}
|
|
|
|
|
}
|