Explorar o código

feat:云教练训练功能使用记录

Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
4e3273ba84

+ 10 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -1,10 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.dto.Student4operating;
-import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
-import com.ym.mec.biz.dal.dto.StudentServeDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.GroupType;
@@ -244,4 +241,13 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     void cleanStudentMember();
 
     void cleanMember(Integer userId);
+
+    /**
+     * @describe 统计分部会员学员数据
+     * @author Joburgess
+     * @date 2021/8/16 0016
+     * @param organId:
+     * @return com.ym.mec.biz.dal.dto.EduOrganStudentDataDto
+     */
+    EduOrganStudentDataDto getOrganStudentVipData(@Param("organId") Integer organId);
 }

+ 76 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/EduOrganStudentDataDto.java

@@ -0,0 +1,76 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/8/16 0016
+ */
+public class EduOrganStudentDataDto {
+
+    @ApiModelProperty("学员总数")
+    private int totalStudentNum;
+
+    @ApiModelProperty("付费会员数")
+    private int vipStudentNum;
+
+    @ApiModelProperty("试用会员数")
+    private int eVipStudentNum;
+
+    @ApiModelProperty("付费会员占比")
+    private float vipStudentDuty;
+
+    @ApiModelProperty("云教练试用人数")
+    private int cloudStudyUseStudentNum;
+
+    @ApiModelProperty("活跃人数")
+    private int cloudStudyLivelyStudentNum;
+
+    public int getTotalStudentNum() {
+        return totalStudentNum;
+    }
+
+    public void setTotalStudentNum(int totalStudentNum) {
+        this.totalStudentNum = totalStudentNum;
+    }
+
+    public int getVipStudentNum() {
+        return vipStudentNum;
+    }
+
+    public void setVipStudentNum(int vipStudentNum) {
+        this.vipStudentNum = vipStudentNum;
+    }
+
+    public int geteVipStudentNum() {
+        return eVipStudentNum;
+    }
+
+    public void seteVipStudentNum(int eVipStudentNum) {
+        this.eVipStudentNum = eVipStudentNum;
+    }
+
+    public float getVipStudentDuty() {
+        return vipStudentDuty;
+    }
+
+    public void setVipStudentDuty(float vipStudentDuty) {
+        this.vipStudentDuty = vipStudentDuty;
+    }
+
+    public int getCloudStudyUseStudentNum() {
+        return cloudStudyUseStudentNum;
+    }
+
+    public void setCloudStudyUseStudentNum(int cloudStudyUseStudentNum) {
+        this.cloudStudyUseStudentNum = cloudStudyUseStudentNum;
+    }
+
+    public int getCloudStudyLivelyStudentNum() {
+        return cloudStudyLivelyStudentNum;
+    }
+
+    public void setCloudStudyLivelyStudentNum(int cloudStudyLivelyStudentNum) {
+        this.cloudStudyLivelyStudentNum = cloudStudyLivelyStudentNum;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentQueryInfo.java

@@ -16,6 +16,8 @@ public class StudentQueryInfo extends QueryInfo {
 
     private Integer studentId;
 
+    private Integer organId;
+
     private List<String> organIdList;
 
     public String getGroupType() {
@@ -42,6 +44,14 @@ public class StudentQueryInfo extends QueryInfo {
         this.studentId = studentId;
     }
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
     public List<String> getOrganIdList() {
         return organIdList;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import java.text.ParseException;
 import java.util.List;
 
+import com.ym.mec.biz.dal.dto.StatDto;
 import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.Student;
@@ -10,6 +11,7 @@ import com.ym.mec.biz.dal.enums.GradeTypeEnum;
 import com.ym.mec.biz.dal.enums.PeriodEnum;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface StudentService extends BaseService<Integer, Student> {
@@ -87,4 +89,12 @@ public interface StudentService extends BaseService<Integer, Student> {
 
     void cleanMember(Integer userId);
 
+    /**
+     * @describe 分部各类型学员数据统计
+     * @author Joburgess
+     * @date 2021/8/16 0016
+     * @param queryInfo:
+     * @return com.ym.mec.biz.dal.dto.StatDto
+     */
+    StatDto organStudentData(StudentQueryInfo queryInfo);
 }

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

@@ -1,9 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.StudentClassInfoDto;
-import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
-import com.ym.mec.biz.dal.dto.StudentTeacherCourseDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
@@ -11,6 +9,7 @@ import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
@@ -362,4 +361,11 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     public void cleanMember(Integer userId) {
         studentDao.cleanMember(userId);
     }
+
+    @Override
+    public StatDto organStudentData(StudentQueryInfo queryInfo) {
+        EduOrganStudentDataDto organStudentVipData = studentDao.getOrganStudentVipData(queryInfo.getOrganId());
+
+        return null;
+    }
 }

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -762,6 +762,18 @@
         AND DATEDIFF(MAX(cto.end_time_),NOW()) = #{pushMemberRenew}
     </select>
 
+    <select id="getOrganStudentVipData" resultType="com.ym.mec.biz.dal.dto.EduOrganStudentDataDto">
+        SELECT COUNT(stu.user_id_) studentNum,
+               SUM(CASE WHEN stu.member_rank_setting_id_ IS NULL THEN 0 ELSE 1 END) vipStudentNum,
+               SUM(CASE WHEN stu.experience_member_rank_setting_id_ IS NULL THEN 0 ELSE 1 END) eVipStudentNum
+        FROM student stu
+                 LEFT JOIN sys_user su ON stu.user_id_=su.id_
+        WHERE su.del_flag_=0
+        <if test="organId!=null">
+            AND su.organ_id_=#{organId}
+        </if>
+    </select>
+
     <update id="updateGrade"><![CDATA[
         UPDATE student SET current_grade_num_=current_grade_num_+1
         WHERE current_grade_num_>=1