Ver Fonte

fix 声部更换后学生列表显示问题

周箭河 há 4 anos atrás
pai
commit
352bcce531

+ 45 - 36
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -6,40 +6,49 @@ import com.ym.mec.common.enums.BaseEnum;
  * 类型(乐器、教辅、课程)'
  */
 public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum> {
-	MUSICAL("MUSICAL", "乐器"),
-	ACCESSORIES("ACCESSORIES", "辅件"),
-	TEACHING("TEACHING", "教谱"),
-	OTHER("OTHER", "其他"),
-	COURSE("COURSE", "课程"),
-	MUSIC_COURSE("MUSIC_COURSE", "乐团声部训练"),
-	MIX_COURSE("MIX_COURSE", "乐团合奏训练"),
-	HIGH_ONLINE_COURSE("HIGH_ONLINE_COURSE", "网络基础训练"),
-	HOLIDAY_COURSE("HOLIDAY_COURSE", "假期集中训练"),
-	NETWORK_COURSE("NETWORK_COURSE", "乐团云课堂");
-
-	private String code;
-
-	private String msg;
-
-	OrderDetailTypeEnum(String code, String msg) {
-		this.code = code;
-		this.msg = msg;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public String getMsg() {
-		return msg;
-	}
-
-	public void setMsg(String msg) {
-		this.msg = msg;
-	}
-
-	@Override
-	public String getCode() {
-		return this.code;
-	}
+    MUSICAL("MUSICAL", "乐器"),
+    ACCESSORIES("ACCESSORIES", "辅件"),
+    TEACHING("TEACHING", "教谱"),
+    OTHER("OTHER", "其他"),
+    COURSE("COURSE", "课程"),
+    HIGH_ONLINE_COURSE("HIGH_ONLINE_COURSE", "网络基础训练"),
+
+    SINGLE("SINGLE", "单技课"),
+    MIX("MIX", "合奏课"),
+    HIGH("HIGH", "小班课"),
+    VIP("VIP", "vip课"),
+    DEMO("DEMO", "试听课"),
+    COMPREHENSIVE("COMPREHENSIVE", "综合课"),
+    ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"),
+    TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"),
+    TRAINING_MIX("TRAINING_MIX", "集训合奏课"),
+    HIGH_ONLINE("HIGH_ONLINE", "网络基础训练课"),
+    MUSIC_NETWORK("MUSIC_NETWORK", "乐团网管课");
+
+
+    private String code;
+
+    private String msg;
+
+    OrderDetailTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
 }

+ 274 - 251
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -14,257 +14,280 @@ import java.util.Map;
 
 public interface StudentRegistrationService extends BaseService<Long, StudentRegistration> {
 
-	/**
-	 * 获取乐团学员报名详情
-	 *
-	 * @param queryInfo
-	 * @return
-	 */
-	PageInfo<StudentApplyDetailDto> queryStudentDetailPage(StudentRegistrationQueryInfo queryInfo);
-
-	/**
-	 * 批量调剂
-	 *
-	 * @param userId
-	 * @param subId
-	 * @return
-	 */
-	Integer batchUpdateSubject(Integer userId, Integer subId,String musicGroupId) throws Exception;
-
-	/**
-	 * 学生报名缴费金额详情
-	 *
-	 * @param studentId
-	 * @param musicGroupId
-	 * @return
-	 */
-	StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId);
-
-	/**
-	 * 获取未分配的班级的学生
-	 *
-	 * @param musicGroupId    乐团id
-	 * @param actualSubjectId 科目id
-	 * @return
-	 */
-	List<Map<String,Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId);
-
-	/**
-	 * 获取乐团声部未分配学生统计
-	 *
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<MusicGroupSubjectPlan> getNoClassStuCountByMusicGroupId(String musicGroupId);
-
-	/**
-	 * 根据user_id 和 乐团id更新
-	 *
-	 * @param studentRegistration
-	 * @return
-	 */
-	Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration);
-
-	/**
-	 * 添加学生报名信息
-	 * @param studentRegistration
-	 * @return
-	 */
-	StudentRegistration addStudent(StudentRegistration studentRegistration) throws Exception;
-
-	/**
-	 * 查询学生信息
-	 * @param userId
-	 * @return
-	 */
-	StudentInfo queryStudentInfo(Integer userId);
-
-	/**
-	 * 学生注册缴费订单
-	 * @param studentRegistration
-	 * @param amount
-	 * @param courseFee
-	 * @param goodsGroups
-	 * @param goodsList
-	 * @return
-	 */
-	StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
-			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,List<CourseFormDto> courseForms,
-								 BigDecimal remitFee,BigDecimal courseRemitFee) throws Exception;
-
-	/**
-	 * 学生注册缴费重新下订单
-	 * @param userId
-	 * @param amount
-	 * @param courseFee
-	 * @param goodsGroups
-	 * @param goodsList
-	 * @return
-	 */
-	StudentPaymentOrder reAddOrder(
-			Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
-			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,
-			String musicGroupId,StudentPaymentOrder oldOrder,List<CourseFormDto> courseForms,BigDecimal remitFee,BigDecimal courseRemitFee);
-
-	/**
-	 * 查询用户指定乐团的报名信息
-	 * @param userId 用户编号
-	 * @param musicGroupId 乐团编号
-	 * @return
-	 */
-	StudentRegistration queryByUserIdAndMusicGroupId(Integer userId, String musicGroupId);
-
-	/**
-	 * 根据乐团id,手机查询乐团注册信息
-	 * @param musicGroupId
-	 * @param parentsPhone
-	 * @return
-	 */
-	StudentRegistration getByPhoneAndMusicGroupId(String musicGroupId, String parentsPhone);
-
-	/**
-	 * 乐团插入新学员
-	 * @param studentAddDto
-	 * @return
-	 */
+    /**
+     * 获取乐团学员报名详情
+     *
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<StudentApplyDetailDto> queryStudentDetailPage(StudentRegistrationQueryInfo queryInfo);
+
+    /**
+     * 批量调剂
+     *
+     * @param userId
+     * @param subId
+     * @return
+     */
+    Integer batchUpdateSubject(Integer userId, Integer subId, String musicGroupId) throws Exception;
+
+    /**
+     * 学生报名缴费金额详情
+     *
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId);
+
+    /**
+     * 获取未分配的班级的学生
+     *
+     * @param musicGroupId    乐团id
+     * @param actualSubjectId 科目id
+     * @return
+     */
+    List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId);
+
+    /**
+     * 获取乐团声部未分配学生统计
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<MusicGroupSubjectPlan> getNoClassStuCountByMusicGroupId(String musicGroupId);
+
+    /**
+     * 根据user_id 和 乐团id更新
+     *
+     * @param studentRegistration
+     * @return
+     */
+    Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration);
+
+    /**
+     * 添加学生报名信息
+     *
+     * @param studentRegistration
+     * @return
+     */
+    StudentRegistration addStudent(StudentRegistration studentRegistration) throws Exception;
+
+    /**
+     * 查询学生信息
+     *
+     * @param userId
+     * @return
+     */
+    StudentInfo queryStudentInfo(Integer userId);
+
+    /**
+     * 学生注册缴费订单
+     *
+     * @param studentRegistration
+     * @param amount
+     * @param courseFee
+     * @param goodsGroups
+     * @param goodsList
+     * @return
+     */
+    StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
+                                 List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, List<CourseFormDto> courseForms,
+                                 BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses) throws Exception;
+
+    /**
+     * 学生注册缴费重新下订单
+     *
+     * @param userId
+     * @param amount
+     * @param courseFee
+     * @param goodsGroups
+     * @param goodsList
+     * @return
+     */
+    StudentPaymentOrder reAddOrder(
+            Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
+            List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,
+            String musicGroupId, StudentPaymentOrder oldOrder, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses) throws Exception;
+
+    /**
+     * 查询用户指定乐团的报名信息
+     *
+     * @param userId       用户编号
+     * @param musicGroupId 乐团编号
+     * @return
+     */
+    StudentRegistration queryByUserIdAndMusicGroupId(Integer userId, String musicGroupId);
+
+    /**
+     * 根据乐团id,手机查询乐团注册信息
+     *
+     * @param musicGroupId
+     * @param parentsPhone
+     * @return
+     */
+    StudentRegistration getByPhoneAndMusicGroupId(String musicGroupId, String parentsPhone);
+
+    /**
+     * 乐团插入新学员
+     *
+     * @param studentAddDto
+     * @return
+     */
     Integer insertStudent(StudentAddDto studentAddDto) throws Exception;
 
