Explorar o código

fix 乐团分班

周箭河 %!s(int64=5) %!d(string=hai) anos
pai
achega
08b18217a7

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

@@ -58,9 +58,17 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 获取乐团声部未分配学生数
+     *
      * @param musicGroupId
      * @param actualSubjectId
      * @return
      */
     Integer getNoClassStuCountBySubjectId(@Param("musicGroupId") Integer musicGroupId, @Param("actualSubjectId") Integer actualSubjectId);
+
+    /**
+     * 根据乐团id和user_id 更新
+     * @param studentRegistration
+     * @return
+     */
+    Integer updateByUserIdAndMusicGroupId(@Param("studentRegistration") StudentRegistration studentRegistration);
 }

+ 16 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -17,6 +17,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 
     /**
      * 获取乐团学员报名详情
+     *
      * @param queryInfo
      * @return
      */
@@ -24,6 +25,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 
     /**
      * 批量调剂
+     *
      * @param userId
      * @param subId
      * @return
@@ -32,15 +34,17 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 
     /**
      * 学生报名缴费金额详情
+     *
      * @param studentId
      * @param musicGroupId
      * @return
      */
-    StudentFeeDto queryFeeDetail(Integer studentId,String musicGroupId);
+    StudentFeeDto queryFeeDetail(Integer studentId, String musicGroupId);
 
     /**
      * 获取未分配的班级的学生
-     * @param musicGroupId 乐团id
+     *
+     * @param musicGroupId    乐团id
      * @param actualSubjectId 科目id
      * @return
      */
@@ -48,11 +52,20 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 
     /**
      * 获取乐团声部未分配学生统计
+     *
      * @param musicGroupId
      * @param actualSubjectId
      * @return
      */
-    Integer getNoClassStuCountBySubjectId(@Param("musicGroupId") Integer musicGroupId, @Param("actualSubjectId") Integer actualSubjectId);
+    Integer getNoClassStuCountBySubjectId(Integer musicGroupId, Integer actualSubjectId);
 
 
+    /**
+     * 根据user_id 和 乐团id更新
+     *
+     * @param studentRegistration
+     * @return
+     */
+    Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration);
+
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -42,6 +42,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
     @Autowired
     private CourseScheduleService courseScheduleService;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
 
     @Override
     public BaseDAO<Integer, ClassGroup> getDAO() {
@@ -99,7 +101,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             classGroupStudentMapper.setCreateTime(date);
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentList.add(classGroupStudentMapper);
+            StudentRegistration studentRegistration = new StudentRegistration();
+            studentRegistration.setClassGroupId(classGroupId.intValue());
+            studentRegistration.setUserId(Integer.getInteger(userId));
+            studentRegistration.setMusicGroupId(classGroup.getMusicGroupId());
+            studentRegistrationService.updateByUserIdAndMusicGroupId(studentRegistration);
         }
+
         classGroupStudentMapperService.classGroupStudentsInsert(classGroupStudentList);
 
         return classGroup;

+ 6 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRechargeServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -14,10 +16,12 @@ public class StudentRechargeServiceImpl extends BaseServiceImpl<String, StudentR
 	
 	@Autowired
 	private StudentRechargeDao studentRechargeDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
 
-	@Override
+    @Override
 	public BaseDAO<String, StudentRecharge> getDAO() {
 		return studentRechargeDao;
 	}
-	
+
 }

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

@@ -79,4 +79,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public Integer getNoClassStuCountBySubjectId(Integer musicGroupId, Integer actualSubjectId) {
         return studentRegistrationDao.getNoClassStuCountBySubjectId(musicGroupId,actualSubjectId);
     }
+
+    @Override
+    public Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration) {
+        return studentRegistrationDao.updateByUserIdAndMusicGroupId(studentRegistration);
+    }
 }

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

@@ -212,4 +212,15 @@
         SELECT count(*) FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
         #{actualSubjectId} AND class_group_id_ >=1
     </select>
+
+    <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
+        UPDATE student_registration
+        <set>
+            <if test="classGroupId != null != null">
+                class_group_id_ = #{classGroupId},
+            </if>
+        </set>
+        WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
+        <foreach collection="@ " item="id">
+    </update>
 </mapper>