mitao
2024-07-29 fc8b51f40e71aa09bb49f407c1e9f68ac94ceb58
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSkuController.java
@@ -1,6 +1,7 @@
package com.ruoyi.goods.controller.inner;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.annotation.InnerAuth;
import com.ruoyi.goods.service.IGoodsSkuService;
@@ -9,14 +10,8 @@
import java.util.Collection;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -40,7 +35,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);
@@ -80,6 +75,22 @@
        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集合查询商品
     *