| | |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.domain.vo.AppActivityPageVo; |
| | | import com.ruoyi.goods.domain.vo.AppSimpleActivityGoodsVo; |
| | | import com.ruoyi.goods.service.activity.ActivityService; |
| | | import com.ruoyi.goods.service.goods.GoodsService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppActivityGoodsPageDto; |
| | | import com.ruoyi.system.api.domain.dto.AppPageDto; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.service.RemoteMemberService; |
| | |
| | | public R<Page<AppActivityPageVo>> pageAppActivity(@RequestBody AppPageDto appPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Long shopId = null; |
| | | Member member = null; |
| | | if(userId!=null){ |
| | | Member member = memberService.getMember(userId).getData(); |
| | | member = memberService.getMember(userId).getData(); |
| | | if(member!=null&&member.getRelationShopId()!=null){ |
| | | shopId = member.getRelationShopId(); |
| | | } |
| | |
| | | if(shopId==null){ |
| | | throw new ServiceException(AppErrorConstant.NO_POSITION); |
| | | } |
| | | // if(member!=null&&member.getBindingFlag()==0){ |
| | | // shopId = null; |
| | | // } |
| | | Page<AppActivityPageVo> page = new Page<>(); |
| | | page.setSize(appPageDto.getPageSize()); |
| | | page.setCurrent(appPageDto.getPageNum()); |
| | |
| | | } |
| | | |
| | | |
| | | /*@RequestMapping(value = "/pageAppActivityGoods", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/pageAppActivityGoods", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取活动商品") |
| | | public R<Page<AppSimpleActivityGoodsVo>> pageAppActivityGoods(@RequestBody AppActivityGoodsPageDto appActivityGoodsPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | |
| | | Member member = memberService.getMember(userId).getData(); |
| | | if(member!=null&&member.getRelationShopId()!=null){ |
| | | appActivityGoodsPageDto.setShopId(member.getRelationShopId()); |
| | | }else{ |
| | | appActivityGoodsPageDto.setShopId(appActivityGoodsPageDto.getPositionShopId()); |
| | | } |
| | | } |
| | | if(appActivityGoodsPageDto.getShopId()==null){ |
| | |
| | | page.setCurrent(appActivityGoodsPageDto.getPageNum()); |
| | | List<AppSimpleActivityGoodsVo> appSimpleGoodsVoList = goodsService.pageAppActivityGoods(page,appActivityGoodsPageDto); |
| | | return R.ok(page.setRecords(appSimpleGoodsVoList)); |
| | | }*/ |
| | | } |
| | | |
| | | |
| | | } |