From 01d6fa48a0de7a21988e89f71721b6b85e53b517 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期四, 06 三月 2025 16:33:53 +0800 Subject: [PATCH] 去掉资讯图片必填限制 --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 46 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java index ccdcc09..d8075b2 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java @@ -5,7 +5,9 @@ import com.ruoyi.common.security.annotation.InnerAuth; import com.ruoyi.goods.service.IGoodsSkuService; import com.ruoyi.system.api.domain.GoodsSku; +import com.ruoyi.system.api.domain.Order; import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; +import java.util.Collection; import java.util.List; import javax.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; @@ -39,7 +41,7 @@ @InnerAuth @PostMapping("/getGoodsSkuOne") @ResponseBody - public R<GoodsSku> getGoodsSkuOne(@RequestBody Integer goodsSkuId) { + public R<GoodsSku> getGoodsSkuOne(@RequestBody Long goodsSkuId) { GoodsSku goodsSkuOne=iGoodsSkuService.getById(goodsSkuId); return R.ok(goodsSkuOne); @@ -73,9 +75,49 @@ * @param source 请求来源 */ @InnerAuth - @PutMapping("/goods-sku/upd-stock") - R<?> returningStock(@RequestBody List<GoodsStockUpdDTO> goodsStockUpdDTOS) { - iGoodsSkuService.returningStock(goodsStockUpdDTOS); + @PutMapping("/upd-stock") + R<?> updGoodsStock(@RequestBody List<GoodsStockUpdDTO> goodsStockUpdDTOS) { + iGoodsSkuService.updGoodsStock(goodsStockUpdDTOS); + return R.ok(); + } + + @InnerAuth + @PutMapping("/upd-stock1") + R<?> updGoodsStock1(@RequestBody GoodsStockUpdDTO goodsStockUpdDTOS) { + iGoodsSkuService.updGoodsStock1(goodsStockUpdDTOS); + return R.ok(); + } + @InnerAuth + @PutMapping("/updGoods") + R<Boolean> updGoods(@RequestBody GoodsSku goodsSku){ + GoodsSku goodsSkuOne=iGoodsSkuService.getById(goodsSku.getId()); + Integer h=goodsSkuOne.getSoldQuantity()+goodsSku.getSoldQuantity(); + goodsSkuOne.setSoldQuantity(h); + iGoodsSkuService.updateById(goodsSkuOne); + return R.ok(); + } + + /** + * 根据商品id集合查询商品 + * + * @param goodsIdList 商品id集合 + * @return 商品集合 + */ + @InnerAuth + @PostMapping("/list") + R<List<GoodsSku>> getGoodsListByIds(@RequestBody Collection<Long> goodsIdList) { + return R.ok(iGoodsSkuService.listByIds(goodsIdList)); + } + + /** + * 退款退货订单退库存 + * + * @param order + */ + @InnerAuth + @PostMapping("/returnStockByOrder") + R<?> returnStockByOrder(@RequestBody Order order) { + iGoodsSkuService.returnStockByOrder(order); return R.ok(); } } -- Gitblit v1.7.1