瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
82deaa7f89
共有 18 個文件被更改,包括 801 次插入609 次删除
  1. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 39 23
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  3. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SubFeeSettingDto.java
  4. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SubjectRegisterDto.java
  5. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectPlan.java
  6. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  7. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  8. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  9. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  10. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  11. 559 539
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  12. 28 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  13. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentWithdrawServiceImpl.java
  14. 7 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  15. 19 1
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  16. 34 21
      mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java
  17. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  18. 10 13
      mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

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

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.entity.ImUserModel;
+
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
@@ -329,4 +330,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      * @return
      */
      */
     List<ConditionDto> queryStudentClassGroup(@Param("musicGroupId") String musicGroupId, @Param("teacherId") Integer teacherId);
     List<ConditionDto> queryStudentClassGroup(@Param("musicGroupId") String musicGroupId, @Param("teacherId") Integer teacherId);
+    
+    /**
+     * 批量新增班级上的课次数
+     * @param classGroupList
+     * @return
+     */
+    int batchIncreaseClassTimes(List<Integer> classGroupList);
 }
 }

+ 39 - 23
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -31,22 +31,22 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      */
      */
     int queryStudentDetailCount(Map<String, Object> params);
     int queryStudentDetailCount(Map<String, Object> params);
 
 
-	/**
-	 * 根据乐团编号和声部获取缴费学员人数
-	 *
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<Map<Integer, Long>> countPayNum(@Param("musicGroupId") String musicGroupId);
-
-	/**
-	 * 学生报名缴费金额详情
-	 *
-	 * @param studentId
-	 * @param musicGroupId
-	 * @return
-	 */
-	StudentFeeDetailDto queryFeeDetail(@Param("studentId") Integer studentId, @Param("musicGroupId") String musicGroupId);
+    /**
+     * 根据乐团编号和声部获取缴费学员人数
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<Map<Integer, Long>> countPayNum(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 学生报名缴费金额详情
+     *
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    StudentFeeDetailDto queryFeeDetail(@Param("studentId") Integer studentId, @Param("musicGroupId") String musicGroupId);
 
 
     /**
     /**
      * 获取乐团声部未分配的班级的学生
      * 获取乐团声部未分配的班级的学生
@@ -126,11 +126,27 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      */
      */
     List<StudentRegistration> findMusicGroupStudent(@Param("musicGroupId") String musicGroupId, @Param("actualSubjectId") Integer actualSubjectId);
     List<StudentRegistration> findMusicGroupStudent(@Param("musicGroupId") String musicGroupId, @Param("actualSubjectId") Integer actualSubjectId);
 
 
-	/**
-	 * 批量调剂学生专业
-	 * @param userIds
-	 * @param subId
-	 * @return
-	 */
-	int batchUpdateSubject(@Param("userIds")String userIds, @Param("subId") Integer subId,@Param("musicGroupId") String musicGroupId);
+    /**
+     * 批量调剂学生专业
+     *
+     * @param userIds
+     * @param subId
+     * @return
+     */
+    int batchUpdateSubject(@Param("userIds") String userIds, @Param("subId") Integer subId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 根据id list 查询报名学生
+     *
+     * @param idList
+     * @return
+     */
+    List<StudentRegistration> findStudentListByIdList(@Param("idList") List<Long> idList);
+
+    /**
+     * 批量插入
+     * @param studentRegistrationList
+     * @return
+     */
+    int batchInsert(@Param("studentRegistrationList") List<StudentRegistration> studentRegistrationList);
 }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SubFeeSettingDto.java

@@ -22,6 +22,9 @@ public class SubFeeSettingDto {
     @ApiModelProperty(value = "学员的付费方式月份列表",required = false)
     @ApiModelProperty(value = "学员的付费方式月份列表",required = false)
     private List<Integer> months;
     private List<Integer> months;
 
 
+    @ApiModelProperty(value = "科目关联注册学员",required = false)
+    private List<SubjectRegisterDto> subjectRegisters;
+
     public MusicGroup getMusicGroup() {
     public MusicGroup getMusicGroup() {
         return musicGroup;
         return musicGroup;
     }
     }
@@ -61,4 +64,12 @@ public class SubFeeSettingDto {
     public void setMonths(List<Integer> months) {
     public void setMonths(List<Integer> months) {
         this.months = months;
         this.months = months;
     }
     }
+
+    public List<SubjectRegisterDto> getSubjectRegisters() {
+        return subjectRegisters;
+    }
+
+    public void setSubjectRegisters(List<SubjectRegisterDto> subjectRegisters) {
+        this.subjectRegisters = subjectRegisters;
+    }
 }
 }

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SubjectRegisterDto.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class SubjectRegisterDto {
+
+    @ApiModelProperty(value = "科目编号",required = true)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "注册ids",required = true)
+    private List<Long> registerIdList;
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public List<Long> getRegisterIdList() {
+        return registerIdList;
+    }
+
+    public void setRegisterIdList(List<Long> registerIdList) {
+        this.registerIdList = registerIdList;
+    }
+}

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectPlan.java

@@ -55,7 +55,6 @@ public class MusicGroupSubjectPlan {
 	/** 保证金(只有租赁才有) */
 	/** 保证金(只有租赁才有) */
 	@ApiModelProperty(value = "保证金(只有租赁才有)",required = false)
 	@ApiModelProperty(value = "保证金(只有租赁才有)",required = false)
 	private BigDecimal depositFee = new BigDecimal(0);
 	private BigDecimal depositFee = new BigDecimal(0);
-	
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
 	
 	

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -48,6 +48,9 @@ public class StudentRegistration {
     @ApiModelProperty(value = "实际科目", required = false)
     @ApiModelProperty(value = "实际科目", required = false)
     private Integer actualSubjectId;
     private Integer actualSubjectId;
 
 
+    @ApiModelProperty(value = "实际科目名称", required = false)
+    private String subjectName;
+
     @ApiModelProperty(value = "是否允许调剂", required = false)
     @ApiModelProperty(value = "是否允许调剂", required = false)
     private YesOrNoEnum isAllowAdjust;
     private YesOrNoEnum isAllowAdjust;
 
 
@@ -281,6 +284,14 @@ public class StudentRegistration {
         this.organId = organId;
         this.organId = organId;
     }
     }
 
 
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

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

@@ -260,4 +260,11 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return
      * @return
      */
      */
     PageInfo<MusicGroupCourseScheduleDto> queryMusicGroupCourseSchedule(queryMusicGroupCourseScheduleQueryInfo queryInfo);
     PageInfo<MusicGroupCourseScheduleDto> queryMusicGroupCourseSchedule(queryMusicGroupCourseScheduleQueryInfo queryInfo);
+    
+    /**
+     * 批量新增班级上的课次数
+     * @param classGroupList
+     * @return
+     */
+    boolean batchIncreaseClassTimes(List<Integer> classGroupList);
 }
 }

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -158,4 +158,18 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	 */
 	 */
 	List<StudentRegistration> getMusicGroupStu(String musicGroupId, Integer actualSubjectId);
 	List<StudentRegistration> getMusicGroupStu(String musicGroupId, Integer actualSubjectId);
 
 
