| | |
| | | package com.ruoyi.goods.controller.concole; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.goods.service.activity.ActivityGoodsService; |
| | | import com.ruoyi.goods.service.goods.GoodsFileService; |
| | | import com.ruoyi.goods.service.goods.GoodsService; |
| | | import com.ruoyi.goods.service.goods.GoodsTotalService; |
| | | import com.ruoyi.goods.service.goods.ShopGoodsService; |
| | | import com.ruoyi.system.api.domain.dto.AppShopGoodsGetDto; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; |
| | | import com.ruoyi.system.api.domain.dto.GoodsTotalChangeDto; |
| | | import com.ruoyi.system.api.domain.dto.MerGoodsPriceListDto; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | | import com.ruoyi.system.api.domain.poji.goods.GoodsFile; |
| | | import com.ruoyi.system.api.domain.poji.goods.ShopGoods; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.system.api.domain.vo.MerGoodsPriceListVo; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | |
| | | @RequestMapping("/goods") |
| | | public class GoodsController { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private GoodsFileService goodsFileService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private ShopGoodsService shopGoodsService; |
| | | |
| | | @Resource |
| | | private GoodsTotalService goodsTotalService; |
| | | |
| | | @PostMapping("/getGoods") |
| | | public R<Goods> getGoods(@RequestBody String goodsId) |
| | |
| | | ShopGoods shopGoods = shopGoodsService.getByShopIdAndGoodsId(appShopGoodsGetDto.getShopId(),appShopGoodsGetDto.getGoodsId()); |
| | | return R.ok(shopGoods); |
| | | } |
| | | |
| | | /** |
| | | * @description 删除商品分类 |
| | | * @author jqs |
| | | * @date 2023/6/8 17:08 |
| | | * @param classId |
| | | * @return R |
| | | */ |
| | | @PostMapping("/deleteGoodsClass") |
| | | public R deleteGoodsClass(@RequestBody Long classId) |
| | | { |
| | | goodsService.deleteGoodsClass(classId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @description 删除商品标签 |
| | | * @author jqs |
| | | * @date 2023/6/8 17:07 |
| | | * @param goodsTag |
| | | * @return R |
| | | */ |
| | | @PostMapping("/deleteGoodsTag") |
| | | public R deleteGoodsTag(@RequestBody String goodsTag) |
| | | { |
| | | goodsService.deleteGoodsTag(goodsTag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @description 通过id获取商品列表 |
| | | * @author jqs |
| | | * @date 2023/6/13 15:55 |
| | | * @param goodsIds |
| | | * @return R<List<Goods>> |
| | | */ |
| | | @PostMapping("/listGoodsByGoodsId") |
| | | public R<List<Goods>> listGoodsByGoodsId(@RequestBody String goodsIds) |
| | | { |
| | | List<Goods> goodsList = goodsService.listGoodsByGoodsId(goodsIds); |
| | | return R.ok(goodsList); |
| | | } |
| | | |
| | | /** |
| | | * @description 通过id获取商品价格列表 |
| | | * @author jqs |
| | | * @date 2023/7/3 10:01 |
| | | * @param merGoodsPriceListDto |
| | | * @return R<List<MerGoodsPriceListVo>> |
| | | */ |
| | | @PostMapping("/listGoodsPriceByGoodsId") |
| | | public R<List<MerGoodsPriceListVo>> listGoodsPriceByGoodsId(@RequestBody MerGoodsPriceListDto merGoodsPriceListDto) |
| | | { |
| | | List<MerGoodsPriceListVo> goodsPriceListVoList = goodsService.listGoodsPriceByGoodsId(merGoodsPriceListDto); |
| | | return R.ok(goodsPriceListVoList); |
| | | } |
| | | |
| | | /** |
| | | * @description 改变商品统计 |
| | | * @author jqs |
| | | * @date 2023/9/5 15:01 |
| | | * @param goodsTotalChangeDtoList |
| | | * @return R |
| | | */ |
| | | @PostMapping("/changeGoodsTotal") |
| | | public R changeGoodsTotal(@RequestBody List<GoodsTotalChangeDto> goodsTotalChangeDtoList) |
| | | { |
| | | goodsTotalService.changeGoodsTotal(goodsTotalChangeDtoList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @description 获取分类商品名 |
| | | * @author jqs |
| | | * @date 2023/8/12 18:39 |
| | | * @param classId |
| | | * @return R<List<String>> |
| | | */ |
| | | @PostMapping("/listGoodsNameByGoodsClass") |
| | | public R<List<String>> listGoodsNameByGoodsClass(@RequestBody Long classId) |
| | | { |
| | | List<String> goodsNameList = goodsService.listGoodsNameByGoodsClass(classId); |
| | | return R.ok(goodsNameList); |
| | | } |
| | | } |