-	/**
-	 * 获取班级学生
-	 * @param musicGroupId
-	 * @param classGroupId
-	 * @return
-	 */
-	List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
-
-
-	/**
-	 * 更新报名订单
-	 * @param studentPaymentOrder
-	 * @return
-	 */
-	StudentPaymentOrder updateApplyOrder(StudentPaymentOrder studentPaymentOrder) throws Exception;
-
-	/**
-	 * 获取乐团科目的学生
-	 *
-	 * @param musicGroupId    乐团id
-	 * @param actualSubjectId 科目id
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupNoClassGroupStudent(String musicGroupId, Integer actualSubjectId);
-
-	/**
-	 * 根据id list 查询报名学生
-	 * @param idList
-	 * @return
-	 */
-	List<StudentRegistration> findStudentListByIdList(List<Long> idList);
-
-	/**
-	 * 批量插入
-	 * @param studentRegistrationList
-	 * @return
-	 */
-	int batchInsert(List<StudentRegistration> studentRegistrationList);
-
-
-	/**
-	 * 根据userId 和班级id查询学生
-	 * @param userId
-	 * @param classGroupId
-	 * @return
-	 */
-	StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId);
-
-
-
-	/**
-	 * 查询乐团声部下的学生
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupStudent(String musicGroupId,Integer actualSubjectId);
-
-	/**
-	 * 查询乐团userIdList的学生
-	 * @param musicGroupId
-	 * @param userIdList
-	 * @return
-	 */
-	List<StudentRegistration> findStudentListByUserIdList(String musicGroupId, List<Integer> userIdList);
-
-	/**
-	 * 开启缴费
-	 * @param ids
-	 * @return
-	 */
-	int openPayment(String ids) throws IOException;
-
-	/**
-	 * 根据乐团编号获取已缴费学员列表
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
-
-	/**
-	 * 根据家长的手机号列表,获取用户编号
-	 * @param parentPhones
-	 * @return
-	 */
-	List<Map<Integer,String>> findParentId(String parentPhones);
-
-	/**
-	 * 更新用户注册信息
-	 * @param studentRegistration
-	 * @return
-	 */
-	StudentRegistration updateStudent(StudentRegistration studentRegistration);
-
-	/**
-	 * 获取学员基本信息
-	 * @param mobile
-	 * @return
-	 */
-	StudentRegistration queryUserByPhone(String mobile);
-
-	/**
-	 * 获取没有某种班级类型的学生
-	 * @param musicGroupId
-	 * @param type
-	 * @param subjectId
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupStuNoClassType(String musicGroupId, ClassGroupTypeEnum type, Integer subjectId);
-
-	/**
-	 * 获取乐团下所有学员身上的声部列表
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId);
-
-	/**
-	 * 获取学员详情页,包含所在乐团信息
-	 * @param studentId
-	 * @return
-	 */
-	StudentMusicDetailDto getStudentDetail(Integer studentId);
-
-	/**
-	 * 获取学生
-	 * @param studentId
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<StudentPaymentOrderDetail> getStudentApplyDetail(Integer studentId,String musicGroupId);
-
-	/**
-	 * 更换学生声部
-	 * @param musicGroup
-	 * @param originalSubjectId
-	 * @param changeSubjectId
-	 * @return
-	 */
-	StudentRegistration changeStudentSubject(Integer studentId,String musicGroupId,Integer originalSubjectId,Integer changeSubjectId);
+    /**
+     * 获取班级学生
+     *
+     * @param musicGroupId
+     * @param classGroupId
+     * @return
+     */
+    List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
+
+
+    /**
+     * 更新报名订单
+     *
+     * @param studentPaymentOrder
+     * @return
+     */
+    StudentPaymentOrder updateApplyOrder(StudentPaymentOrder studentPaymentOrder) throws Exception;
+
+    /**
+     * 获取乐团科目的学生
+     *
+     * @param musicGroupId    乐团id
+     * @param actualSubjectId 科目id
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupNoClassGroupStudent(String musicGroupId, Integer actualSubjectId);
+
+    /**
+     * 根据id list 查询报名学生
+     *
+     * @param idList
+     * @return
+     */
+    List<StudentRegistration> findStudentListByIdList(List<Long> idList);
+
+    /**
+     * 批量插入
+     *
+     * @param studentRegistrationList
+     * @return
+     */
+    int batchInsert(List<StudentRegistration> studentRegistrationList);
+
+
+    /**
+     * 根据userId 和班级id查询学生
+     *
+     * @param userId
+     * @param classGroupId
+     * @return
+     */
+    StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId);
+
+
+    /**
+     * 查询乐团声部下的学生
+     *
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupStudent(String musicGroupId, Integer actualSubjectId);
+
+    /**
+     * 查询乐团userIdList的学生
+     *
+     * @param musicGroupId
+     * @param userIdList
+     * @return
+     */
+    List<StudentRegistration> findStudentListByUserIdList(String musicGroupId, List<Integer> userIdList);
+
+    /**
+     * 开启缴费
+     *
+     * @param ids
+     * @return
+     */
+    int openPayment(String ids) throws IOException;
+
+    /**
+     * 根据乐团编号获取已缴费学员列表
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
+
+    /**
+     * 根据家长的手机号列表,获取用户编号
+     *
+     * @param parentPhones
+     * @return
+     */
+    List<Map<Integer, String>> findParentId(String parentPhones);
+
+    /**
+     * 更新用户注册信息
+     *
+     * @param studentRegistration
+     * @return
+     */
+    StudentRegistration updateStudent(StudentRegistration studentRegistration);
+
+    /**
+     * 获取学员基本信息
+     *
+     * @param mobile
+     * @return
+     */
+    StudentRegistration queryUserByPhone(String mobile);
+
+    /**
+     * 获取没有某种班级类型的学生
+     *
+     * @param musicGroupId
+     * @param type
+     * @param subjectId
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupStuNoClassType(String musicGroupId, ClassGroupTypeEnum type, Integer subjectId);
+
+    /**
+     * 获取乐团下所有学员身上的声部列表
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId);
+
+    /**
+     * 获取学员详情页,包含所在乐团信息
+     *
+     * @param studentId
+     * @return
+     */
+    StudentMusicDetailDto getStudentDetail(Integer studentId);
+
+    /**
+     * 获取学生
+     *
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentPaymentOrderDetail> getStudentApplyDetail(Integer studentId, String musicGroupId);
+
+    /**
+     * 更换学生声部
+     *
+     * @param musicGroup
+     * @param originalSubjectId
+     * @param changeSubjectId
+     * @return
+     */
+    StudentRegistration changeStudentSubject(Integer studentId, String musicGroupId, Integer originalSubjectId, Integer changeSubjectId);
 }

