|
|
@ -764,7 +764,28 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
writeSheet = EasyExcel.writerSheet("Sheet1") |
|
|
writeSheet = EasyExcel.writerSheet("Sheet1") |
|
|
.head(head) |
|
|
.head(head) |
|
|
.build(); |
|
|
.build(); |
|
|
} else { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
// 如果是资金流水表,添加动态表头处理器 |
|
|
|
|
|
else if ("fundUser".equals(exportType)) { |
|
|
|
|
|
Map<String, String> headers = excelHeaderTranslator.getFundsHeaders(lang); |
|
|
|
|
|
List<String> columnOrder = excelHeaderTranslator.getFundsColumnOrder(); |
|
|
|
|
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
|
|
List<List<String>> head = new ArrayList<>(); |
|
|
|
|
|
for (String fieldName : columnOrder) { |
|
|
|
|
|
String headerText = headers.get(fieldName); |
|
|
|
|
|
if (headerText != null) { |
|
|
|
|
|
List<String> headItems = new ArrayList<>(); |
|
|
|
|
|
headItems.add(headerText); |
|
|
|
|
|
head.add(headItems); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
writeSheet = EasyExcel.writerSheet("Sheet1") |
|
|
|
|
|
.head(head) |
|
|
|
|
|
.build(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
writeSheet = EasyExcel.writerSheet("Sheet1").build(); |
|
|
writeSheet = EasyExcel.writerSheet("Sheet1").build(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -871,6 +892,12 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
translatePerformanceList((List<PerformanceVO>) list, lang); |
|
|
translatePerformanceList((List<PerformanceVO>) list, lang); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 添加资金流水翻译支持 |
|
|
|
|
|
if ("fundsUser".equals(exportType) && list.get(0) instanceof FundsDTO) { |
|
|
|
|
|
fillUserStatusDescriptions((List<FundsDTO>) list); |
|
|
|
|
|
translateFundsList((List<FundsDTO>) list, lang); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
excelWriter.write(list, writeSheet); |
|
|
excelWriter.write(list, writeSheet); |
|
|
page.setPageNum(page.getPageNum() + 1); |
|
|
page.setPageNum(page.getPageNum() + 1); |
|
|
totalCount += list.size(); |
|
|
totalCount += list.size(); |
|
|
@ -1029,6 +1056,30 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* 填充用户数据的状态描述 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void fillUserStatusDescriptions(List<FundsDTO> funds) { |
|
|
|
|
|
if (funds != null && !funds.isEmpty()) { |
|
|
|
|
|
for (FundsDTO fund : funds) { |
|
|
|
|
|
if (fund.getStatus() != null) { |
|
|
|
|
|
fund.setStatusName(convertStatusToString(fund.getStatus())); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 将类型数字转换为中文描述 |
|
|
|
|
|
*/ |
|
|
|
|
|
private String convertStatusToString(Integer type) { |
|
|
|
|
|
if (type == null) return ""; |
|
|
|
|
|
switch (type) { |
|
|
|
|
|
case 4: return "正常"; |
|
|
|
|
|
case 6: return "已退款"; |
|
|
|
|
|
default: return "其他"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* 填充金币明细数据的类型描述 |
|
|
* 填充金币明细数据的类型描述 |
|
|
*/ |
|
|
*/ |
|
|
private void fillGoldDetailTypeDescriptions(List<GoldDetail> goldDetails) { |
|
|
private void fillGoldDetailTypeDescriptions(List<GoldDetail> goldDetails) { |
|
|
@ -1181,7 +1232,7 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
switch (platform) { |
|
|
switch (platform) { |
|
|
case 1: return "PC"; |
|
|
case 1: return "PC"; |
|
|
case 2: return "手机"; |
|
|
case 2: return "手机"; |
|
|
default: return ""; |
|
|
|
|
|
|
|
|
default: return "未知"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1612,4 +1663,39 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 翻译资金流水列表 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void translateFundsList(List<FundsDTO> list, String lang) { |
|
|
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
for (FundsDTO item : list) { |
|
|
|
|
|
// 翻译所属地区名称 |
|
|
|
|
|
if (item.getMarketName() != null && !item.getMarketName().isEmpty()) { |
|
|
|
|
|
item.setMarketName(languageTranslationUtil.translate(item.getMarketName(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
// 翻译付款币种 |
|
|
|
|
|
if (item.getPaymentCurrencyName() != null && !item.getPaymentCurrencyName().isEmpty()) { |
|
|
|
|
|
item.setPaymentCurrencyName(languageTranslationUtil.translate(item.getPaymentCurrencyName(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
// 翻译到账币种 |
|
|
|
|
|
if (item.getReceivedCurrencyName() != null && !item.getReceivedCurrencyName().isEmpty()) { |
|
|
|
|
|
item.setReceivedCurrencyName(languageTranslationUtil.translate(item.getReceivedCurrencyName(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
// 翻译支付方式 |
|
|
|
|
|
if (item.getPayType() != null && !item.getPayType().isEmpty()) { |
|
|
|
|
|
item.setPayType(languageTranslationUtil.translate(item.getPayType(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
// 翻译退款状态 |
|
|
|
|
|
if (item.getStatusName() != null && !item.getStatusName().isEmpty()) { |
|
|
|
|
|
item.setStatusName(languageTranslationUtil.translate(item.getStatusName(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
// 翻译退款币种 |
|
|
|
|
|
if (item.getRefundCurrency() != null && !item.getRefundCurrency().isEmpty()) { |
|
|
|
|
|
item.setRefundCurrency(languageTranslationUtil.translate(item.getRefundCurrency(), lang)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |