From 046d7ac5bbef4cbb6c6b64f3589e2722d13a07a5 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期二, 27 六月 2023 11:00:01 +0800
Subject: [PATCH] 日志管理

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java
index 5354c45..baff41c 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java
@@ -4,24 +4,25 @@
 import com.ruoyi.common.core.exception.ServiceException;
 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.domain.dto.AppBaseBathDto;
 import com.ruoyi.goods.domain.dto.AppGoodsInfoGetDto;
 import com.ruoyi.goods.domain.dto.AppShoppingCartAddDto;
 import com.ruoyi.goods.domain.dto.AppShoppingCartChangeDto;
 import com.ruoyi.goods.domain.vo.AppGoodsInfoVo;
+import com.ruoyi.goods.domain.vo.AppShoppingCartVo;
 import com.ruoyi.goods.service.goods.GoodsService;
 import com.ruoyi.goods.service.goods.ShoppingCartService;
+import com.ruoyi.system.api.constant.AppErrorConstant;
+import com.ruoyi.system.api.domain.dto.AppBaseBathDto;
 import com.ruoyi.system.api.domain.poji.member.Member;
 import com.ruoyi.system.api.service.RemoteMemberService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -36,13 +37,13 @@
 @RequestMapping("/app/goods")
 public class AppGoodsController extends BaseController {
 
-    @Autowired
+    @Resource
     private GoodsService goodsService;
 
-    @Autowired
+    @Resource
     private RemoteMemberService memberService;
 
-    @Autowired
+    @Resource
     private ShoppingCartService shoppingCartService;
 
     @RequestMapping(value = "/getGoodsInfo", method = RequestMethod.POST)
@@ -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);
     }

--
Gitblit v1.7.1