Parcourir la source

修改模版文件 增加日志

shuiqilin-optimize
JianShengFei il y a 9 mois
Parent
révision
eba19d3b25

+ 3
- 0
src/main/java/com/qtzl/alterSales/manager/service/AflCommissionReportExportServiceImpl.java Voir le fichier

@@ -72,6 +72,7 @@ public class AflCommissionReportExportServiceImpl implements AflCommissionReport

@Override
public String exportExcel(List<Integer> yearAndMonths) throws ServiceHandleException {
log.info("【{}】开始导出excel...", "手续费");
// yearAndMonth按照从小到大排序
AtomicInteger indexSer = new AtomicInteger(1);
Collections.sort(yearAndMonths);
@@ -125,6 +126,7 @@ public class AflCommissionReportExportServiceImpl implements AflCommissionReport

return vo;
}).collect(Collectors.toList());
log.info("【{}】推送数据完成", "手续费");

InputStream inputStream;
try {
@@ -151,6 +153,7 @@ public class AflCommissionReportExportServiceImpl implements AflCommissionReport
excelWriter.fill(map, writeSheet);

excelWriter.finish();
log.info("【{}】导出excel完成", "手续费");

File file = new File(fileName);
// 上传文件到文件服务器并返回文件请求路径

+ 4
- 0
src/main/java/com/qtzl/alterSales/manager/service/AflPaccountReceivableBillServiceImpl.java Voir le fichier

@@ -50,6 +50,7 @@ public class AflPaccountReceivableBillServiceImpl implements AflPaccountReceivab

@Override
public String export(List<Integer> accountDates) throws ServiceHandleException {
log.info("【{}】开始导出数据", "通行费");
List<AflPaccountReceivableBillDateGroupVO> receivableBillDateGroupVOS = aflPaccountReceivableBillRepo.findMapByAccountDates(accountDates);

InputStream inputStream;
@@ -68,6 +69,7 @@ public class AflPaccountReceivableBillServiceImpl implements AflPaccountReceivab
ExcelWriter excelWriter = EasyExcelFactory.write(fileName + ".xlsx").withTemplate(inputStream).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet().build();

log.info("开始推送数据...");
AtomicReference<Long> totalAmountAll = new AtomicReference<>(0L);
AtomicInteger indexSer = new AtomicInteger(1);
List<ExcelHeadTollPaymentReceiptVO> collect = receivableBillDateGroupVOS.stream().map(e -> {
@@ -84,6 +86,7 @@ public class AflPaccountReceivableBillServiceImpl implements AflPaccountReceivab
totalAmountAll.updateAndGet(v -> v + totalAmount);
return vo;
}).collect(Collectors.toList());
log.info("数据推送完成...");

FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
excelWriter.fill(collect, fillConfig, writeSheet);
@@ -93,6 +96,7 @@ public class AflPaccountReceivableBillServiceImpl implements AflPaccountReceivab
map.put("totalAmountAll", String.valueOf(totalAmountAll.get()));
excelWriter.fill(map, writeSheet);
excelWriter.finish();
log.info("【{}】导出数据完成", "通行费");

// 将文件上传到文件服务器
File file = new File(fileName + ".xlsx");

BIN
src/main/resources/excel-template/BydIncomeCostTemplate.xlsx Voir le fichier


Chargement…
Annuler
Enregistrer