Quellcode durchsuchen

新生报到调整,增加班级报到人数调整

dzx vor 1 Jahr
Ursprung
Commit
780cf180d4

+ 12 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -275,6 +275,18 @@ public class StudentReportRecordController {
         }
         statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
 
+        Map<String, List<StudentReportRecordStatisticsListVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassName));
+        List<ItemCountVo> classList = new ArrayList<>();
+        for (String className : classMap.keySet()) {
+            classList.add(
+                    new ItemCountVo(){{
+                        setItem(className);
+                        setCount(classMap.get(className).size());
+                    }}
+            );
+        }
+        statisticsVo.setClassList(classList);
+
         BigDecimal divide = BigDecimal.ZERO;
         if( statisticsVo.getAllCount() != 0){
             divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsListVo.java

@@ -34,4 +34,7 @@ public class StudentReportRecordStatisticsListVo {
     @ApiModelProperty("报到时间")
     private LocalDateTime reportTime;
 
+    @ApiModelProperty("所属班级")
+    private String className;
+
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsVo.java

@@ -64,4 +64,7 @@ public class StudentReportRecordStatisticsVo {
     @ApiModelProperty("走读女学生总人数")
     private Long notStayFemaleCount;
 
+    @ApiModelProperty("班级报到情况")
+    private List<ItemCountVo> classList;
+
 }

+ 1 - 1
src/main/resources/application.yml

@@ -5,7 +5,7 @@ server:
 spring:
   # 环 io境 dev|pre|prod
   profiles:
-    active: dev
+    active: pre
   # jackson时间格式化
   jackson:
     time-zone: GMT+8

+ 2 - 1
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -53,11 +53,12 @@
     </select>
     <select id="getStatisticsDataList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
             resultType="com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo">
-            SELECT t1.name,t1.credential_number,t2.gender,t4.graduated_university,t4.stduy_status,t5.report_time FROM base_new_student t1
+            SELECT t1.name,t1.credential_number,t2.gender,t4.graduated_university,t4.stduy_status,t5.report_time ,t6.name as class_name FROM base_new_student t1
             INNER JOIN xjr_user t2 ON t1.credential_number = t2.credential_number
             INNER JOIN enrollment_plan t3 ON t3.id = t1.enrollment_plan_id
             INNER JOIN base_student_school_roll t4 ON t4.user_id = t2.id
             LEFT JOIN student_report_record t5 ON t2.id = t5.user_id and t5.delete_mark = 0
+            INNER JOIN base_class t6 ON t6.id = t4.class_id
             WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
             AND t3.grade_id = #{dto.gradeId} AND t3.enroll_type = #{dto.enrollType}
     </select>