| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.YwMaterial; |
| | | import com.doumee.service.business.YwMaterialService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:ywmaterial:exportExcel") |
| | | 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); |
| | | ExcelExporter.build(YwMaterial.class).export(ywMaterialService.findPage(pageWrap).getRecords(), "物料信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(ywMaterialService.getDetail(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("物料信息导入") |
| | | @PostMapping("/importMaterialBatch") |
| | | @CloudRequiredPermission("business:ywmaterial:query") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | public ApiResponse importMaterialBatch(@ApiParam(value = "file") MultipartFile file,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(ywMaterialService.importMaterialBatch(file,getLoginUser(token))); |
| | | } |
| | | } |