浏览代码

feat:云教练分部数据增加排名

Joburgess 3 年之前
父节点
当前提交
8287fabf58

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -28,6 +28,7 @@ import sun.nio.cs.ext.Big5;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 @Service
@@ -718,6 +719,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         }
 
         result = result.stream().sorted(comparing).skip(pageInfo.getOffset()).limit(pageInfo.getLimit()).collect(Collectors.toList());
+        AtomicInteger i= new AtomicInteger();
+        result.forEach(e->e.setIndex(i.incrementAndGet()));
         pageInfo.setRows(result);
         return pageInfo;
     }

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -3177,8 +3177,8 @@ public class ExportController extends BaseController {
         }
         OutputStream outputStream = response.getOutputStream();
         try {
-            String[] header = {"分部", "学员总数", "活跃人数", "使用人数", "新增使用人数", "使用比例", "付费会员数", "付费会员占比"};
-            String[] body = {"organName", "totalStudentNum", "cloudStudyLivelyStudentNum", "cloudStudyUseStudentNum", "newCloudStudyStudentNum",
+            String[] header = {"排名", "分部", "学员总数", "活跃人数", "使用人数", "新增使用人数", "使用比例", "付费会员数", "付费会员占比"};
+            String[] body = {"index","organName", "totalStudentNum", "cloudStudyLivelyStudentNum", "cloudStudyUseStudentNum", "newCloudStudyStudentNum",
                     "cloudStudyUseStudentDuty+\"%\"", "vipStudentNum", "vipStudentDuty+\"%\""};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");