From 0414ddb0b2b3a7199ae6181a770f97ac140dbd73 Mon Sep 17 00:00:00 2001
From: zhangf <1603559716@qq.com>
Date: 星期三, 08 五月 2024 16:46:22 +0800
Subject: [PATCH] spi统计

---
 emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesInspectController.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesInspectController.java b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesInspectController.java
index 07ccce4..a8dd4ba 100644
--- a/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesInspectController.java
+++ b/emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencySuppliesInspectController.java
@@ -1,5 +1,6 @@
 package com.gkhy.safePlatform.emergency.controller;
 
+import com.gkhy.safePlatform.commons.co.ContextCacheUser;
 import com.gkhy.safePlatform.commons.query.PageQuery;
 import com.gkhy.safePlatform.commons.utils.PageUtils;
 import com.gkhy.safePlatform.commons.vo.ResultVO;
@@ -9,6 +10,7 @@
 import com.gkhy.safePlatform.emergency.query.EmergencySuppliesInspectQuery;
 import com.gkhy.safePlatform.emergency.service.EmergencySuppliesInspectService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.Authentication;
 import org.springframework.web.bind.annotation.*;
 
 import java.security.Principal;
@@ -26,7 +28,7 @@
      */
     @RequestMapping(value = "/page/list" ,method = RequestMethod.POST)
     private ResultVO<List<EmergencySuppliesInspectPageRespDTO>> list (@RequestBody PageQuery<EmergencySuppliesInspectQuery> pageQuery){
-        PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize());
+        PageUtils.checkCheck(pageQuery);
         return  emergencySuppliesInspectService.selectEmergencySuppliesInspectList(pageQuery);
     }
 
@@ -34,9 +36,9 @@
      * 应急物资检查新增
      */
     @RequestMapping(value = "/add",method = RequestMethod.POST)
-    public ResultVO addEmergencySuppliesInspect(Principal principal, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) {
-        String uid = principal.getName();
-        return emergencySuppliesInspectService.addEmergencySuppliesInspect(Long.valueOf(uid), emergencySuppliesInspectReqDTO);
+    public ResultVO addEmergencySuppliesInspect(Authentication authentication, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) {
+       ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
+        return emergencySuppliesInspectService.addEmergencySuppliesInspect(currentUser.getUid(), emergencySuppliesInspectReqDTO);
     }
 
     /**
@@ -51,16 +53,16 @@
      * 应急物资检查修改
      */
     @RequestMapping(value = "/update",method = RequestMethod.POST)
-    public ResultVO updateEmergencySuppliesInspect(Principal principal, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) {
-        String uid = principal.getName();
-        return emergencySuppliesInspectService.updateEmergencySuppliesInspect(Long.valueOf(uid), emergencySuppliesInspectReqDTO);
+    public ResultVO updateEmergencySuppliesInspect(Authentication authentication, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) {
+       ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
+        return emergencySuppliesInspectService.updateEmergencySuppliesInspect(currentUser.getUid(), emergencySuppliesInspectReqDTO);
     }
 
     /**
      * 应急物资检查删除/批量删除
      */
-    @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET)
-    public ResultVO batchDeleteEmergencySuppliesInspect(@PathVariable("ids")String ids){
+    @RequestMapping(value = "/batchDelete",method = RequestMethod.POST)
+    public ResultVO batchDeleteEmergencySuppliesInspect(@RequestBody Long[] ids){
         return emergencySuppliesInspectService.batchDeleteEmergencySuppliesInspect(ids);
     }
 }

--
Gitblit v1.9.2