Bladeren bron

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

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
#	mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
#	mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
zouxuan 4 jaren geleden
bovenliggende
commit
f6aede11ae
20 gewijzigde bestanden met toevoegingen van 983 en 888 verwijderingen
  1. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  2. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  3. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  4. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java
  5. 45 36
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  6. 5 5
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  7. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java
  8. 274 251
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  9. 453 515
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  10. 48 26
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  11. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java
  12. 15 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  13. 12 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  14. 31 33
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  15. 4 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  16. 12 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  17. 9 5
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  18. 6 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  19. 6 6
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  20. 7 0
      mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -325,4 +325,13 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return
      */
     List<RongyunBasicUserDto> queryNoJoinStu(@Param("roomId") String roomId, @Param("courseScheduleId") String courseScheduleId);
+
+    /**
+     * @describe 根据批次号获取学员课程缴费记录
+     * @author Joburgess
+     * @date 2020.10.30
+     * @param batchNo:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment>
+     */
+    List<CourseScheduleStudentPayment> findByBatchNo(@Param("batchNo") String batchNo);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -135,6 +135,16 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     MusicGroupPaymentCalender getUnusedFirstPaymentCalenderWithCalenders(@Param("calenderIds") List<Long> calenderIds);
 
     /**
+     * @describe 根据批次号获取缴费日历
+     * @author Joburgess
+     * @date 2020.10.30
+     * @param batchNo: 批次号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender>
+     */
+    List<MusicGroupPaymentCalender> findByBatchNo(@Param("batchNo") String batchNo);
+
+
+    /**
      * @describe 乐团缴费日历审核列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
@@ -155,4 +165,5 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @return int
      */
     List<MusicGroupPaymentCalenderAuditDto> queryAuditList(Map<String, Object> params);
+
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -138,6 +138,15 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 */
 	List<MusicGroupPaymentCalenderDetail> getCalenderDetailWithCalender(@Param("calenderId") Long calenderId);
 
+	/**
+	 * @describe 获取指定缴费日历的详情
+	 * @author Joburgess
+	 * @date 2020.10.30
+	 * @param calenderIds:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail>
+	 */
+	List<MusicGroupPaymentCalenderDetail> getWithCalenderIds(@Param("calenderIds") List<Long> calenderIds);
+
     /**
      * @describe 获取乐团下未使用的缴费日历记录
      * @author Joburgess

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java

@@ -1,9 +1,14 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import io.swagger.annotations.ApiModelProperty;
 
 public class CourseTimeDto {
 
+
+    @ApiModelProperty(value = "课程类型", required = true)
+    private CourseSchedule.CourseScheduleType courseType;
+
     @ApiModelProperty(value = "排课星期几")
     private Integer dayOfWeek;
 
@@ -13,6 +18,14 @@ public class CourseTimeDto {
     @ApiModelProperty(value = "上课结束时间")
     private String endClassTime;
 
+    public CourseSchedule.CourseScheduleType getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
+        this.courseType = courseType;
+    }
+
     public Integer getDayOfWeek() {
         return dayOfWeek;
     }

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

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -265,21 +265,21 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param classGroup4MixDto
      * @return
      */
