|
|
|
@ -3,9 +3,14 @@ package com.example.demo.serviceImpl.coin; |
|
|
|
import cn.hutool.log.AbstractLog; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.ExcelWriter; |
|
|
|
import com.alibaba.excel.write.handler.SheetWriteHandler; |
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
|
|
|
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; |
|
|
|
import com.example.demo.Util.ExcelHeaderTranslator; |
|
|
|
import com.example.demo.Util.ExcelUploadUtil; |
|
|
|
import com.example.demo.Util.JWTUtil; |
|
|
|
import com.example.demo.Util.LanguageTranslationUtil; |
|
|
|
import com.example.demo.controller.bean.BeanConsumeController; |
|
|
|
import com.example.demo.controller.bean.BeanRechargeController; |
|
|
|
import com.example.demo.controller.cash.CashCollectionController; |
|
|
|
@ -50,9 +55,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.io.*; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
|
|
|
|
@Service |
|
|
|
@ -85,6 +88,12 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
private CashRefundController cashRefundController; |
|
|
|
@Autowired |
|
|
|
private CashCollectionController cashCollectionController; |
|
|
|
// 注入LanguageTranslationUtil |
|
|
|
@Autowired |
|
|
|
private LanguageTranslationUtil languageTranslationUtil; |
|
|
|
// 注入ExcelHeaderTranslator |
|
|
|
@Autowired |
|
|
|
private ExcelHeaderTranslator excelHeaderTranslator; |
|
|
|
// 每页查询的数据量 |
|
|
|
private static final int PAGE_SIZE = 5000; |
|
|
|
@Autowired |
|
|
|
@ -100,7 +109,15 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode GoldDetailNode = requestDataNode.path("goldDetail"); |
|
|
|
GoldDetail goldDetail = objectMapper.treeToValue(GoldDetailNode, GoldDetail.class); |
|
|
|
page.setGoldDetail(goldDetail); |
|
|
|
return goldDetailController.ExcelGoldDetail(page); |
|
|
|
|
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
|
|
|
|
return goldDetailController.ExcelGoldDetail(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -117,7 +134,15 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode UserNode = requestDataNode.path("user"); |
|
|
|
User user = objectMapper.treeToValue(UserNode, User.class); |
|
|
|
page.setUser(user); |
|
|
|
return goldDetailController.ExcelGold(page); |
|
|
|
|
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
|
|
|
|
return goldDetailController.ExcelGold(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -139,7 +164,15 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
List<String> markets = Arrays.asList(StringUtils.split(admin.getMarkets(), ",")); |
|
|
|
rechargeUser.setMarkets(markets); |
|
|
|
page.setRechargeUser(rechargeUser); |
|
|
|
return rechargeController.select(page); |
|
|
|
|
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
|
|
|
|
return rechargeController.select(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -161,13 +194,22 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
List<String> markets = Arrays.asList(StringUtils.split(admin.getMarkets(), ",")); |
|
|
|
consumeUser.setMarkets(markets); |
|
|
|
page.setConsumeUser(consumeUser); |
|
|
|
return consumeController.select(page); |
|
|
|
|
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
|
|
|
|
return consumeController.select(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public Exception refundExcel(String message) throws Exception { |
|
|
|
@ -183,7 +225,14 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
List<String> markets = Arrays.asList(StringUtils.split(admin.getMarkets(), ",")); |
|
|
|
refundUser.setMarkets(markets); |
|
|
|
page.setRefundUser(refundUser); |
|
|
|
return refundController.select(page, String.join(",", markets)); |
|
|
|
|
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return refundController.select(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -199,7 +248,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanConsumeLiveNode = requestDataNode.path("beanConsumeLive"); |
|
|
|
BeanConsumeLive beanConsumeLive = objectMapper.treeToValue(beanConsumeLiveNode, BeanConsumeLive.class); |
|
|
|
page.setBeanConsumeLive(beanConsumeLive); |
|
|
|
return beanConsumeController.selectLiveBy(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return beanConsumeController.selectLiveBy(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -215,7 +270,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanConsumeFanNode = requestDataNode.path("beanConsumeFan"); |
|
|
|
BeanConsumeFan beanConsumeFan = objectMapper.treeToValue(beanConsumeFanNode, BeanConsumeFan.class); |
|
|
|
page.setBeanConsumeFan(beanConsumeFan); |
|
|
|
return beanConsumeController.selectFanBy(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return beanConsumeController.selectFanBy(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -231,7 +292,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanConsumeArticleNode = requestDataNode.path("beanConsumeArticle"); |
|
|
|
BeanConsumeArticle beanConsumeArticle = objectMapper.treeToValue(beanConsumeArticleNode, BeanConsumeArticle.class); |
|
|
|
page.setBeanConsumeArticle(beanConsumeArticle); |
|
|
|
return beanConsumeController.selectArticleBy(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return beanConsumeController.selectArticleBy(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -247,7 +314,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanRechargeNode = requestDataNode.path("beanSystemRechargeInfo"); |
|
|
|
BeanSystemRechargeInfo beanSystemRechargeInfo = objectMapper.treeToValue(beanRechargeNode, BeanSystemRechargeInfo.class); |
|
|
|
page.setBeanSystemRechargeInfo(beanSystemRechargeInfo); |
|
|
|
return beanRechargeController.selectBySystem(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return beanRechargeController.selectBySystem(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -263,7 +336,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanRechargeNode = requestDataNode.path("beanOnlineRechargeInfo"); |
|
|
|
BeanOnlineRechargeInfo beanOnlineRechargeInfo = objectMapper.treeToValue(beanRechargeNode, BeanOnlineRechargeInfo.class); |
|
|
|
page.setBeanOnlineRechargeInfo(beanOnlineRechargeInfo); |
|
|
|
return beanRechargeController.selectByOnline(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return beanRechargeController.selectByOnline(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -279,7 +358,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanRechargeNode = requestDataNode.path("cashRecordDTO"); |
|
|
|
CashRecordDTO cashRecordDTO = objectMapper.treeToValue(beanRechargeNode, CashRecordDTO.class); |
|
|
|
page.setCashRecordDTO(cashRecordDTO); |
|
|
|
return cashRefundController.export(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return cashRefundController.export(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -295,7 +380,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode beanRechargeNode = requestDataNode.path("cashCollection"); |
|
|
|
CashCollection cashCollection = objectMapper.treeToValue(beanRechargeNode, CashCollection.class); |
|
|
|
page.setCashCollection(cashCollection); |
|
|
|
return cashCollectionController.export(page); |
|
|
|
// 从请求数据中获取语言设置,如果没有则使用默认值 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = requestDataNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
return cashCollectionController.export(page, lang); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
@ -345,6 +436,13 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
JsonNode requestDataNode = rootNode.path("requestData"); |
|
|
|
String tokenValue = requestDataNode.path("token").asText(); |
|
|
|
|
|
|
|
// 获取语言参数 |
|
|
|
String lang = "zh_CN"; |
|
|
|
JsonNode langNode = rootNode.path("lang"); |
|
|
|
if (langNode != null && !langNode.asText().isEmpty()) { |
|
|
|
lang = langNode.asText(); |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 验证导出记录 |
|
|
|
AiEmotionExportRecordVO record = validateExportRecord(recordId); |
|
|
|
if (record == null) return null; |
|
|
|
@ -360,8 +458,253 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
try { |
|
|
|
// 5. 初始化Excel写入器 |
|
|
|
Class<?> clazz = getExportClass(exportType); // 动态获取导出类 |
|
|
|
|
|
|
|
// 创建Excel写入器 |
|
|
|
excelWriter = EasyExcel.write(outputStream, clazz).build(); |
|
|
|
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); |
|
|
|
WriteSheet writeSheet; |
|
|
|
|
|
|
|
// 如果是充值用户,添加动态表头处理器 |
|
|
|
if ("rechargeUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getRechargeHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getRechargeColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("consumeUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getConsumeHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getConsumeColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("refundUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getRefundHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getRefundColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("liveUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getBeanConsumeLiveHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getBeanConsumeLiveColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("fanUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getBeanConsumeFanHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getBeanConsumeFanColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("articleUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getBeanConsumeArticleHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getBeanConsumeArticleColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("beanUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getBeanSystemRechargeHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getBeanSystemRechargeColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("onlineUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getBeanOnlineRechargeHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getBeanOnlineRechargeColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("financeUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getCashRecordHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getCashRecordColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("cashUser".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getCashCollectionHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getCashCollectionColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("goldDetail".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getGoldDetailHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getGoldDetailColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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 if ("user".equals(exportType)) { |
|
|
|
Map<String, String> headers = excelHeaderTranslator.getUserHeaders(lang); |
|
|
|
List<String> columnOrder = excelHeaderTranslator.getUserColumnOrder(); |
|
|
|
|
|
|
|
// 构建自定义表头 |
|
|
|
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(); |
|
|
|
} |
|
|
|
|
|
|
|
// 6. 分页查询并写入数据 |
|
|
|
Page page = new Page(); |
|
|
|
@ -370,7 +713,6 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
Integer totalCount = 0; |
|
|
|
boolean hasMore = true; |
|
|
|
|
|
|
|
// 在 exportExcelGeneric 方法中的适当位置添加类型转换 |
|
|
|
while (hasMore) { |
|
|
|
Result pageResult = dataFetcher.apply(page); |
|
|
|
Integer code = pageResult.getCode(); |
|
|
|
@ -394,11 +736,65 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
// 在这里添加类型转换逻辑 |
|
|
|
if ("goldDetail".equals(exportType) && list.get(0) instanceof GoldDetail) { |
|
|
|
fillGoldDetailTypeDescriptions((List<GoldDetail>) list); |
|
|
|
// 添加翻译支持 |
|
|
|
translateGoldDetailList((List<GoldDetail>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加退款方式转换逻辑 |
|
|
|
if ("refundUser".equals(exportType) && list.get(0) instanceof RefundUser) { |
|
|
|
fillRefundUserModelDescriptions((List<RefundUser>) list); |
|
|
|
// 添加翻译支持 |
|
|
|
translateRefundUserList((List<RefundUser>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加充值用户翻译支持 |
|
|
|
if ("rechargeUser".equals(exportType) && list.get(0) instanceof RechargeUser) { |
|
|
|
translateRechargeUserList((List<RechargeUser>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加消费用户翻译支持 |
|
|
|
if ("consumeUser".equals(exportType) && list.get(0) instanceof ConsumeUser) { |
|
|
|
translateConsumeUserList((List<ConsumeUser>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加直播用户翻译支持 |
|
|
|
if ("liveUser".equals(exportType) && list.get(0) instanceof BeanConsumeLive) { |
|
|
|
translateBeanConsumeLiveList((List<BeanConsumeLive>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加铁粉用户翻译支持 |
|
|
|
if ("fanUser".equals(exportType) && list.get(0) instanceof BeanConsumeFan) { |
|
|
|
translateBeanConsumeFanList((List<BeanConsumeFan>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加文章用户翻译支持 |
|
|
|
if ("articleUser".equals(exportType) && list.get(0) instanceof BeanConsumeArticle) { |
|
|
|
translateBeanConsumeArticleList((List<BeanConsumeArticle>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加金豆充值翻译支持 |
|
|
|
if ("beanUser".equals(exportType) && list.get(0) instanceof BeanSystemRechargeInfo) { |
|
|
|
translateBeanSystemRechargeInfoList((List<BeanSystemRechargeInfo>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加在线充值翻译支持 |
|
|
|
if ("onlineUser".equals(exportType) && list.get(0) instanceof BeanOnlineRechargeInfo) { |
|
|
|
translateBeanOnlineRechargeInfoList((List<BeanOnlineRechargeInfo>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加财务退款翻译支持 |
|
|
|
if ("financeUser".equals(exportType) && list.get(0) instanceof CashRecordDTO) { |
|
|
|
translateCashRecordDTOList((List<CashRecordDTO>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加现金收款翻译支持 |
|
|
|
if ("cashUser".equals(exportType) && list.get(0) instanceof CashCollection) { |
|
|
|
translateCashCollectionList((List<CashCollection>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加用户金币余额翻译支持 |
|
|
|
if ("goldUser".equals(exportType) && list.get(0) instanceof User) { |
|
|
|
translateUserList((List<User>) list, lang); |
|
|
|
} |
|
|
|
|
|
|
|
excelWriter.write(list, writeSheet); |
|
|
|
@ -605,4 +1001,362 @@ public class ExportExcelServiceImpl implements ExportExcelService { |
|
|
|
default: return "未知退款方式"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 各种实体类的翻译方法 |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译金币明细列表 |
|
|
|
*/ |
|
|
|
private void translateGoldDetailList(List<GoldDetail> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (GoldDetail item : list) { |
|
|
|
// 翻译类型描述 |
|
|
|
if (item.getTypeDesc() != null && !item.getTypeDesc().isEmpty()) { |
|
|
|
item.setTypeDesc(languageTranslationUtil.translate(item.getTypeDesc(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译市场名称 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译退款用户列表 |
|
|
|
*/ |
|
|
|
private void translateRefundUserList(List<RefundUser> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (RefundUser item : list) { |
|
|
|
// 翻译市场名称 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译商品名称 |
|
|
|
if (item.getGoodsName() != null && !item.getGoodsName().isEmpty()) { |
|
|
|
item.setGoodsName(languageTranslationUtil.translate(item.getGoodsName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译退款类型 |
|
|
|
if (item.getRefundType() != null && !item.getRefundType().isEmpty()) { |
|
|
|
item.setRefundType(languageTranslationUtil.translate(item.getRefundType(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译退款方式描述 |
|
|
|
if (item.getRefundModelDesc() != null && !item.getRefundModelDesc().isEmpty()) { |
|
|
|
item.setRefundModelDesc(languageTranslationUtil.translate(item.getRefundModelDesc(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译充值用户列表 |
|
|
|
*/ |
|
|
|
private void translateRechargeUserList(List<RechargeUser> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (RechargeUser item : list) { |
|
|
|
// 翻译市场名称 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译汇率名称 |
|
|
|
if (item.getRateName() != null && !item.getRateName().isEmpty()) { |
|
|
|
item.setRateName(languageTranslationUtil.translate(item.getRateName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译支付方式 |
|
|
|
if (item.getPayModel() != null && !item.getPayModel().isEmpty()) { |
|
|
|
item.setPayModel(languageTranslationUtil.translate(item.getPayModel(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译消费用户列表 |
|
|
|
*/ |
|
|
|
private void translateConsumeUserList(List<ConsumeUser> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (ConsumeUser item : list) { |
|
|
|
// 翻译商品名称 |
|
|
|
if (item.getGoodsName() != null && !item.getGoodsName().isEmpty()) { |
|
|
|
item.setGoodsName(languageTranslationUtil.translate(item.getGoodsName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译市场名称 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译直播消费列表 |
|
|
|
*/ |
|
|
|
private void translateBeanConsumeLiveList(List<BeanConsumeLive> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (BeanConsumeLive item : list) { |
|
|
|
// 翻译地区/分部 |
|
|
|
if (item.getDept() != null && !item.getDept().isEmpty()) { |
|
|
|
item.setDept(languageTranslationUtil.translate(item.getDept(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译礼物名称 |
|
|
|
if (item.getGift() != null && !item.getGift().isEmpty()) { |
|
|
|
item.setGift(languageTranslationUtil.translate(item.getGift(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译频道名称 |
|
|
|
if (item.getLiveChannel() != null && !item.getLiveChannel().isEmpty()) { |
|
|
|
item.setLiveChannel(languageTranslationUtil.translate(item.getLiveChannel(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译直播间名称 |
|
|
|
if (item.getLiveName() != null && !item.getLiveName().isEmpty()) { |
|
|
|
item.setLiveName(languageTranslationUtil.translate(item.getLiveName(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译铁粉消费列表 |
|
|
|
*/ |
|
|
|
private void translateBeanConsumeFanList(List<BeanConsumeFan> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (BeanConsumeFan item : list) { |
|
|
|
// 翻译地区/分部 |
|
|
|
if (item.getDept() != null && !item.getDept().isEmpty()) { |
|
|
|
item.setDept(languageTranslationUtil.translate(item.getDept(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译频道名称 |
|
|
|
if (item.getChannel() != null && !item.getChannel().isEmpty()) { |
|
|
|
item.setChannel(languageTranslationUtil.translate(item.getChannel(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译会员类型 |
|
|
|
if (item.getType() != null && !item.getType().isEmpty()) { |
|
|
|
item.setType(languageTranslationUtil.translate(item.getType(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译文章消费列表 |
|
|
|
*/ |
|
|
|
private void translateBeanConsumeArticleList(List<BeanConsumeArticle> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (BeanConsumeArticle item : list) { |
|
|
|
// 翻译地区/分部 |
|
|
|
if (item.getDept() != null && !item.getDept().isEmpty()) { |
|
|
|
item.setDept(languageTranslationUtil.translate(item.getDept(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译类型 |
|
|
|
if (item.getType() != null && !item.getType().isEmpty()) { |
|
|
|
item.setType(languageTranslationUtil.translate(item.getType(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译文章/视频标题 |
|
|
|
if (item.getArticleName() != null && !item.getArticleName().isEmpty()) { |
|
|
|
item.setArticleName(languageTranslationUtil.translate(item.getArticleName(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译金豆系统充值列表 |
|
|
|
*/ |
|
|
|
private void translateBeanSystemRechargeInfoList(List<BeanSystemRechargeInfo> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (BeanSystemRechargeInfo item : list) { |
|
|
|
// 翻译所属地区 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译金豆在线充值列表 |
|
|
|
*/ |
|
|
|
private void translateBeanOnlineRechargeInfoList(List<BeanOnlineRechargeInfo> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (BeanOnlineRechargeInfo item : list) { |
|
|
|
// 翻译所属地区 |
|
|
|
if (item.getMarket() != null && !item.getMarket().isEmpty()) { |
|
|
|
item.setMarket(languageTranslationUtil.translate(item.getMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译充值平台 |
|
|
|
if (item.getPlatform() != null && !item.getPlatform().isEmpty()) { |
|
|
|
item.setPlatform(languageTranslationUtil.translate(item.getPlatform(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译现金退款记录列表 |
|
|
|
*/ |
|
|
|
private void translateCashRecordDTOList(List<CashRecordDTO> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (CashRecordDTO item : list) { |
|
|
|
// 翻译商品名称 |
|
|
|
if (item.getGoodsName() != null && !item.getGoodsName().isEmpty()) { |
|
|
|
item.setGoodsName(languageTranslationUtil.translate(item.getGoodsName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译退款理由 |
|
|
|
if (item.getRefundReason() != null && !item.getRefundReason().isEmpty()) { |
|
|
|
item.setRefundReason(languageTranslationUtil.translate(item.getRefundReason(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译驳回理由 |
|
|
|
if (item.getRejectReason() != null && !item.getRejectReason().isEmpty()) { |
|
|
|
item.setRejectReason(languageTranslationUtil.translate(item.getRejectReason(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译退款备注 |
|
|
|
if (item.getRefundRemark() != null && !item.getRefundRemark().isEmpty()) { |
|
|
|
item.setRefundRemark(languageTranslationUtil.translate(item.getRefundRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译现金收款列表 |
|
|
|
*/ |
|
|
|
private void translateCashCollectionList(List<CashCollection> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (CashCollection item : list) { |
|
|
|
// 翻译所属地区名称 |
|
|
|
if (item.getMarketName() != null && !item.getMarketName().isEmpty()) { |
|
|
|
item.setMarketName(languageTranslationUtil.translate(item.getMarketName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译活动名称 |
|
|
|
if (item.getActivity() != null && !item.getActivity().isEmpty()) { |
|
|
|
item.setActivity(languageTranslationUtil.translate(item.getActivity(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译商品名称 |
|
|
|
if (item.getGoodsName() != null && !item.getGoodsName().isEmpty()) { |
|
|
|
item.setGoodsName(languageTranslationUtil.translate(item.getGoodsName(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译数量单位 |
|
|
|
if (item.getNumUnit() != null && !item.getNumUnit().isEmpty()) { |
|
|
|
item.setNumUnit(languageTranslationUtil.translate(item.getNumUnit(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译付款币种 |
|
|
|
if (item.getPaymentCurrency() != null && !item.getPaymentCurrency().isEmpty()) { |
|
|
|
item.setPaymentCurrency(languageTranslationUtil.translate(item.getPaymentCurrency(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译到账币种 |
|
|
|
if (item.getReceivedCurrency() != null && !item.getReceivedCurrency().isEmpty()) { |
|
|
|
item.setReceivedCurrency(languageTranslationUtil.translate(item.getReceivedCurrency(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译支付方式 |
|
|
|
if (item.getPayType() != null && !item.getPayType().isEmpty()) { |
|
|
|
item.setPayType(languageTranslationUtil.translate(item.getPayType(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译到账地区 |
|
|
|
if (item.getReceivedMarket() != null && !item.getReceivedMarket().isEmpty()) { |
|
|
|
item.setReceivedMarket(languageTranslationUtil.translate(item.getReceivedMarket(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译备注 |
|
|
|
if (item.getRemark() != null && !item.getRemark().isEmpty()) { |
|
|
|
item.setRemark(languageTranslationUtil.translate(item.getRemark(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译驳回理由 |
|
|
|
if (item.getRejectReason() != null && !item.getRejectReason().isEmpty()) { |
|
|
|
item.setRejectReason(languageTranslationUtil.translate(item.getRejectReason(), lang)); |
|
|
|
} |
|
|
|
|
|
|
|
// 翻译到账备注 |
|
|
|
if (item.getReceivedRemark() != null && !item.getReceivedRemark().isEmpty()) { |
|
|
|
item.setReceivedRemark(languageTranslationUtil.translate(item.getReceivedRemark(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 翻译用户金币余额列表 |
|
|
|
*/ |
|
|
|
private void translateUserList(List<User> list, String lang) { |
|
|
|
if (list == null || list.isEmpty() || "zh_CN".equalsIgnoreCase(lang) || "zh".equalsIgnoreCase(lang)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
for (User item : list) { |
|
|
|
// 翻译所属地区名称 |
|
|
|
if (item.getMarketName() != null && !item.getMarketName().isEmpty()) { |
|
|
|
item.setMarketName(languageTranslationUtil.translate(item.getMarketName(), lang)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |