浏览代码

Merge branch 'cloud_study_video' into online1

Joburgess 3 年之前
父节点
当前提交
e40af39212

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -316,6 +316,8 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      */
      */
     int countStudentNotStartCourseNumWithCourseType(@Param("studentId") Integer studentId,
     int countStudentNotStartCourseNumWithCourseType(@Param("studentId") Integer studentId,
                                                     @Param("courseScheduleType") CourseSchedule.CourseScheduleType courseScheduleType);
                                                     @Param("courseScheduleType") CourseSchedule.CourseScheduleType courseScheduleType);
+    List<Map<Integer, Integer>> countStudentsNotStartCourseNumWithCourseType(@Param("studentIds") List<Integer> studentIds,
+                                                    @Param("courseScheduleType") CourseSchedule.CourseScheduleType courseScheduleType);
 
 
     /**
     /**
      * 批量操作节拍器状态
      * 批量操作节拍器状态

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -311,6 +311,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     List<EduOrganStudentListDto> queryCloudStudyStudentData(Map<String, Object> params);
     List<EduOrganStudentListDto> queryCloudStudyStudentData(Map<String, Object> params);
     int countCloudStudyStudentData(Map<String, Object> params);
     int countCloudStudyStudentData(Map<String, Object> params);
 
 
+    List<Map<Integer, String>> getStudentCooperationNameMap(@Param("studentIds") List<Integer> studentIds);
+
     /**
     /**
      * @describe 更新学员云教练连续使用天数
      * @describe 更新学员云教练连续使用天数
      * @author Joburgess
      * @author Joburgess

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -675,6 +675,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.String>>
      * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.String>>
      */
      */
     List<Map<Integer, String>> queryStudentMusicGroupNamesMap(@Param("studentIds") List<Integer> studentIds);
     List<Map<Integer, String>> queryStudentMusicGroupNamesMap(@Param("studentIds") List<Integer> studentIds);
