|  |  |  | 
|---|
|  |  |  | SysShopInfo zbShop = shopInfoDao.selectZbShop(user.getCompanyId()); | 
|---|
|  |  |  | ShoppingGoodsCategory category = new ShoppingGoodsCategory(); | 
|---|
|  |  |  | category.setShopId(zbShop.getId()); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(shoppingGoodsCategoryService.findByModel(category)); | 
|---|
|  |  |  | List<ShoppingGoodsCategory> list = new ArrayList<>(); | 
|---|
|  |  |  | List<ShoppingGoodsCategory> byModel = shoppingGoodsCategoryService.findByModel(category); | 
|---|
|  |  |  | ShoppingGoodsCategory type = new ShoppingGoodsCategory(); | 
|---|
|  |  |  | type.setName("全部"); | 
|---|
|  |  |  | type.setParentId(0L); | 
|---|
|  |  |  | list.add(type); | 
|---|
|  |  |  | list.addAll(byModel); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取商品列表", notes = "获取商品列表") | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/findShoppingGoods") | 
|---|
|  |  |  | public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) { | 
|---|
|  |  |  | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | shoppingGoodsListDto.setShopId(user.getShopId()); | 
|---|
|  |  |  | if (!DataAuthUtil.hasAllShopAuth()) { | 
|---|
|  |  |  | shoppingGoodsListDto.setShopId(user.getShopId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | QueryUtil.setQueryLimitCom(shoppingGoodsListDto); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|