|  |  |  | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Category; | 
|---|
|  |  |  | import com.doumee.service.business.CategoryService; | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(categoryService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("列表查询") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @CloudRequiredPermission("business:category:query") | 
|---|
|  |  |  | public ApiResponse<List<Category>> findList (@RequestBody Category category,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(categoryService.queryList(category)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:category:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<Category> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | ExcelExporter.build(Category.class).export(categoryService.findPage(pageWrap).getRecords(), "分类信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("导出二级分类数据Excel") | 
|---|
|  |  |  | @PostMapping("/exportChildExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:category:exportExcel") | 
|---|
|  |  |  | public void exportChildExcel (@RequestBody PageWrap<Category> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | //        pageWrap.getModel().setType(Constants.ONE); | 
|---|
|  |  |  | ExcelExporter.build(Category.class).export(categoryService.findChileList(pageWrap.getModel()), "车辆分类信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | category.setType(type); | 
|---|
|  |  |  | return ApiResponse.success(categoryService.findList(category)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|