| | |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/stockInventory") |
| | | @Api(tags = "库存表") |
| | | @Tag(name = "库存表") |
| | | @AllArgsConstructor |
| | | public class StockInventoryController { |
| | | |
| | | @Autowired |
| | | private StockInventoryService stockInventoryService; |
| | | |
| | | @GetMapping("/pagestockInventory") |
| | | @ApiOperation("分页查询库存") |
| | | @Operation(summary = "分页查询库存") |
| | | public R pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | IPage<StockInventoryDto> stockInventoryDtoIPage = stockInventoryService.pagestockInventory(page, stockInventoryDto); |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @GetMapping("/pageListCombinedStockInventory") |
| | | @ApiOperation("分页查询联合库存列表") |
| | | @Operation(summary = "分页查询联合库存列表") |
| | | public R pageListCombinedStockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | IPage<StockInventoryDto> stockInventoryDtoIPage = stockInventoryService.pageListCombinedStockInventory(page, stockInventoryDto); |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @PostMapping("/addstockInventory") |
| | | @ApiOperation("新增库存") |
| | | @Operation(summary = "新增库存") |
| | | public R addstockInventory(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode())); |
| | | stockInventoryDto.setRecordId(0L); |
| | |
| | | |
| | | |
| | | @PostMapping("/subtractStockInventory") |
| | | @ApiOperation("扣减库存") |
| | | @Operation(summary = "扣减库存") |
| | | public R subtractStockInventory(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType(String.valueOf(StockOutQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_OUT.getCode())); |
| | | stockInventoryDto.setRecordId(0L); |
| | |
| | | |
| | | |
| | | @PostMapping("importStockInventory") |
| | | @ApiOperation("导入库存") |
| | | @Operation(summary = "导入库存") |
| | | public R importStockInventory(MultipartFile file) { |
| | | return stockInventoryService.importStockInventory(file); |
| | | } |
| | |
| | | } |
| | | |
| | | @PostMapping("/exportStockInventory") |
| | | @ApiOperation("导出库存") |
| | | @Operation(summary = "导出库存") |
| | | public void exportStockInventory(HttpServletResponse response, StockInventoryDto stockInventoryDto) { |
| | | stockInventoryService.exportStockInventory(response, stockInventoryDto); |
| | | } |
| | | |
| | | @GetMapping("stockInventoryPage") |
| | | @ApiOperation("库存报表查询") |
| | | @Operation(summary = "库存报表查询") |
| | | public R stockInventoryPage(Page page, StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.stockInventoryPage(stockInventoryDto,page)); |
| | | } |
| | | |
| | | @GetMapping("stockInAndOutRecord") |
| | | @ApiOperation("统计各个产品的入库和出库记录") |
| | | @Operation(summary = "统计各个产品的入库和出库记录") |
| | | public R stockInAndOutRecord(StockInventoryDto stockInventoryDto,Page page) { |
| | | return R.ok(stockInventoryService.stockInAndOutRecord(stockInventoryDto,page)); |
| | | } |
| | | |
| | | @PostMapping("/frozenStock") |
| | | @ApiOperation("冻结库存") |
| | | @Operation(summary = "冻结库存") |
| | | public R frozenStock(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.frozenStock(stockInventoryDto)); |
| | | } |
| | | |
| | | @PostMapping("/thawStock") |
| | | @ApiOperation("解冻库存") |
| | | @Operation(summary = "解冻库存") |
| | | public R thawStock(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.thawStock(stockInventoryDto)); |
| | | } |