+ 12 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -344,7 +344,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("订单金额异常");
         }
         if (chargeInfo.getMaxNum() != null) {
-            if(chargeInfo.getMaxNum() <= chargeInfo.getPaidNum()){
+            if (chargeInfo.getMaxNum() <= chargeInfo.getPaidNum()) {
                 throw new Exception("活动人数暂时已满,请稍后再试");
             }
             chargeInfo.setPaidNum(chargeInfo.getPaidNum() + 1);
@@ -593,7 +593,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         String channelType = "";
 
-        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, courseForms, remitFee, courseRemitFee);
+        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, courseForms, remitFee, courseRemitFee, newCourses);
         studentPaymentOrder.setVersion(0);
 
         Date date = new Date();
@@ -788,6 +788,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
+        //新课程形态
+        List<MusicGroupPaymentCalenderCourseSettings> newCourses = new ArrayList<>();
+        if (registerPayDto.getNewCourse() != null && registerPayDto.getNewCourse().size() > 0) {
+            newCourses = musicGroupPaymentCalenderCourseSettingsDao.getCalenderCourseSettings(registerPayDto.getNewCourse());
+            for (MusicGroupPaymentCalenderCourseSettings calenderCourseSetting : newCourses) {
+                orderAmount = orderAmount.add(calenderCourseSetting.getCourseCurrentPrice());
+            }
+        }
+
         if (amount.compareTo(orderAmount) != 0) {
             throw new BizException("商品价格不符");
         }
