| | |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @GetMapping("/warnPage") |
| | | @Operation(summary = "库存预警分页(可用数量<=预警值)") |
| | | public R warnPage(Page page, StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setWarnOnly(true); |
| | | return R.ok(stockInventoryService.pagestockInventory(page, stockInventoryDto)); |
| | | } |
| | | |
| | | @GetMapping("/warnExport") |
| | | @Operation(summary = "库存预警导出") |
| | | public void warnExport(HttpServletResponse response, StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setWarnOnly(true); |
| | | List<StockInventoryDto> list = stockInventoryService.pagestockInventory(new Page<>(1, -1), stockInventoryDto).getRecords(); |
| | | List<StockInventoryExportData> exportList = new ArrayList<>(); |
| | | for (StockInventoryDto item : list) { |
| | | StockInventoryExportData data = new StockInventoryExportData(); |
| | | data.setProductName(item.getProductName()); |
| | | data.setModel(item.getModel()); |
| | | data.setUnit(item.getUnit()); |
| | | data.setBatchNo(item.getBatchNo()); |
| | | data.setQualifiedQuantity(item.getQualitity()); |
| | | data.setWarnNum(item.getWarnNum()); |
| | | data.setQualifiedLockedQuantity(item.getLockedQuantity()); |
| | | data.setRemark(item.getRemark()); |
| | | exportList.add(data); |
| | | } |
| | | ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class); |
| | | util.exportExcel(response, exportList, "库存预警"); |
| | | } |
| | | |
| | | /** |
| | | * 查询对应批号和数量 |
| | | * @param page |
| | | * @param stockInventoryDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/getBatchNoQty") |
| | | @Operation(summary = "查询对应批号和数量") |
| | | public R getBatchNoQty(Page page, StockInventoryDto stockInventoryDto) { |
| | | IPage<StockInventoryDto> stockInventoryDtoIPage = stockInventoryService.getBatchNoQty(page, stockInventoryDto); |
| | | return R.ok(stockInventoryDtoIPage); |
| | | } |
| | | |
| | | @PostMapping("/addstockInventory") |
| | | @Operation(summary = "新增库存") |
| | | public R addstockInventory(@RequestBody StockInventoryDto stockInventoryDto) { |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("importStockInventory") |
| | | @PostMapping("/importStockInventory") |
| | | @Operation(summary = "导入库存") |
| | | public R importStockInventory(MultipartFile file) { |
| | | return stockInventoryService.importStockInventory(file); |
| | |
| | | stockInventoryService.exportStockInventory(response, stockInventoryDto); |
| | | } |
| | | |
| | | @GetMapping("stockInventoryPage") |
| | | @GetMapping("/stockInventoryPage") |
| | | @Operation(summary = "库存报表查询") |
| | | public R stockInventoryPage(Page page, StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.stockInventoryPage(stockInventoryDto,page)); |
| | | } |
| | | |
| | | @GetMapping("stockInAndOutRecord") |
| | | @GetMapping("/stockInAndOutRecord") |
| | | @Operation(summary = "统计各个产品的入库和出库记录") |
| | | public R stockInAndOutRecord(StockInventoryDto stockInventoryDto,Page page) { |
| | | return R.ok(stockInventoryService.stockInAndOutRecord(stockInventoryDto,page)); |
| | |
| | | public R thawStock(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.thawStock(stockInventoryDto)); |
| | | } |
| | | |
| | | @GetMapping("/getByModelId") |
| | | @Operation(summary = "根据产品规格ID获取入库记录") |
| | | public R getByModelId(Long productModelId) { |
| | | return R.ok(stockInventoryService.getByModelId(productModelId)); |
| | | } |
| | | } |