-    ClassGroup classGroupAdjust(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupAdjust(List<ClassGroup4MixDto> classGroup4MixDto);
 
     /**
      * 班级调整(修改班级)
-     * @param classGroup4MixDto
+     * @param classGroup4MixDtos
      * @return
      */
-    ClassGroup classGroupUpdate(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupUpdate(List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception;
 
     /**
      * 班级调整(增加临时班级)
-     * @param classGroup4MixDto
+     * @param classGroup4MixDtos
      * @return
      */
-    ClassGroup classGroupSnap(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupSnap(List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception;
 
 
     /**

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -118,4 +118,6 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @return java.util.List<com.ym.mec.biz.dal.dto.GoodsSellDto>
      */
     List<GoodsSellDto> queryGoodsSellDtos(String goodsId);
+
+    void getGoodsTest(Integer goodsId);
 }

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

File diff suppressed because it is too large
+ 453 - 515
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java


+ 48 - 26
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -12,8 +12,10 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.yqpay.DateUtils;
 import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
@@ -276,10 +278,11 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void createForMusicGroup(String musicGroupId, List<CourseSchedule> courseSchedules, List<Integer> studentIds) {
 		MusicGroupPaymentCalender musicGroupUnusedFirstPaymentCalender = musicGroupPaymentCalenderDao.getMusicGroupUnusedFirstPaymentCalender(musicGroupId, studentIds);
 		if(Objects.isNull(musicGroupUnusedFirstPaymentCalender)){
-			throw new BizException("当前乐团无未使用缴费记录");
+			throw new BizException("当前乐团暂无新缴费设置");
 		}
 
 		List<MusicGroupPaymentCalenderDetail> unusedPaymentCalenderDetail = musicGroupPaymentCalenderDetailDao.getCalenderDetailWithCalender(musicGroupUnusedFirstPaymentCalender.getId());
@@ -302,6 +305,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 
 		Map<CourseSchedule.CourseScheduleType, MusicGroupPaymentCalenderCourseSettings> courseTypeCourseSettingMap = calenderCourseSettings.stream().collect(Collectors.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, cs -> cs, (c1, c2) -> c1));
 
+		List<CourseScheduleStudentPayment> baseCourseScheduleStudentPayments = new ArrayList<>();
+
 		Map<CourseSchedule.CourseScheduleType, List<CourseSchedule>> typeCourseMap = courseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getType));
 		for (Map.Entry<CourseSchedule.CourseScheduleType, List<CourseSchedule>> typeCoursesEntry : typeCourseMap.entrySet()) {
 			MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings = courseTypeCourseSettingMap.get(typeCoursesEntry.getKey());
@@ -345,8 +350,10 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			}
 			typeCourseStudentPayments.get(0).setOriginalPrice(typeCourseStudentPayments.get(0).getOriginalPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().subtract(typeCourseTotalOriginalPrice)));
 			typeCourseStudentPayments.get(0).setExpectPrice(typeCourseStudentPayments.get(0).getExpectPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().subtract(typeCourseTotalCurrentPrice)));
+			baseCourseScheduleStudentPayments.addAll(typeCourseStudentPayments);
 		}
 
