定时任务增加系统定时任务

This commit is contained in:
2025-11-25 14:45:11 +08:00
parent 5d14957eba
commit 24c5188eb0
14 changed files with 988 additions and 30 deletions

View File

@@ -59,7 +59,7 @@ public class ResourceController {
public ResultDomain<ResourceVO> getResourcePageOrderByViewCount(@RequestBody PageRequest<TbResource> request) {
TbResource filter = request.getFilter();
PageParam pageParam = request.getPageParam();
return resourceService.getResourcePageOrderByViewCount(filter, pageParam);
return resourceService.getResourcePageOrder(filter, pageParam);
}
/**

View File

@@ -176,7 +176,7 @@ public interface ResourceMapper extends BaseMapper<TbResource> {
* @author yslg
* @since 2025-10-15
*/
List<ResourceVO> selectResourcesPageOrderByViewCount(@Param("filter") TbResource filter, @Param("pageParam") PageParam pageParam, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
List<ResourceVO> selectResourcesPageOrder(@Param("filter") TbResource filter, @Param("pageParam") PageParam pageParam, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
/**
* @description 统计资源总数

View File

@@ -161,7 +161,7 @@ public class NCResourceServiceImpl implements ResourceService {
}
@Override
public ResultDomain<ResourceVO> getResourcePageOrderByViewCount(TbResource filter, PageParam pageParam) {
public ResultDomain<ResourceVO> getResourcePageOrder(TbResource filter, PageParam pageParam) {
ResultDomain<ResourceVO> resultDomain = new ResultDomain<>();
try {
if (filter == null) {
@@ -170,7 +170,7 @@ public class NCResourceServiceImpl implements ResourceService {
// 获取当前用户的部门角色
List<UserDeptRoleVO> userDeptRoles = LoginUtil.getCurrentDeptRole();
// 直接查询ResourceVO列表
List<ResourceVO> resourceVOList = resourceMapper.selectResourcesPageOrderByViewCount(filter, pageParam, userDeptRoles);
List<ResourceVO> resourceVOList = resourceMapper.selectResourcesPageOrder(filter, pageParam, userDeptRoles);
logger.info("资源数量{}",resourceVOList.size());
long total = resourceMapper.countResources(filter, userDeptRoles);
pageParam.setTotalElements(total);
@@ -284,6 +284,7 @@ public class NCResourceServiceImpl implements ResourceService {
// 进行审核
ResultDomain<String> pass =auditService.auditText(resource.getTitle() + " "+resource.getContent());
if(pass.isSuccess()){
resource.setPublishTime(new Date());
resource.setIsAudited(true);
}else {
auditService.sendAuditResultMessage(resource.getCreator(), "文章"+resource.getTitle(), pass.getDataList());
@@ -509,6 +510,7 @@ public class NCResourceServiceImpl implements ResourceService {
ResultDomain<String> pass = auditService.auditText(resource.getTitle()+" "+resource.getContent());
if (pass.isSuccess()) {
resource.setIsAudited(true);
resource.setPublishTime(new Date());
} else {
// 审核失败标记状态为4审核失败
resource.setStatus(4);
@@ -562,6 +564,7 @@ public class NCResourceServiceImpl implements ResourceService {
ResultDomain<String> pass = auditService.auditText(resource.getTitle()+" "+resource.getContent());
if (pass.isSuccess()) {
resource.setIsAudited(true);
resource.setPublishTime(new Date());
} else {
// 审核失败标记状态为3审核失败
resource.setStatus(3);

View File

@@ -378,7 +378,7 @@
</association>
</resultMap>
<select id="selectResourcesPageOrderByViewCount" resultMap="ResourceVOResultMap">
<select id="selectResourcesPageOrder" resultMap="ResourceVOResultMap">
SELECT
r.*,
MAX(CASE WHEN rec.recommend_type = 1 THEN 1 ELSE 0 END) AS is_top_recommend,