update
This commit is contained in:
@@ -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: ??
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -21,13 +22,16 @@ public class DocumentHome implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "我的收藏")
|
@Schema(description = "我的收藏")
|
||||||
private List<DocumentFavorites> favorite;
|
private List<DocumentFavorites> favorite;
|
||||||
@Schema(description = "最新文档")
|
@Schema(description = "最新文档")
|
||||||
private List<DocumentLibrary> latest;
|
private List<DocumentLibrary> latest;
|
||||||
@Schema(description = "最近访问")
|
@Schema(description = "最近访问")
|
||||||
private List<DocumentLibrary> recently;
|
private List<DocumentLibrary> recently;
|
||||||
@Schema(description = "文档总计")
|
@Schema(description = "文档总计")
|
||||||
private Long total;
|
private Long total;
|
||||||
@Schema(description = "今日新增")
|
@Schema(description = "今日新增")
|
||||||
private Long today;
|
private Long today;
|
||||||
|
@Schema(description = "分类文档")
|
||||||
|
private Map<String, List<DocumentLibrary>> category;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user