This commit is contained in:
ls
2024-11-18 23:07:30 +08:00
parent 3a34ee483a
commit c349ac4c4d
6 changed files with 34 additions and 8 deletions

View File

@@ -230,7 +230,7 @@ jeecg:
#webapp文件路径 #webapp文件路径
webapp: /opt/webapp webapp: /opt/webapp
shiro: shiro:
excludeUrls: /database/experimentDoc/**,/sys/common/upload,/sys/common/download,/sys/user/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/** excludeUrls: /library/documentLibrary/home,/database/experimentDoc/**,/sys/common/upload,/sys/common/download,/sys/user/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置 #阿里云oss存储和大鱼短信秘钥配置
oss: oss:
accessKey: ?? accessKey: ??

View File

@@ -61,6 +61,7 @@ public class DocumentLibraryController extends JeecgController<DocumentLibrary,
home.setRecently(documentVisitHistoryService.getRecently(userByName.getId())); home.setRecently(documentVisitHistoryService.getRecently(userByName.getId()));
home.setTotal(documentLibraryService.getTotal()); home.setTotal(documentLibraryService.getTotal());
home.setToday(documentLibraryService.getToday()); home.setToday(documentLibraryService.getToday());
home.setCategory(documentLibraryService.getCategory());
return Result.OK(home); return Result.OK(home);
} }

View File

@@ -10,6 +10,7 @@ import lombok.Setter;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author lise * @author lise
@@ -30,4 +31,7 @@ public class DocumentHome implements Serializable {
private Long total; private Long total;
@Schema(description = "今日新增") @Schema(description = "今日新增")
private Long today; private Long today;
@Schema(description = "分类文档")
private Map<String, List<DocumentLibrary>> category;
} }

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.database.entity.DocumentLibrary; import org.jeecg.modules.database.entity.DocumentLibrary;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description: 知识库 * @Description: 知识库
@@ -18,4 +19,7 @@ public interface IDocumentLibraryService extends IService<DocumentLibrary> {
Long getTotal(); Long getTotal();
Long getToday(); Long getToday();
Map<String, List<DocumentLibrary>> getCategory();
} }

View File

@@ -28,6 +28,7 @@ public class DocumentFavoritesServiceImpl extends ServiceImpl<DocumentFavoritesM
public List<DocumentFavorites> getTopFavoritesByUserId(String userId) { public List<DocumentFavorites> getTopFavoritesByUserId(String userId) {
LambdaQueryWrapper<DocumentFavorites> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DocumentFavorites> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DocumentFavorites::getUserId, userId); queryWrapper.eq(DocumentFavorites::getUserId, userId);
queryWrapper.orderByDesc(DocumentFavorites::getCreateTime);
Page<DocumentFavorites> page = new Page<>(1, 10); Page<DocumentFavorites> page = new Page<>(1, 10);
List<DocumentFavorites> list = list(page, queryWrapper); List<DocumentFavorites> list = list(page, queryWrapper);
return list; return list;

View File

@@ -10,8 +10,7 @@ import org.jeecg.modules.database.mapper.DocumentLibraryMapper;
import org.jeecg.modules.database.service.IDocumentLibraryService; import org.jeecg.modules.database.service.IDocumentLibraryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.*;
import java.util.List;
/** /**
* @Description: 知识库 * @Description: 知识库
@@ -42,4 +41,21 @@ public class DocumentLibraryServiceImpl extends ServiceImpl<DocumentLibraryMappe
DateUtils.formatDate(new Date(), "yyyy-MM-dd")); DateUtils.formatDate(new Date(), "yyyy-MM-dd"));
return count(queryWrapper); return count(queryWrapper);
} }
@Override
public Map<String, List<DocumentLibrary>> getCategory() {
LambdaQueryWrapper<DocumentLibrary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNull(DocumentLibrary::getParentId);
queryWrapper.eq(DocumentLibrary::getType, "FOLDER");
List<DocumentLibrary> folderList = list(queryWrapper);
Map<String, List<DocumentLibrary>> map = new HashMap<>();
folderList.forEach(folder -> {
LambdaQueryWrapper<DocumentLibrary> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(DocumentLibrary::getParentId, folder.getId());
queryWrapper1.eq(DocumentLibrary::getType, "DOCUMENT");
queryWrapper1.orderByDesc(DocumentLibrary::getCreateTime);
map.put(folder.getTitle(), list(queryWrapper1));
});
return map;
}
} }