+	/**
+	 * 根据id list 查询报名学生
+	 * @param idList
+	 * @return
+	 */
+	List<StudentRegistration> findStudentListByIdList(List<Long> idList);
+
+	/**
+	 * 批量插入
+	 * @param studentRegistrationList
+	 * @return
+	 */
+	int batchInsert(List<StudentRegistration> studentRegistrationList);
+
 }
 }

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

@@ -20,6 +20,7 @@ import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -915,4 +916,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         pageInfo.setRows(dataList);
         pageInfo.setRows(dataList);
         return pageInfo;
         return pageInfo;
     }
     }
+
+	@Override
+	public boolean batchIncreaseClassTimes(List<Integer> classGroupList) {
+		classGroupDao.batchIncreaseClassTimes(classGroupList);
+		return true;
+	}
 }
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
+import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysConfigService;
@@ -21,6 +22,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,6 +62,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
 	private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
 	@Autowired
 	@Autowired
 	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+	
+	@Autowired
+	private ClassGroupService classGroupService;
 
 
 	@Override
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
 	public BaseDAO<Long, CourseSchedule> getDAO() {
@@ -548,15 +553,26 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 
 		List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
 		List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
 		Date date = new Date();
 		Date date = new Date();
+		List<Integer> classGroups = new ArrayList<Integer>();
 		for (CourseSchedule courseSchedule : list) {
 		for (CourseSchedule courseSchedule : list) {
 			courseSchedule.setStatus(CourseStatusEnum.OVER);
 			courseSchedule.setStatus(CourseStatusEnum.OVER);
 			courseSchedule.setUpdateTime(date);
 			courseSchedule.setUpdateTime(date);
 			updateList.add(courseSchedule);
 			updateList.add(courseSchedule);
+			
+			if(!classGroups.contains(courseSchedule.getClassGroupId())){
+				classGroups.add(courseSchedule.getClassGroupId());
+			}
 		}
 		}
 
 
 		if (updateList.size() > 0) {
 		if (updateList.size() > 0) {
 			courseScheduleDao.batchUpdate(updateList);
 			courseScheduleDao.batchUpdate(updateList);
 		}
 		}
+		
+		//更新班级课次
+		if(classGroups.size()>0){
+			classGroupService.batchIncreaseClassTimes(classGroups);
+		}
+		
 		return true;
 		return true;
 	}
 	}
 
 

+ 559 - 539
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.MusicCardDto;
 import com.ym.mec.biz.dal.dto.MusicCardDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
+import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.enums.*;
@@ -34,552 +35,571 @@ import java.util.stream.Collectors;
 @Service
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
 
 
-	@Autowired
-	private MusicGroupDao musicGroupDao;
-	@Autowired
-	private ChargeTypeDao chargeTypeDao;
-	@Autowired
-	private TeacherDao teacherDao;
-	@Autowired
-	private IdGeneratorService idGeneratorService;
-	@Autowired
-	private SchoolDao schoolDao;
-	@Autowired
-	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
-	@Autowired
-	private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
-	@Autowired
-	private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
-	@Autowired
-	private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
-	@Autowired
-	private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
-	@Autowired
-	private ImFeignService imFeignService;
-	@Autowired
-	private MusicGroupBuildLogDao musicGroupBuildLogDao;
-
-	@Autowired
-	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
-
-	@Autowired
-	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-
-	@Autowired
-	private StudentPaymentOrderDao studentPaymentOrderDao;
-
-	@Autowired
-	private SysUserCashAccountService sysUserCashAccountService;
-
-	@Autowired
-	private SysUserCashAccountDetailService sysUserCashAccountDetailService;
-
-	@Autowired
-	private MusicGroupQuitDao musicGroupQuitDao;
-
-	@Autowired
-	private StudentRegistrationService studentRegistrationService;
-	
-	@Autowired
-	private CourseScheduleDao courseScheduleDao;
-	
-	@Autowired
-	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-	
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private ChargeTypeDao chargeTypeDao;
+    @Autowired
+    private TeacherDao teacherDao;
+    @Autowired
+    private IdGeneratorService idGeneratorService;
+    @Autowired
+    private SchoolDao schoolDao;
+    @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
+    @Autowired
+    private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
+    @Autowired
+    private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
+    @Autowired
+    private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
+    @Autowired
+    private ImFeignService imFeignService;
+    @Autowired
+    private MusicGroupBuildLogDao musicGroupBuildLogDao;
+
+    @Autowired
+    private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
+
+    @Autowired
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+
+    @Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
+
+    @Autowired
+    private SysUserCashAccountService sysUserCashAccountService;
+
+    @Autowired
+    private SysUserCashAccountDetailService sysUserCashAccountDetailService;
+
+    @Autowired
+    private MusicGroupQuitDao musicGroupQuitDao;
+
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
+
+    @Autowired
+    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+
     @Autowired
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     private StudentPaymentOrderService studentPaymentOrderService;
-    
+
     @Autowired
     @Autowired
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
 
-	@Autowired
-	private PayService payService;
+    @Autowired
+    private PayService payService;
 
 
     @Autowired
     @Autowired
     private SysUserFeignService sysUserFeignService;
     private SysUserFeignService sysUserFeignService;
 
 
