From bde9c0e7db380721e3850ef3b0108fbc47b58b94 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 01 三月 2024 14:17:11 +0800
Subject: [PATCH] 添加缓存功能

---
 src/main/java/com/lf/server/controller/data/DataCountController.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/data/DataCountController.java b/src/main/java/com/lf/server/controller/data/DataCountController.java
index 9a51d39..6f0bd88 100644
--- a/src/main/java/com/lf/server/controller/data/DataCountController.java
+++ b/src/main/java/com/lf/server/controller/data/DataCountController.java
@@ -1,6 +1,7 @@
 package com.lf.server.controller.data;
 
 import com.lf.server.annotation.SysLog;
+import com.lf.server.controller.all.BaseController;
 import com.lf.server.controller.all.BaseQueryController;
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.ctrl.CountEntity;
@@ -28,7 +29,7 @@
 @Api(tags = "鏁版嵁绠$悊\\鏁版嵁缁熻")
 @RestController
 @RequestMapping("/dataCount")
-public class DataCountController extends BaseQueryController {
+public class DataCountController extends BaseController {
     @Autowired
     ReportService reportService;
 
@@ -42,26 +43,27 @@
     @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = ""),
+            @ApiImplicitParam(name = "code", value = "缂栫爜", dataType = "String", paramType = "query", example = "countOperates"),
             @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"),
             @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1")
     })
     @GetMapping(value = "/selectByPageAndCount")
-    public ResponseMsg<List<ReportEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) {
+    public ResponseMsg<List<ReportEntity>> selectByPageAndCount(String name, String code, Integer pageSize, Integer pageIndex) {
         try {
             if (pageSize < 1 || pageIndex < 1) {
                 return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null);
             }
 
-            int count = reportService.selectCount(name);
+            int count = reportService.selectCount(name, code);
             if (count == 0) {
                 return success(0, null);
             }
 
-            List<ReportEntity> rs = reportService.selectByPage(name, pageSize, pageSize * (pageIndex - 1));
+            List<ReportEntity> rs = reportService.selectByPage(name, code, pageSize, pageSize * (pageIndex - 1));
 
             return success(count, rs);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -74,7 +76,20 @@
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鎸夋枃浠剁被鍨嬬粺璁�")
+    @GetMapping(value = "/countSizesByType")
+    public ResponseMsg<Object> countSizesByType() {
+        try {
+            List<CountEntity> list = reportService.countSizesByType();
+
+            return success(list);
+        } catch (Exception ex) {
+            return fail(ex, null);
         }
     }
 
@@ -87,7 +102,7 @@
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
         }
     }
 
@@ -100,14 +115,40 @@
 
             return success(list);
         } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
+            return fail(ex, null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鎸夐」鐩粺璁℃暟鎹�")
+    @GetMapping(value = "/countSizesByPrj")
+    public ResponseMsg<Object> countSizesByPrj() {
+        try {
+            List<CountEntity> list = reportService.countSizesByPrj();
+
+            return success(list);
+        } catch (Exception ex) {
+            return fail(ex, null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鎸夐」鐩粺璁¢捇瀛旀暟鎹�")
+    @GetMapping(value = "/countExplorationPoints")
+    public ResponseMsg<Object> countExplorationPoints() {
+        try {
+            List<CountEntity> list = reportService.countExplorationPoints();
+
+            return success(list);
+        } catch (Exception ex) {
+            return fail(ex, null);
         }
     }
 
     @SysLog()
     @ApiOperation(value = "涓嬭浇鎶ュ憡")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "鎶ュ憡ID", dataType = "Integer", paramType = "7")
+            @ApiImplicitParam(name = "id", value = "鎶ュ憡ID", dataType = "Integer", paramType = "query", example = "18")
     })
     @GetMapping(value = "/downloadReport")
     public void downloadReport(Integer id, HttpServletRequest req, HttpServletResponse res) {

--
Gitblit v1.9.3