| package com.doumee.api.business; | 
|   | 
| import com.doumee.api.BaseController; | 
| import com.doumee.core.annotation.excel.ExcelExporter; | 
| import com.doumee.core.annotation.pr.PreventRepeat; | 
| import com.doumee.core.constants.ResponseStatus; | 
| import com.doumee.core.exception.BusinessException; | 
| import com.doumee.core.model.ApiResponse; | 
| import com.doumee.core.model.LoginUserInfo; | 
| import com.doumee.core.model.PageData; | 
| import com.doumee.core.model.PageWrap; | 
| import com.doumee.core.utils.Constants; | 
| import com.doumee.dao.business.model.BaseCateParam; | 
| import com.doumee.dao.business.model.BaseCategory; | 
| import com.doumee.dao.business.model.Category; | 
| import com.doumee.service.CateParamSelectService; | 
| import com.doumee.service.business.BaseCateParamService; | 
| import com.doumee.service.business.BaseCategoryService; | 
| import com.doumee.service.business.CategoryService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.java.Log; | 
| import org.apache.shiro.authz.annotation.RequiresPermissions; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.util.ArrayList; | 
| import java.util.List; | 
| import java.util.Objects; | 
|   | 
| /** | 
|  * @author 江蹄蹄 | 
|  * @date 2023/05/12 13:58 | 
|  */ | 
| @Api(tags = "品类信息表") | 
| @RestController | 
| @RequestMapping("/business/category") | 
| public class CategoryController extends BaseController { | 
|   | 
|     @Autowired | 
|     private CategoryService categoryService; | 
|   | 
|     @Autowired | 
|     private BaseCategoryService baseCategoryService; | 
|   | 
|     @Autowired | 
|     private BaseCateParamService baseCateParamService; | 
|     @Autowired | 
|     private CateParamSelectService cateParamSelectService; | 
|   | 
|   | 
|     @ApiOperation("列表") | 
|     @PostMapping("/list") | 
|     public ApiResponse<List<Category>> findList (@RequestBody Category category) { | 
|         return ApiResponse.success(categoryService.findList(category)); | 
|     } | 
|   | 
|     @ApiOperation("列表 - 商品选择") | 
|     @GetMapping("/findListForGoodsId") | 
|     public ApiResponse<List<Category>> findListForGoodsId (Integer goodsId) { | 
|         return ApiResponse.success(categoryService.findListForGoods(goodsId)); | 
|     } | 
|   | 
|   | 
|     @ApiOperation("企业选择分类列表 - H5") | 
|     @PostMapping("/companyFindList") | 
|     public ApiResponse<List<Category>> companyFindList (@RequestBody Category category) { | 
|         return ApiResponse.success(categoryService.companyFindList(category)); | 
|     } | 
|   | 
|     @ApiOperation("平台分类列表") | 
|     @PostMapping("/baseCategoryList") | 
|     public ApiResponse<List<BaseCategory>> baseCategoryList () { | 
|         BaseCategory baseCategory = new BaseCategory(); | 
|         baseCategory.setIsdeleted(Constants.ZERO); | 
|         baseCategory.setStatus(Constants.ZERO); | 
|         List list = baseCategoryService.findList(baseCategory); | 
|         return ApiResponse.success(list); | 
|     } | 
|   | 
|     @ApiOperation("平台分类详情") | 
|     @GetMapping("/baseCategoryDetail") | 
|     public ApiResponse<BaseCategory> baseCategoryDetail (Integer baseCategoryId) { | 
|   | 
|         BaseCategory baseCategory = baseCategoryService.findById(baseCategoryId); | 
|         if(Objects.isNull(baseCategory)){ | 
|             throw new BusinessException(ResponseStatus.DATA_EMPTY); | 
|         } | 
|         BaseCateParam baseCateParam = new BaseCateParam(); | 
|         baseCateParam.setIsdeleted(Constants.ZERO); | 
|         baseCateParam.setStatus(Constants.ZERO); | 
|         baseCateParam.setCategoryId(baseCategoryId); | 
|         baseCategory.setBaseCateParamList( | 
|                 baseCateParamService.findList(baseCateParam) | 
|         ); | 
|         return ApiResponse.success(baseCategory); | 
|     } | 
|   | 
|     @ApiOperation("列表 - SaaSH5") | 
|     @PostMapping("/saasList") | 
|     public ApiResponse<List<Category>> saasList (@RequestBody Category category) { | 
|         return ApiResponse.success(categoryService.findListSaaS(category)); | 
|     } | 
|   | 
| } |