| | |
| | | package com.ruoyi.stock.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | 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; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/stockInventory") |
| | | @Api(tags = "库存表") |
| | | public class StockInventoryController { |
| | | |
| | | @Autowired |
| | | private StockInventoryService stockInventoryService; |
| | | |
| | | @GetMapping("/pagestockInventory") |
| | | @ApiOperation("分页查询库存") |
| | | public R pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | IPage<StockInventoryDto> stockInventoryDtoIPage = stockInventoryService.pagestockInventory(page, stockInventoryDto); |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @PostMapping("/addstockInventory") |
| | | @ApiOperation("新增库存") |
| | | public R addstockInventory(StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType("合格自定义入库"); |
| | | stockInventoryDto.setRecordId(0L); |
| | | return R.ok(stockInventoryService.addstockInventory(stockInventoryDto)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/subtractStockInventory") |
| | | @ApiOperation("扣减库存") |
| | | public R subtractStockInventory(StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType("合格自定义出库库"); |
| | | stockInventoryDto.setRecordId(0L); |
| | | return R.ok(stockInventoryService.subtractStockInventory(stockInventoryDto)); |
| | | } |
| | | } |