+		List<MusicGroupPaymentCalenderDetail> needUpdateCalenderDetails = new ArrayList<>();
 		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
 
 		for (Integer studentId : studentIds) {
@@ -358,42 +365,57 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			if(!musicGroupPaymentCalenderDetail.getMusicGroupPaymentCalenderId().equals(musicGroupUnusedFirstPaymentCalender.getId())){
 				throw new BizException("缴费信息异常");
 			}
+			musicGroupPaymentCalenderDetail.setUseInCourse(1);
+			needUpdateCalenderDetails.add(musicGroupPaymentCalenderDetail);
 
-			List<StudentPaymentOrderDetail> studentPaymentOrderDetails = orderIdOrderDetailMap.get(musicGroupPaymentCalenderDetail.getPaymentOrderId());
-			for (CourseSchedule courseSchedule : courseSchedules) {
-				MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings = courseTypeCourseSettingMap.get(courseSchedule.getType());
-
-				//课程每分钟原价
-				BigDecimal unitMinuteOriginalPrice = musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().divide(new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-				//课程每分钟现价
-				BigDecimal unitMinuteCurrentPrice = musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().divide(new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-
-				//课程时长
-				int courseDuration = DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime());
-
-				//课程原价
-				BigDecimal courseOriginalPrice = unitMinuteOriginalPrice.multiply(new BigDecimal(courseDuration)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
-				//课程现价
-				BigDecimal courseCurrentPrice = unitMinuteCurrentPrice.multiply(new BigDecimal(courseDuration)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
-
+			for (CourseScheduleStudentPayment baseCourseScheduleStudentPayment : baseCourseScheduleStudentPayments) {
 				CourseScheduleStudentPayment cssp = new CourseScheduleStudentPayment();
-				cssp.setGroupType(courseSchedule.getGroupType());
-				cssp.setMusicGroupId(courseSchedule.getMusicGroupId());
-				cssp.setCourseScheduleId(courseSchedule.getId());
-				cssp.setClassGroupId(courseSchedule.getClassGroupId());
+				BeanUtils.copyProperties(baseCourseScheduleStudentPayment, cssp);
 				cssp.setUserId(studentId);
-				cssp.setBatchNo(musicGroupUnusedFirstPaymentCalender.getBatchNo());
-				cssp.setOriginalPrice(courseOriginalPrice);
-				cssp.setExpectPrice(courseCurrentPrice);
-				cssp.setActualPrice(BigDecimal.ZERO);
 				courseScheduleStudentPayments.add(cssp);
 			}
 		}
 		courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+		musicGroupPaymentCalenderDetailDao.batchUpdate(needUpdateCalenderDetails);
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void updateForMusicGroupWithPaymentCalender(String batchNo) {
+		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByBatchNo(batchNo);
+		if(CollectionUtils.isEmpty(courseScheduleStudentPayments)){
+			return;
+		}
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		if(CollectionUtils.isEmpty(musicGroupPaymentCalenders)){
+			return;
+		}
+		List<Long> calenderIds = musicGroupPaymentCalenders.stream().map(MusicGroupPaymentCalender::getId).collect(Collectors.toList());
+		List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.getWithCalenderIds(calenderIds);
+
+		Map<Integer, List<CourseScheduleStudentPayment>> studentStudentPaymentMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getUserId));
+		Map<Integer, List<MusicGroupPaymentCalenderDetail>> studentCalenderDetailMap = calenderDetails.stream().collect(Collectors.groupingBy(MusicGroupPaymentCalenderDetail::getUserId));
+
+		List<CourseScheduleStudentPayment> updateStudentPayments = new ArrayList<>();
+
+		for (Map.Entry<Integer, List<CourseScheduleStudentPayment>> studentStudentPaymentMapEntry : studentStudentPaymentMap.entrySet()) {
+			List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetails = studentCalenderDetailMap.get(studentStudentPaymentMapEntry.getKey());
+
+			//学员总缴费金额
+			BigDecimal totalActualAmount = musicGroupPaymentCalenderDetails.stream().map(MusicGroupPaymentCalenderDetail::getActualAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+			for (CourseScheduleStudentPayment courseScheduleStudentPayment : studentStudentPaymentMapEntry.getValue()) {
+				if(totalActualAmount.compareTo(courseScheduleStudentPayment.getExpectPrice())>=0){
+					courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
+					totalActualAmount=totalActualAmount.subtract(courseScheduleStudentPayment.getExpectPrice());
+				}else{
+					courseScheduleStudentPayment.setActualPrice(totalActualAmount);
+					totalActualAmount=BigDecimal.ZERO;
+				}
+				updateStudentPayments.add(courseScheduleStudentPayment);
+			}
+		}
 
+		courseScheduleStudentPaymentDao.batchUpdate(updateStudentPayments);
 	}
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -447,6 +447,18 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 
 	@Override
 	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void getGoodsTest(Integer goodsId) {
+		List<Goods> tempGoodsList = goodsDao.lockGoods(Arrays.asList(goodsId));
+		Goods goods = goodsDao.get(goodsId);
+		if(!tempGoodsList.get(0).getSellCount().equals(goods.getSellCount())){
+			System.out.println("-----------------------------------" + goods);
+		}
+		goods.setSellCount(new AtomicInteger(goods.getSellCount()).incrementAndGet());
+		goodsDao.update(goods);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public List<SellOrder> subtractStock(List<Integer> goodsIds, AccountType accountType) {
 		if(CollectionUtils.isEmpty(goodsIds)){
 			return Collections.emptyList();

+ 15 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -41,6 +41,7 @@ import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
@@ -63,6 +64,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
 	
 	@Autowired
+	private IdGeneratorService idGeneratorService;
+	
+	@Autowired
 	private MusicGroupDao musicGroupDao;
 	@Autowired
 	private SysConfigDao sysConfigDao;
@@ -169,7 +173,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 			}
 		}
-		
+		//设置批次号
+		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId()+"");
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 		
 		for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
@@ -474,13 +479,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 						mgpcd.setUpdateTime(date);
 						updateMusicGroupPaymentCalenderDetailList.add(mgpcd);
 
-						// 更新fee表,且加1
-						musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
-						if (musicGroupStudentFee != null) {
-							musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-							musicGroupStudentFee.setUpdateTime(date);
-							musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getContinuousAbsenteeismTimes() + 1);
-							updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
+						if (mgpc.getIsGiveMusicNetwork()) {
+							// 更新fee表,且加1
+							musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
+							if (musicGroupStudentFee != null) {
+								musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+								musicGroupStudentFee.setUpdateTime(date);
+								musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getContinuousAbsenteeismTimes() + 1);
+								updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
+							}
 						}
 					}
 				}

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

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -521,4 +521,8 @@
 			AND cssp.music_group_id_ = #{groupId}
 			AND CONCAT( cs.class_date_, ' ', cs.start_class_time_ ) > NOW( )
 	</select>
