| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.annotation.DistributedLock; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.dto.AddGoodsDTO; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import io.swagger.annotations.*; |
| | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加商品 |
| | | */ |
| | | @PostMapping("/addGoods") |
| | | @ApiOperation(value = "发布商品", tags = {"管理后台-商品管理"}) |
| | | public R<Void> addGoods(@RequestBody Goods goods) { |
| | | if(goods.getPurchaseLimit()==null){ |
| | | /* if(goods.getPurchaseLimit()==null){ |
| | | goods.setPurchaseLimit(-1); |
| | | } |
| | | goodsService.addGoods(goods); |
| | | goodsService.addGoods(goods);*/ |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PutMapping("/manageGoodsUpdate") |
| | | @ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"}) |
| | | public R<Void> manageGoodsUpdate(@RequestBody Goods goods){ |
| | | if(goods.getPurchaseLimit()==null){ |
| | | /* if(goods.getPurchaseLimit()==null){ |
| | | goods.setPurchaseLimit(-1); |
| | | } |
| | | goodsService.updateManageGoods(goods); |
| | |
| | | goodsLambdaUpdateWrapper.set(Goods::getDistributionMode,null); |
| | | goodsLambdaUpdateWrapper.eq(Goods::getId, goods.getId()); |
| | | goodsService.update(goodsLambdaUpdateWrapper); |
| | | } |
| | | }*/ |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 根据类型(1=服务商品,2=单品商品)获取商品数据 |
| | | * @param type |
| | | * 获取商品数据 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getGoodsByType") |
| | | public R<List<Goods>> getGoodsByType(@RequestParam("type") Integer type){ |
| | | List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); |
| | | public R<List<Goods>> getGoodsByType(){ |
| | | List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); |
| | | return R.ok(list); |
| | | } |
| | | |