+    List<Map<Integer, String>> queryStudentSchoolNamesMap(@Param("studentIds") List<Integer> studentIds);
 
 
     /**
     /**
      * 获取进行中在读的学员列表
      * 获取进行中在读的学员列表

+ 279 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/EduOrganStudentListExportDto.java

@@ -0,0 +1,279 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/8/17 0017
+ */
+public class EduOrganStudentListExportDto {
+
+    @ApiModelProperty("学员编号")
+    private Integer studentId;
+
+    @ApiModelProperty("姓名")
+    private String studentName;
+
+    @ApiModelProperty("手机号")
+    private String phone;
+
+    @ApiModelProperty("指导老师编号")
+    private Integer teacherId;
+
+    @ApiModelProperty("指导老师名称")
+    private String teacherName;
+
+    @ApiModelProperty("声部编号")
+    private Integer subjectId;
+
+    @ApiModelProperty("声部名称")
+    private String subjectName;
+
+    @ApiModelProperty("乐团名称")
+    private String musicGroupNames;
+
+    @ApiModelProperty("所属学校")
+    private String schoolNames;
+
+    private boolean newUser;
+
+    @ApiModelProperty(value = "关心包:0:默认不可用;1:可用;2:已使用;")
+    private int carePackage;
+
+    @ApiModelProperty(value = "加油包:0:默认不可用;1:可用;2:已使用;")
+    private int comeOnPackage;
+
+    @ApiModelProperty("是否激活")
+    private boolean enable;
+
+    private int serviceTag;
+
+    private int operatingTag;
+
+    private int notStartCourseNum;
+
+    private int notStartVipCourseNum;
+
+    private int notStartPracticeCourseNum;
+
+    @ApiModelProperty("是否有小课")
+    private int hasVipGroup;
+
+    @ApiModelProperty("训练次数")
+    private int cloudStudyUseNum;
+
+    @ApiModelProperty("平均时长")
+    private double cloudStudyUseAvgTime;
+
+    @ApiModelProperty("总时长")
+    private  double cloudStudyUseTime;
+
+    @ApiModelProperty("连续天数")
+    private int cloudStudyRunningDays;
+
+    @ApiModelProperty("使用天数")
+    private int cloudStudyUseDays;
+
+    @ApiModelProperty("会员有效期")
+    private String membershipEndTime;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getMusicGroupNames() {
+        return musicGroupNames;
+    }
+
+    public void setMusicGroupNames(String musicGroupNames) {
+        this.musicGroupNames = musicGroupNames;
+    }
+
+    public int getHasVipGroup() {
+        return hasVipGroup;
+    }
+
+    public void setHasVipGroup(int hasVipGroup) {
+        this.hasVipGroup = hasVipGroup;
+    }
+
+    public int getCloudStudyUseNum() {
+        return cloudStudyUseNum;
+    }
+
+    public void setCloudStudyUseNum(int cloudStudyUseNum) {
+        this.cloudStudyUseNum = cloudStudyUseNum;
+    }
+
+    public double getCloudStudyUseAvgTime() {
+        return cloudStudyUseAvgTime;
+    }
+
+    public void setCloudStudyUseAvgTime(double cloudStudyUseAvgTime) {
+        this.cloudStudyUseAvgTime = cloudStudyUseAvgTime;
+    }
+
+    public double getCloudStudyUseTime() {
+        return cloudStudyUseTime;
+    }
+
+    public void setCloudStudyUseTime(double cloudStudyUseTime) {
+        this.cloudStudyUseTime = cloudStudyUseTime;
+    }
+
+    public int getCloudStudyRunningDays() {
+        return cloudStudyRunningDays;
+    }
+
+    public void setCloudStudyRunningDays(int cloudStudyRunningDays) {
+        this.cloudStudyRunningDays = cloudStudyRunningDays;
+    }
+
+    public String getMembershipEndTime() {
+        return membershipEndTime;
+    }
+
+    public void setMembershipEndTime(String membershipEndTime) {
+        this.membershipEndTime = membershipEndTime;
+    }
+
+    public int getCloudStudyUseDays() {
+        return cloudStudyUseDays;
+    }
+
+    public void setCloudStudyUseDays(int cloudStudyUseDays) {
+        this.cloudStudyUseDays = cloudStudyUseDays;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getSchoolNames() {
+        return schoolNames;
+    }
+
+    public void setSchoolNames(String schoolNames) {
+        this.schoolNames = schoolNames;
+    }
+
+    public boolean isNewUser() {
+        return newUser;
+    }
+
+    public void setNewUser(boolean newUser) {
+        this.newUser = newUser;
+    }
+
+    public int getCarePackage() {
+        return carePackage;
+    }
+
+    public void setCarePackage(int carePackage) {
+        this.carePackage = carePackage;
+    }
+
+    public int getComeOnPackage() {
+        return comeOnPackage;
+    }
+
+    public void setComeOnPackage(int comeOnPackage) {
+        this.comeOnPackage = comeOnPackage;
+    }
+
+    public boolean isEnable() {
+        return enable;
+    }
+
+    public void setEnable(boolean enable) {
+        this.enable = enable;
+    }
+
+    public int getServiceTag() {
+        return serviceTag;
+    }
+
+    public void setServiceTag(int serviceTag) {
+        this.serviceTag = serviceTag;
+    }
+
+    public int getOperatingTag() {
+        return operatingTag;
+    }
+
+    public void setOperatingTag(int operatingTag) {
+        this.operatingTag = operatingTag;
+    }
+
+    public int getNotStartCourseNum() {
+        return notStartCourseNum;
+    }
+
+    public void setNotStartCourseNum(int notStartCourseNum) {
+        this.notStartCourseNum = notStartCourseNum;
+    }
+
+    public int getNotStartVipCourseNum() {
+        return notStartVipCourseNum;
+    }
+
+    public void setNotStartVipCourseNum(int notStartVipCourseNum) {
+        this.notStartVipCourseNum = notStartVipCourseNum;
+    }
+
+    public int getNotStartPracticeCourseNum() {
+        return notStartPracticeCourseNum;
+    }
+
+    public void setNotStartPracticeCourseNum(int notStartPracticeCourseNum) {
+        this.notStartPracticeCourseNum = notStartPracticeCourseNum;
+    }
+}

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

@@ -108,6 +108,7 @@ public interface StudentService extends BaseService<Integer, Student> {
      * @return com.ym.mec.biz.dal.dto.StatDto
      * @return com.ym.mec.biz.dal.dto.StatDto
      */
      */
     StatDto organStudentData(StudentQueryInfo queryInfo);
     StatDto organStudentData(StudentQueryInfo queryInfo);
+    StatDto exportOrganStudentData(StudentQueryInfo queryInfo);
 
 
     List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds);
     List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds);
 
 

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -20,6 +21,7 @@ import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -74,6 +76,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     @Autowired
     @Autowired
     private IndexBaseMonthDataDao indexBaseMonthDataDao;
     private IndexBaseMonthDataDao indexBaseMonthDataDao;
 
 
