授权的课程到期信息

beetlsql3-dev
Mlxa0324 2 years ago
parent b02d40fe80
commit 7ddb837f6b

@ -6,6 +6,7 @@ import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionExperimentalSystem;
import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionCurriculumResourcesQuery; import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionCurriculumResourcesQuery;
import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.SqlResource;
import org.beetl.sql.mapper.annotation.Update; import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -57,9 +58,10 @@ public interface UniversitiesCollegesJurisdictionCurriculumResourcesDao extends
* *
* @param beforeDays * @param beforeDays
* @param afterDays * @param afterDays
* @param orgId
* @return {@link List< UniversitiesCollegesJurisdictionExperimentalSystem >} * @return {@link List< UniversitiesCollegesJurisdictionExperimentalSystem >}
* @Author: lx * @Author: lx
* @Date: 2023/3/19 23:38 * @Date: 2023/3/19 23:38
*/ */
List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthByBeforeAndAfterDays(Long beforeDays, Long afterDays); List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthByBeforeAndAfterDays(@Param("beforeDays") Long beforeDays, @Param("afterDays") Long afterDays, @Param("orgId") Long orgId);
} }

@ -4,6 +4,7 @@ import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionExperimentalSystem;
import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionExperimentalSystemQuery; import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionExperimentalSystemQuery;
import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper; import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource; import org.beetl.sql.mapper.annotation.SqlResource;
import org.beetl.sql.mapper.annotation.Update; import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -37,9 +38,10 @@ public interface UniversitiesCollegesJurisdictionExperimentalSystemDao extends B
* *
* @param beforeDays * @param beforeDays
* @param afterDays * @param afterDays
* @param orgId
* @return {@link List< UniversitiesCollegesJurisdictionExperimentalSystem>} * @return {@link List< UniversitiesCollegesJurisdictionExperimentalSystem>}
* @Author: lx * @Author: lx
* @Date: 2023/3/19 23:38 * @Date: 2023/3/19 23:38
*/ */
List<UniversitiesCollegesJurisdictionExperimentalSystem> getAllOverdueAuthByBeforeAndAfterDays( Long beforeDays, Long afterDays); List<UniversitiesCollegesJurisdictionExperimentalSystem> getAllOverdueAuthByBeforeAndAfterDays(@Param("beforeDays") Long beforeDays, @Param("afterDays") Long afterDays, @Param("orgId") Long orgId);
} }

@ -203,4 +203,10 @@ public class UniversitiesCollegesJurisdictionCurriculumResourcesService extends
public List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthUnUpdateStatus(){ public List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthUnUpdateStatus(){
return universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuthUnUpdateStatus(); return universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuthUnUpdateStatus();
} }
@Cacheable(value = "cache:core:resources:getAllOverdueAuthByBeforeAndAfterDays", key = "#orgId", unless="#result == null || #result.size() == 0", cacheManager = "cacheManager1Hour")
public List<UniversitiesCollegesJurisdictionCurriculumResources> getAllOverdueAuthByBeforeAndAfterDays(Long beforeDays, Long afterDays, Long orgId) {
return universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays, orgId);
}
} }

@ -19,6 +19,7 @@ import com.ibeetl.jlw.web.query.UniversitiesCollegesJurisdictionExperimentalSyst
import org.beetl.sql.core.SqlId; import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery; import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -176,5 +177,8 @@ public class UniversitiesCollegesJurisdictionExperimentalSystemService extends C
return sqlManager.select(SqlId.of("jlw.universitiesCollegesJurisdictionExperimentalSystem.getUniversitiesCollegesJurisdictionExperimentalSystemValues"),UniversitiesCollegesJurisdictionExperimentalSystem.class,paras); return sqlManager.select(SqlId.of("jlw.universitiesCollegesJurisdictionExperimentalSystem.getUniversitiesCollegesJurisdictionExperimentalSystemValues"),UniversitiesCollegesJurisdictionExperimentalSystem.class,paras);
} }
@Cacheable(value = "cache:core:experimentalSystem:getAllOverdueAuthByBeforeAndAfterDays", key = "#orgId", unless="#result == null || #result.size() == 0", cacheManager = "cacheManager1Hour")
public List<UniversitiesCollegesJurisdictionExperimentalSystem> getAllOverdueAuthByBeforeAndAfterDays(Long beforeDays, Long afterDays, Long orgId) {
return universitiesCollegesJurisdictionExperimentalSystemDao.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays, orgId);
}
} }