-	@Override
-	public BaseDAO<String, MusicGroup> getDAO() {
-		return musicGroupDao;
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public String createGroup(SubFeeSettingDto subFeeSettingDto, Integer userId) {
-		MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
-		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
-		List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
-		String musicGroupId = idGeneratorService.generatorId() + "";
-		musicGroup.setId(musicGroupId);
-		// 保存乐团基本信息
-		musicGroupDao.insert(musicGroup);
-		// 保存乐团付费主体列表
-		//批量新增
-		musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
-		// 保存学员付费周期
-		List<Integer> months = subFeeSettingDto.getMonths();
-		if (months != null && months.size() > 0) {
-			musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
-		}
-		// 保存乐团声部规划
-		if (musicGroupSubjectPlans == null) {
-			musicGroupSubjectPlans = new ArrayList<>();
-		}
-		musicGroupSubjectPlans.forEach(e -> {
-			e.setMusicGroupId(musicGroupId);
-			musicGroupSubjectPlanDao.insert(e);
-		});
-		// 保存乐团声部商品规划
-		if (musicGroupSubjectGoodsGroups == null) {
-			musicGroupSubjectGoodsGroups = new ArrayList<>();
-		}
-		musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups,musicGroupId);
-		// 新增聊天群
-		// ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
-		// 教务老师和运营主管加入群组
-		ImGroupMember[] imGroupMembers = { new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
-				new ImGroupMember(musicGroup.getEducationalTeacherId().toString()) };
-		// 创建群组
-		imFeignService.groupCreate(new ImGroupModel(musicGroupId, imGroupMembers, musicGroup.getName()));
-		// 记录创建日志
-		musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交建团申请", userId, ""));
-		return musicGroupId;
-	}
-
-	@Override
-	public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
-		List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
-		// 获取学员在该乐团续费状态
-		musicCardDtos.forEach(e -> {
-			MusicGroupStudentFee groupStudentFee = musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId());
-			if(groupStudentFee != null){
-				e.setPaymentStatus(musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId()).getPaymentStatus());
-			}
-		});
-		return musicCardDtos;
-	}
-
-	@Override
-	public MusicCardDto queryPersonalMusicGroups(Integer id) {
-		MusicCardDto musicCardDto = musicGroupDao.queryPersonalMusicGroups(id);
-		musicCardDto.setMusicGroupNum(musicGroupDao.countUserMusicGroups(id));
-		musicCardDto.setVipClassNum(musicGroupDao.countCourseByType(id, ClassGroupTypeEnum.VIP));
-		return musicGroupDao.queryPersonalMusicGroups(id);
-	}
-
-	@Override
-	public List<BasicUserDto> findTeachersByStuId(Integer studentId) {
-		return musicGroupDao.findTeachersByStuId(studentId);
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean cancelMusicGroup(String musicGroupId) {
-		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团找不到");
-		}
-
-		if (musicGroup.getStatus() == MusicGroupStatusEnum.APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
-			musicGroup.setStatus(MusicGroupStatusEnum.CANCELED);
-			musicGroup.setUpdateTime(new Date());
-			musicGroupDao.update(musicGroup);
-		} else {
-			throw new BizException("乐团当前状态是{},不能取消", musicGroup.getStatus().getMsg());
-		}
-
-		// 查询是否有中间状态的缴费信息
-		List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.ING);
-
-		if (studentPaymentOrders != null && studentPaymentOrders.size() > 0) {
-			throw new BizException("缴费存在交易中的数据,不能取消乐团");
-		}
-
-		// 查询已缴费信息
-		studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.SUCCESS);
-
-		// 退费
-		for (StudentPaymentOrder order : studentPaymentOrders) {
-			sysUserCashAccountService.updateBalance(order.getUserId(), order.getActualAmount());
-			// 增加交易流水
-			sysUserCashAccountDetailService.addCashAccountDetail(order.getUserId(), order.getActualAmount(), SysUserCashAccountDetailService.MUSIC_GROUP
-					+ musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "取消乐团");
-		}
-
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean pauseMusicGroup(String musicGroupId) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团找不到");
-		}
-
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
-			throw new BizException("乐团当前状态是{},不能暂停", musicGroup.getStatus().getMsg());
-		}
-
-		musicGroup.setStatus(MusicGroupStatusEnum.PAUSE);
-		musicGroup.setUpdateTime(new Date());
-		musicGroupDao.update(musicGroup);
-
-		// 清除下次缴费时间
-		musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, null);
-
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean resumeMusicGroup(String musicGroupId) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团找不到");
-		}
-
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PAUSE) {
-			throw new BizException("乐团当前状态是{},不能恢复", musicGroup.getStatus().getMsg());
-		}
-
-		musicGroup.setStatus(MusicGroupStatusEnum.PROGRESS);
-		musicGroup.setUpdateTime(new Date());
-		musicGroupDao.update(musicGroup);
-
-		// 重新设置下次缴费时间
-		musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
-
-		return true;
-	}
-
-	@Override
-	public boolean extensionPayment(String musicGroupId, Date expireDate) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团找不到");
-		}
-
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
-			throw new BizException("乐团当前状态是{},延长缴费", musicGroup.getStatus().getMsg());
-		}
-
-		Date date = new Date();
-
-		if (date.after(expireDate)) {
-			throw new BizException("日期设置错误");
-		}
-
-		musicGroup.setPaymentExpireDate(expireDate);
-		musicGroup.setUpdateTime(date);
-		musicGroupDao.update(musicGroup);
-
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean applyQuitMusicGroup(String musicGroupId, SysUser sysUser) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团不存在");
-		}
-
-		MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
-		musicGroupQuit.setCreateTime(new Date());
-		musicGroupQuit.setJoinDate(sysUser.getCreateTime());
-		musicGroupQuit.setMusicGroupId(musicGroupId);
-		musicGroupQuit.setUserId(sysUser.getId());
-		musicGroupQuit.setStatus(ApprovalStatus.PROCESSING);
-
-		musicGroupQuitDao.insert(musicGroupQuit);
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean approveQuitMusicGroup(Long id, ApprovalStatus status, String reason) {
-		MusicGroupQuit musicGroupQuit = musicGroupQuitDao.get(id);
-		if (musicGroupQuit != null) {
-
-			Date date = new Date();
-
-			String musicGroupId = musicGroupQuit.getMusicGroupId();
-			Integer userId = musicGroupQuit.getUserId();
-
-			musicGroupQuit.setStatus(status);
-			musicGroupQuit.setReason(reason);
-			musicGroupQuit.setQuitDate(date);
-			musicGroupQuitDao.update(musicGroupQuit);
-
-			if (status == ApprovalStatus.APPROVED) {
-				classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
-
-				// 判断乐器是否是租赁
-				StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
-				if (studentRegistration == null) {
-					throw new BizException("用户注册信息不存在");
-				}
-				// 退团
-				studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
-				studentRegistration.setUpdateTime(date);
-
-				Integer subjectId = studentRegistration.getActualSubjectId();
-				MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
-				if (musicGroupSubjectPlan == null) {
-					throw new BizException("乐团声部费用设置不存在");
-				}
-				if (musicGroupSubjectPlan.getDepositFee().doubleValue() > 0) {
-					// 增加交易流水
-					sysUserCashAccountDetailService.addCashAccountDetail(userId, musicGroupSubjectPlan.getDepositFee(),
-							SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null,
-							DealStatusEnum.SUCCESS, "退出乐团");
-				}
-			}
-		}
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason) {
-
-		SysUser sysUser = sysUserFeignService.queryUserById(userId);
-		if (sysUser == null) {
-			throw new BizException("获取用户信息失败");
-		}
-
-		Date date = new Date();
-
-		MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
-		musicGroupQuit.setCreateTime(date);
-		musicGroupQuit.setJoinDate(sysUser.getCreateTime());
-		musicGroupQuit.setMusicGroupId(musicGroupId);
-		musicGroupQuit.setUserId(sysUser.getId());
-		musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
-		musicGroupQuit.setReason(reason);
-		musicGroupQuit.setQuitDate(date);
-
-		musicGroupQuitDao.insert(musicGroupQuit);
-
-		classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
-
-		// 判断乐器是否是租赁
-		StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
-		if (studentRegistration == null) {
-			throw new BizException("用户注册信息不存在");
-		}
-		// 退团
-		studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
-		studentRegistration.setUpdateTime(date);
-
-		Integer subjectId = studentRegistration.getActualSubjectId();
-		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
-		if (musicGroupSubjectPlan == null) {
-			throw new BizException("乐团声部费用设置不存在");
-		}
-		if (musicGroupSubjectPlan.getDepositFee().doubleValue() > 0) {
-			// 增加交易流水
-			sysUserCashAccountDetailService.addCashAccountDetail(userId, musicGroupSubjectPlan.getDepositFee(), SysUserCashAccountDetailService.MUSIC_GROUP
-					+ musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "退出乐团");
-		}
-
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public Map renew(String musicGroupId, Integer userId) {
-
-		MusicGroup musicGroup = this.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团不存在");
-		}
-
-		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
-
-		if (musicGroupStudentFee == null) {
-			throw new BizException("个人信息不存在");
-		}
-		// 判断当前是否是续费状态
-		if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
-			throw new BizException("已缴费");
-		}
-
-		BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
-		if (amount == null || amount.doubleValue() == 0) {
-			amount = musicGroupStudentFee.getCourseFee();
-		}
-
-		Date date = new Date();
-		StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
-		studentPaymentOrder.setUserId(userId);
-		studentPaymentOrder.setOrderNo(idGeneratorService.generatorId("RENEW") + "");
-		studentPaymentOrder.setType(OrderTypeEnum.RENEW);
-		studentPaymentOrder.setExpectAmount(amount);
-		studentPaymentOrder.setActualAmount(amount);
-		studentPaymentOrder.setStatus(DealStatusEnum.ING);
-		studentPaymentOrder.setPaymentChannel("银联");
-		studentPaymentOrder.setMusicGroupId(musicGroupId);
-		studentPaymentOrderService.insert(studentPaymentOrder);
-
-		ArrayList<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
-		StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
-		studentPaymentOrderDetail.setType(OrderDetailTypeEnum.COURSE);
-		studentPaymentOrderDetail.setPrice(amount);
-		studentPaymentOrderDetail.setCreateTime(date);
-		studentPaymentOrderDetail.setUpdateTime(date);
-		studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
-		studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
-
-		studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
-
-		try {
-			return payService.getPayMap(amount, idGeneratorService.generatorId("payment") + "", "https://pay.dayaedu.com/api/yqpay/notify",
-					"http://dev.dayaedu.com", "测试订单", "测试订单");
-		} catch (Exception e) {
-			throw new BizException("调用支付接口出错", e);
-		}
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) {
-		
-		studentPaymentOrderDao.update(studentPaymentOrder);
-		
-		Integer userId = studentPaymentOrder.getUserId();
-		String musicGroupId = studentPaymentOrder.getMusicGroupId();
-		
-		//更新下次续费时间
-		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
-		
-		if(musicGroupStudentFee == null){
-			throw new BizException("系统数据异常,找不到学员预缴费信息");
-		}
-		
-		Date date = new Date();
-		
-		musicGroupStudentFee.setUpdateTime(date);
-		musicGroupStudentFee.setLatestPaidTime(date);
-		musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-		musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
-		musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
-		
-		musicGroupStudentFeeDao.update(musicGroupStudentFee);
-		
-		return true;
-	}
-
-	@Override
-	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public boolean updateTeacherCoursesSalary(Long courseScheduleId, Integer teacherId, BigDecimal salary, BigDecimal subsidy, String scope) {
-
-		CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
-		if (courseSchedule == null) {
-			throw new BizException("课程信息不存在");
-		}
-
-		if ("all".equals(scope)) {
-			Integer classGrpupId = courseSchedule.getClassGroupId();
-			// 未结算的课酬都修改
-			courseScheduleTeacherSalaryDao.batchUpdateWages(classGrpupId, teacherId, salary, subsidy);
-		} else {
-			CourseScheduleTeacherSalary courseScheduleTeacherSalary = courseScheduleTeacherSalaryDao.queryByCourseScheduleIdAndUserId(courseScheduleId,
-					teacherId);
-			if (courseScheduleTeacherSalary == null) {
-				throw new BizException("课程结算信息不存在");
-			}
-			// 判断当前课程是否结算
-			if (courseScheduleTeacherSalary.getSettlementTime() != null) {
-				throw new BizException("课程已结算");
-			}
-			courseScheduleTeacherSalary.setExpectSalary(salary);
-			courseScheduleTeacherSalary.setSubsidy(subsidy);
-			courseScheduleTeacherSalary.setUpdateTime(new Date());
-			courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
-		}
-		return true;
-	}
-
-	@Override
-	public PageInfo<MusicGroup> queryMusicGroupPage(QueryInfo queryInfo) {
-		PageInfo<MusicGroup> musicGroupPageInfo = queryPage(queryInfo);
-		List<MusicGroup> musicGroupList = musicGroupPageInfo.getRows();
-		// 获取学校编号列表
-		Set<Integer> schoolIds = musicGroupList.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
-		List<Map<Integer, String>> schoolNames = schoolDao.queryNameByIds(schoolIds);
-		// 获取相关学校名称map
-		Map<Integer, String> schoolNameMap = MapUtil.convertMybatisMap(schoolNames);
-
-		// 获取教务老师编号列表
-		Set<Integer> educationalTeacherIds = musicGroupList.stream().map(e -> e.getEducationalTeacherId()).collect(Collectors.toSet());
-		// 获取相关老师的名字
-		List<Map<Integer, String>> educationalTeacherNames = teacherDao.queryNameByIds(educationalTeacherIds);
-		Map<Integer, String> educationalTeacherNameMap = MapUtil.convertMybatisMap(educationalTeacherNames);
-
-		// 获取运营主管编号列表
-		Set<Integer> teamTeacherIds = musicGroupList.stream().map(e -> e.getTeamTeacherId()).collect(Collectors.toSet());
-		List<Map<Integer, String>> teamTeacherNames = teacherDao.queryNameByIds(teamTeacherIds);
-		Map<Integer, String> teamTeacherNameMap = MapUtil.convertMybatisMap(teamTeacherNames);
-
-		// 获取乐团编号列表
-		Set<String> musicGroupIds = musicGroupList.stream().map(e -> e.getId()).collect(Collectors.toSet());
-		// 统计乐团在读人数
-		List<Map<String, Long>> payNums = musicGroupDao.countPayNum(musicGroupIds);
-		Map<String, Long> payNumMap = MapUtil.convertMybatisMap(payNums);
-
-		// 获取收费类型编号列表
-		Set<Integer> chargeTypeIds = musicGroupList.stream().map(e -> e.getChargeTypeId()).collect(Collectors.toSet());
-		List<Map<Integer, String>> chargeTypeNames = chargeTypeDao.queryNameByIds(chargeTypeIds);
-		Map<Integer, String> chargeTypeNameMap = MapUtil.convertMybatisMap(chargeTypeNames);
-
-		musicGroupList.forEach(e -> {
-			e.setSchoolName(schoolNameMap.get(e.getSchoolId()));
-			e.setEducationalTeacherName(educationalTeacherNameMap.get(e.getEducationalTeacherId()));
-			e.setTeamTeacherName(teamTeacherNameMap.get(e.getTeamTeacherId()));
-			e.setPayNum(payNumMap.get(e.getId()) == null ? 0 : payNumMap.get(e.getId()).intValue());
-			e.setChargeTypeName(chargeTypeNameMap.get(e.getChargeTypeId()));
-		});
-		return musicGroupPageInfo;
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void updateBaseInfo(SubFeeSettingDto subFeeSettingDto) {
-		MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
-		String musicGroupId = musicGroup.getId();
-		MusicGroup group = musicGroupDao.get(musicGroupId);
-		if(group != null){
-			musicGroupDao.update(musicGroup);
-			//修改课程里面的教学点
-			if(!group.getSchoolId().equals(musicGroup.getSchoolId())){
-				courseScheduleDao.updateByMusicGroupId(musicGroupId,musicGroup.getSchoolId());
-			}
-			// 删除乐团付费主体列表
-			musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
-			//批量新增
-			musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
-
-			// 修改学员付费周期
-			List<Integer> calender = subFeeSettingDto.getMonths();
-			//删除乐团相关付费周期
-			musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
-			//批量插入
-			musicGroupPaymentCalenderDao.batchAdd(calender,musicGroupId);
-		}
-	}
-
-	@Override
-	public SubFeeSettingDto findMusicGroupBasicInfo(String musicGroupId) {
-		SubFeeSettingDto subFeeSettingDto = new SubFeeSettingDto();
-		//获取乐团信息
-		subFeeSettingDto.setMusicGroup(musicGroupDao.get(musicGroupId));
-		//获取付费主体
-		subFeeSettingDto.setMusicGroupPaymentEntities(musicGroupPaymentEntitiesDao.findByMusicGroupId(musicGroupId));
-		//获取缴费周期
-		List<Integer> paymentMonth = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId).stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
-		subFeeSettingDto.setMonths(paymentMonth);
-		return subFeeSettingDto;
-	}
+    @Override
+    public BaseDAO<String, MusicGroup> getDAO() {
+        return musicGroupDao;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String createGroup(SubFeeSettingDto subFeeSettingDto, Integer userId) {
+        MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
+        List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
+        List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
+        List<SubjectRegisterDto> subjectRegisters = subFeeSettingDto.getSubjectRegisters();
+        String musicGroupId = idGeneratorService.generatorId() + "";
+        musicGroup.setId(musicGroupId);
+        // 保存乐团基本信息
+        musicGroupDao.insert(musicGroup);
+        // 保存乐团付费主体列表
+        //批量新增
+        musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
+        // 保存学员付费周期
+        List<Integer> months = subFeeSettingDto.getMonths();
+        if (months != null && months.size() > 0) {
+            musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
+        }
+        // 保存乐团声部规划
+        if (musicGroupSubjectPlans == null) {
+            musicGroupSubjectPlans = new ArrayList<>();
+        }
+        musicGroupSubjectPlans.forEach(e -> {
+            e.setMusicGroupId(musicGroupId);
+            musicGroupSubjectPlanDao.insert(e);
+        });
+        //乐团科目学生
+        if (subjectRegisters != null) {
+            List<StudentRegistration> studentRegistrationList = new ArrayList<>();
+            subjectRegisters.forEach(e -> {
+                        //原来乐团的注册学生
+                        List<StudentRegistration> musicGroupStudentRegistrationList = studentRegistrationService.findStudentListByIdList(e.getRegisterIdList());
+                        for (StudentRegistration studentRegistration : musicGroupStudentRegistrationList) {
+                            studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.NORMAL);
+                            studentRegistration.setPaymentStatus(YesOrNoEnum.NO);
+                            studentRegistration.setMusicGroupId(musicGroupId);
+                            studentRegistration.setSubjectId(e.getSubjectId());
+                            studentRegistration.setActualSubjectId(e.getSubjectId());
+                        }
+                        studentRegistrationList.addAll(musicGroupStudentRegistrationList);
+                    }
+            );
+            studentRegistrationService.batchInsert(studentRegistrationList);
+        }
+        // 保存乐团声部商品规划
+        if (musicGroupSubjectGoodsGroups == null) {
+            musicGroupSubjectGoodsGroups = new ArrayList<>();
+        }
+        musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups,musicGroupId);
+        // 新增聊天群
+        // ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
+        // 教务老师和运营主管加入群组
+        ImGroupMember[] imGroupMembers = { new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
+                new ImGroupMember(musicGroup.getEducationalTeacherId().toString()) };
+        // 创建群组
+        imFeignService.groupCreate(new ImGroupModel(musicGroupId, imGroupMembers, musicGroup.getName()));
+        // 记录创建日志
+        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交建团申请", userId, ""));
+        return musicGroupId;
+    }
+
+    @Override
+    public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
+        List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
+        // 获取学员在该乐团续费状态
+        musicCardDtos.forEach(e -> {
+            MusicGroupStudentFee groupStudentFee = musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId());
+            if(groupStudentFee != null){
+                e.setPaymentStatus(musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId()).getPaymentStatus());
+            }
+        });
+        return musicCardDtos;
+    }
+
+    @Override
+    public MusicCardDto queryPersonalMusicGroups(Integer id) {
+        MusicCardDto musicCardDto = musicGroupDao.queryPersonalMusicGroups(id);
+        musicCardDto.setMusicGroupNum(musicGroupDao.countUserMusicGroups(id));
+        musicCardDto.setVipClassNum(musicGroupDao.countCourseByType(id, ClassGroupTypeEnum.VIP));
+        return musicGroupDao.queryPersonalMusicGroups(id);
+    }
+
+    @Override
+    public List<BasicUserDto> findTeachersByStuId(Integer studentId) {
+        return musicGroupDao.findTeachersByStuId(studentId);
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean cancelMusicGroup(String musicGroupId) {
+        MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团找不到");
+        }
+
+        if (musicGroup.getStatus() == MusicGroupStatusEnum.APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
+            musicGroup.setStatus(MusicGroupStatusEnum.CANCELED);
+            musicGroup.setUpdateTime(new Date());
+            musicGroupDao.update(musicGroup);
+        } else {
+            throw new BizException("乐团当前状态是{},不能取消", musicGroup.getStatus().getMsg());
+        }
+
+        // 查询是否有中间状态的缴费信息
+        List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.ING);
+
+        if (studentPaymentOrders != null && studentPaymentOrders.size() > 0) {
+            throw new BizException("缴费存在交易中的数据,不能取消乐团");
+        }
+
+        // 查询已缴费信息
+        studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.SUCCESS);
+
+        // 退费
+        for (StudentPaymentOrder order : studentPaymentOrders) {
+            sysUserCashAccountService.updateBalance(order.getUserId(), order.getActualAmount());
+            // 增加交易流水
+            sysUserCashAccountDetailService.addCashAccountDetail(order.getUserId(), order.getActualAmount(), SysUserCashAccountDetailService.MUSIC_GROUP
+                    + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "取消乐团");
+        }
+
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean pauseMusicGroup(String musicGroupId) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团找不到");
+        }
+
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
+            throw new BizException("乐团当前状态是{},不能暂停", musicGroup.getStatus().getMsg());
+        }
+
+        musicGroup.setStatus(MusicGroupStatusEnum.PAUSE);
+        musicGroup.setUpdateTime(new Date());
+        musicGroupDao.update(musicGroup);
+
+        // 清除下次缴费时间
+        musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, null);
+
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean resumeMusicGroup(String musicGroupId) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团找不到");
+        }
+
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PAUSE) {
+            throw new BizException("乐团当前状态是{},不能恢复", musicGroup.getStatus().getMsg());
+        }
+
+        musicGroup.setStatus(MusicGroupStatusEnum.PROGRESS);
+        musicGroup.setUpdateTime(new Date());
+        musicGroupDao.update(musicGroup);
+
+        // 重新设置下次缴费时间
+        musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
+
+        return true;
+    }
+
+    @Override
+    public boolean extensionPayment(String musicGroupId, Date expireDate) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团找不到");
+        }
+
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
+            throw new BizException("乐团当前状态是{},延长缴费", musicGroup.getStatus().getMsg());
+        }
+
+        Date date = new Date();
+
+        if (date.after(expireDate)) {
+            throw new BizException("日期设置错误");
+        }
+
+        musicGroup.setPaymentExpireDate(expireDate);
+        musicGroup.setUpdateTime(date);
+        musicGroupDao.update(musicGroup);
+
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean applyQuitMusicGroup(String musicGroupId, SysUser sysUser) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团不存在");
+        }
+
+        MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
+        musicGroupQuit.setCreateTime(new Date());
+        musicGroupQuit.setJoinDate(sysUser.getCreateTime());
+        musicGroupQuit.setMusicGroupId(musicGroupId);
+        musicGroupQuit.setUserId(sysUser.getId());
+        musicGroupQuit.setStatus(ApprovalStatus.PROCESSING);
+
+        musicGroupQuitDao.insert(musicGroupQuit);
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean approveQuitMusicGroup(Long id, ApprovalStatus status, String reason) {
+        MusicGroupQuit musicGroupQuit = musicGroupQuitDao.get(id);
+        if (musicGroupQuit != null) {
+
+            Date date = new Date();
+
+            String musicGroupId = musicGroupQuit.getMusicGroupId();
+            Integer userId = musicGroupQuit.getUserId();
+
+            musicGroupQuit.setStatus(status);
+            musicGroupQuit.setReason(reason);
+            musicGroupQuit.setQuitDate(date);
+            musicGroupQuitDao.update(musicGroupQuit);
+
+            if (status == ApprovalStatus.APPROVED) {
+                classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
+
+                // 判断乐器是否是租赁
+                StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+                if (studentRegistration == null) {
+                    throw new BizException("用户注册信息不存在");
+                }
+                // 退团
+                studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
+                studentRegistration.setUpdateTime(date);
+
+                Integer subjectId = studentRegistration.getActualSubjectId();
+                MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
+                if (musicGroupSubjectPlan == null) {
+                    throw new BizException("乐团声部费用设置不存在");
+                }
+                if (musicGroupSubjectPlan.getDepositFee().doubleValue() > 0) {
+                    // 增加交易流水
+                    sysUserCashAccountDetailService.addCashAccountDetail(userId, musicGroupSubjectPlan.getDepositFee(),
+                            SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null,
+                            DealStatusEnum.SUCCESS, "退出乐团");
+                }
+            }
+        }
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason) {
+
+        SysUser sysUser = sysUserFeignService.queryUserById(userId);
+        if (sysUser == null) {
+            throw new BizException("获取用户信息失败");
+        }
+
+        Date date = new Date();
+
+        MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
+        musicGroupQuit.setCreateTime(date);
+        musicGroupQuit.setJoinDate(sysUser.getCreateTime());
+        musicGroupQuit.setMusicGroupId(musicGroupId);
+        musicGroupQuit.setUserId(sysUser.getId());
+        musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
+        musicGroupQuit.setReason(reason);
+        musicGroupQuit.setQuitDate(date);
+
+        musicGroupQuitDao.insert(musicGroupQuit);
+
+        classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
+
+        // 判断乐器是否是租赁
+        StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+        if (studentRegistration == null) {
+            throw new BizException("用户注册信息不存在");
+        }
+        // 退团
+        studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
+        studentRegistration.setUpdateTime(date);
+
+        Integer subjectId = studentRegistration.getActualSubjectId();
+        MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
+        if (musicGroupSubjectPlan == null) {
+            throw new BizException("乐团声部费用设置不存在");
+        }
+        if (musicGroupSubjectPlan.getDepositFee().doubleValue() > 0) {
+            // 增加交易流水
+            sysUserCashAccountDetailService.addCashAccountDetail(userId, musicGroupSubjectPlan.getDepositFee(), SysUserCashAccountDetailService.MUSIC_GROUP
+                    + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "退出乐团");
+        }
+
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public Map renew(String musicGroupId, Integer userId) {
+
+        MusicGroup musicGroup = this.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团不存在");
+        }
+
+        MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+
+        if (musicGroupStudentFee == null) {
+            throw new BizException("个人信息不存在");
+        }
+        // 判断当前是否是续费状态
+        if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
+            throw new BizException("已缴费");
+        }
+
+        BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
+        if (amount == null || amount.doubleValue() == 0) {
+            amount = musicGroupStudentFee.getCourseFee();
+        }
+
+        Date date = new Date();
+        StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
+        studentPaymentOrder.setUserId(userId);
+        studentPaymentOrder.setOrderNo(idGeneratorService.generatorId("RENEW") + "");
+        studentPaymentOrder.setType(OrderTypeEnum.RENEW);
+        studentPaymentOrder.setExpectAmount(amount);
+        studentPaymentOrder.setActualAmount(amount);
+        studentPaymentOrder.setStatus(DealStatusEnum.ING);
+        studentPaymentOrder.setPaymentChannel("银联");
+        studentPaymentOrder.setMusicGroupId(musicGroupId);
+        studentPaymentOrderService.insert(studentPaymentOrder);
+
+        ArrayList<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
+        StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
+        studentPaymentOrderDetail.setType(OrderDetailTypeEnum.COURSE);
+        studentPaymentOrderDetail.setPrice(amount);
+        studentPaymentOrderDetail.setCreateTime(date);
+        studentPaymentOrderDetail.setUpdateTime(date);
+        studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
+        studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
+
+        studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
+
+        try {
+            return payService.getPayMap(amount, idGeneratorService.generatorId("payment") + "", "https://pay.dayaedu.com/api/yqpay/notify",
+                    "http://dev.dayaedu.com", "测试订单", "测试订单");
+        } catch (Exception e) {
+            throw new BizException("调用支付接口出错", e);
+        }
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) {
+
+        studentPaymentOrderDao.update(studentPaymentOrder);
+
+        Integer userId = studentPaymentOrder.getUserId();
+        String musicGroupId = studentPaymentOrder.getMusicGroupId();
+
+        //更新下次续费时间
+        MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+
+        if(musicGroupStudentFee == null){
+            throw new BizException("系统数据异常,找不到学员预缴费信息");
+        }
+
+        Date date = new Date();
+
+        musicGroupStudentFee.setUpdateTime(date);
+        musicGroupStudentFee.setLatestPaidTime(date);
+        musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+        musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+        musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
+
+        musicGroupStudentFeeDao.update(musicGroupStudentFee);
+
+        return true;
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public boolean updateTeacherCoursesSalary(Long courseScheduleId, Integer teacherId, BigDecimal salary, BigDecimal subsidy, String scope) {
+
+        CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
+        if (courseSchedule == null) {
+            throw new BizException("课程信息不存在");
+        }
+
+        if ("all".equals(scope)) {
+            Integer classGrpupId = courseSchedule.getClassGroupId();
+            // 未结算的课酬都修改
+            courseScheduleTeacherSalaryDao.batchUpdateWages(classGrpupId, teacherId, salary, subsidy);
+        } else {
+            CourseScheduleTeacherSalary courseScheduleTeacherSalary = courseScheduleTeacherSalaryDao.queryByCourseScheduleIdAndUserId(courseScheduleId,
+                    teacherId);
+            if (courseScheduleTeacherSalary == null) {
+                throw new BizException("课程结算信息不存在");
+            }
+            // 判断当前课程是否结算
+            if (courseScheduleTeacherSalary.getSettlementTime() != null) {
+                throw new BizException("课程已结算");
+            }
+            courseScheduleTeacherSalary.setExpectSalary(salary);
+            courseScheduleTeacherSalary.setSubsidy(subsidy);
+            courseScheduleTeacherSalary.setUpdateTime(new Date());
+            courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
+        }
+        return true;
+    }
+
+    @Override
+    public PageInfo<MusicGroup> queryMusicGroupPage(QueryInfo queryInfo) {
+        PageInfo<MusicGroup> musicGroupPageInfo = queryPage(queryInfo);
+        List<MusicGroup> musicGroupList = musicGroupPageInfo.getRows();
+        // 获取学校编号列表
+        Set<Integer> schoolIds = musicGroupList.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
+        List<Map<Integer, String>> schoolNames = schoolDao.queryNameByIds(schoolIds);
+        // 获取相关学校名称map
+        Map<Integer, String> schoolNameMap = MapUtil.convertMybatisMap(schoolNames);
+
+        // 获取教务老师编号列表
+        Set<Integer> educationalTeacherIds = musicGroupList.stream().map(e -> e.getEducationalTeacherId()).collect(Collectors.toSet());
+        // 获取相关老师的名字
+        List<Map<Integer, String>> educationalTeacherNames = teacherDao.queryNameByIds(educationalTeacherIds);
+        Map<Integer, String> educationalTeacherNameMap = MapUtil.convertMybatisMap(educationalTeacherNames);
+
+        // 获取运营主管编号列表
+        Set<Integer> teamTeacherIds = musicGroupList.stream().map(e -> e.getTeamTeacherId()).collect(Collectors.toSet());
+        List<Map<Integer, String>> teamTeacherNames = teacherDao.queryNameByIds(teamTeacherIds);
+        Map<Integer, String> teamTeacherNameMap = MapUtil.convertMybatisMap(teamTeacherNames);
+
+        // 获取乐团编号列表
+        Set<String> musicGroupIds = musicGroupList.stream().map(e -> e.getId()).collect(Collectors.toSet());
+        // 统计乐团在读人数
+        List<Map<String, Long>> payNums = musicGroupDao.countPayNum(musicGroupIds);
+        Map<String, Long> payNumMap = MapUtil.convertMybatisMap(payNums);
+
+        // 获取收费类型编号列表
+        Set<Integer> chargeTypeIds = musicGroupList.stream().map(e -> e.getChargeTypeId()).collect(Collectors.toSet());
+        List<Map<Integer, String>> chargeTypeNames = chargeTypeDao.queryNameByIds(chargeTypeIds);
+        Map<Integer, String> chargeTypeNameMap = MapUtil.convertMybatisMap(chargeTypeNames);
+
+        musicGroupList.forEach(e -> {
+            e.setSchoolName(schoolNameMap.get(e.getSchoolId()));
+            e.setEducationalTeacherName(educationalTeacherNameMap.get(e.getEducationalTeacherId()));
+            e.setTeamTeacherName(teamTeacherNameMap.get(e.getTeamTeacherId()));
+            e.setPayNum(payNumMap.get(e.getId()) == null ? 0 : payNumMap.get(e.getId()).intValue());
+            e.setChargeTypeName(chargeTypeNameMap.get(e.getChargeTypeId()));
+        });
+        return musicGroupPageInfo;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateBaseInfo(SubFeeSettingDto subFeeSettingDto) {
+        MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
+        String musicGroupId = musicGroup.getId();
+        MusicGroup group = musicGroupDao.get(musicGroupId);
+        if(group != null){
+            musicGroupDao.update(musicGroup);
+            //修改课程里面的教学点
+            if(!group.getSchoolId().equals(musicGroup.getSchoolId())){
+                courseScheduleDao.updateByMusicGroupId(musicGroupId,musicGroup.getSchoolId());
+            }
+            // 删除乐团付费主体列表
+            musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
+            //批量新增
+            musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
+
+            // 修改学员付费周期
+            List<Integer> calender = subFeeSettingDto.getMonths();
+            //删除乐团相关付费周期
+            musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
+            //批量插入
+            musicGroupPaymentCalenderDao.batchAdd(calender,musicGroupId);
+        }
+    }
+
+    @Override
+    public SubFeeSettingDto findMusicGroupBasicInfo(String musicGroupId) {
+        SubFeeSettingDto subFeeSettingDto = new SubFeeSettingDto();
+        //获取乐团信息
+        subFeeSettingDto.setMusicGroup(musicGroupDao.get(musicGroupId));
+        //获取付费主体
+        subFeeSettingDto.setMusicGroupPaymentEntities(musicGroupPaymentEntitiesDao.findByMusicGroupId(musicGroupId));
+        //获取缴费周期
+        List<Integer> paymentMonth = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId).stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
+        subFeeSettingDto.setMonths(paymentMonth);
+        return subFeeSettingDto;
+    }
 }
 }

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

