|
|
@@ -61,6 +61,8 @@ public class ResearchReportController extends BaseController {
|
|
|
private ResearchReportService researchReportService;
|
|
|
@Resource
|
|
|
private ResearchReportAsyncService researchReportAsyncService;
|
|
|
+ private static final String marketZH = "市场概况";
|
|
|
+ private static final String marketEN = "Market Overview";
|
|
|
|
|
|
/**
|
|
|
* 获取数据
|
|
|
@@ -274,7 +276,7 @@ public class ResearchReportController extends BaseController {
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append(vo.getTitle()); //标题
|
|
|
sb.append("\r\r");
|
|
|
- sb.append(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven()))); //研究范围
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven(), vo.getLang()))); //研究范围
|
|
|
sb.append("\r\r");
|
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|
|
|
sb.append("\r\r");
|
|
|
@@ -339,7 +341,7 @@ public class ResearchReportController extends BaseController {
|
|
|
List<ResearchReportDto> listExcel = ListUtils.newArrayList();
|
|
|
if(!list.isEmpty()){
|
|
|
listExcel = list.stream().map(vo -> {
|
|
|
- vo.setReportScopeHtml(convertExcelStr(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven()))));
|
|
|
+ vo.setReportScopeHtml(convertExcelStr(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven(), vo.getLang()))));
|
|
|
vo.setDirectoryHtml(convertExcelStr(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())));
|
|
|
vo.setMarketType(convertMarketType(vo.getMarketType(), vo.getLang()));
|
|
|
vo.setChartsHtml(convertExcelStr(Html2PlainTxtUtils.convert(vo.getChartsHtml())));
|
|
|
@@ -383,7 +385,7 @@ public class ResearchReportController extends BaseController {
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append(vo.getTitle()); //标题
|
|
|
sb.append("\r\r");
|
|
|
- sb.append(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven()))); //研究范围
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(convertMarket(vo.getReportScopeHtml(), vo.getMarketScale(), vo.getMarketDriven(), vo.getLang()))); //研究范围
|
|
|
sb.append("\r\r");
|
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|
|
|
sb.append("\r\r");
|
|
|
@@ -437,11 +439,17 @@ public class ResearchReportController extends BaseController {
|
|
|
return URLEncoder.encode(fileName, "UTF-8");
|
|
|
}
|
|
|
|
|
|
- private String convertMarket(String html, String marketScale, String marketDriven) {
|
|
|
+ private String convertMarket(String html, String marketScale, String marketDriven, String lang) {
|
|
|
if (StringUtils.isEmpty(marketScale) && StringUtils.isEmpty(marketDriven) && StringUtils.isEmpty(html)) {
|
|
|
return html;
|
|
|
}
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
+ if (Constants.lang.ZH_CH.equals(lang)) {
|
|
|
+ sb.append(marketZH);
|
|
|
+ } else {
|
|
|
+ sb.append(marketEN);
|
|
|
+ }
|
|
|
+ sb.append("\\n");
|
|
|
if (StringUtils.isNotEmpty(marketScale)) {
|
|
|
sb.append(marketScale);
|
|
|
}
|