Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

Joburgess 4 лет назад
Родитель
Сommit
9c7f2fbd83
24 измененных файлов с 559 добавлено и 196 удалено
  1. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderStudentDetailDao.java
  2. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java
  3. 0 95
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentCalenderDto.java
  4. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  5. 167 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java
  6. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentClassAdjust.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeQueryInfo.java
  8. 9 5
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  9. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  10. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderStudentDetailService.java
  11. 55 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  12. 50 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  13. 18 52
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  14. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderStudentDetailServiceImpl.java
  15. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java
  16. 11 11
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  17. 15 0
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  18. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  19. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  20. 115 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml
  21. 11 11
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  22. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  23. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/AdapayController.java
  24. 10 1
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderStudentDetailDao.java

@@ -0,0 +1,14 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MusicGroupPaymentCalenderStudentDetailDao extends BaseDAO<Integer, MusicGroupPaymentCalenderStudentDetail> {
+
+    void batchInsert(@Param("musicGroupPaymentCalenderStudentDetails") List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails, @Param("calenderId") Long calenderId);
+
+    void batchUpdate(@Param("musicGroupPaymentCalenderStudentDetails") List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails);
+}

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

@@ -8,6 +8,8 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import io.swagger.annotations.ApiModelProperty;
 
 public class MusicGroupPaymentCalenderDto {
 
@@ -37,6 +39,17 @@ public class MusicGroupPaymentCalenderDto {
 
 	private List<String> IgnoreBatchNoList = null;
 
+	@ApiModelProperty(value = "跨团合并时缴费项目中学员的缴费明细")
+	private List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails;
+
+	public List<MusicGroupPaymentCalenderStudentDetail> getMusicGroupPaymentCalenderStudentDetails() {
+		return musicGroupPaymentCalenderStudentDetails;
+	}
+
+	public void setMusicGroupPaymentCalenderStudentDetails(List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails) {
+		this.musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderStudentDetails;
+	}
+
 	public List<String> getIgnoreBatchNoList() {
 		return IgnoreBatchNoList;
 	}

+ 0 - 95
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentCalenderDto.java

@@ -1,95 +0,0 @@
-package com.ym.mec.biz.dal.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-
-public class StudentPaymentCalenderDto {
-
-    @ApiModelProperty(value = "学员编号",required = false)
-    private Integer userId;
-
-    @ApiModelProperty(value = "学员名称",required = false)
-    private String username;
-
-    @ApiModelProperty(value = "学员手机号",required = false)
-    private String phone;
-
-    @ApiModelProperty(value = "原价",required = false)
-    private BigDecimal courseOriginalPrice;
-
-    @ApiModelProperty(value = "现价",required = false)
-    private BigDecimal courseCurrentPrice;
-
-    @ApiModelProperty(value = "课程类型",required = false)
-    private String courseType;
-
-    @ApiModelProperty(value = "课程时长",required = false)
-    private Long courseTime;
-
-    @ApiModelProperty(value = "班级编号",required = false)
-    private Integer classGroupId;
-
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public BigDecimal getCourseOriginalPrice() {
-        return courseOriginalPrice;
-    }
-
-    public void setCourseOriginalPrice(BigDecimal courseOriginalPrice) {
-        this.courseOriginalPrice = courseOriginalPrice;
-    }
-
-    public BigDecimal getCourseCurrentPrice() {
-        return courseCurrentPrice;
-    }
-
-    public void setCourseCurrentPrice(BigDecimal courseCurrentPrice) {
-        this.courseCurrentPrice = courseCurrentPrice;
-    }
-
-    public String getCourseType() {
-        return courseType;
-    }
-
-    public void setCourseType(String courseType) {
-        this.courseType = courseType;
-    }
-
-    public Long getCourseTime() {
-        return courseTime;
-    }
-
-    public void setCourseTime(Long courseTime) {
-        this.courseTime = courseTime;
-    }
-
-    public Integer getClassGroupId() {
-        return classGroupId;
-    }
-
-    public void setClassGroupId(Integer classGroupId) {
-        this.classGroupId = classGroupId;
-    }
-}

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

@@ -57,7 +57,7 @@ public class MusicGroupPaymentCalender {
 	}
 
 	public enum PaymentType implements BaseEnum<String, PaymentType> {
-		ADD_STUDENT("新增学员"), ADD_COURSE("临时加课"), MUSIC_APPLY("乐团报名"),MUSIC_RENEW("乐团续费");
+		ADD_STUDENT("新增学员"), ADD_COURSE("临时加课"), MUSIC_APPLY("乐团报名"),MUSIC_RENEW("乐团续费"),SPAN_GROUP_CLASS_ADJUST("跨团班级调整");
 
 		private String desc;
 

+ 167 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java

@@ -0,0 +1,167 @@
+package com.ym.mec.biz.dal.entity;
+
+import java.util.Objects;
+
+/**
+ * 对应数据库表(music_group_payment_calender_student_detail):
+ */
+public class MusicGroupPaymentCalenderStudentDetail {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private String phone;
+	
+	/**  */
+	private String username;
+	
+	/** 原价 */
+	private java.math.BigDecimal courseOriginalPrice;
+	
+	/** 现价 */
+	private java.math.BigDecimal courseCurrentPrice;
+	
+	/** 课程类型 */
+	private String courseType;
+	
+	/** 课程时长 */
+	private Long courseTime;
+	
+	/** 班级编号 */
+	private Integer classGroupId;
+	
+	/** 缴费项目编号 */
+	private Long calenderId;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setPhone(String phone){
+		this.phone = phone;
+	}
+	
+	public String getPhone(){
+		return this.phone;
+	}
+			
+	public void setUsername(String username){
+		this.username = username;
+	}
+	
+	public String getUsername(){
+		return this.username;
+	}
+			
+	public void setCourseOriginalPrice(java.math.BigDecimal courseOriginalPrice){
+		this.courseOriginalPrice = courseOriginalPrice;
+	}
+	
+	public java.math.BigDecimal getCourseOriginalPrice(){
+		return this.courseOriginalPrice;
+	}
+			
+	public void setCourseCurrentPrice(java.math.BigDecimal courseCurrentPrice){
+		this.courseCurrentPrice = courseCurrentPrice;
+	}
+	
+	public java.math.BigDecimal getCourseCurrentPrice(){
+		return this.courseCurrentPrice;
+	}
+			
+	public void setCourseType(String courseType){
+		this.courseType = courseType;
+	}
+	
+	public String getCourseType(){
+		return this.courseType;
+	}
+
+	public Long getCourseTime() {
+		return courseTime;
+	}
+
+	public void setCourseTime(Long courseTime) {
+		this.courseTime = courseTime;
+	}
+
+	public void setClassGroupId(Integer classGroupId){
+		this.classGroupId = classGroupId;
+	}
+	
+	public Integer getClassGroupId(){
+		return this.classGroupId;
+	}
+			
+	public void setCalenderId(Long calenderId){
+		this.calenderId = calenderId;
+	}
+	
+	public Long getCalenderId(){
+		return this.calenderId;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+
+	@Override
+	public String toString() {
+		return "MusicGroupPaymentCalenderStudentDetail{" +
+				"userId=" + userId +
+				", courseCurrentPrice=" + courseCurrentPrice +
+				", courseType='" + courseType + '\'' +
+				", classGroupId=" + classGroupId +
+				'}';
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+		MusicGroupPaymentCalenderStudentDetail that = (MusicGroupPaymentCalenderStudentDetail) o;
+		return userId.equals(that.userId) &&
+				courseCurrentPrice.equals(that.courseCurrentPrice) &&
+				courseType.equals(that.courseType) &&
+				classGroupId.equals(that.classGroupId);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(userId, courseCurrentPrice, courseType, classGroupId);
+	}
+}

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

@@ -43,12 +43,23 @@ public class MusicGroupStudentClassAdjust {
 	@ApiModelProperty(value = "每个班级对应的学员", required = false)
 	private String classGroupStudents;
 
+	@ApiModelProperty(value = "学员的缴费详情", required = false)
+	private String studentPaymentCalender;
+
 	private Integer operatorId;
 
 	private Date createTime;
 
 	private Date updateTime;
 
+	public String getStudentPaymentCalender() {
+		return studentPaymentCalender;
+	}
+
+	public void setStudentPaymentCalender(String studentPaymentCalender) {
+		this.studentPaymentCalender = studentPaymentCalender;
+	}
+
 	public String getDefaultCourseTypeMinute() {
 		return defaultCourseTypeMinute;
 	}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeQueryInfo.java

@@ -21,6 +21,18 @@ public class EmployeeQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "用户名或电话",required = false)
     private Long userNameOrPhone;
 
+    /** 是否离职 */
+    @ApiModelProperty(value = "是否离职",required = false)
+    private Boolean demissionflag;
+
+    public Boolean getDemissionflag() {
+        return demissionflag;
+    }
+
+    public void setDemissionflag(Boolean demissionflag) {
+        this.demissionflag = demissionflag;
+    }
+
     public String getJobNature() {
         return jobNature;
     }

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

@@ -1,10 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
@@ -513,7 +510,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param mergeClassSplitClassAffirmDto
      * @return
      */
-    Map<Integer, List<StudentPaymentCalenderDto>> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
+    List<MusicGroupPaymentCalenderStudentDetail> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
 
     /**
      * 获取班级列表最大可排课时长
@@ -521,4 +518,11 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return
      */
     Map<String,Long> querySubCourseTime(Integer classGroupId);
+
+    /**
+     * 跨团班级合并提交
+     * @param mergeClassSplitClassAffirmDto
+     * @return
+     */
+    void spanGroupMergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -6,7 +6,9 @@ import java.util.Set;
 
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 import com.ym.mec.common.service.BaseService;
 
 public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long, MusicGroupPaymentCalenderDetail> {
@@ -54,6 +56,13 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
 
     /**
      * 乐团缴费记录新增学员
+     * @param musicGroupPaymentCalender
+     * @param musicGroupPaymentCalenderStudentDetails
+     */
+    void batchAdd(MusicGroupPaymentCalender musicGroupPaymentCalender, List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails);
+
+    /**
+     * 乐团缴费记录新增学员
      * @param batchNo
      * @param userIdList
      */

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderStudentDetailService.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.service;
+
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.common.service.BaseService;
+
+public interface MusicGroupPaymentCalenderStudentDetailService extends BaseService<Integer, MusicGroupPaymentCalenderStudentDetail> {
+
+}

+ 55 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST;
 import static com.ym.mec.biz.dal.enums.GroupType.COMM;
 import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
@@ -30,7 +32,6 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.service.*;
-import com.ym.mec.common.service.IdGeneratorService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -163,8 +164,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     @Autowired
-    private IdGeneratorService idGeneratorService;
-    @Autowired
     private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 
     @Override
@@ -905,7 +904,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     public List<ImGroupModel> queryUserGroups(Integer userId, String search) {
         List<ImGroupModel> imGroupModels = classGroupDao.queryUserMusicGroups(userId, search);
         imGroupModels.addAll(classGroupDao.queryUserVipGroups(userId, search));
-//        imGroupModels.addAll(classGroupDao.queryUserPracticeGroups(userId, search));
         imGroupModels.addAll(classGroupDao.queryUserCommGroups(userId, search));
         if (imGroupModels != null && imGroupModels.size() > 0) {
             imGroupModels.forEach(e -> {
@@ -3574,7 +3572,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-    public Map<Integer, List<StudentPaymentCalenderDto>> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
+    public List<MusicGroupPaymentCalenderStudentDetail> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
         //获取主班剩余时长
         Map<String, Long> masterMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(mergeClassSplitClassAffirmDto.getMasterClassGroupId()));
         if(masterMap.size() <= 0){
@@ -3606,7 +3604,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //计算主班课程类型剩余价值
         Map<String, BigDecimal> masterTotalPriceMap = new HashMap<>(masterKeySet.size());
         //学员缴费项目列表
-        List<StudentPaymentCalenderDto> studentPaymentCalenderDtos = new ArrayList<>();
+        List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = new ArrayList<>();
         for (String s : masterKeySet) {
             BigDecimal unitPrice = unitPriceMap.get(s);
             if (unitPrice == null) {
@@ -3625,7 +3623,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 //学员剩余课程余额
                 BigDecimal bigDecimal = surplusCourseFeeMap.get(studentId);
                 //创建学员缴费项目
-                StudentPaymentCalenderDto calenderDto = new StudentPaymentCalenderDto();
+                MusicGroupPaymentCalenderStudentDetail calenderDto = new MusicGroupPaymentCalenderStudentDetail();
                 calenderDto.setClassGroupId(studentCLassMap.get(studentId));
                 //如果剩余课程余额小于等于0
                 if(bigDecimal.doubleValue() <= 0d){
@@ -3650,14 +3648,62 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 calenderDto.setPhone(phoneMaps.get(studentId));
                 calenderDto.setUserId(studentId);
                 calenderDto.setUsername(userNames.get(studentId));
-                studentPaymentCalenderDtos.add(calenderDto);
+                musicGroupPaymentCalenderStudentDetails.add(calenderDto);
             }
         }
-        return studentPaymentCalenderDtos.stream().collect(Collectors.groupingBy(e -> e.getClassGroupId()));
+        return musicGroupPaymentCalenderStudentDetails;
     }
 
     @Override
     public Map<String, Long> querySubCourseTime(Integer classGroupId) {
         return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void spanGroupMergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
+        //缴费项目
+        List<MusicGroupPaymentCalenderDto> paymentCalenderDtos = mergeClassSplitClassAffirmDto.getMusicGroupPaymentCalenderDtos();
+        //主班
+        Integer masterClassGroupId = mergeClassSplitClassAffirmDto.getMasterClassGroupId();
+        //班级和学员关联
+        List<Map<Integer, String>> classGroupStudents = mergeClassSplitClassAffirmDto.getClassGroupStudents();
+        //获取默认的学员缴费详情
+        List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = queryStudentPaymentCalenders(mergeClassSplitClassAffirmDto);
+        MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = new MusicGroupStudentClassAdjust();
+        //创建缴费项目
+        MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
+        MusicGroupPaymentCalender.PaymentCalenderStatusEnum status = null;
+        StringBuffer batchNos = new StringBuffer();
+        List<String> batchNoList = new ArrayList<>();
+        if (paymentCalenderDtos != null && paymentCalenderDtos.size() > 0) {
+            //是否有需要审核的缴费项目
+            for (MusicGroupPaymentCalenderDto calenderDto : paymentCalenderDtos) {
+                //扣除原乐团剩余课程余额,补充到现有乐团
+                //将学员加入新乐团
+
+                calenderDto.setMusicGroupId(musicGroup.getId());
+                List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = calenderDto.getMusicGroupPaymentCalenderStudentDetails();
+                boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
+                if(!containsAll){
+                    calenderDto.setStatus(AUDITING);
+                }else {
+                    calenderDto.setStatus(NO);
+                }
+                calenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
+                //生成缴费项目
+                musicGroupPaymentCalenderService.create(calenderDto);
+                if (batchNos.length() > 0) {
+                    batchNos.append(",");
+                }
+                batchNoList.add(calenderDto.getBatchNo());
+                batchNos.append(calenderDto.getBatchNo());
+                if (status == null || status != AUDITING) {
+                    if(!containsAll){
+                        status = AUDITING;
+                    }
+                }
+            }
+        }
+    }
 }

+ 50 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 
 import java.math.BigDecimal;
@@ -15,6 +16,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -29,13 +31,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
@@ -379,6 +375,54 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
+	public void batchAdd(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails) {
+		Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = musicGroupPaymentCalenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
+		//生成music_group_payment_calender_detail
+		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
+		MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
+		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
+		Long musicGroupPaymentCalenderId = musicGroupPaymentCalender.getId();
+		for (Integer studentId : collect.keySet()) {
+			musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+			musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
+			musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
+			List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = collect.get(studentId);
+			BigDecimal totalPrice = calenderStudentDetails.stream().map(e->e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+			musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
+			if(musicGroupPaymentCalender.getStatus() != AUDITING){
+				if (totalPrice.doubleValue() == 0d) {
+					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+				}
+			}
+			musicGroupPaymentCalenderDetail.setUserId(studentId);
+			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
+			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
+			musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
+			musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+			Long musicGroupPaymentCalenderDetailId = musicGroupPaymentCalenderDetail.getId();
+			for (MusicGroupPaymentCalenderStudentDetail calenderStudentDetail : calenderStudentDetails) {
+				//创建学生课排课分钟数
+				musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
+				musicGroupPaymentStudentCourseDetail.setCourseType(CourseSchedule.CourseScheduleType.valueOf(calenderStudentDetail.getCourseType()));
+				musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
+				musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetailId);
+				musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(0);
+				musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(calenderStudentDetail.getCourseTime().intValue());
+				musicGroupPaymentStudentCourseDetail.setUserId(studentId);
+				musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
+			}
+		}
+		musicGroupPaymentCalender.setExpectNum(collect.keySet().size());
+		musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
+		musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
+		//给学员推送缴费通知
+		if(musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN){
+			musicGroupPaymentCalenderService.pushWaitRenewMessage(musicGroupPaymentCalenderId,musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId()),collect.keySet());
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void batchAdd(String batchNo, Set<Integer> userIdList) {
 		
 		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);

+ 18 - 52
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -4,10 +4,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SC
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_COURSE;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_STUDENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.*;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -23,6 +20,9 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,50 +34,12 @@ import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentClassAdjustDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
-import com.ym.mec.biz.dal.dto.CalenderPushDto;
-import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
-import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -140,9 +102,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Autowired
 	private TeacherAttendanceDao teacherAttendanceDao;
-
-	@Autowired
-	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
 	private MusicGroupBuildLogDao musicGroupBuildLogDao;
 	@Autowired
@@ -150,19 +109,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Autowired
 	private OrganizationDao organizationDao;
 	@Autowired
-	private StudentRegistrationDao studentRegistrationDao;
-	@Autowired
 	private SysMessageService sysMessageService;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private CourseScheduleStudentPaymentServiceImpl courseScheduleStudentPaymentService;
-	@Autowired
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	@Autowired
 	private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 	@Autowired
 	private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
+	@Autowired
+	private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
 
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -366,7 +323,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			}
-			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE) {
+			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 				if (count > 0) {
@@ -411,11 +368,20 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
 			}
-
+			//如果是跨团班级合并,保存用户缴费详情
+			List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
+			if (musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+				musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
+				//记录学员缴费详情
+				musicGroupPaymentCalenderStudentDetailDao.batchInsert(musicGroupPaymentCalenderStudentDetails,musicGroupPaymentCalender.getId());
+			}
 			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
 				// 如果是进行中加学生
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
+				}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+					//如果是跨团班级合并,添加学员
+					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
 				}else if(musicGroupPaymentCalenderDto.getMergeClassFlag()){
 					//缴费项目添加学员
 					int[] ints = Arrays.stream(musicGroupPaymentCalenderDto.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
@@ -673,7 +639,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			}
-			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE) {
+			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 				if (count > 0) {

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderStudentDetailServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderStudentDetailService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MusicGroupPaymentCalenderStudentDetailServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentCalenderStudentDetail> implements MusicGroupPaymentCalenderStudentDetailService {
+	
+	@Autowired
+	private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
+
+	@Override
+	public BaseDAO<Integer, MusicGroupPaymentCalenderStudentDetail> getDAO() {
+		return musicGroupPaymentCalenderStudentDetailDao;
+	}
+	
+}

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

@@ -538,7 +538,7 @@ public class PayServiceImpl implements PayService {
         }
 
         BigDecimal monthMaxReceipt = hfmember.getMonthMaxReceipt(); //每月限定金额
-        Date monthStartTime = DateUtil.getFirstDayOfMonth(new Date());
+        Date dayStartTime = DateUtil.trunc(new Date());
 
         //已收金额
         List<PaymentChannelEnum> paymentChannelList = new ArrayList<>();
@@ -556,7 +556,7 @@ public class PayServiceImpl implements PayService {
 //                redisTemplate.expire(key, 600, TimeUnit.SECONDS);// 保留10分钟内的key
 //            }
 //        }else {
-            BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(routeScaleDto.getOrganId(), paymentChannelList, monthStartTime);
+            BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(routeScaleDto.getOrganId(), paymentChannelList, dayStartTime);
             monthHasReceipt = monthHasReceipt == null ? BigDecimal.ZERO : monthHasReceipt;
 //            monthHasReceipt.multiply(new BigDecimal(100));
 //

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

@@ -324,7 +324,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         <where>
-            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND mg.status_ = 'PROGRESS' AND cgsm.group_type_ = 'MUSIC'
+            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND mg.status_ IN ('PROGRESS','PAUSE') AND cgsm.group_type_ = 'MUSIC'
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
@@ -342,7 +342,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         <where>
-            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND vg.group_status_ = 2 AND cgsm.group_type_ = 'VIP'
+            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND vg.group_status_ IN (2,6) AND cgsm.group_type_ = 'VIP'
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
             </if>
@@ -478,8 +478,8 @@
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         WHERE cg.del_flag_ = 0 AND
-        ((mg.status_ = 'PROGRESS' AND cg.group_type_ = 'MUSIC' AND (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
-        OR (vg.group_status_ = 2 AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId})
+        ((mg.status_ IN ('PROGRESS','PAUSE') AND cg.group_type_ = 'MUSIC' AND (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
+        OR (vg.group_status_ IN (2,6) AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId})
         OR (csg.status_ = 'NORMAL' AND cg.group_type_ = 'COMM' AND csg.educational_teacher_id_ =  #{userId}))
         <if test="search != null">
             AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%')
@@ -496,9 +496,9 @@
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         WHERE cgtm.user_id_ != #{userId} AND cg.del_flag_ = 0
-        AND ((vg.group_status_ = 2 AND vg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'VIP')
-        OR (mg.status_ = 'PROGRESS' AND cg.group_type_ = 'MUSIC' AND (mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
-        OR (csg.status_ = 'NORMAL' AND csg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'COMM'))
+        AND ((vg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'VIP')
+        OR (cg.group_type_ = 'MUSIC' AND (mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
+        OR (csg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'COMM'))
         GROUP BY cg.id_
     </select>
 
@@ -510,8 +510,8 @@
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         WHERE cg.del_flag_ = 0 AND
-        ((vg.group_status_ = 2 AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId} AND vg.organ_id_ = #{organId})
-        OR (mg.status_ = 'PROGRESS' AND cg.group_type_ = 'MUSIC' AND mg.educational_teacher_id_ =  #{userId} AND mg.organ_id_ = #{organId})
+        ((vg.group_status_ IN (2,6) AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId} AND vg.organ_id_ = #{organId})
+        OR (mg.status_ IN ('PROGRESS','PAUSE') AND cg.group_type_ = 'MUSIC' AND mg.educational_teacher_id_ =  #{userId} AND mg.organ_id_ = #{organId})
         OR (csg.status_ = 'NORMAL' AND cg.group_type_ = 'COMM' AND csg.educational_teacher_id_ =  #{userId} AND csg.organ_id_ = #{organId}))
         GROUP BY cg.id_
     </select>
@@ -522,7 +522,7 @@
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
-        WHERE mg.team_teacher_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS' AND cg.group_type_ = 'MUSIC'
+        WHERE mg.team_teacher_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ IN ('PROGRESS','PAUSE')  AND cg.group_type_ = 'MUSIC'
         GROUP BY cg.id_
     </select>
 
@@ -531,7 +531,7 @@
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
-        WHERE mg.director_user_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS'
+        WHERE mg.director_user_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY cg.id_
     </select>
 

+ 15 - 0
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -208,6 +208,12 @@
             LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
         </if>
         <where>
+            <if test="demissionflag != null and demissionflag == 'true'">
+                AND e.demission_date_ IS NOT NULL
+            </if>
+            <if test="demissionflag != null and demissionflag == 'false'">
+                AND e.demission_date_ IS NULL
+            </if>
             <if test="organId != null">
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
             </if>
@@ -238,6 +244,15 @@
             <if test="organId != null">
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
             </if>
+            <if test="demissionflag != null and demissionflag == 'true'">
+                AND e.demission_date_ IS NOT NULL
+            </if>
+            <if test="demissionflag != null and demissionflag == 'false'">
+                AND e.demission_date_ IS NULL
+            </if>
+            <if test="jobNature != null">
+                AND e.job_nature_ = #{jobNature}
+            </if>
             <if test="search != null">
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
             </if>

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

@@ -327,7 +327,7 @@
         LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON cg.id_ = cgtm.class_group_id_
         WHERE (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId}
-        OR director_user_id_ = #{userId}) AND mg.status_ = 'PROGRESS'
+        OR director_user_id_ = #{userId}) AND mg.status_ IN ('PROGRESS','PAUSE')
         <if test="search != null and search != ''">
             AND mg.name_ LIKE CONCAT('%',#{search},'%')
         </if>

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

@@ -323,7 +323,7 @@
         WHERE music_group_id_ = #{musicGroupId}
         AND (payment_valid_end_date_ IS NULL OR payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
         OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}) AND payment_valid_start_date_ IS NOT NULL
-        AND mgpc.payment_type_ != 'ADD_STUDENT' AND mgpc.payment_type_ != 'ADD_COURSE' AND mgpc.batch_no_ IS NOT NULL
+        AND mgpc.payment_type_ NOT IN ('SPAN_GROUP_CLASS_ADJUST','ADD_STUDENT','ADD_COURSE') AND mgpc.batch_no_ IS NOT NULL
         <if test="payUserType != null">
         	and pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>

+ 115 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail" id="MusicGroupPaymentCalenderStudentDetail">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="phone_" property="phone" />
+		<result column="username_" property="username" />
+		<result column="course_original_price_" property="courseOriginalPrice" />
+		<result column="course_current_price_" property="courseCurrentPrice" />
+		<result column="course_type_" property="courseType" />
+		<result column="course_time_" property="courseTime" />
+		<result column="class_group_id_" property="classGroupId" />
+		<result column="calender_id_" property="calenderId" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="MusicGroupPaymentCalenderStudentDetail" >
+		SELECT * FROM music_group_payment_calender_student_detail WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="MusicGroupPaymentCalenderStudentDetail">
+		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO music_group_payment_calender_student_detail (id_,user_id_,phone_,username_,course_original_price_,
+																 course_current_price_,course_type_,course_time_,class_group_id_,calender_id_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{phone},#{username},#{courseOriginalPrice},#{courseCurrentPrice},
+			   #{courseType},#{courseTime},#{classGroupId},#{calenderId},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail">
+		UPDATE music_group_payment_calender_student_detail <set>
+		<if test="userId != null">
+		user_id_ = #{userId},
+		</if>
+		<if test="classGroupId != null">
+		class_group_id_ = #{classGroupId},
+		</if>
+		<if test="courseCurrentPrice != null">
+		course_current_price_ = #{courseCurrentPrice},
+		</if>
+		<if test="courseType != null">
+		course_type_ = #{courseType},
+		</if>
+		<if test="courseOriginalPrice != null">
+		course_original_price_ = #{courseOriginalPrice},
+		</if>
+		<if test="calenderId != null">
+		calender_id_ = #{calenderId},
+		</if>
+		<if test="phone != null">
+		phone_ = #{phone},
+		</if>
+		<if test="courseTime != null">
+		course_time_ = #{courseTime},
+		</if>
+		<if test="username != null">
+		username_ = #{username},
+		</if>
+		update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM music_group_payment_calender_student_detail WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="MusicGroupPaymentCalenderStudentDetail" parameterType="map">
+		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM music_group_payment_calender_student_detail
+	</select>
+	<insert id="batchInsert">
+		INSERT INTO music_group_payment_calender_student_detail (id_,user_id_,phone_,username_,course_original_price_,
+		course_current_price_,course_type_,course_time_,class_group_id_,calender_id_,create_time_,update_time_)
+		VALUES
+		<foreach collection="musicGroupPaymentCalenderStudentDetails" item="item" index="index" separator=",">
+			(#{item.userId},#{item.phone},#{item.username},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
+			#{item.courseType},#{item.courseTime},#{item.classGroupId},#{calenderId},NOW(),NOW())
+		</foreach>
+	</insert>
+
+	<update id="batchUpdate">
+		<foreach collection="musicGroupPaymentCalenderStudentDetails" item="item" index="index" open="" close="" separator=";">
+			UPDATE music_group_payment_calender_student_detail
+		<set>
+			<if test="item.courseCurrentPrice != null">
+				course_current_price_ = #{item.courseCurrentPrice},
+			</if>
+			<if test="item.courseOriginalPrice != null">
+				course_original_price_ = #{item.courseOriginalPrice},
+			</if>
+			update_time_ = NOW()
+		</set>
+			WHERE id_ = #{item.id}
+		</foreach>
+	</update>
+</mapper>

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

@@ -936,13 +936,13 @@
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN music_group mg ON cgsm.music_group_id_ = mg.id_
-        WHERE mg.status_ = 'PROGRESS' AND cgsm.user_id_ = #{studentId}
+        WHERE mg.status_ IN ('PROGRESS','PAUSE') AND cgsm.user_id_ = #{studentId}
     </select>
     <select id="findVipTeacherIds" resultType="java.lang.Integer">
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cgsm.music_group_id_
-        WHERE vg.group_status_ IN (2,3,4) AND cgsm.user_id_ = #{studentId}
+        WHERE vg.group_status_ IN (2,3,4,6) AND cgsm.user_id_ = #{studentId}
     </select>
     <select id="findPracticeTeacherIds" resultType="java.lang.Integer">
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
@@ -1061,11 +1061,11 @@
         SELECT cssp.user_id_ FROM music_group mg
         LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
         WHERE (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
-        AND cssp.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        AND cssp.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         UNION ALL
         SELECT cgsm.user_id_ FROM vip_group vg
         LEFT JOIN class_group_student_mapper cgsm ON vg.id_ = cgsm.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgsm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgsm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         UNION ALL
         SELECT cssp.user_id_ FROM courses_group cg
         LEFT JOIN course_schedule_student_payment cssp ON cg.id_ = cssp.music_group_id_
@@ -1085,7 +1085,7 @@
         UNION ALL
         SELECT csts.user_id_ FROM vip_group vg 
         LEFT JOIN course_schedule_teacher_salary csts ON vg.id_ = csts.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY csts.user_id_
         UNION ALL
         SELECT csts.user_id_ FROM courses_group cg 
@@ -1100,13 +1100,13 @@
         UNION ALL
         SELECT cgtm.user_id_ FROM music_group mg
         LEFT JOIN class_group_teacher_mapper cgtm ON mg.id_ = cgtm.music_group_id_
-        WHERE cgtm.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE cgtm.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         AND (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
         GROUP BY cgtm.user_id_
         UNION ALL
         SELECT cgtm.user_id_ FROM vip_group vg 
         LEFT JOIN class_group_teacher_mapper cgtm ON vg.id_ = cgtm.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY cgtm.user_id_
         UNION ALL
         SELECT cgtm.user_id_ FROM courses_group cg 
@@ -1121,7 +1121,7 @@
         UNION ALL
         SELECT vg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
         LEFT JOIN vip_group vg ON vg.id_ = cgtm.music_group_id_
-        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY vg.educational_teacher_id_
         UNION ALL
         SELECT cg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
@@ -1136,7 +1136,7 @@
         UNION ALL
         SELECT vg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
         LEFT JOIN vip_group vg ON vg.id_ = csts.music_group_id_
-        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY vg.educational_teacher_id_
         UNION ALL
         SELECT cg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
@@ -1152,12 +1152,12 @@
     <select id="queryMusicLeaderIds" resultType="java.lang.String">
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM course_schedule_teacher_salary csts
         LEFT JOIN music_group mg ON mg.id_ = csts.music_group_id_
-        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY mg.id_
         UNION ALL
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM class_group_teacher_mapper cgtm
         LEFT JOIN music_group mg ON mg.id_ = cgtm.music_group_id_
-        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY mg.id_
     </select>
     <select id="queryStudent" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -102,7 +102,7 @@ public class MusicGroupController extends BaseController {
         return succeed(musicGroupService.queryPersonalMusicGroups(sysUser.getId()));
     }
 
-    @ApiOperation(value = "根据学员编号,获取有关联的老师列表")
+    @ApiOperation(value = "根据学员编号,获取有关联的老师列表,获取学员通讯录列表")
     @GetMapping("/findTeachersByStuId")
     public Object findTeachersByStuId(String search) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();

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

@@ -251,6 +251,7 @@ public class AdapayController extends BaseController {
         hfMember.setMonthMaxReceipt(monthMaxReceipt);
         hfMember.setRouteMemberId(routeMemberId);
         hfMember.setRouteOrganId(organId);
+        hfMember.setUpdateTime(new Date());
         if (hfMemberService.update(hfMember) <= 0) {
             return failed("修改失败,请重试");
         }

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

@@ -13,6 +13,7 @@ import io.swagger.annotations.ApiParam;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -380,7 +381,15 @@ public class ClassGroupController extends BaseController {
     @PostMapping("/queryStudentPaymentCalenders")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryStudentPaymentCalenders')")
     public HttpResponseResult queryStudentPaymentCalenders(@RequestBody MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
-        return succeed(classGroupService.queryStudentPaymentCalenders(mergeClassSplitClassAffirmDto));
+        return succeed(classGroupService.queryStudentPaymentCalenders(mergeClassSplitClassAffirmDto).stream().collect(Collectors.groupingBy(e -> e.getClassGroupId())));
+    }
+
+    @ApiOperation(value = "跨团班级合并提交")
+    @PostMapping("/spanGroupMergeClassSplitClassAffirm")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/spanGroupMergeClassSplitClassAffirm')")
+    public HttpResponseResult spanGroupMergeClassSplitClassAffirm(@RequestBody MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) throws Exception {
+        classGroupService.spanGroupMergeClassSplitClassAffirm(mergeClassSplitClassAffirmDto);
+        return succeed();
     }
 
     @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-获取所选班级最大可排课时长")