瀏覽代碼

web-统计报表导出调整

liao-sea 3 月之前
父節點
當前提交
54c3aa70d9
共有 1 個文件被更改,包括 18 次插入14 次删除
  1. 18 14
      src/main/java/com/hz/employmentsite/controller/statistics/StatisticsController.java

+ 18 - 14
src/main/java/com/hz/employmentsite/controller/statistics/StatisticsController.java

@@ -12,6 +12,7 @@ import com.hz.employmentsite.vo.statistics.SystemDataCount;
 import com.hz.employmentsite.vo.statistics.company.ModelCompanyCount;
 import com.hz.employmentsite.vo.statistics.jobUser.*;
 import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -235,9 +236,9 @@ public class StatisticsController {
         if (startDate != null && endDate != null) {
             dataStr = dateUtils.dateToStrFormat(startDate, "yyyy年MM月dd日") + "-" + dateUtils.dateToStrFormat(endDate, "yyyy年MM月dd日");
         }
-        titleMap.put(dataStr + "就业驿站系统使用情况表", new CellRangeAddress(0, 0, 0, 5));
+        titleMap.put(dataStr + "就业驿站系统使用情况表", new CellRangeAddress(0, 0, 0, 6));
         data.setColspanTitles(Arrays.asList(titleMap));
-        data.setTitles(Arrays.asList("行政区划", "驿站名", "驿站人员数量", "录入企业数", "收集岗位数", "登记求职人数"));
+        data.setTitles(Arrays.asList("行政区划", "驿站名", "驿站人员数量", "录入企业数", "收集岗位条数","收集岗位个数", "登记求职人数"));
         List<List<Object>> rowsData = new ArrayList();
         for (SystemDataCount dataCount : systemDataCount) {
             List<Object> row = new ArrayList();
@@ -246,6 +247,7 @@ public class StatisticsController {
             row.add(dataCount.getSiteUserCount());
             row.add(dataCount.getCompanyCount());
             row.add(dataCount.getPostCount());
+            row.add(dataCount.getPostRecruitCount());
             row.add(dataCount.getJobUserCount());
             rowsData.add(row);
         }
@@ -305,19 +307,19 @@ public class StatisticsController {
         // 初始合并位置
         int firstCol = 1;
         // 汇总有"驿站人员数量"
-        titleMap.put("汇总", new CellRangeAddress(0, 0, firstCol, firstCol + 3));
+        titleMap.put("汇总", new CellRangeAddress(0, 0, firstCol, firstCol + 4));
         setRSDCExcelData(result.get("汇总"), rowsData, true);
         // 填充子标题
-        childrenTitle.addAll(Arrays.asList("驿站人员数量","录入企业数量","收集岗位条数","登记求职人数"));
-        firstCol += 4;
+        childrenTitle.addAll(Arrays.asList("驿站人员数量","录入企业数量","收集岗位条数","收集岗位个数","登记求职人数"));
+        firstCol += 5;
         // 生成周数标题,周数标题没有驿站人员数量
         for (Map.Entry<String, List<RegionSystemDataCount>> entry : result.entrySet()) {
             String key = entry.getKey();
             if (!key.equals("汇总")){
-                titleMap.put(key, new CellRangeAddress(0, 0, firstCol, firstCol + 2));
+                titleMap.put(key, new CellRangeAddress(0, 0, firstCol, firstCol + 3));
                 // 填充子标题
-                childrenTitle.addAll(Arrays.asList("录入企业数量","收集岗位条数","登记求职人数"));
-                firstCol += 3;
+                childrenTitle.addAll(Arrays.asList("录入企业数量","收集岗位条数","收集岗位个数","登记求职人数"));
+                firstCol += 4;
                 setRSDCExcelData(result.get(key), rowsData,false);
             }
         }
@@ -354,19 +356,19 @@ public class StatisticsController {
         // 初始合并位置
         int firstCol = 1;
         // 汇总有"驿站人员数量"
-        titleMap.put("汇总", new CellRangeAddress(0, 0, firstCol, firstCol + 3));
+        titleMap.put("汇总", new CellRangeAddress(0, 0, firstCol, firstCol + 4));
         setRSDCExcelData(result.get("汇总"), rowsData, true);
         // 填充子标题
-        childrenTitle.addAll(Arrays.asList("驿站人员数量","录入企业数量","收集岗位数量","登记求职人数"));
-        firstCol += 4;
+        childrenTitle.addAll(Arrays.asList("驿站人员数量","录入企业数量","收集岗位条数","收集岗位个数","登记求职人数"));
+        firstCol += 5;
         // 生成周数标题,周数标题没有驿站人员数量
         for (Map.Entry<String, List<RegionSystemDataCount>> entry : result.entrySet()) {
             String key = entry.getKey();
             if (!key.equals("汇总")){
-                titleMap.put(key, new CellRangeAddress(0, 0, firstCol, firstCol + 2));
+                titleMap.put(key, new CellRangeAddress(0, 0, firstCol, firstCol + 3));
                 // 填充子标题
-                childrenTitle.addAll(Arrays.asList("录入企业数量","收集岗位数量","登记求职人数"));
-                firstCol += 3;
+                childrenTitle.addAll(Arrays.asList("录入企业数量","收集岗位条数","收集岗位个数","登记求职人数"));
+                firstCol += 4;
                 setRSDCExcelData(result.get(key), rowsData,false);
             }
         }
@@ -390,6 +392,7 @@ public class StatisticsController {
                         existingRow.add(item.getSiteUserCount());
                     }
                     existingRow.add(item.getCompanyCount());
+                    existingRow.add(item.getPostCount());
                     existingRow.add(item.getPostRecruitCount());
                     existingRow.add(item.getJobUserCount());
                     found = true;
@@ -404,6 +407,7 @@ public class StatisticsController {
                     row.add(item.getSiteUserCount());
                 }
                 row.add(item.getCompanyCount());
+                row.add(item.getPostCount());
                 row.add(item.getPostRecruitCount());
                 row.add(item.getJobUserCount());
                 rowsData.add(row);