Explorar el Código

管乐迷需求迭代

zouxuan hace 2 años
padre
commit
836ddbdec6

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CloudTeacherSumDto.java

@@ -10,6 +10,9 @@ public class CloudTeacherSumDto {
     private String organName;
 
     @ApiModelProperty(value = "分部")
+    private Integer organId;
+
+    @ApiModelProperty(value = "分部")
     private String teacherName;
 
     @ApiModelProperty(value = "在读人数")
@@ -45,6 +48,14 @@ public class CloudTeacherSumDto {
     @ApiModelProperty(value = ">240分钟")
     private Integer train4;
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
     public String getTeacherName() {
         return teacherName;
     }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -1279,7 +1279,11 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         Map<Integer,Long> activeMap = MapUtil.convertIntegerMap(studentDao.getOrganActiveCloudStudyStudentNum(organIdsList, startTime, endTime));
         //获取重复购买人数
         Map<Integer,Long> againBuyMap = MapUtil.convertIntegerMap(studentDao.getAgainBuyNum(organIdsList));
-        Map<Integer,Integer> todayStudyMap = MapUtil.convertIntegerMap(studentDao.getOrgansTodayTotalCloudStudyStudentNumMap(organIdsList));
+        Map<Integer,Integer> todayStudyMap = new HashMap<>();
+        List<Map<Integer, Integer>> studentNumMap = studentDao.getOrgansTodayTotalCloudStudyStudentNumMap(organIdsList);
+        if(!CollectionUtils.isEmpty(studentNumMap)){
+            todayStudyMap = MapUtil.convertIntegerMap(studentNumMap);
+        }
         for (IndexCloudStudySumDto dto : list) {
             dto.setOrganName(organMap.get(dto.getOrganId()));
             dto.setCloudStudyTodayUseStudentNum(todayStudyMap.get(dto.getOrganId()));

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -1170,6 +1170,7 @@
     </select>
     <resultMap id="CloudTeacherSumDto" type="com.ym.mec.biz.dal.dto.CloudTeacherSumDto">
         <result property="organName" column="organ_name_"/>
+        <result property="organId" column="organ_id_"/>
         <result property="teacherName" column="teacher_name_"/>
         <result property="normalNum" column="normal_num_"/>
         <result property="train0" column="train0"/>
@@ -1181,7 +1182,7 @@
         <result property="trainStudentNum" column="train_student_num_"/>
     </resultMap>
     <select id="cloudTeacherSum" resultMap="CloudTeacherSumDto">
-        select o.name_ organ_name_,COUNT(distinct s.user_id_) normal_num_,COUNT(distinct smcr.user_id_) train_student_num_,
+        select o.id_ organ_id_,o.name_ organ_name_,COUNT(distinct s.user_id_) normal_num_,COUNT(distinct smcr.user_id_) train_student_num_,
         COUNT(distinct CASE WHEN smcr.train_time_ &lt; 60 THEN smcr.user_id_ END) 'train1',
         COUNT(distinct CASE WHEN smcr.train_time_ >= 60 AND smcr.train_time_ &lt; 120 THEN smcr.user_id_ END) 'train2',
         COUNT(distinct CASE WHEN smcr.train_time_ >= 120 AND smcr.train_time_ &lt; 240 THEN smcr.user_id_ END) 'train3',