jiangqs
2023-06-04 0404b00b9cfecc8044d340ead52a30a5298c6c31
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java
@@ -5,6 +5,7 @@
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.goods.domain.vo.AppShoppingCartVo;
import com.ruoyi.system.api.constant.AppErrorConstant;
import com.ruoyi.system.api.domain.dto.AppBaseBathDto;
import com.ruoyi.goods.domain.dto.AppGoodsInfoGetDto;
import com.ruoyi.goods.domain.dto.AppShoppingCartAddDto;
@@ -54,9 +55,12 @@
            if(member!=null&&member.getRelationShopId()!=null){
                appGoodsInfoGetDto.setShopId(member.getRelationShopId());
            }else{
                throw new ServiceException("请先获取附近商户定位");
                appGoodsInfoGetDto.setShopId(appGoodsInfoGetDto.getPositionShopId());
            }
        }
        if(appGoodsInfoGetDto.getShopId()==null){
            throw new ServiceException(AppErrorConstant.NO_POSITION);
        }
        AppGoodsInfoVo appGoodsInfoVo = goodsService.getGoodsInfo(appGoodsInfoGetDto);
        return R.ok(appGoodsInfoVo);
    }