@@ -64,6 +64,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private ImFeignService imFeignService;
     private ImFeignService imFeignService;
     @Autowired
     @Autowired
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Autowired
+    private SubjectService subjectService;
 
 
     @Override
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -91,14 +93,14 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     }
     }
 
 
     @Override
     @Override
-    public Integer batchUpdateSubject(String userIds, Integer subId,String musicGroupId) {
+    public Integer batchUpdateSubject(String userIds, Integer subId, String musicGroupId) {
         //批量调剂(未缴费学员)
         //批量调剂(未缴费学员)
-        return studentRegistrationDao.batchUpdateSubject(userIds,subId,musicGroupId);
+        return studentRegistrationDao.batchUpdateSubject(userIds, subId, musicGroupId);
     }
     }
 
 
     @Override
     @Override
     public StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId) {
     public StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId) {
-		return studentRegistrationDao.queryFeeDetail(studentId,musicGroupId);
+        return studentRegistrationDao.queryFeeDetail(studentId, musicGroupId);
     }
     }
 
 
     @Override
     @Override
@@ -423,7 +425,18 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
 
     @Override
     @Override
     public List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId) {
     public List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId) {
-        return studentRegistrationDao.findClassGroupStu(musicGroupId, classGroupId);
+        //获取所有声部
+        List<Subject> subjectList = subjectService.findAll(new HashMap<>());
+        List<StudentRegistration> classGroupStuList = studentRegistrationDao.findClassGroupStu(musicGroupId, classGroupId);
+        for (StudentRegistration studentRegistration : classGroupStuList) {
+            for (Subject subject : subjectList) {
+                if (studentRegistration.getActualSubjectId().equals(subject.getId())) {
+                    studentRegistration.setSubjectName(subject.getName());
+                    break;
+                }
+            }
+        }
+        return classGroupStuList;
     }
     }
 
 
     @Override
     @Override
