|
@@ -375,7 +375,7 @@ public class ReportController {
|
|
|
|
|
|
|
|
|
|
if (exportFlag) {
|
|
if (exportFlag) {
|
|
- String filePath = exportXls(mapList);
|
|
|
|
|
|
+ String filePath = groupExportXls(mapList);
|
|
msgResult.setData(filePath);
|
|
msgResult.setData(filePath);
|
|
} else {
|
|
} else {
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
@@ -395,6 +395,66 @@ public class ReportController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ private String groupExportXls(List<Map> mapList) {
|
|
|
|
+ String downloadUrl = "";
|
|
|
|
+
|
|
|
|
+ Workbook workbook = new HSSFWorkbook();
|
|
|
|
+ Sheet sheet = workbook.createSheet();
|
|
|
|
+
|
|
|
|
+ //表头
|
|
|
|
+ Row rowTitle = sheet.createRow(0);
|
|
|
|
+
|
|
|
|
+ String[] titles = new String[]{"序号", "日期", "新增登录人数", "累计登录人数", "今日注册人数","累计注册人数", "新增求职登记人数", "累计求职登记人数", "累计简历数",
|
|
|
|
+ "新增线上认证企业数量", "累计认证企业数量","新增岗位发布数量","实时发布岗位数","累计发布岗位数","岗位需求人数","累计岗位需求人数","今日报名人数"};
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < titles.length; i++) {
|
|
|
|
+ Cell cell = rowTitle.createCell(i);
|
|
|
|
+ cell.setCellValue(titles[i]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
|
+ Map<String, Object> map = mapList.get(i);
|
|
|
|
+
|
|
|
|
+ Row row = sheet.createRow(i + 1);
|
|
|
|
+
|
|
|
|
+ int colIndex = 0;
|
|
|
|
+ row.createCell(colIndex++).setCellValue(i + 1);
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("date"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("loginNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalLoginNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("dailyPersonRegNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalPersonRegNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("personNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalPersonNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalJobInformation"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("enterpriseNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalEnterpriseNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("recruitNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalRecruitNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalRecruitStatusNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("jobRequirementNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("totalJobRequirementNum"), ""));
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("jobInformationNum"), ""));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ workbook.write(output);
|
|
|
|
+
|
|
|
|
+ byte[] buffer = output.toByteArray();
|
|
|
|
+ ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
|
+
|
|
|
|
+ downloadUrl = OSSUtil.upload(ossConfig, "personList", "分组统计日报表.xls", input);
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return downloadUrl;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据一段时间获取该段时间的所有日期 正序排序
|
|
* 根据一段时间获取该段时间的所有日期 正序排序
|