| | |
| | | if (sysInfo == null) { |
| | | throw new RuntimeException("登录用户信息不存在"); |
| | | } |
| | | ClassPathResource classPathResource = new ClassPathResource("import/采购退货单.xls"); |
| | | ClassPathResource classPathResource = new ClassPathResource("import/出库单.xls"); |
| | | // 获取文件输入流 |
| | | InputStream inputStream = classPathResource.getInputStream(); |
| | | Workbook wb = new HSSFWorkbook(inputStream); |
| | |
| | | params.setHeadingStartRow(2); |
| | | |
| | | List<OutputExcelTemplate> exportList = lWhFormOutputService.getExportList(id); |
| | | |
| | | if (CollectionUtils.isEmpty(exportList)) { |
| | | throw new RuntimeException("数据为空"); |
| | | } |
| | | int countNum = exportList.stream().filter(item -> item.getNum() != null).mapToInt(OutputExcelTemplate::getNum).sum(); |
| | | int totalAmount = exportList.stream().filter(item -> item.getTotalAmount() != null).mapToInt(OutputExcelTemplate::getTotalAmount).sum(); |
| | | double totalAmount = exportList.stream().filter(item -> item.getTotalAmount() != null).mapToDouble(OutputExcelTemplate::getAmount).sum(); |
| | | Optional<OutputExcelTemplate> first = exportList.stream().findFirst(); |
| | | OutputExcelTemplate templateExcelExport = first.get(); |
| | | String businessFormCode = templateExcelExport.getBusinessFormCode(); |
| | |
| | | map.put("totalAmount", totalAmount); |
| | | |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, OutputExcelTemplate.class, exportList, map); |
| | | downLoadExcel("采购退货单", response, workbook); |
| | | downLoadExcel("出库单", response, workbook); |
| | | |
| | | } |
| | | |