| | |
| | | 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 |