@ -18,8 +18,6 @@ import com.ibeetl.admin.core.service.CoreDictService;
import com.ibeetl.admin.core.service.CorePlatformService; import com.ibeetl.admin.core.service.CorePlatformService;
import com.ibeetl.admin.core.service.CoreUserService; import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.admin.core.util.HttpRequestLocal; import com.ibeetl.admin.core.util.HttpRequestLocal;
import com.ibeetl.jlw.dao.UniversitiesCollegesJurisdictionCurriculumResourcesDao;
import com.ibeetl.jlw.dao.UniversitiesCollegesJurisdictionExperimentalSystemDao;
import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.web.IndexController; import com.ibeetl.jlw.web.IndexController;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -57,9 +55,9 @@ public class WebPlatformService {
@Autowired @Autowired
private RoleConsoleService roleConsoleService; private RoleConsoleService roleConsoleService;
@Autowired @Autowired
private UniversitiesCollegesJurisdictionExperimentalSystemDao universitiesCollegesJurisdictionExperimentalSystemDao; private UniversitiesCollegesJurisdictionExperimentalSystemService universitiesCollegesJurisdictionExperimentalSystemService;
@Autowired @Autowired
private UniversitiesCollegesJurisdictionCurriculumResourcesDao universitiesCollegesJurisdictionCurriculumResourcesDao; private UniversitiesCollegesJurisdictionCurriculumResourcesService universitiesCollegesJurisdictionCurriculumResourcesService;
@Autowired @Autowired
private CoreDictService coreDictService; private CoreDictService coreDictService;
@ -291,7 +289,7 @@ public class WebPlatformService {
* @Author: lx * @Author: lx
* @Date: 2023/3/19 22:49 * @Date: 2023/3/19 22:49
*/ */
public List<IndexController.AuthResourcesAndSystemInfo> getAuthResourcesAndSystemInfo() { public List<IndexController.AuthResourcesAndSystemInfo> getAuthResourcesAndSystemInfo(CoreUser coreUser) {
// 返回值 // 返回值
List<IndexController.AuthResourcesAndSystemInfo> result = new ArrayList<>(10); List<IndexController.AuthResourcesAndSystemInfo> result = new ArrayList<>(10);
@ -309,9 +307,9 @@ public class WebPlatformService {
// 查询需要通知续约的应用和课程 // 查询需要通知续约的应用和课程
List<UniversitiesCollegesJurisdictionExperimentalSystem> systemList = List<UniversitiesCollegesJurisdictionExperimentalSystem> systemList =
universitiesCollegesJurisdictionExperimentalSystemDao.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays); universitiesCollegesJurisdictionExperimentalSystemService.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays, coreUser.getOrgId());
List<UniversitiesCollegesJurisdictionCurriculumResources> resourcesList = List<UniversitiesCollegesJurisdictionCurriculumResources> resourcesList =
universitiesCollegesJurisdictionCurriculumResourcesDao.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays); universitiesCollegesJurisdictionCurriculumResourcesService.getAllOverdueAuthByBeforeAndAfterDays(beforeDays, afterDays, coreUser.getOrgId());
// 快要到期的数据处理 // 快要到期的数据处理
List<IndexController.AuthResourcesAndSystemInfo> authApplicationList = systemList.stream().map(item -> { List<IndexController.AuthResourcesAndSystemInfo> authApplicationList = systemList.stream().map(item -> {

@ -1114,6 +1114,6 @@ public class IndexController {
@GetMapping("getAuthResourcesAndSystemInfo.json") @GetMapping("getAuthResourcesAndSystemInfo.json")
@ResponseBody @ResponseBody
public JsonResult<List<AuthResourcesAndSystemInfo>> getAuthResourcesAndSystemInfo(@SCoreUser CoreUser coreUser) { public JsonResult<List<AuthResourcesAndSystemInfo>> getAuthResourcesAndSystemInfo(@SCoreUser CoreUser coreUser) {
return JsonResult.success(webPlatformService.getAuthResourcesAndSystemInfo()); return JsonResult.success(webPlatformService.getAuthResourcesAndSystemInfo(coreUser));
} }
} }

@ -432,3 +432,6 @@ getAllOverdueAuthByBeforeAndAfterDays
where 1 = 1 where 1 = 1
AND now() BETWEEN date_add( t.use_end_time, INTERVAL -#beforeDays# DAY ) AND now() BETWEEN date_add( t.use_end_time, INTERVAL -#beforeDays# DAY )
AND date_add( t.use_end_time, INTERVAL #afterDays# DAY ) AND date_add( t.use_end_time, INTERVAL #afterDays# DAY )
@if(!isEmpty(orgId) && orgId != 1){
and t.org_id =#orgId#
@}

@ -239,4 +239,7 @@ getAllOverdueAuthByBeforeAndAfterDays
where 1 = 1 where 1 = 1
AND now() BETWEEN date_add( t.use_end_time, INTERVAL -#beforeDays# DAY ) AND now() BETWEEN date_add( t.use_end_time, INTERVAL -#beforeDays# DAY )
AND date_add( t.use_end_time, INTERVAL #afterDays# DAY ) AND date_add( t.use_end_time, INTERVAL #afterDays# DAY )
@if(!isEmpty(orgId) && orgId != 1){
and t.org_id =#orgId#
@}

Loading…
Cancel
Save