From de40c5a7d03ffe9bcdb2aabe82e03aef98e94eb8 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期四, 03 四月 2025 18:07:41 +0800 Subject: [PATCH] 订单部分 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java index 77a8e72..28222d3 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java @@ -8,9 +8,11 @@ import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.GoodsShop; +import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.service.GoodsShopService; +import com.ruoyi.other.service.ShopService; import com.ruoyi.other.vo.ShopGoodsList; import com.ruoyi.other.vo.ShopGoodsListVo; import io.swagger.annotations.ApiOperation; @@ -33,6 +35,8 @@ @Resource private GoodsShopService goodsShopService; + @Resource + private ShopService shopService; @Resource private GoodsService goodsService; @@ -40,14 +44,18 @@ /** * 获取商品门店关系数据 - * @param goodsShop - * @return */ @ResponseBody - @PostMapping("/getGoodsShop") - public R<GoodsShop> getGoodsShop(@RequestBody GoodsShop goodsShop){ - GoodsShop one = goodsShopService.getOne(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getGoodsId, goodsShop.getGoodsId()) - .eq(GoodsShop::getShopId, goodsShop.getShopId())); + @GetMapping("/getGoodsShop/{goodsId}") + public R<GoodsShop> getGoodsShop(@PathVariable("goodsId") Integer goodsId) { + GoodsShop one = goodsShopService.getOne(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getGoodsId,goodsId)); + Shop shop = shopService.getOne(new LambdaQueryWrapper<Shop>().eq(Shop::getId, one.getShopId())); + if (shop == null || shop.getStatus() ==2 || shop.getDelFlag()==1) { + return R.ok(); + } + one.setShopName(shop.getName()); + one.setPhone(shop.getPhone()); + one.setAddress(shop.getAddress()); return R.ok(one); } -- Gitblit v1.7.1