|
@@ -11,6 +11,8 @@ import com.jeesite.common.utils.excel.ExcelExport;
|
|
import com.jeesite.common.web.BaseController;
|
|
import com.jeesite.common.web.BaseController;
|
|
import com.jeesite.modules.report.async.ResearchReportAsyncService;
|
|
import com.jeesite.modules.report.async.ResearchReportAsyncService;
|
|
import com.jeesite.modules.report.dto.ResearchReportDto;
|
|
import com.jeesite.modules.report.dto.ResearchReportDto;
|
|
|
|
+import com.jeesite.modules.report.dto.ResearchReportMarketDrivenDto;
|
|
|
|
+import com.jeesite.modules.report.dto.ResearchReportMarketScaleDto;
|
|
import com.jeesite.modules.report.entity.ResearchReport;
|
|
import com.jeesite.modules.report.entity.ResearchReport;
|
|
import com.jeesite.modules.report.service.ResearchReportService;
|
|
import com.jeesite.modules.report.service.ResearchReportService;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
@@ -54,8 +56,10 @@ public class ResearchReportController extends BaseController {
|
|
@Value("${file.baseDir}")
|
|
@Value("${file.baseDir}")
|
|
private String basePath;
|
|
private String basePath;
|
|
private static final String TEMP_PATH = "/temp";
|
|
private static final String TEMP_PATH = "/temp";
|
|
- private static final String marketZH = "市场概况";
|
|
|
|
- private static final String marketEN = "Market Profile";
|
|
|
|
|
|
+ private static final String marketScaleZH = "市场规模";
|
|
|
|
+ private static final String marketScaleEN = "Market Scale";
|
|
|
|
+ private static final String marketDrivenZH = "市场驱动";
|
|
|
|
+ private static final String marketDrivenEN = "Market Driven";
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取数据
|
|
* 获取数据
|
|
@@ -204,6 +208,58 @@ public class ResearchReportController extends BaseController {
|
|
return renderResult(Global.TRUE, text(msg));
|
|
return renderResult(Global.TRUE, text(msg));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 市场规模下载模板
|
|
|
|
+ * @param response
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/marketScaleDownloadTemplate")
|
|
|
|
+ @RequiresPermissions("report:researchReport:import")
|
|
|
|
+ public void marketScaleDownloadTemplate(HttpServletResponse response){
|
|
|
|
+ List<ResearchReportMarketScaleDto> list = ListUtils.newArrayList();
|
|
|
|
+ try(ExcelExport ee = new ExcelExport("市场规模导入数据",ResearchReportMarketScaleDto.class)){
|
|
|
|
+ ee.setDataList(list).write(response,"市场规模导入数据.xlsx");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 市场规模导入
|
|
|
|
+ * @param file
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/marketScaleImportData")
|
|
|
|
+ @RequiresPermissions("report:researchReport:import")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public String marketScaleImportData(MultipartFile file) throws Exception {
|
|
|
|
+ String msg = researchReportService.marketScaleImportData(file);
|
|
|
|
+ return renderResult(Global.TRUE, text(msg));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 市场驱动下载模板
|
|
|
|
+ * @param response
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/marketDrivenDownloadTemplate")
|
|
|
|
+ @RequiresPermissions("report:researchReport:import")
|
|
|
|
+ public void marketDrivenDownloadTemplate(HttpServletResponse response){
|
|
|
|
+ List<ResearchReportMarketScaleDto> list = ListUtils.newArrayList();
|
|
|
|
+ try(ExcelExport ee = new ExcelExport("市场驱动导入数据", ResearchReportMarketDrivenDto.class)){
|
|
|
|
+ ee.setDataList(list).write(response,"市场驱动导入数据.xlsx");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 市场驱动导入
|
|
|
|
+ * @param file
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/marketDrivenImportData")
|
|
|
|
+ @RequiresPermissions("report:researchReport:import")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public String marketDrivenImportData(MultipartFile file) throws Exception {
|
|
|
|
+ String msg = researchReportService.marketDrivenImportData(file);
|
|
|
|
+ return renderResult(Global.TRUE, text(msg));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 导出txt格式
|
|
* 导出txt格式
|
|
* @param researchReport
|
|
* @param researchReport
|
|
@@ -218,14 +274,24 @@ public class ResearchReportController extends BaseController {
|
|
sb.append(vo.getTitle()); //标题
|
|
sb.append(vo.getTitle()); //标题
|
|
sb.append("\r\r");
|
|
sb.append("\r\r");
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getReportScopeHtml())); //研究范围
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getReportScopeHtml())); //研究范围
|
|
- if (StringUtils.isNotEmpty(vo.getGeneralization())) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketScale())) {
|
|
|
|
+ sb.append("\r\r\r\r");
|
|
|
|
+ if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
|
|
+ sb.append(marketScaleZH + "\r\r");
|
|
|
|
+ } else {
|
|
|
|
+ sb.append(marketScaleEN + "\r\r");
|
|
|
|
+ }
|
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(vo.getMarketScale()));
|
|
|
|
+ }
|
|
|
|
+ sb.append("\r\r");
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketDriven())) {
|
|
sb.append("\r\r\r\r");
|
|
sb.append("\r\r\r\r");
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
- sb.append(marketZH + "\r\r");
|
|
|
|
|
|
+ sb.append(marketDrivenZH + "\r\r");
|
|
} else {
|
|
} else {
|
|
- sb.append(marketEN + "\r\r");
|
|
|
|
|
|
+ sb.append(marketDrivenEN + "\r\r");
|
|
}
|
|
}
|
|
- sb.append(Html2PlainTxtUtils.convert(vo.getGeneralization()));
|
|
|
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(vo.getMarketDriven()));
|
|
}
|
|
}
|
|
sb.append("\r\r");
|
|
sb.append("\r\r");
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|
|
@@ -293,14 +359,23 @@ public class ResearchReportController extends BaseController {
|
|
if(!list.isEmpty()){
|
|
if(!list.isEmpty()){
|
|
listExcel = list.stream().map(vo -> {
|
|
listExcel = list.stream().map(vo -> {
|
|
vo.setReportScopeHtml(Html2PlainTxtUtils.convert(vo.getReportScopeHtml()));
|
|
vo.setReportScopeHtml(Html2PlainTxtUtils.convert(vo.getReportScopeHtml()));
|
|
- if (StringUtils.isNotEmpty(vo.getGeneralization())) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketScale())) {
|
|
|
|
+ String str;
|
|
|
|
+ if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
|
|
+ str = marketScaleZH;
|
|
|
|
+ } else {
|
|
|
|
+ str = marketScaleEN;
|
|
|
|
+ }
|
|
|
|
+ vo.setReportScopeHtml(vo.getReportScopeHtml() + lineStr + lineStr + lineStr + lineStr + str + lineStr + lineStr + Html2PlainTxtUtils.convert(vo.getMarketScale()));
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketDriven())) {
|
|
String str;
|
|
String str;
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
- str = marketZH;
|
|
|
|
|
|
+ str = marketDrivenZH;
|
|
} else {
|
|
} else {
|
|
- str = marketEN;
|
|
|
|
|
|
+ str = marketDrivenEN;
|
|
}
|
|
}
|
|
- vo.setReportScopeHtml(vo.getReportScopeHtml() + lineStr + lineStr + lineStr + lineStr + str + lineStr + lineStr + Html2PlainTxtUtils.convert(vo.getGeneralization()));
|
|
|
|
|
|
+ vo.setReportScopeHtml(vo.getReportScopeHtml() + lineStr + lineStr + lineStr + lineStr + str + lineStr + lineStr + Html2PlainTxtUtils.convert(vo.getMarketDriven()));
|
|
}
|
|
}
|
|
vo.setDirectoryHtml(Html2PlainTxtUtils.convert(vo.getDirectoryHtml()));
|
|
vo.setDirectoryHtml(Html2PlainTxtUtils.convert(vo.getDirectoryHtml()));
|
|
return vo;
|
|
return vo;
|
|
@@ -335,14 +410,24 @@ public class ResearchReportController extends BaseController {
|
|
sb.append(vo.getTitle()); //标题
|
|
sb.append(vo.getTitle()); //标题
|
|
sb.append("\r\r");
|
|
sb.append("\r\r");
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getReportScopeHtml())); //研究范围
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getReportScopeHtml())); //研究范围
|
|
- if (StringUtils.isNotEmpty(vo.getGeneralization())) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketScale())) {
|
|
|
|
+ sb.append("\r\r\r\r");
|
|
|
|
+ if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
|
|
+ sb.append(marketScaleZH + "\r\r");
|
|
|
|
+ } else {
|
|
|
|
+ sb.append(marketScaleEN + "\r\r");
|
|
|
|
+ }
|
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(vo.getMarketScale()));
|
|
|
|
+ }
|
|
|
|
+ sb.append("\r\r");
|
|
|
|
+ if (StringUtils.isNotEmpty(vo.getMarketDriven())) {
|
|
sb.append("\r\r\r\r");
|
|
sb.append("\r\r\r\r");
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
if (Constants.lang.ZH_CH.equals(vo.getLang())) {
|
|
- sb.append(marketZH + "\r\r");
|
|
|
|
|
|
+ sb.append(marketDrivenZH + "\r\r");
|
|
} else {
|
|
} else {
|
|
- sb.append(marketEN + "\r\r");
|
|
|
|
|
|
+ sb.append(marketDrivenEN + "\r\r");
|
|
}
|
|
}
|
|
- sb.append(Html2PlainTxtUtils.convert(vo.getGeneralization()));
|
|
|
|
|
|
+ sb.append(Html2PlainTxtUtils.convert(vo.getMarketDriven()));
|
|
}
|
|
}
|
|
sb.append("\r\r");
|
|
sb.append("\r\r");
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|
|
sb.append(Html2PlainTxtUtils.convert(vo.getDirectoryHtml())); //正文目录
|