Commit fffa61d1 authored by huyuchen's avatar huyuchen

导出优化

parent 56f43907
...@@ -162,18 +162,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -162,18 +162,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<TPaymentInfoBatchVo> util;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPaymentInfoNoPage(searchVo); list = baseMapper.getTPaymentInfoNoPage(searchVo);
if (Common.isNotNull(list)) {
util = new ExcelUtil<>(TPaymentInfoBatchVo.class);
for (TPaymentInfoBatchVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet("缴费库" + index).build(); writeSheet = EasyExcel.writerSheet("缴费库" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
...@@ -190,6 +183,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -190,6 +183,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
out.flush();
excelWriter.finish(); excelWriter.finish();
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
...@@ -217,18 +211,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -217,18 +211,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet; WriteSheet writeSheet;
ExcelUtil<TPaymentInfoExportVo> util;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPaymentInfoSumNoPage(searchVo); list = baseMapper.getTPaymentInfoSumNoPage(searchVo);
if (Common.isNotNull(list)) {
util = new ExcelUtil<>(TPaymentInfoExportVo.class);
for (TPaymentInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcel.writerSheet(PaymentConstants.EXPORT + index).build(); writeSheet = EasyExcel.writerSheet(PaymentConstants.EXPORT + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
...@@ -245,6 +232,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -245,6 +232,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
list.clear(); list.clear();
} }
out.flush();
excelWriter.finish(); excelWriter.finish();
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
......
...@@ -773,8 +773,12 @@ ...@@ -773,8 +773,12 @@
a.UNIT_PROVIDENT_SUM, a.UNIT_PROVIDENT_SUM,
a.PERSONAL_PROIDENT_SET, a.PERSONAL_PROIDENT_SET,
a.PERSONAL_PROVIDENT_SUM, a.PERSONAL_PROVIDENT_SUM,
a.PUSH_STATUS, CASE WHEN a.PUSH_STATUS=0 THEN "未打标"
a.LOCK_STATUS, WHEN a.PUSH_STATUS =1 THEN "已打标"
ELSE a.PUSH_STATUS END as "PUSH_STATUS",
CASE WHEN a.LOCK_STATUS=0 THEN "已推送"
WHEN a.LOCK_STATUS =1 THEN "未推送"
ELSE a.LOCK_STATUS END as "LOCK_STATUS",
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME a.CREATE_TIME
FROM t_payment_info a FROM t_payment_info a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment