| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private GoodsShopService goodsShopService; |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | |
| | | |
| | | /** |
| | | * 获取商品门店关系数据 |
| | | * @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); |
| | | } |
| | | |