浏览代码

Merge branch 'online1' of http://git.dayaedu.com/yonge/mec into online1

yonge 4 年之前
父节点
当前提交
5746d447e0

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

@@ -361,4 +361,13 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     List<OrderStatisDto> getOrganNormalStudent();
-}
+
+    /**
+     * @describe 获取学员关联乐团记录
+     * @author qnc99
+     * @date 2020/11/24 0024
+     * @param userIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.UserGroupDto>
+     */
+    List<UserGroupDto> getUserGroups(@Param("userIds") List<Integer> userIds);
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/Student4operating.java

@@ -21,8 +21,17 @@ public class Student4operating {
     private String freePracticeTimesStr;
     private String buyPracticeTimesStr;
     private String musicNetWorkTimesStr;
+    private String groupNames;
     private Integer studentNum;
 
+    public String getGroupNames() {
+        return groupNames;
+    }
+
+    public void setGroupNames(String groupNames) {
+        this.groupNames = groupNames;
+    }
+
     public String getOrganName() {
         return organName;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java

@@ -22,6 +22,8 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
 
     private String educationalTeacherName;
 
+    private String groupNames;
+
     public Integer getEducationalTeacherId() {
         return educationalTeacherId;
     }
@@ -77,4 +79,12 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
     public void setTeacherName(String teacherName) {
         this.teacherName = teacherName;
     }
+
+    public String getGroupNames() {
+        return groupNames;
+    }
+
+    public void setGroupNames(String groupNames) {
+        this.groupNames = groupNames;
+    }
 }

+ 38 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/UserGroupDto.java

@@ -0,0 +1,38 @@
+package com.ym.mec.biz.dal.dto;
+
+/**
+ * @Author qnc99
+ * @Date 2020/11/24 0024
+ */
+public class UserGroupDto {
+
+    private Integer userId;
+
+    private String groupId;
+
+    private String groupName;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+}

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.StudentEduTeacherDto;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
+import com.ym.mec.biz.dal.dto.UserGroupDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
@@ -39,6 +40,8 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	private TeacherDao teacherDao;
 	@Autowired
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
 
 	@Override
 	public BaseDAO<Long, StudentExtracurricularExercisesSituation> getDAO() {
@@ -69,12 +72,22 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			List<StudentEduTeacherDto> studentEducationalTeachers = classGroupStudentMapperDao.getStudentEducationalTeachers(studentIds);
 			Map<Integer, List<StudentEduTeacherDto>> studentEduTeachersMap = studentEducationalTeachers.stream().collect(Collectors.groupingBy(StudentEduTeacherDto::getStudentId));
 
+			List<UserGroupDto> allUserGroups = studentRegistrationDao.getUserGroups(studentIds);
+			Map<Integer, List<UserGroupDto>> userGroupsMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(allUserGroups)){
+				userGroupsMap = allUserGroups.stream().collect(Collectors.groupingBy(UserGroupDto::getUserId));
+			}
+
 			for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
 				Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
 				exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
 				Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
 				exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
 //				exercisesSituationDto.setExpectExercisesNum((int) until+1);
+				List<UserGroupDto> userGroupDtos = userGroupsMap.get(exercisesSituationDto.getStudentId());
+				if(!CollectionUtils.isEmpty(userGroupDtos)){
+					exercisesSituationDto.setGroupNames(userGroupDtos.stream().map(UserGroupDto::getGroupName).collect(Collectors.joining(",")));
+				}
 				List<StudentEduTeacherDto> studentEduTeachers = studentEduTeachersMap.get(exercisesSituationDto.getStudentId());
 				if(!CollectionUtils.isEmpty(studentEduTeachers)){
 					List<StudentEduTeacherDto> t1 = studentEduTeachers.stream().filter(set -> set.getGroupType().equals(GroupType.VIP.getCode())||set.getGroupType().equals(GroupType.PRACTICE.getCode())).collect(Collectors.toList());

+ 16 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dto.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -33,22 +34,6 @@ import com.ym.mec.biz.dal.dao.SubjectChangeDao;
 import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.VipGroupDao;
-import com.ym.mec.biz.dal.dto.BasicUserDto;
-import com.ym.mec.biz.dal.dto.ConditionDto;
-import com.ym.mec.biz.dal.dto.MusicCardDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentSignDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.dto.Student4operating;
-import com.ym.mec.biz.dal.dto.StudentListCourseDto;
-import com.ym.mec.biz.dal.dto.StudentManageAccountBaseInfoDto;
-import com.ym.mec.biz.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
-import com.ym.mec.biz.dal.dto.StudentManageCourseListDto;
-import com.ym.mec.biz.dal.dto.StudentManageListDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupClassDto;
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupDto;
-import com.ym.mec.biz.dal.dto.StudentRegisterPerDto;
-import com.ym.mec.biz.dal.dto.UserGoodsDto;
 import com.ym.mec.biz.dal.entity.MusicGroupQuit;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
@@ -594,6 +579,21 @@ public class StudentManageServiceImpl implements StudentManageService {
         if (count > 0) {
             pageInfo.setTotal(count);
             dataList = studentDao.getOperatingStudents(params);
+
+            Set<Integer> studentIds = dataList.stream().map(Student4operating::getStudentId).collect(Collectors.toSet());
+
+            List<UserGroupDto> allUserGroups = studentRegistrationDao.getUserGroups(new ArrayList<>(studentIds));
+            Map<Integer, List<UserGroupDto>> userGroupsMap = new HashMap<>();
+            if(!CollectionUtils.isEmpty(allUserGroups)){
+                userGroupsMap = allUserGroups.stream().collect(Collectors.groupingBy(UserGroupDto::getUserId));
+            }
+
+            for (Student4operating student4operating : dataList) {
+                List<UserGroupDto> userGroupDtos = userGroupsMap.get(student4operating.getStudentId());
+                if(!CollectionUtils.isEmpty(userGroupDtos)){
+                    student4operating.setGroupNames(userGroupDtos.stream().map(UserGroupDto::getGroupName).collect(Collectors.joining(",")));
+                }
+            }
         }
         pageInfo.setRows(dataList);
         return pageInfo;

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

@@ -70,6 +70,12 @@
         <result column="subject_name_" property="subject.name"/>
     </resultMap>
 
+    <resultMap id="UserGroupDto" type="com.ym.mec.biz.dal.dto.UserGroupDto">
+        <result column="user_id_" property="userId"/>
+        <result column="group_id_" property="groupId"/>
+        <result column="group_name_" property="groupName"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentRegistration">
         SELECT * FROM student_registration WHERE id_ = #{id}
@@ -660,4 +666,13 @@
         WHERE sr.music_group_status_ = 'NORMAL'
         GROUP BY mg.organ_id_
     </select>
+
+    <select id="getUserGroups" resultMap="UserGroupDto">
+        SELECT DISTINCT sr.user_id_, mg.id_ group_id_, mg.name_ group_name_ FROM student_registration sr
+        LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
+        WHERE sr.payment_status_=2 AND sr.user_id_ IN
+        <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
+            #{userId}
+        </foreach>
+    </select>
 </mapper>

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

@@ -1439,8 +1439,8 @@ public class ExportController extends BaseController {
         OutputStream ouputStream = null;
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"学员编号", "学员姓名", "所属分部", "指导老师", "教务老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课", "作业提交时间"},
-                    new String[]{"studentId", "studentName", "organName", "teacherName", "educationalTeacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum",
+                    new String[]{"学员编号", "学员姓名", "所属分部", "乐团名称", "指导老师", "教务老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课", "作业提交时间"},
+                    new String[]{"studentId", "studentName", "organName", "groupNames", "teacherName", "educationalTeacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum",
                             "exercisesMessageNum", "exercisesMessageTimelyNum", "existPracticeCourse", "existVipCourse", "lastSubmitTime"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -1599,8 +1599,8 @@ public class ExportController extends BaseController {
         try {
 
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"分部", "学生", "学生编号", "指导老师", "指导老师id", "参与运营指标", "有线上VIP课", "参与免费网管课", "有付费网管课", "有乐团网管课"},
-                    new String[]{"organName", "studentName", "studentId", "teacherName", "teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr", "musicNetWorkTimes"}, rows);
+                    new String[]{"分部", "乐团名称", "学生", "学生编号", "指导老师", "指导老师id", "参与运营指标", "有线上VIP课", "参与免费网管课", "有付费网管课", "有乐团网管课"},
+                    new String[]{"organName", "groupNames", "studentName", "studentId", "teacherName", "teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr", "musicNetWorkTimes"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();