2026-04-22 f5fec3e27510969ee9f2fc89d2e1e2868d25f1f1
src/main/java/com/ruoyi/warehouse/controller/DocumentationController.java
@@ -17,8 +17,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/documentation")
@@ -66,9 +68,24 @@
    public void export(HttpServletResponse response,Documentation documentation ) {
        documentationService.export(response,documentation);
    }
    //附件详情
//    @GetMapping("/getDocumentation")
//    public Documentation getDocumentation(Documentation documentation) {
//        return documentationService.getById(id);
//    }
    @ApiOperation("文档信息表-统计")
    @GetMapping("/overview")
    public AjaxResult getOverviewStatistics() {
        Map<String, Object> result = new HashMap<>();
        result.put("totalDocsCount", documentationService.getTotalDocsCount());
        result.put("categoryNumCount", documentationService.getCategoryNumCount());
        result.put("borrowedDocsCount", documentationService.getBorrowedDocsCount());
        result.put("monthlyAddedDocsCount", documentationService.getMonthlyAddedDocsCount());
        return AjaxResult.success(result);
    }
    @ApiOperation("文档信息表-分类统计")
    @GetMapping("/category")
    public AjaxResult getCategoryDistribution() {
        return AjaxResult.success(documentationService.getCategoryDistribution());
    }
    @ApiOperation("文档信息表-状态统计")
    @GetMapping("/status")
    public AjaxResult getStatusDistribution() {
        return AjaxResult.success(documentationService.getStatusDistribution());
    }
}