liyong
5 天以前 962dd24e7a041ed75e1d80856c7ce8ec4dcf2d8f
src/main/java/com/ruoyi/stock/controller/StockInventoryController.java
@@ -10,10 +10,8 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
 * <p>
@@ -40,7 +38,7 @@
    @PostMapping("/addstockInventory")
    @ApiOperation("新增库存")
    public R addstockInventory(StockInventoryDto stockInventoryDto) {
    public R addstockInventory(@RequestBody StockInventoryDto stockInventoryDto) {
        stockInventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode()));
        stockInventoryDto.setRecordId(0L);
        return R.ok(stockInventoryService.addstockInventory(stockInventoryDto));
@@ -49,9 +47,17 @@
    @PostMapping("/subtractStockInventory")
    @ApiOperation("扣减库存")
    public R subtractStockInventory(StockInventoryDto stockInventoryDto) {
    public R subtractStockInventory(@RequestBody StockInventoryDto stockInventoryDto) {
        stockInventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_STOCK_OUT.getCode()));
        stockInventoryDto.setRecordId(0L);
        return R.ok(stockInventoryService.subtractStockInventory(stockInventoryDto));
    }
    @GetMapping("importStockInventory")
    @ApiOperation("导入库存")
    public R importStockInventory(MultipartFile  file) {
        return R.ok(stockInventoryService.importStockInventory(file));
    }
}