+    @Autowired
+    private EmployeeDao employeeDao;
+
     @Override
     @Override
     public BaseDAO<Integer, Student> getDAO() {
     public BaseDAO<Integer, Student> getDAO() {
         return studentDao;
         return studentDao;
@@ -511,6 +516,111 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     }
     }
 
 
     @Override
     @Override
+    public StatDto exportOrganStudentData(StudentQueryInfo queryInfo) {
+        PageInfo<EduOrganStudentListExportDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<EduOrganStudentListDto> dataList1 = new ArrayList<>();
+        List<EduOrganStudentListExportDto> dataList = new ArrayList<>();
+        int count = studentDao.countCloudStudyStudentData(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList1 = studentDao.queryCloudStudyStudentData(params);
+            List<Integer> studentIds = dataList1.stream().map(EduOrganStudentListDto::getStudentId).collect(Collectors.toList());
+
+
+            List<Map<Integer, String>> studentGroupNamesMapList = studentRegistrationDao.queryStudentMusicGroupNamesMap(studentIds);
+            Map<Integer, String> studentGroupNamesMap = MapUtil.convertIntegerMap(studentGroupNamesMapList);
+            Set<Integer> hasVipCourseStudentIds = courseScheduleStudentPaymentDao.getHasVipCourseStudentIds(studentIds);
+
+            List<Map<Integer, String>> studentSchoolNamesMapList = studentDao.getStudentCooperationNameMap(studentIds);
+            Map<Integer, String> studentSchoolNamesMap = MapUtil.convertIntegerMap(studentSchoolNamesMapList);
+
+            List<SysUser> users = employeeDao.getUsers(studentIds);
+            Map<Integer, SysUser> idUserMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(users)){
+                idUserMap = users.stream().collect(Collectors.toMap(SysUser::getId, u -> u, (u1, u2) -> u1));
+            }
+
+            List<Student> students = studentDao.findByStudentIds(studentIds);
+            Map<Integer, Student> idStudentMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(students)){
+                idStudentMap = students.stream().collect(Collectors.toMap(Student::getUserId, s->s, (s1, s2)->s1));
+            }
+
+            List<Map<Integer, Integer>> studentNotStartCourseNumMapList = courseScheduleStudentPaymentDao.countStudentsNotStartCourseNumWithCourseType(studentIds, null);
+            Map<Integer, Long> studentNotStartCourseNumMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(studentNotStartCourseNumMapList)){
+                studentNotStartCourseNumMap = MapUtil.convertIntegerMap(studentNotStartCourseNumMapList);
+            }
+            List<Map<Integer, Integer>> studentNotStartVipCourseNumMapList = courseScheduleStudentPaymentDao.countStudentsNotStartCourseNumWithCourseType(studentIds, CourseSchedule.CourseScheduleType.VIP);
+            Map<Integer, Long> studentNotStartVipCourseNumMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(studentNotStartVipCourseNumMapList)){
+                studentNotStartVipCourseNumMap = MapUtil.convertIntegerMap(studentNotStartVipCourseNumMapList);
+            }
+            List<Map<Integer, Integer>> studentNotStartPracticeCourseNumMapList = courseScheduleStudentPaymentDao.countStudentsNotStartCourseNumWithCourseType(studentIds, CourseSchedule.CourseScheduleType.PRACTICE);
+            Map<Integer, Long> studentNotStartPracticeCourseNumMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(studentNotStartPracticeCourseNumMapList)){
+                studentNotStartPracticeCourseNumMap = MapUtil.convertIntegerMap(studentNotStartPracticeCourseNumMapList);
+            }
+
+            for (EduOrganStudentListDto eduOrganStudentListDto : dataList1) {
+                EduOrganStudentListExportDto data = new EduOrganStudentListExportDto();
+                BeanUtils.copyProperties(eduOrganStudentListDto, data);
+                if(studentGroupNamesMap.containsKey(data.getStudentId())){
+                    data.setMusicGroupNames(studentGroupNamesMap.get(data.getStudentId()));
+                }
+                if(studentSchoolNamesMap.containsKey(data.getStudentId())){
+                    data.setSchoolNames(studentSchoolNamesMap.get(data.getStudentId()));
+                }
+                if(hasVipCourseStudentIds.contains(data.getStudentId())){
+                    data.setHasVipGroup(1);
+                }
+                if(data.getCloudStudyUseNum()>0 && data.getCloudStudyUseTime()>0){
+                    data.setCloudStudyUseAvgTime(data.getCloudStudyUseTime()/data.getCloudStudyUseNum());
+                }
+                data.setCloudStudyUseTime(data.getCloudStudyUseTime()/60);
+                data.setCloudStudyUseAvgTime(data.getCloudStudyUseAvgTime()/60);
+
+                if(idUserMap.containsKey(eduOrganStudentListDto.getStudentId())){
+                    SysUser sysUser = idUserMap.get(data.getStudentId());
+                    data.setPhone(sysUser.getPhone());
+                    data.setEnable(StringUtils.isNotBlank(sysUser.getPassword()));
+                }
+
+                if(idStudentMap.containsKey(data.getStudentId())){
+                    Student student = idStudentMap.get(data.getStudentId());
+                    data.setNewUser(student.getIsNewUser());
+                    data.setServiceTag(Objects.isNull(student.getServiceTag())?0:student.getServiceTag());
+                    data.setOperatingTag(Objects.isNull(student.getOperatingTag())?0:student.getOperatingTag());
+                    data.setCarePackage(Objects.nonNull(student.getCarePackage())?student.getCarePackage():0);
+                    data.setComeOnPackage(Objects.isNull(student.getComeOnPackage())?0:student.getComeOnPackage());
+                }
+
+                if(studentNotStartCourseNumMap.containsKey(data.getStudentId())){
+                    data.setNotStartCourseNum(studentNotStartCourseNumMap.get(data.getStudentId()).intValue());
+                }
+                if(studentNotStartVipCourseNumMap.containsKey(data.getStudentId())){
+                    data.setNotStartVipCourseNum(studentNotStartVipCourseNumMap.get(data.getStudentId()).intValue());
+                }
+                if(studentNotStartPracticeCourseNumMap.containsKey(data.getStudentId())){
+                    data.setNotStartPracticeCourseNum(studentNotStartPracticeCourseNumMap.get(data.getStudentId()).intValue());
+                }
+
+                dataList.add(data);
+            }
+        }
+        pageInfo.setRows(dataList);
+
+        StatDto result = new StatDto();
+        result.setDetail(pageInfo);
+
+        return result;
+    }
+
+    @Override
     public List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds) {
     public List<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds) {
         List<Organization> organs = organizationDao.getOrgans(organIds);
         List<Organization> organs = organizationDao.getOrgans(organIds);
 
 

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -490,6 +490,20 @@
 		</if>
 		</if>
 		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ = 0
 		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ = 0
 	</select>
 	</select>
+	<select id="countStudentsNotStartCourseNumWithCourseType" resultType="map">
+		SELECT cssp.user_id_ 'key',COUNT(DISTINCT cssp.course_schedule_id_) 'value'
+		FROM course_schedule_student_payment cssp
+		LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
+		WHERE cssp.user_id_ IN
+		<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+			#{studentId}
+		</foreach>
+		<if test="courseScheduleType != null">
+			AND cs.type_= #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+		</if>
+		AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW() AND cs.pre_course_flag_ = 0
+		GROUP BY cssp.user_id_
+	</select>
 	<select id="queryMidiByUserIdsAndCourseId" resultType="java.util.Map">
 	<select id="queryMidiByUserIdsAndCourseId" resultType="java.util.Map">
 		SELECT cssp.user_id_ 'key',CASE WHEN cssp.open_play_midi_ IS NULL THEN '' ELSE cssp.open_play_midi_ END 'value' FROM course_schedule_student_payment cssp
 		SELECT cssp.user_id_ 'key',CASE WHEN cssp.open_play_midi_ IS NULL THEN '' ELSE cssp.open_play_midi_ END 'value' FROM course_schedule_student_payment cssp
 		WHERE cssp.user_id_ IN
 		WHERE cssp.user_id_ IN

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

@@ -1257,6 +1257,19 @@
         AND cs.status_='NOT_START'))t)
         AND cs.status_='NOT_START'))t)
     </select>
     </select>
 
 
