zouxuan преди 5 години
родител
ревизия
959acea3dc

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

@@ -197,4 +197,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      * @return
      */
      */
     List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
     List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
+
+    /**
+     * 统计乐团不同声部报名人数
+     * @param musicGroupId
+     * @return
+     */
+    List<Map<Long, Long>> countApplyNum(String musicGroupId);
 }
 }

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -107,12 +107,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             throw new Exception("学员信息不存在");
             throw new Exception("学员信息不存在");
         }
         }
         //当前专业报名人数减一
         //当前专业报名人数减一
-        musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,studentRegistration.getActualSubjectId(),-1);
+//        musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,studentRegistration.getActualSubjectId(),-1);
         //批量调剂(未缴费学员)
         //批量调剂(未缴费学员)
-        int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
+//        int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
         //修改专业已报名人数
         //修改专业已报名人数
-        musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,subId,1);
-        return i;
+//        musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId,subId,1);
+        return studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
     }
     }
 
 
     @Override
     @Override

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java

@@ -62,11 +62,14 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  imple
     @Override
     @Override
     public List<SubjectApplyDetailDto> findSubApplyDetail(String musicGroupId) {
     public List<SubjectApplyDetailDto> findSubApplyDetail(String musicGroupId) {
         List<SubjectApplyDetailDto> subApplyDetail = subjectDao.findSubApplyDetail(musicGroupId);
         List<SubjectApplyDetailDto> subApplyDetail = subjectDao.findSubApplyDetail(musicGroupId);
-        List<Map<Integer, Long>> payNums = studentRegistrationDao.countPayNum(musicGroupId);
-        Map<Integer, Long> payNumMap = MapUtil.convertMybatisMap(payNums);
+        //统计当前乐团不同声部的报名人数
+        Map<Long,Long> applyNum = MapUtil.convertMybatisMap(studentRegistrationDao.countApplyNum(musicGroupId));
+        Map<Integer, Long> payNumMap = MapUtil.convertMybatisMap(studentRegistrationDao.countPayNum(musicGroupId));
         subApplyDetail.forEach(detail ->{
         subApplyDetail.forEach(detail ->{
             Long num = payNumMap.get(detail.getSubjectId());
             Long num = payNumMap.get(detail.getSubjectId());
             detail.setPayNum(num == null?0:num.intValue());
             detail.setPayNum(num == null?0:num.intValue());
+            num = applyNum.get(detail.getSubjectId().longValue());
+            detail.setApplyStudentNum(num == null?0:num.intValue());
         });
         });
         return subApplyDetail;
         return subApplyDetail;
     }
     }

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

@@ -115,7 +115,7 @@
     </update>
     </update>
 
 
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
-        SELECT sr.user_id_,su.real_name_,su.gender_,sr.parents_name_,sr.parents_phone_
+        SELECT sr.user_id_,su.username_ real_name_,su.gender_,sr.parents_name_,sr.parents_phone_
         FROM student_registration sr
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
         WHERE sr.user_id_ IN (
         WHERE sr.user_id_ IN (

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

@@ -421,6 +421,11 @@
     <select id="queryStudentByMusicGroupId" resultMap="StudentRegistration">
     <select id="queryStudentByMusicGroupId" resultMap="StudentRegistration">
 
 
     </select>
     </select>
+    <select id="countApplyNum" resultType="java.util.Map">
+        SELECT sr.actual_subject_id_ 'key',COUNT(DISTINCT sr.user_id_) 'value' FROM student_registration sr
+        WHERE sr.music_group_id_ = #{musicGroupId}
+        GROUP BY actual_subject_id_
+    </select>
 
 
     <!-- 批量开启缴费 -->
     <!-- 批量开启缴费 -->
     <update id="batchOpenPay">
     <update id="batchOpenPay">

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

@@ -109,7 +109,7 @@
         <result column="not_part_class_num_" property="notPartClassNum"/>
         <result column="not_part_class_num_" property="notPartClassNum"/>
     </resultMap>
     </resultMap>
     <select id="findSubApplyDetail" resultMap="subApplyDetail">
     <select id="findSubApplyDetail" resultMap="subApplyDetail">
-        SELECT mgsp.subject_id_,s.name_,mgsp.expected_student_num_,mgsp.apply_student_num_
+        SELECT mgsp.subject_id_,s.name_,mgsp.expected_student_num_
         FROM music_group_subject_plan mgsp
         FROM music_group_subject_plan mgsp
         LEFT JOIN `subject` s ON mgsp.subject_id_ = s.id_
         LEFT JOIN `subject` s ON mgsp.subject_id_ = s.id_
         WHERE mgsp.music_group_id_ = #{musicGroupId} AND s.del_flag_ = 0
         WHERE mgsp.music_group_id_ = #{musicGroupId} AND s.del_flag_ = 0