Procházet zdrojové kódy

Merge branch 'master' of git.dayaedu.com:yonge/mec

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRechargeServiceImpl.java
chengpeng před 5 roky
rodič
revize
03bc1126a7

+ 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;

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

@@ -1,4 +1,10 @@
 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;
+
 import com.ym.mec.biz.dal.dao.StudentRechargeDao;
 import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 import com.ym.mec.biz.dal.dao.SysUserCashAccountDetailDao;
@@ -19,6 +25,8 @@ public class StudentRechargeServiceImpl extends BaseServiceImpl<String, StudentR
 	
 	@Resource
 	private StudentRechargeDao studentRechargeDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
 
 	@Resource
 	private SysUserCashAccountDao sysUserCashAccountDao;
@@ -33,17 +41,17 @@ public class StudentRechargeServiceImpl extends BaseServiceImpl<String, StudentR
 	@Override
 	public Boolean recharge(RechargeDto rechargeDto) {
 
-		//TODO 璋冪敤绗�笁鏂瑰厖鍊兼帴鍙�
+		//TODO 调用第三方充值接口
 		Date now  = new Date();
 
-		//鐢熸垚鍏呭€艰�褰�
+		//生成充值记录
         StudentRecharge studentRecharge = new StudentRecharge();
         studentRecharge.setAmount(rechargeDto.getRechargeAmount());
 		studentRecharge.setCreateTime(now);
 		studentRecharge.setUserId(rechargeDto.getUserId().longValue());
 		studentRecharge.setTransNo(null);
 		studentRechargeDao.insert(studentRecharge);
-		//璐︽埛閲戦�
+		//账户金额
 		SysUserCashAccountDetail cashAccount = new SysUserCashAccountDetail();
 		cashAccount.setAmount(rechargeDto.getRechargeAmount());
 		cashAccount.setBalance(null);
@@ -52,7 +60,7 @@ public class StudentRechargeServiceImpl extends BaseServiceImpl<String, StudentR
 		cashAccount.setUserId(rechargeDto.getUserId());
 		cashAccount.setCreateTime(now);
 		sysUserCashAccountDetailDao.insert(cashAccount);
-		//鏇存柊璐︽埛浣欓�
+		//更新账户余额
 		sysUserCashAccountDao.incrAccount(rechargeDto.getUserId(),rechargeDto.getRechargeAmount());
 
 		return true;

+ 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>