+
+    <select id="findByBatchNo" resultMap="CourseScheduleStudentPayment">
+		SELECT * FROM course_schedule_student_payment WHERE batch_no_=#{batchNo}
+	</select>
 </mapper>

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -330,6 +330,18 @@
 			mgpc.music_group_id_ = #{musicGroupId}
 			AND NOT EXISTS ( SELECT id_ FROM course_schedule_student_payment WHERE batch_no_ = mgpcd.music_group_payment_calender_id_ AND music_group_id_ = #{musicGroupId} )
 	</select>
+
+    <select id="getWithCalenderIds" resultType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail">
+		SELECT
+			mgpcd.*
+		FROM
+			music_group_payment_calender_detail mgpcd
+		WHERE
+			mgpc.music_group_payment_calender_id_ IN
+			<foreach collection="calenderIds" item="calenderId" open="(" close=")" separator=",">
+				#{calenderId}
+			</foreach>
+	</select>
 	<resultMap id="SimpleUserDtoMap" type="com.ym.mec.biz.dal.dto.SimpleUserDto">
 		<result property="userName" column="username_"/>
 		<result property="userId" column="id_"/>

+ 9 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -186,10 +186,10 @@
         	<if test="musicGroupId != null">
         		and mgpc.music_group_id_ = #{musicGroupId}
         	</if>
-        	<if test="musicGroupId != null">
+        	<if test="payUserType != null">
         		and mgpc.pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
-        	<if test="musicGroupId != null">
+        	<if test="status != null">
         		and mgpc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         </where>
@@ -204,10 +204,10 @@
         	<if test="musicGroupId != null">
         		and mgpc.music_group_id_ = #{musicGroupId}
         	</if>
-        	<if test="musicGroupId != null">
+        	<if test="payUserType != null">
         		and mgpc.pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
-        	<if test="musicGroupId != null">
+        	<if test="status != null">
         		and mgpc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         </where>
@@ -321,7 +321,7 @@
             AND mgpc.music_group_id_ = #{musicGroupId}
             AND mgpcd.use_in_course_ = 1
             AND mgpcd.user_id_ IN
-            <foreach collection="studentIds" item="studentIds" open="(" close=")" separator=",">
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
                 #{studentId}
             </foreach>
         ORDER BY
@@ -337,6 +337,10 @@
         ORDER BY create_time_ LIMIT 1;
     </select>
 
+	<select id="findByBatchNo" resultMap="MusicGroupPaymentCalender">
+        SELECT * FROM music_group_payment_calender WHERE batch_no_=#{batchNo}
+    </select>
+
     <resultMap id="MusicGroupPaymentCalenderAuditDtoMap" type="com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto">
         <result property="musicGroupId" column="music_group_id_"/>
         <result property="musicGroupName" column="music_group_name_"/>

+ 6 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -72,6 +72,8 @@ public class StudentOrderController extends BaseController {
     private StudentPaymentRouteOrderDao studentPaymentRouteOrderDao;
     @Autowired
     private StudentGoodsSellDao studentGoodsSellDao;
+    @Autowired
+    private LuckDrawCountService luckDrawCountService;
 
 
     @Value("${spring.profiles.active:dev}")
@@ -135,6 +137,10 @@ public class StudentOrderController extends BaseController {
         } else if (orderByOrderNo.getGroupType().equals(GroupType.SPORADIC)) {
             SporadicChargeInfo info = sporadicChargeInfoService.get(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
             orderDetail.put("detail", info);
+            if (orderByOrderNo.getType().equals(OrderTypeEnum.DOUBLE_ELEVEN2020)) {
+                LuckDrawCount luckDrawCount = luckDrawCountService.get(orderByOrderNo.getUserId().longValue());
+                orderDetail.put("drawTimes", luckDrawCount==null? 0: luckDrawCount.getAvailableCount());
+            }
         } else if (orderByOrderNo.getGroupType().equals(GroupType.GOODS_SELL)) {
             orderDetail.put("detail", studentGoodsSellDao.getStudentGoodsSellDto(orderNo));
         }

+ 6 - 6
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -238,24 +238,24 @@ public class ClassGroupController extends BaseController {
     @PostMapping("/revisionAddClassGroup")
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionAddClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "ClassGroup4MixDto", value = "添加班级结构", required = true, dataType = "String")})
-    public HttpResponseResult revisionAddClassGroup(@RequestBody ClassGroup4MixDto classGroup4MixDto) throws Exception {
-        return succeed(classGroupService.classGroupAdjust(classGroup4MixDto));
+    public HttpResponseResult revisionAddClassGroup(@RequestBody List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception {
+        return succeed(classGroupService.classGroupAdjust(classGroup4MixDtos));
     }
 
     @ApiOperation(value = "调整班级(临时调整)")
     @PostMapping("/revisionClassGroup")
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "ClassGroup4MixDto", value = "添加班级结构", required = true, dataType = "String")})
-    public HttpResponseResult revisionClassGroup(@RequestBody ClassGroup4MixDto classGroup4MixDto) throws Exception {
-        return succeed(classGroupService.classGroupSnap(classGroup4MixDto));
+    public HttpResponseResult revisionClassGroup(@RequestBody List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception {
+        return succeed(classGroupService.classGroupSnap(classGroup4MixDtos));
     }
 
     @ApiOperation(value = "调整班级(调整老师,重排课)")
     @PostMapping("/classGroupUpdate")
     @PreAuthorize("@pcs.hasPermissions('classGroup/classGroupUpdate')")
     @ApiImplicitParams({@ApiImplicitParam(name = "ClassGroup4MixDto", value = "添加班级结构", required = true, dataType = "String")})
-    public HttpResponseResult classGroupUpdate(@RequestBody ClassGroup4MixDto classGroup4MixDto) throws Exception {
-        return succeed(classGroupService.classGroupUpdate(classGroup4MixDto));
+    public HttpResponseResult classGroupUpdate(@RequestBody List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception {
+        return succeed(classGroupService.classGroupUpdate(classGroup4MixDtos));
     }
 
     @ApiOperation(value = "小班报名详情")

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.GoodsCategory;
 import com.ym.mec.biz.dal.entity.GoodsProcurement;
 import com.ym.mec.biz.service.GoodsCategoryService;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -118,4 +119,10 @@ public class GoodsController extends BaseController {
     public Object findGoodsBySubId(Integer subjectId,String type){
         return succeed(goodsService.findGoodsBySubId(subjectId,type));
     }
+
+    @GetMapping("getGoodsTest")
+    public HttpResponseResult getGoodsTest(Integer goodsId){
+        goodsService.getGoodsTest(goodsId);
+        return succeed();
+    }
 }

Some files were not shown because too many files changed in this diff