|  |  | 
 |  |  |     @ApiOperation("新建") | 
 |  |  |     @PostMapping("/create") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:create") | 
 |  |  |     public ApiResponse create(@RequestBody YwMaterial ywMaterial) { | 
 |  |  |     public ApiResponse create(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         ywMaterial.setLoginUserInfo(this.getLoginUser(token)); | 
 |  |  |         return ApiResponse.success(ywMaterialService.create(ywMaterial)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("根据ID删除") | 
 |  |  |     @GetMapping("/delete/{id}") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:delete") | 
 |  |  |     public ApiResponse deleteById(@PathVariable Integer id) { | 
 |  |  |     public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         ywMaterialService.deleteById(id); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     @ApiOperation("批量删除") | 
 |  |  |     @GetMapping("/delete/batch") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:delete") | 
 |  |  |     public ApiResponse deleteByIdInBatch(@RequestParam String ids) { | 
 |  |  |     public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         String [] idArray = ids.split(","); | 
 |  |  |         List<Integer> idList = new ArrayList<>(); | 
 |  |  |         for (String id : idArray) { | 
 |  |  | 
 |  |  |     @ApiOperation("根据ID修改") | 
 |  |  |     @PostMapping("/updateById") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:update") | 
 |  |  |     public ApiResponse updateById(@RequestBody YwMaterial ywMaterial) { | 
 |  |  |     public ApiResponse updateById(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         ywMaterial.setLoginUserInfo(getLoginUser(token)); | 
 |  |  |         ywMaterialService.updateById(ywMaterial); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("根据ID修改状态") | 
 |  |  |     @PostMapping("/updateStatus") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:update") | 
 |  |  |     public ApiResponse updateStatus(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         ywMaterialService.updateStatus(ywMaterial); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation("分页查询") | 
 |  |  |     @PostMapping("/page") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:query") | 
 |  |  |     public ApiResponse<PageData<YwMaterial>> findPage (@RequestBody PageWrap<YwMaterial> pageWrap) { | 
 |  |  |     public ApiResponse<PageData<YwMaterial>> findPage (@RequestBody PageWrap<YwMaterial> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         return ApiResponse.success(ywMaterialService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("导出Excel") | 
 |  |  |     @PostMapping("/exportExcel") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:exportExcel") | 
 |  |  |     public void exportExcel (@RequestBody PageWrap<YwMaterial> pageWrap, HttpServletResponse response) { | 
 |  |  |     public void exportExcel (@RequestBody PageWrap<YwMaterial> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         ExcelExporter.build(YwMaterial.class).export(ywMaterialService.findPage(pageWrap).getRecords(), "运维资产信息表", response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("根据ID查询") | 
 |  |  |     @GetMapping("/{id}") | 
 |  |  |     @CloudRequiredPermission("business:ywmaterial:query") | 
 |  |  |     public ApiResponse findById(@PathVariable Integer id) { | 
 |  |  |         return ApiResponse.success(ywMaterialService.findById(id)); | 
 |  |  |     public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
 |  |  |         return ApiResponse.success(ywMaterialService.getDetail(id)); | 
 |  |  |     } | 
 |  |  | } |