|
@@ -875,7 +875,6 @@ public class SubInfoExportController extends BaseController {
|
|
|
|
|
|
* 4库/总库 导出明细
|
|
|
*
|
|
|
- * @param response
|
|
|
*/
|
|
|
@PostMapping("/exportDetailExcel")
|
|
|
public void exportDetailExcel(@RequestBody SubInfoQueryTzVO queryVO) {
|
|
@@ -1003,6 +1002,71 @@ public class SubInfoExportController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 导出重点项目储备明细表
|
|
|
+ *
|
|
|
+ * @param vo
|
|
|
+ */
|
|
|
+ @Log("页面:【项目四库管理-项目总库】,执行操作:导出明细")
|
|
|
+ @PostMapping("/exportXmzkDetailExcel")
|
|
|
+ public void exportXmzkDetailExcel(@RequestBody SubInfoQueryTzVO vo) throws IOException {
|
|
|
+
|
|
|
+
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("项目总库-明细数据.xlsx", "UTF-8"));
|
|
|
+
|
|
|
+ try (cn.hutool.poi.excel.ExcelWriter writer = ExcelUtil.getBigWriter();
|
|
|
+ ServletOutputStream out = response.getOutputStream()) {
|
|
|
+
|
|
|
+
|
|
|
+ List<String> subjectIds = getSubjectIds();
|
|
|
+ List<SmzkDetailVo> subInfoTotalExcel = subInfoService.exportSmzkDetailExcel(vo,subjectIds);
|
|
|
+
|
|
|
+
|
|
|
+ writer.writeHeadRow(CollUtil.newArrayList("“四个一批”工业项目表(项目总库)"));
|
|
|
+ writer.merge(0, 0, 0, 9, "“四个一批”工业项目表(项目总库)", true);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ writer.addHeaderAlias("number", "序号");
|
|
|
+ writer.addHeaderAlias("id", "项目id");
|
|
|
+ writer.addHeaderAlias("status", "项目库");
|
|
|
+ writer.addHeaderAlias("subCode", "项目代码");
|
|
|
+ writer.addHeaderAlias("subName", "项目名称");
|
|
|
+ writer.addHeaderAlias("amtTotal", "总金额(亿元)");
|
|
|
+ writer.addHeaderAlias("beginDate", "计划开始日期");
|
|
|
+ writer.addHeaderAlias("endDate", "计划投产日期");
|
|
|
+ writer.addHeaderAlias("indusKind", "行业名称");
|
|
|
+ writer.addHeaderAlias("cbStatus", "状态");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ SXSSFSheet sheet = ((SXSSFWorkbook) writer.getWorkbook()).getSheetAt(0);
|
|
|
+ int defaultColumnWidth = 40;
|
|
|
+ for (int i = 0; i < 9; i++) {
|
|
|
+ sheet.setColumnWidth(i, defaultColumnWidth * 256);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (int i = 0; i < subInfoTotalExcel.size(); i++) {
|
|
|
+ subInfoTotalExcel.get(i).setNumber(i);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ writer.write(subInfoTotalExcel, true);
|
|
|
+
|
|
|
+ writer.flush(out, true);
|
|
|
+
|
|
|
+ } catch (IOException e) {
|
|
|
+
|
|
|
+ handleErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "导出 Excel 文件时出现错误:" + e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ handleErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, "请求参数错误或发生其他错误:" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private <K extends SubInfoBaseDetailVo> void exportDetail(HttpServletResponse response,ExportParams exportParams,Class<K> clazz, List<SubInfoGxj> list, Map<String, String> hyDictMap, Map<String, List<SubInfoGxj>> groupMap) {
|
|
|
List<K> exportList = new ArrayList<>();
|
|
|
|