@@ -453,6 +466,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
 
     @Override
     @Override
     public List<StudentRegistration> getMusicGroupStu(String musicGroupId, Integer actualSubjectId) {
     public List<StudentRegistration> getMusicGroupStu(String musicGroupId, Integer actualSubjectId) {
-        return studentRegistrationDao.findMusicGroupStudent(musicGroupId,actualSubjectId);
+        return studentRegistrationDao.findMusicGroupStudent(musicGroupId, actualSubjectId);
+    }
+
+    @Override
+    public List<StudentRegistration> findStudentListByIdList(List<Long> idList) {
+        return studentRegistrationDao.findStudentListByIdList(idList);
+    }
+
+    @Override
+    public int batchInsert(List<StudentRegistration> studentRegistrationList) {
+        return studentRegistrationDao.batchInsert(studentRegistrationList);
     }
     }
 }
 }

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

@@ -59,13 +59,10 @@ public class StudentWithdrawServiceImpl extends BaseServiceImpl<String, StudentW
 	@Autowired
 	@Autowired
 	private SysUserCashAccountDetailService accountDetailService;
 	private SysUserCashAccountDetailService accountDetailService;
 
 
-	private Lock lock = new ReentrantLock();
-
 	@Override
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	@Transactional(rollbackFor = Exception.class)
 	public boolean confirmWithdraw(WithdrawDto withdrawDto) {
 	public boolean confirmWithdraw(WithdrawDto withdrawDto) {
 		try {
 		try {
-			lock.lock();
 			SysUserCashAccount sysUserCashAccount = cashAccountService.get(withdrawDto.getUserId().intValue());
 			SysUserCashAccount sysUserCashAccount = cashAccountService.get(withdrawDto.getUserId().intValue());
 			if (Objects.isNull(sysUserCashAccount)){
 			if (Objects.isNull(sysUserCashAccount)){
 				throw new BizException("账户不存在!");
 				throw new BizException("账户不存在!");
@@ -85,8 +82,6 @@ public class StudentWithdrawServiceImpl extends BaseServiceImpl<String, StudentW
 		} catch (Exception e) {
 		} catch (Exception e) {
 			log.error("用户提现出现异常 {}", e.getMessage(), e);
 			log.error("用户提现出现异常 {}", e.getMessage(), e);
 			throw new BizException(e.getMessage());
 			throw new BizException(e.getMessage());
-		} finally {
-			lock.unlock();
 		}
 		}
 		return true;
 		return true;
 	}
 	}

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -645,4 +645,11 @@
         UPDATE class_group SET student_num_ = student_num_+1,update_time_=#{updateTime} WHERE id_ = #{id} AND
         UPDATE class_group SET student_num_ = student_num_+1,update_time_=#{updateTime} WHERE id_ = #{id} AND
         student_num_=#{studentNum}
         student_num_=#{studentNum}
     </update>
     </update>
+
+    <update id="batchIncreaseClassTimes" parameterType="java.util.List">
+        UPDATE class_group SET current_class_times_ = current_class_times_+1,update_time_ = now() WHERE id_ in
+        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
+        #{item}
+        </foreach>
+    </update>
 </mapper>
 </mapper>

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

@@ -317,10 +317,28 @@
 
 
     <!-- 获取乐团的学生 -->
     <!-- 获取乐团的学生 -->
     <select id="findMusicGroupStudent" resultMap="StudentRegistration">
     <select id="findMusicGroupStudent" resultMap="StudentRegistration">
-        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroup}
+        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId}
         <if test="actualSubjectId != null and actualSubjectId !=''">
         <if test="actualSubjectId != null and actualSubjectId !=''">
             AND actual_subject_id_ = #{actualSubjectId}
             AND actual_subject_id_ = #{actualSubjectId}
         </if>
         </if>
         AND payment_status_ = 1
         AND payment_status_ = 1
     </select>
     </select>
