kongzy
2024-09-23 d015cc0b48ca51a2b93b6c60c91dc352a104b1e7
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);
    }
}