| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | @Autowired |
| | | private DocumentationMapper documentationMapper; |
| | | @Override |
| | | public List<DocumentationDto> listPage(Page page, Documentation documentation) { |
| | | public IPage<DocumentationDto> listPage(Page page, Documentation documentation) { |
| | | return documentationMapper.listPage(page, documentation); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response,Documentation documentation) { |
| | | List<DocumentationDto> list = documentationMapper.listPage(null, documentation); |
| | | IPage<DocumentationDto> list = documentationMapper.listPage(null, documentation); |
| | | ExcelUtil<DocumentationDto> util = new ExcelUtil<>(DocumentationDto.class); |
| | | util.exportExcel(response, list, "文档信息表"); |
| | | util.exportExcel(response, list.getRecords(), "文档信息表"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return true; |
| | | } |
| | | /** |
| | | * 列表所有文档 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocumentationDto> listAll() { |
| | | List<DocumentationDto> list = documentationMapper.list().stream().filter(documentationDto -> "正常".equals(documentationDto.getDocStatus())).collect(Collectors.toList()); |
| | | return list; |
| | | } |
| | | /** |
| | | * 获取文档总数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getTotalDocsCount() { |
| | | return documentationMapper.countTotalDocs(); |
| | | } |
| | | /** |
| | | * 获取文档分类总数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getCategoryNumCount() { |
| | | return documentationMapper.countCategoryNum(); |
| | | } |
| | | /** |
| | | * 获取已借出文档总数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getBorrowedDocsCount() { |
| | | return documentationMapper.countBorrowedDocs(); |
| | | } |
| | | /** |
| | | * 获取每月新增文档总数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getMonthlyAddedDocsCount() { |
| | | return documentationMapper.countMonthlyAddedDocs(); |
| | | } |
| | | /** |
| | | * 获取文档分类分布 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getCategoryDistribution() { |
| | | return documentationMapper.countCategoryDistribution(); |
| | | } |
| | | /** |
| | | * 获取文档状态分布 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getStatusDistribution() { |
| | | return documentationMapper.countStatusDistribution(); |
| | | } |
| | | } |
| | | |
| | | |