@@ -800,7 +809,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         String channelType = "";
 
-        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId(), ApplyOrder, courseForms, remitFee, courseRemitFee);
+        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId(), ApplyOrder, courseForms, remitFee, courseRemitFee, newCourses);
         studentPaymentOrder.setVersion(0);
         Date date = new Date();
 

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

@@ -300,8 +300,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     }
 
     @Override
-    @Transactional
-    public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee) throws Exception {
+    @Transactional(rollbackFor = Exception.class)
+    public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses) throws Exception {
         Date date = new Date();
         StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
         studentPaymentOrder.setUserId(studentRegistration.getUserId());
@@ -366,7 +366,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         //单独教谱
         if (otherGoodsList != null && otherGoodsList.size() > 0) {
-
             for (Goods goods : otherGoodsList) {
                 StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
                 studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
@@ -381,20 +380,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         //可选课程
         if (courseForms != null && courseForms.size() > 0) {
             for (CourseFormDto courseForm : courseForms) {
-                OrderDetailTypeEnum courType = OrderDetailTypeEnum.MUSIC_COURSE;
-                if (courseForm.getType().equals("soundInfo")) {
-                    courType = OrderDetailTypeEnum.MUSIC_COURSE;
-                } else if (courseForm.getType().equals("allInfo")) {
-                    courType = OrderDetailTypeEnum.MIX_COURSE;
-                } else if (courseForm.getType().equals("baseInfo")) {
-                    courType = OrderDetailTypeEnum.HIGH_ONLINE_COURSE;
-                } else if (courseForm.getType().equals("holidayInfo")) {
-                    courType = OrderDetailTypeEnum.HOLIDAY_COURSE;
-                } else if (courseForm.getType().equals("networkInfo")) {
-                    courType = OrderDetailTypeEnum.NETWORK_COURSE;
-                }
                 StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
-                studentPaymentOrderDetailCourse.setType(courType);
+                studentPaymentOrderDetailCourse.setType(OrderDetailTypeEnum.HIGH_ONLINE_COURSE);
                 studentPaymentOrderDetailCourse.setPrice(courseForm.getPrice());
                 studentPaymentOrderDetailCourse.setCreateTime(date);
                 studentPaymentOrderDetailCourse.setUpdateTime(date);
@@ -402,7 +389,18 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
             }
         }
-
+        //新的课程形态
+        if (newCourses != null && newCourses.size() > 0) {
+            for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
+                StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
+                studentPaymentOrderDetailCourse.setType(OrderDetailTypeEnum.valueOf(newCourse.getCourseType().getCode()));
+                studentPaymentOrderDetailCourse.setPrice(newCourse.getCourseCurrentPrice());
+                studentPaymentOrderDetailCourse.setCreateTime(date);
+                studentPaymentOrderDetailCourse.setUpdateTime(date);
+                studentPaymentOrderDetailCourse.setPaymentOrderId(studentPaymentOrder.getId());
+                studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
+            }
+        }
         studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
 
         //增加缴费学生数
@@ -432,8 +430,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     }
 
     @Override
-    @Transactional
-    public StudentPaymentOrder reAddOrder(Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, String musicGroupId, StudentPaymentOrder oldOrder, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee) {
+    @Transactional(rollbackFor = Exception.class)
+    public StudentPaymentOrder reAddOrder(Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, String musicGroupId, StudentPaymentOrder oldOrder, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee,List<MusicGroupPaymentCalenderCourseSettings> newCourses) {
         //关闭老订单
         oldOrder.setStatus(DealStatusEnum.CLOSE);
         studentPaymentOrderService.update(oldOrder);
@@ -519,20 +517,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         //可选课程
         if (courseForms != null && courseForms.size() > 0) {
             for (CourseFormDto courseForm : courseForms) {
-                OrderDetailTypeEnum courType = OrderDetailTypeEnum.MUSIC_COURSE;
-                if (courseForm.getType().equals("soundInfo")) {
-                    courType = OrderDetailTypeEnum.MUSIC_COURSE;
-                } else if (courseForm.getType().equals("allInfo")) {
-                    courType = OrderDetailTypeEnum.MIX_COURSE;
-                } else if (courseForm.getType().equals("baseInfo")) {
-                    courType = OrderDetailTypeEnum.HIGH_ONLINE_COURSE;
-                } else if (courseForm.getType().equals("holidayInfo")) {
-                    courType = OrderDetailTypeEnum.HOLIDAY_COURSE;
-                } else if (courseForm.getType().equals("networkInfo")) {
-                    courType = OrderDetailTypeEnum.NETWORK_COURSE;
-                }
                 StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
-                studentPaymentOrderDetailCourse.setType(courType);
+                studentPaymentOrderDetailCourse.setType(OrderDetailTypeEnum.HIGH_ONLINE_COURSE);
                 studentPaymentOrderDetailCourse.setPrice(courseForm.getPrice());
                 studentPaymentOrderDetailCourse.setCreateTime(date);
                 studentPaymentOrderDetailCourse.setUpdateTime(date);
@@ -540,6 +526,18 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
             }
         }
+        //新的课程形态
+        if (newCourses != null && newCourses.size() > 0) {
+            for (MusicGroupPaymentCalenderCourseSettings newCourse : newCourses) {
+                StudentPaymentOrderDetail studentPaymentOrderDetailCourse = new StudentPaymentOrderDetail();
+                studentPaymentOrderDetailCourse.setType(OrderDetailTypeEnum.valueOf(newCourse.getCourseType().getCode()));
+                studentPaymentOrderDetailCourse.setPrice(newCourse.getCourseCurrentPrice());
+                studentPaymentOrderDetailCourse.setCreateTime(date);
+                studentPaymentOrderDetailCourse.setUpdateTime(date);
+                studentPaymentOrderDetailCourse.setPaymentOrderId(studentPaymentOrder.getId());
+                studentPaymentOrderDetailList.add(studentPaymentOrderDetailCourse);
+            }
+        }
         studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
 
         return studentPaymentOrder;
@@ -1165,7 +1163,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public StudentRegistration changeStudentSubject(Integer studentId, String musicGroupId, Integer originalSubjectId, Integer changeSubjectId) {
         studentDao.lockUser(studentId);
         //1、更换学生的声部
-        StudentRegistration studentRegistration = studentRegistrationDao.getStudentRegister(musicGroupId,studentId);
+        StudentRegistration studentRegistration = studentRegistrationDao.getStudentRegister(musicGroupId, studentId);
         studentRegistration.setActualSubjectId(changeSubjectId);
         studentRegistrationDao.update(studentRegistration);