+
+    <!-- 根据注册id list查询报名学生的信息 -->
+    <select id="findStudentListByIdList" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE id_ IN
+        <foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
+
+    <insert id="batchInsert">
+        INSERT INTO student_registration
+        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,actual_subject_id_,music_group_status_)
+        VALUES
+        <foreach collection="studentRegistrationList" item="item" index="index" separator=",">
+            (#{item.parentsPhone},#{item.id},#{item.userId},#{item.name},#{item.musicGroupId},#{item.currentGrade},#{item.currentClass},#{item.subjectId},#{item.isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{item.remark},now(),now(),#{item.parentsName},#{item.parentsCompany},#{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.subjectId},#{item.musicGroupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+        </foreach>
+    </insert>
 </mapper>
 </mapper>

+ 34 - 21
mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java

@@ -1,18 +1,24 @@
 package com.ym.mec.student.controller;
 package com.ym.mec.student.controller;
 
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.StudentWithdraw;
-import com.ym.mec.biz.service.StudentWithdrawService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.StudentWithdraw;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.service.StudentWithdrawService;
+import com.ym.mec.common.controller.BaseController;
+
 /**
 /**
  * @program: mec
  * @program: mec
  * @description: 提现
  * @description: 提现
@@ -24,21 +30,28 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(tags = "提现服务")
 @Api(tags = "提现服务")
 public class WithdrawController extends BaseController {
 public class WithdrawController extends BaseController {
 
 
-    @Autowired
-    private StudentWithdrawService studentWithdrawService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private StudentWithdrawService studentWithdrawService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 
-    @ApiOperation(value = "新增提现申请")
-    @PostMapping("/add")
-    @PreAuthorize("@pcs.hasPermissions('studentWithdraw/add')")
-    public Object add(StudentWithdraw studentWithdraw) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null && sysUser.getId() == null){
-            return failed("获取用户信息失败");
-        }
-        studentWithdraw.setUserId(sysUser.getId());
-        studentWithdrawService.add(studentWithdraw);
-        return succeed();
-    }
+	@ApiOperation(value = "新增提现申请")
+	@PostMapping("/add")
+	@PreAuthorize("@pcs.hasPermissions('studentWithdraw/add')")
+	public Object add(String bankCardNo, BigDecimal amount) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null || sysUser.getId() == null) {
+			return failed("获取用户信息失败");
+		}
+		Date date = new Date();
+		StudentWithdraw studentWithdraw = new StudentWithdraw();
+		studentWithdraw.setUserId(sysUser.getId());
+		studentWithdraw.setAmount(amount);
+		studentWithdraw.setBankCardNo(bankCardNo);
+		studentWithdraw.setModifyTime(date);
+		studentWithdraw.setCreateTime(date);
+		studentWithdraw.setStatus(DealStatusEnum.ING);
+		studentWithdrawService.add(studentWithdraw);
+		return succeed();
+	}
 }
 }

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

@@ -197,7 +197,7 @@ public class ClassGroupController extends BaseController {
     }
     }
 
 
 
 
-    @ApiOperation(value = "调整班级")
+    @ApiOperation(value = "调整班级(添加班级)")
     @PostMapping("/revisionClassGroup")
     @PostMapping("/revisionClassGroup")
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})

+ 10 - 13
mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

@@ -1,14 +1,19 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.biz.dal.dto.CashAccountDetail;
-import com.ym.mec.biz.dal.dto.WithdrawDto;
-import com.ym.mec.biz.service.StudentWithdrawService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.service.StudentWithdrawService;
+import com.ym.mec.common.controller.BaseController;
 
 
 @RequestMapping("studentWithdraw")
 @RequestMapping("studentWithdraw")
 @Api(tags = "提现服务")
 @Api(tags = "提现服务")
@@ -27,14 +32,6 @@ public class StudentWithdrawController extends BaseController {
         return succeed();
         return succeed();
     }
     }
 
 
-    @PostMapping("page")
-    @ApiOperation(value = "学员提现详情")
-    @PreAuthorize("@pcs.hasPermissions('studentWithdraw/page')")
-    public Object getInfo(@RequestBody CashAccountDetail cashAccountDetail) {
-        return succeed(studentWithdrawService.queryWithdrawPage(cashAccountDetail));
-    }
-
-
     @ApiOperation(value = "分页查询")
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('studentWithdraw/queryPage')")
     @PreAuthorize("@pcs.hasPermissions('studentWithdraw/queryPage')")