|  |  | 
 |  |  | 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 江蹄蹄 | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private CategoryService categoryService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private BaseCategoryService baseCategoryService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private BaseCateParamService baseCateParamService; | 
 |  |  |     @Autowired | 
 |  |  |     private CateParamSelectService cateParamSelectService; | 
 |  |  |  | 
 |  |  |     @PreventRepeat | 
 |  |  |     @ApiOperation("新建") | 
 |  |  | 
 |  |  |     @PostMapping("/page") | 
 |  |  |     @RequiresPermissions("business:category:query") | 
 |  |  |     public ApiResponse<PageData<Category>> findPage (@RequestBody PageWrap<Category> pageWrap) { | 
 |  |  |         LoginUserInfo loginUserInfo = this.getLoginUser(); | 
 |  |  |         pageWrap.getModel().setCompanyId(loginUserInfo.getCompanyId()); | 
 |  |  |         return ApiResponse.success(categoryService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation("列表 - H5") | 
 |  |  |     @ApiOperation("列表") | 
 |  |  |     @PostMapping("/list") | 
 |  |  |     public ApiResponse<List<Category>> findList (@RequestBody Category category) { | 
 |  |  |         return ApiResponse.success(categoryService.findList(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)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |