Selaa lähdekoodia

驾驶舱数量汇总

liu 2 vuotta sitten
vanhempi
commit
74019f056c

+ 5 - 0
src/main/java/com/template/api/SmartAccessControllerAPI.java

@@ -25,4 +25,9 @@ public interface SmartAccessControllerAPI {
     CommonResult getAccessPage(@RequestParam Integer currentPage, @RequestParam Integer pageCount,String keyWord,Integer gradeId,Integer classId,String resultStatus,String inOut,String startTime,String endTime);
 
 
+    @GetMapping("/totalCount")
+    @ApiOperation(value = "驾驶舱——数量汇总", notes = "驾驶舱——数量汇总", httpMethod = "GET")
+    CommonResult totalCount();
+
+
 }

+ 21 - 0
src/main/java/com/template/controller/SmartAccessController.java

@@ -1,16 +1,21 @@
 package com.template.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.annotation.DESRespondSecret;
 import com.template.api.SmartAccessControllerAPI;
 import com.template.common.utils.ExcelUtils;
 import com.template.model.pojo.SmartAccess;
+import com.template.model.pojo.SmartCarAccess;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.SmartAccessVo;
 import com.template.model.vo.SmartAttendanceVo;
+import com.template.model.vo.TotalCountVo;
 import com.template.services.SmartAccessService;
+import com.template.services.SmartCarAccessService;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -40,6 +45,9 @@ public class SmartAccessController implements SmartAccessControllerAPI {
     @Autowired
     SmartAccessService smartAccessService;
 
+    @Autowired
+    SmartCarAccessService smartCarAccessService;
+
     @Override
     @DESRespondSecret(validated = true)
     public CommonResult getPage(Integer currentPage, Integer pageCount, String keyWord,Integer gradeId, Integer classId, Integer departmentId,String openType,String resultStatus,String startTime,String endTime) {
@@ -137,5 +145,18 @@ public class SmartAccessController implements SmartAccessControllerAPI {
         PageUtils<SmartAccessVo> pageUtils=smartAccessService.getAccessPage(currentPage,pageCount,keyWord,gradeId,classId,resultStatus,inOut,startTime,endTime);
         return CommonResult.ok(pageUtils);
     }
+
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult totalCount() {
+        Wrapper<SmartAccess> wrapperAccess=new LambdaQueryWrapper<>();
+        int countAccess = smartAccessService.count(wrapperAccess);
+        Wrapper<SmartCarAccess> wrapperCar=new LambdaQueryWrapper<>();
+        int countCar = smartCarAccessService.count(wrapperCar);
+        TotalCountVo totalCountVo = new TotalCountVo();
+        totalCountVo.setAccessCount(countAccess);
+        totalCountVo.setCarCount(countCar);
+        return CommonResult.ok(totalCountVo);
+    }
 }
 

+ 1 - 0
src/main/java/com/template/controller/SmartRelationController.java

@@ -30,6 +30,7 @@ public class SmartRelationController implements SmartRelationControllerAPI {
 
     @Override
     public CommonResult getList(int currentPage, int pageCount, Integer userId) {
+
         PageUtils<SmartRelation> pageUtils=smartRelationService.getPage(currentPage,pageCount,userId);
 
         return CommonResult.ok(pageUtils);

+ 9 - 0
src/main/java/com/template/model/vo/TotalCountVo.java

@@ -0,0 +1,9 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+@Data
+public class TotalCountVo {
+    private Integer carCount;
+    private Integer accessCount;
+}