+    <select id="getStudentCooperationNameMap" resultType="java.util.Map">
+        SELECT stu.user_id_ 'key',co.name_ 'value'
+        FROM student stu
+        LEFT JOIN cooperation_organ co ON stu.cooperation_organ_id_=co.id_
+        WHERE 1=1
+        <if test="studentIds!=null and studentIds.size()>0">
+            AND stu.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+        </if>
+    </select>
+
     <update id="updateGrade"><![CDATA[
     <update id="updateGrade"><![CDATA[
         UPDATE student SET current_grade_num_=current_grade_num_+1
         UPDATE student SET current_grade_num_=current_grade_num_+1
         WHERE current_grade_num_>=1
         WHERE current_grade_num_>=1

+ 15 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1687,6 +1687,21 @@
         </if>
         </if>
         GROUP BY sr.user_id_
         GROUP BY sr.user_id_
     </select>
     </select>
+
+    <select id="queryStudentSchoolNamesMap" resultType="java.util.Map">
+        SELECT sr.user_id_ 'key',GROUP_CONCAT(sch.name_) 'value'
+        FROM student_registration sr
+        LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
+        LEFT JOIN school sch ON mg.school_id_=sch.id_
+        WHERE mg.status_='PROGRESS'
+        <if test="studentIds!=null and studentIds.size()>0">
+            AND sr.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+        </if>
+        GROUP BY sr.user_id_
+    </select>
     <select id="findStudentIds" resultType="java.lang.Integer">
     <select id="findStudentIds" resultType="java.lang.Integer">
         SELECT DISTINCT sr.user_id_ FROM student_registration sr
         SELECT DISTINCT sr.user_id_ FROM student_registration sr
         LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
         LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicCompareWeekDataMapper.xml

@@ -130,6 +130,20 @@
 		</if>
 		</if>
 		WHERE smcwd.monday_ = #{monday}
 		WHERE smcwd.monday_ = #{monday}
 			AND stu.user_id_=smcwd.user_id_
 			AND stu.user_id_=smcwd.user_id_
+			<if test="orderType==1">
+				<if test="heardLevel==null">
+					AND smcwd.advanced_max_score_ > 0
+				</if>
+				<if test="heardLevel=='BEGINNER'">
+					AND smcwd.beginner_max_score_ > 0
+				</if>
+				<if test="heardLevel=='ADVANCED'">
+					AND smcwd.advanced_max_score_ > 0
+				</if>
+				<if test="heardLevel=='PERFORMER'">
+					AND smcwd.performer_max_score_ > 0
+				</if>
+			</if>
 			ORDER BY
 			ORDER BY
 			<if test="orderType==null">
 			<if test="orderType==null">
 				smcwd.train_time_ DESC,
 				smcwd.train_time_ DESC,

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

@@ -3264,7 +3264,7 @@ public class ExportController extends BaseController {
         queryInfo.setPage(1);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         queryInfo.setRows(49999);
 
 
-        List<EduOrganStudentListDto> rows = ((PageInfo<EduOrganStudentListDto>)studentService.organStudentData(queryInfo).getDetail()).getRows();
+        List<EduOrganStudentListExportDto> rows = ((PageInfo<EduOrganStudentListExportDto>)studentService.exportOrganStudentData(queryInfo).getDetail()).getRows();
         if (CollectionUtils.isEmpty(rows)) {
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(200);
             response.setStatus(200);
             response.setContentType("Content-Type: application/json;charset=UTF-8");
             response.setContentType("Content-Type: application/json;charset=UTF-8");
@@ -3272,16 +3272,20 @@ public class ExportController extends BaseController {
             response.flushBuffer();
             response.flushBuffer();
             return;
             return;
         }
         }
-        for (EduOrganStudentListDto row : rows) {
+        for (EduOrganStudentListExportDto row : rows) {
             row.setCloudStudyUseTime(Math.round(row.getCloudStudyUseTime()));
             row.setCloudStudyUseTime(Math.round(row.getCloudStudyUseTime()));
             row.setCloudStudyUseAvgTime(Math.round(row.getCloudStudyUseAvgTime()));
             row.setCloudStudyUseAvgTime(Math.round(row.getCloudStudyUseAvgTime()));
         }
         }
         OutputStream outputStream = response.getOutputStream();
         OutputStream outputStream = response.getOutputStream();
         try {
         try {
-            String[] header = {"学员编号", "学员", "训练总时长", "连续训练天数", "乐团", "指导老师", "声部", "是否有小课", "训练次数", "训练天数", "训练平均时长", "会员有效期"};
-            String[] body = {"studentId", "studentName", "cloudStudyUseTime+\"分钟\"", "cloudStudyRunningDays+\"天\"", "musicGroupNames",
+            String[] header = {"学员编号", "学员", "手机号", "是否新用户", "是否激活", "训练总时长", "连续训练天数", "乐团", "所属学校", "指导老师", "声部", "是否有小课",
+                    "训练次数", "训练天数", "训练平均时长", "会员有效期", "是否服务", "是否运营", "关心包", "加油包", "未上课数", "vip课剩余课时", "网管课剩余课时"};
+            String[] body = {"studentId", "studentName", "phone", "newUser?\"是\":\"否\"", "enable?\"是\":\"否\"",
+                            "cloudStudyUseTime+\"分钟\"", "cloudStudyRunningDays+\"天\"", "musicGroupNames", "schoolNames",
                             "teacherName", "subjectName", "hasVipGroup>0?\"是\":\"否\"", "cloudStudyUseNum+\"次\"", "cloudStudyUseDays+\"天\"",
                             "teacherName", "subjectName", "hasVipGroup>0?\"是\":\"否\"", "cloudStudyUseNum+\"次\"", "cloudStudyUseDays+\"天\"",
-                            "cloudStudyUseAvgTime+\"分钟\"", "membershipEndTime"};
+                            "cloudStudyUseAvgTime+\"分钟\"", "membershipEndTime", "serviceTag>0?\"是\":\"否\"", "operatingTag>0?\"是\":\"否\"",
+                            "carePackage>0?carePackage>1?\"已使用\":\"可用\":\"不可用\"", "comeOnPackage>0?comeOnPackage>1?\"已使用\":\"可用\":\"不可用\"",
+                            "notStartCourseNum", "notStartVipCourseNum", "notStartPracticeCourseNum"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");