瀏覽代碼

Merge branch 'master' into adapay_delay_1231

周箭河 4 年之前
父節點
當前提交
06f8946794
共有 39 個文件被更改,包括 848 次插入465 次删除
  1. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java
  3. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  4. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherAttendanceDao.java
  5. 32 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/HighClassGroupNumDto.java
  6. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentRecoverInfoDto.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendancesDto.java
  8. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java
  9. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java
  10. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  11. 15 2
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  12. 0 6
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java
  13. 265 241
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  14. 37 27
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  15. 64 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  16. 91 35
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  17. 18 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  18. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  19. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  20. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java
  21. 4 15
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  22. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  23. 7 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  24. 49 18
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  25. 7 5
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  26. 6 3
      mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml
  27. 7 1
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  28. 0 5
      mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  29. 6 8
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  30. 0 4
      mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java
  31. 0 5
      mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java
  32. 0 19
      mec-task/src/main/java/com/ym/mec/task/jobs/AttendanceComplaintsAutoAffirmTask.java
  33. 9 1
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/provider/JiguangPushPlugin.java
  34. 26 20
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  35. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  36. 3 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java
  37. 0 6
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java
  38. 13 12
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java
  39. 29 0
      mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -736,6 +736,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 获取班级列表
+     *
      * @param practiceGroupId
      * @param groupType
      * @return
@@ -744,10 +745,19 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 根据班级编号冻结所选班级
-     * @author zouxuan
+     *
      * @param classGroupIds
      * @param lockFlag
      * @return
+     * @author zouxuan
      */
     int batchUpdateLockByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds, @Param("lockFlag") int lockFlag);
+
+
+    /**
+     * 获取乐团某声部基础技能班或基础技能提高班数量
+     *
+     * @return
+     */
+    Integer getMusicGroupHighClassNumBySubject(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds, @Param("type") ClassGroupTypeEnum type);
 }

+ 1 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java

@@ -10,7 +10,6 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.MusicGroupStudentSignDto;
 import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.dto.StudentHasCourseDto;
 import com.ym.mec.biz.dal.dto.StudentListCourseDto;
 import com.ym.mec.biz.dal.dto.StudentManageAccountBaseInfoDto;
 import com.ym.mec.biz.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
@@ -241,7 +240,7 @@ public interface StudentManageDao {
      * @return
      */
     List<BasicUserDto> queryCanAddStudent(@Param("musicGroupId") String musicGroupId,
-                                          @Param("musicGroupPaymentCalenderId") Long musicGroupPaymentCalenderId,
+                                          @Param("batchNo") String batchNo,
                                           @Param("search") String search,
                                           @Param("subjectId") Integer subjectId);
 

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

@@ -380,8 +380,16 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 获取乐团未交费的学生
+     *
      * @param musicGroupId
      * @return
      */
     List<StudentRegistration> getNoPaymentStudent(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 获取乐团声部学生数量
+     *
+     * @return
+     */
+    Integer getMusicGroupSubjectStudentNum(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds);
 }

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherAttendanceDao.java

@@ -266,11 +266,4 @@ public interface TeacherAttendanceDao extends BaseDAO<Long, TeacherAttendance> {
      * @return java.lang.Long
      */
 	Long findFirstSign(@Param("currentScheduleId") Long currentScheduleId, @Param("userId") Integer userId);
-
-	/**
-	 * 获取指定天数之后还没有审批的考勤申述列表
-	 * @param affirmDay
-	 * @return
-	 */
-	List<TeacherAttendance> queryAttendanceComplaintsAutoAffirmList(@Param("affirmDay") String affirmDay);
 }

+ 32 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/HighClassGroupNumDto.java

@@ -0,0 +1,32 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+public class HighClassGroupNumDto {
+
+    @ApiModelProperty(value = "班级类型", required = true)
+    private ClassGroupTypeEnum type;
+
+    @ApiModelProperty(value = "已有基础技能班/线上基础技能班数量", required = true)
+    private Integer nowHighClassGroupNum;
+
+    @ApiModelProperty(value = "容许最大数量", required = true)
+    private Integer maxHighClassGroupNum;
+
+    public Integer getNowHighClassGroupNum() {
+        return nowHighClassGroupNum;
+    }
+
+    public void setNowHighClassGroupNum(Integer nowHighClassGroupNum) {
+        this.nowHighClassGroupNum = nowHighClassGroupNum;
+    }
+
+    public Integer getMaxHighClassGroupNum() {
+        return maxHighClassGroupNum;
+    }
+
+    public void setMaxHighClassGroupNum(Integer maxHighClassGroupNum) {
+        this.maxHighClassGroupNum = maxHighClassGroupNum;
+    }
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentRecoverInfoDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import java.time.LocalDate;
+
 /**
  * @Author Joburgess
  * @Date 2019/12/24
@@ -18,6 +20,16 @@ public class StudentRecoverInfoDto {
 
     private int giveCourseTimes;
 
+    private LocalDate expireDate;
+
+    public LocalDate getExpireDate() {
+        return expireDate;
+    }
+
+    public void setExpireDate(LocalDate expireDate) {
+        this.expireDate = expireDate;
+    }
+
     public Integer getVipGroupId() {
         return vipGroupId;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendancesDto.java

@@ -1,10 +1,12 @@
 package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.TeacherAttendance;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.SignInStatusEnum;
 import com.ym.mec.biz.dal.enums.SignOutStatusEnum;
 import com.ym.mec.biz.dal.enums.TeachTypeEnum;
+
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
@@ -15,6 +17,8 @@ public class TeacherAttendancesDto {
 	private String teacherName;
 
     private TeachTypeEnum teacherRole;
+    
+    private TeacherAttendance teacherAttendance = new TeacherAttendance();
 
     @ApiModelProperty(value = "分部名",required = false)
 	private String organName;
@@ -217,4 +221,12 @@ public class TeacherAttendancesDto {
     public void setSignOutTime(Date signOutTime) {
         this.signOutTime = signOutTime;
     }
+
+	public TeacherAttendance getTeacherAttendance() {
+		return teacherAttendance;
+	}
+
+	public void setTeacherAttendance(TeacherAttendance teacherAttendance) {
+		this.teacherAttendance = teacherAttendance;
+	}
 }

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

@@ -96,6 +96,9 @@ public class Teacher extends SysUser {
 	@ApiModelProperty(value = "离职时间", required = false)
 	private Date demissionDate;
 	
+	@ApiModelProperty(value = "转正时间", required = false)
+	private Date formalStaffDate;
+	
 	@ApiModelProperty(value = "是否支持课程奖励规则活动", required = false)
 	private Boolean isSupportCourseScheduleRewardsRules;
 	
@@ -320,6 +323,14 @@ public class Teacher extends SysUser {
 		this.demissionDate = demissionDate;
 	}
 
+	public Date getFormalStaffDate() {
+		return formalStaffDate;
+	}
+
+	public void setFormalStaffDate(Date formalStaffDate) {
+		this.formalStaffDate = formalStaffDate;
+	}
+
 	public Boolean getIsSupportCourseScheduleRewardsRules() {
 		return isSupportCourseScheduleRewardsRules;
 	}

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java

@@ -2,6 +2,9 @@ package com.ym.mec.biz.dal.page;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.Date;
+
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.common.page.QueryInfo;
 
@@ -34,9 +37,21 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "状态(正常、旷课、请假、休学)",required = false)
     private StudentAttendanceStatusEnum status;
+    
+    @ApiModelProperty(value = "课程状态")
+    private CourseStatusEnum courseStatus;
 
     @ApiModelProperty(value = "过滤状态")
     private StudentAttendanceStatusEnum filterStatus;
+    
+    @ApiModelProperty(value = "课程开始时间")
+    private Date startDateOfCourse;
+    
+    @ApiModelProperty(value = "课程结束时间")
+    private Date endDateOfCourse;
+
+    @ApiModelProperty(value = "分部")
+    private String organId;
 
     public Long getCourseScheduleId() {
         return courseScheduleId;
@@ -109,4 +124,36 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     public void setStatus(StudentAttendanceStatusEnum status) {
         this.status = status;
     }
+
+	public CourseStatusEnum getCourseStatus() {
+		return courseStatus;
+	}
+
+	public void setCourseStatus(CourseStatusEnum courseStatus) {
+		this.courseStatus = courseStatus;
+	}
+
+	public Date getStartDateOfCourse() {
+		return startDateOfCourse;
+	}
+
+	public void setStartDateOfCourse(Date startDateOfCourse) {
+		this.startDateOfCourse = startDateOfCourse;
+	}
+
+	public Date getEndDateOfCourse() {
+		return endDateOfCourse;
+	}
+
+	public void setEndDateOfCourse(Date endDateOfCourse) {
+		this.endDateOfCourse = endDateOfCourse;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
 }

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

@@ -491,4 +491,14 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return
      */
     Map<String,Long> findClassCourseMinuteMap(List<Integer> classGroupIds,Map<String,Long> classCourseMinuteMap);
-}
+
+    /**
+     * 获取基础技能班/线上基础技能班数量和容许最大数量
+     * @param musicGroupId
+     * @param type
+     * @param subjectIds
+     * @return
+     */
+    HighClassGroupNumDto getSubjectMaxHighClassGroupNum(String musicGroupId,ClassGroupTypeEnum type,String subjectIds);
+
+    }

+ 15 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -4,7 +4,20 @@ import java.util.List;
 import java.util.Map;
 
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.dto.ConditionDto;
+import com.ym.mec.biz.dal.dto.MusicCardDto;
+import com.ym.mec.biz.dal.dto.MusicGroupStudentSignDto;
+import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
+import com.ym.mec.biz.dal.dto.Student4operating;
+import com.ym.mec.biz.dal.dto.StudentManageAccountBaseInfoDto;
+import com.ym.mec.biz.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
+import com.ym.mec.biz.dal.dto.StudentManageListDto;
+import com.ym.mec.biz.dal.dto.StudentManageVipGroupClassDto;
+import com.ym.mec.biz.dal.dto.StudentManageVipGroupDto;
+import com.ym.mec.biz.dal.dto.StudentRegisterPerDto;
+import com.ym.mec.biz.dal.dto.StudentVipDouble11Dto;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
@@ -193,5 +206,5 @@ public interface StudentManageService {
      * @param musicGroupPaymentCalenderId
      * @return
      */
-    List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId,String search,Integer subjectId);
+    List<BasicUserDto> queryCanAddStudent(String musicGroupId, String batchNo,String search,Integer subjectId);
 }

+ 0 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java

@@ -186,10 +186,4 @@ public interface TeacherAttendanceService extends BaseService<Long, TeacherAtten
 	 * @param teacherAttendanceId
 	 */
 	void rejectTeacherAttendanceComplaints(long teacherAttendanceId,String content);
-
-	/**
-	 * @author zouxuan
-	 * 考勤申述7天未处理默认同意
-	 */
-	void attendanceComplaintsAutoAffirmTask();
 }

+ 265 - 241
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -6,7 +6,6 @@ import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
 import static com.ym.mec.biz.dal.enums.GroupType.VIP;
 
-import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.time.Duration;
 import java.time.Instant;
@@ -27,20 +26,16 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import com.alibaba.fastjson.JSONArray;
 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.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.util.CollectionUtils;
 
 import com.alibaba.fastjson.JSON;
@@ -216,6 +211,17 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if (classGroup.getGroupType() == null) {
             throw new BizException("课程组类型不能为空");
         }
+
+        //基础技能班和线上基础技能班,可分班原则为声部人数/6向上取整
+        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) {
+            String subjectIds = classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) ? classGroup.getMemo() : classGroup.getSubjectIdList();
+            HighClassGroupNumDto highClassGroupNumDto = getSubjectMaxHighClassGroupNum(classGroup.getMusicGroupId(), classGroup.getType(), subjectIds);
+            if (highClassGroupNumDto.getNowHighClassGroupNum() >= highClassGroupNumDto.getMaxHighClassGroupNum()) {
+                String errMsg = classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) ? "线上基础技能班" : "基础技能班";
+                throw new BizException("此乐团所选声部," + errMsg + "数量不能大于" + highClassGroupNumDto.getMaxHighClassGroupNum());
+            }
+        }
+
         String userIds = classGroup.getUserIds();
 
         Set<String> userIdStrSet = new HashSet<String>();
@@ -360,7 +366,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ClassGroup addMixClassGroup(String musicGroupId, String name, String classGroupIds){
+    public ClassGroup addMixClassGroup(String musicGroupId, String name, String classGroupIds) {
         Date date;
         date = new Date();
 
@@ -571,7 +577,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             batchAddImGroup(classGroupImGroupList);
             classGroupTeacherMapperService.classGroupTeachersInsert(classGroupTeacherMapperList);
             // 检测新排课冲突
-            courseScheduleService.checkNewCourseSchedules(courseScheduleList, false,false);
+            courseScheduleService.checkNewCourseSchedules(courseScheduleList, false, false);
             courseScheduleDao.batchAddCourseSchedules(courseScheduleList);
         } finally {
             redisCache.releaseLocked(key, value);
@@ -594,7 +600,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             param.put("teacherId", queryInfo.getSearch());
             param.put("attendanceStatus", YesOrNoEnum.YES);
             Set<String> classGroupIds = dataList.stream().map(e -> e.getClassGroupIds()).collect(Collectors.toSet());
-            Map<Integer,Long> hasRestClassMap = MapUtil.convertIntegerMap(courseScheduleDao.queryHasReatClass(classGroupIds,queryInfo.getSearch()));
+            Map<Integer, Long> hasRestClassMap = MapUtil.convertIntegerMap(courseScheduleDao.queryHasReatClass(classGroupIds, queryInfo.getSearch()));
             int teacherPersonalAttendancesCount = teacherAttendanceDao.getTeacherPersonalAttendancesCount(param);
             dataList.forEach(e -> {
                 param.put("musicGroupId", e.getMusicGroupId());
@@ -732,8 +738,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                 for (TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary : teacherSalaryByUserIdAndType) {
                     if (teacherDefaultMusicGroupSalary.getCourseScheduleType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE) && teacherDefaultMusicGroupSalary.getSalaryRuleJson() != null) {
-                        if(studentNum>5){
-                            studentNum=Long.valueOf(5);
+                        if (studentNum > 5) {
+                            studentNum = Long.valueOf(5);
                         }
                         BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
                         teacherDefaultMusicGroupSalary.setMainTeacher30MinSalary(salary);
@@ -955,7 +961,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     if (musicGroup.getTeamTeacherId() != null && Integer.parseInt(e.getId()) == musicGroup.getTeamTeacherId()) {
                         e.setTitle("运营主管");
                     } else if (musicGroup.getEducationalTeacherId() != null && Integer.parseInt(e.getId()) == musicGroup.getEducationalTeacherId()) {
-                        e.setTitle("教务老师");
+                        e.setTitle("乐团主管");
                     } else if (musicGroup.getDirectorUserId() != null && Integer.parseInt(e.getId()) == musicGroup.getDirectorUserId()) {
                         e.setTitle("乐队指导");
                     } else if (courseScheduleTeacherSalaryDao.isTeacher(groupId, Integer.parseInt(e.getId()))) {
@@ -963,11 +969,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     }
                 } else {
                     if (groupType == PRACTICE && practiceGroup.getEducationalTeacherId() != null && Integer.parseInt(e.getId()) == practiceGroup.getEducationalTeacherId()) {
-                        e.setTitle("教务老师");
+                        e.setTitle("乐团主管");
                     } else if (groupType == VIP && vipGroup.getEducationalTeacherId() != null && Integer.parseInt(e.getId()) == vipGroup.getEducationalTeacherId()) {
-                        e.setTitle("教务老师");
+                        e.setTitle("乐团主管");
                     } else if (groupType == COMM && coursesGroup.getEducationalTeacherId() != null && Integer.parseInt(e.getId()) == coursesGroup.getEducationalTeacherId()) {
-                        e.setTitle("教务老师");
+                        e.setTitle("乐团主管");
                     } else if (courseScheduleTeacherSalaryDao.isTeacher(groupId, Integer.parseInt(e.getId()))) {
                         e.setTitle("指导老师");
                     }
@@ -1059,8 +1065,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
-                    if(studentNum>5){
-                        studentNum=5;
+                    if (studentNum > 5) {
+                        studentNum = 5;
                     }
                     BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
 
@@ -1089,108 +1095,108 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-	public boolean addStudentToClassGroupAndCourseArranging(Integer studentId, String classGroupIdListStr,
+    public boolean addStudentToClassGroupAndCourseArranging(Integer studentId, String classGroupIdListStr,
                                                             String batchNo,
-			List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList) {
+                                                            List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList) {
 
         //如果学员已经在某些班级,
-        Boolean isExistClassGroup = classGroupStudentMapperDao.existByClassGroupIds(classGroupIdListStr,studentId);
-        if(isExistClassGroup){
+        Boolean isExistClassGroup = classGroupStudentMapperDao.existByClassGroupIds(classGroupIdListStr, studentId);
+        if (isExistClassGroup) {
             return true;
         }
-		List<ClassGroup> classGroupList = classGroupDao.findClassGroupByIds(classGroupIdListStr);
-		if (classGroupList == null || classGroupList.size() == 0) {
-			throw new BizException("班级查询失败");
-		}
-
-		Date date = new Date();
-		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<CourseScheduleStudentPayment>();
-
-		// 计算单价
-		Map<CourseScheduleType, BigDecimal> unitPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-		Map<CourseScheduleType, BigDecimal> originUnitPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-		Map<CourseScheduleType, BigDecimal> totalCurrentPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-		Map<CourseScheduleType, BigDecimal> totalOriginPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-		for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList) {
-			unitPriceMap.put(
-					musicGroupPaymentCalenderCourseSettings.getCourseType(),
-					musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().divide(
-							new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()),CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_DOWN));
-			
-			originUnitPriceMap.put(
-					musicGroupPaymentCalenderCourseSettings.getCourseType(),
-					musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().divide(
-							new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()),CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_DOWN));
-			
-			totalCurrentPriceMap.put(musicGroupPaymentCalenderCourseSettings.getCourseType(), musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
-			totalOriginPriceMap.put(musicGroupPaymentCalenderCourseSettings.getCourseType(), musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice());
-		}
-		
-		Map<CourseScheduleType, BigDecimal> totalPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-		Map<CourseScheduleType, BigDecimal> totalOrignPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
-
-		BigDecimal unitPrice = new BigDecimal(0);
-		BigDecimal originUnitPrice = new BigDecimal(0);
-		CourseScheduleType courseType = null;
-		for (ClassGroup classGroup : classGroupList) {
-			// 1、增加班级人数
-			classGroupDao.addStudentNum(classGroup);
-
-			// 2、插入关联关系
-			ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
-			classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
-			classGroupStudentMapper.setClassGroupId(classGroup.getId());
-			classGroupStudentMapper.setUserId(studentId);
-			classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-			classGroupStudentMapper.setGroupType(classGroup.getGroupType());
-			classGroupStudentMapper.setCreateTime(date);
-			classGroupStudentMapperDao.insert(classGroupStudentMapper);
-
-			// 3、学生加入级未开始课程
-			List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
-			for (CourseSchedule courseSchedule : courseScheduleList) {
-				CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
-				courseScheduleStudentPayment.setCourseSchedule(courseSchedule);
-				courseScheduleStudentPayment.setGroupType(classGroup.getGroupType());
-				courseScheduleStudentPayment.setMusicGroupId(classGroup.getMusicGroupId());
-				courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
-				courseScheduleStudentPayment.setUserId(studentId);
-				courseScheduleStudentPayment.setBatchNo(batchNo);
-
-				unitPrice = unitPriceMap.get(courseSchedule.getType());
-				if (unitPrice != null) {
-					courseType = courseSchedule.getType();
-					BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime()));
-					courseScheduleStudentPayment.setExpectPrice(unitPrice.multiply(duration).setScale(2, BigDecimal.ROUND_DOWN));
-
-					if (totalPriceMap.containsKey(courseType)) {
-						totalPriceMap.put(courseType, totalPriceMap.get(courseType).add(courseScheduleStudentPayment.getExpectPrice()));
-					} else {
-						totalPriceMap.put(courseType, courseScheduleStudentPayment.getExpectPrice());
-					}
-				}
-				
-				originUnitPrice = originUnitPriceMap.get(courseSchedule.getType());
-				if (originUnitPrice != null) {
-					courseType = courseSchedule.getType();
-					BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime()));
-					courseScheduleStudentPayment.setOriginalPrice(originUnitPrice.multiply(duration).setScale(2, BigDecimal.ROUND_DOWN));
-
-					if (totalOrignPriceMap.containsKey(courseType)) {
-						totalOrignPriceMap.put(courseType, totalOrignPriceMap.get(courseType).add(courseScheduleStudentPayment.getOriginalPrice()));
-					} else {
-						totalOrignPriceMap.put(courseType, courseScheduleStudentPayment.getOriginalPrice());
-					}
-				}
-				courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
-				courseScheduleStudentPayment.setCreateTime(date);
-				courseScheduleStudentPayment.setUpdateTime(date);
-				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
-			}
+        List<ClassGroup> classGroupList = classGroupDao.findClassGroupByIds(classGroupIdListStr);
+        if (classGroupList == null || classGroupList.size() == 0) {
+            throw new BizException("班级查询失败");
+        }
+
+        Date date = new Date();
+        List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<CourseScheduleStudentPayment>();
+
+        // 计算单价
+        Map<CourseScheduleType, BigDecimal> unitPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+        Map<CourseScheduleType, BigDecimal> originUnitPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+        Map<CourseScheduleType, BigDecimal> totalCurrentPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+        Map<CourseScheduleType, BigDecimal> totalOriginPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+        for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList) {
+            unitPriceMap.put(
+                    musicGroupPaymentCalenderCourseSettings.getCourseType(),
+                    musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().divide(
+                            new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
+
+            originUnitPriceMap.put(
+                    musicGroupPaymentCalenderCourseSettings.getCourseType(),
+                    musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().divide(
+                            new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
+
+            totalCurrentPriceMap.put(musicGroupPaymentCalenderCourseSettings.getCourseType(), musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
+            totalOriginPriceMap.put(musicGroupPaymentCalenderCourseSettings.getCourseType(), musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice());
+        }
+
+        Map<CourseScheduleType, BigDecimal> totalPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+        Map<CourseScheduleType, BigDecimal> totalOrignPriceMap = new HashMap<CourseSchedule.CourseScheduleType, BigDecimal>();
+
+        BigDecimal unitPrice = new BigDecimal(0);
+        BigDecimal originUnitPrice = new BigDecimal(0);
+        CourseScheduleType courseType = null;
+        for (ClassGroup classGroup : classGroupList) {
+            // 1、增加班级人数
+            classGroupDao.addStudentNum(classGroup);
+
+            // 2、插入关联关系
+            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
+            classGroupStudentMapper.setClassGroupId(classGroup.getId());
+            classGroupStudentMapper.setUserId(studentId);
+            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMapper.setGroupType(classGroup.getGroupType());
+            classGroupStudentMapper.setCreateTime(date);
+            classGroupStudentMapperDao.insert(classGroupStudentMapper);
+
+            // 3、学生加入级未开始课程
+            List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
+            for (CourseSchedule courseSchedule : courseScheduleList) {
+                CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+                courseScheduleStudentPayment.setCourseSchedule(courseSchedule);
+                courseScheduleStudentPayment.setGroupType(classGroup.getGroupType());
+                courseScheduleStudentPayment.setMusicGroupId(classGroup.getMusicGroupId());
+                courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+                courseScheduleStudentPayment.setUserId(studentId);
+                courseScheduleStudentPayment.setBatchNo(batchNo);
+
+                unitPrice = unitPriceMap.get(courseSchedule.getType());
+                if (unitPrice != null) {
+                    courseType = courseSchedule.getType();
+                    BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime()));
+                    courseScheduleStudentPayment.setExpectPrice(unitPrice.multiply(duration).setScale(2, BigDecimal.ROUND_DOWN));
+
+                    if (totalPriceMap.containsKey(courseType)) {
+                        totalPriceMap.put(courseType, totalPriceMap.get(courseType).add(courseScheduleStudentPayment.getExpectPrice()));
+                    } else {
+                        totalPriceMap.put(courseType, courseScheduleStudentPayment.getExpectPrice());
+                    }
+                }
+
+                originUnitPrice = originUnitPriceMap.get(courseSchedule.getType());
+                if (originUnitPrice != null) {
+                    courseType = courseSchedule.getType();
+                    BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime()));
+                    courseScheduleStudentPayment.setOriginalPrice(originUnitPrice.multiply(duration).setScale(2, BigDecimal.ROUND_DOWN));
+
+                    if (totalOrignPriceMap.containsKey(courseType)) {
+                        totalOrignPriceMap.put(courseType, totalOrignPriceMap.get(courseType).add(courseScheduleStudentPayment.getOriginalPrice()));
+                    } else {
+                        totalOrignPriceMap.put(courseType, courseScheduleStudentPayment.getOriginalPrice());
+                    }
+                }
+                courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
+                courseScheduleStudentPayment.setCreateTime(date);
+                courseScheduleStudentPayment.setUpdateTime(date);
+                courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+            }
 
             //4、调整未上课课酬
             List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroup.getId());
-            if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)||classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && courseScheduleList.size() > 0) {
+            if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && courseScheduleList.size() > 0) {
                 Date nowDate = new Date();
                 List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
                 List<Long> courseScheduleIds = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
@@ -1204,12 +1210,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                         Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                         TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
 
-                        int studentNum = classGroup.getStudentNum()+1;
-                        if(studentNum>5){
-                            studentNum=5;
+                        int studentNum = classGroup.getStudentNum() + 1;
+                        if (studentNum > 5) {
+                            studentNum = 5;
                         }
 
-                        BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum+"");
+                        BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
 
                         CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                         courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -1227,36 +1233,36 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);
             }
 
-			// 5、加入班级群组
-			ImGroupMember[] imGroupMembers = new ImGroupMember[] { new ImGroupMember(studentId.toString()) };
-			imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
-
-		}
-
-		if (courseScheduleStudentPayments.size() > 0) {
-			// 排序
-			Collections.sort(courseScheduleStudentPayments);
-			List<CourseScheduleType> list = new ArrayList<CourseSchedule.CourseScheduleType>();
-			for (CourseScheduleStudentPayment courseScheduleStudentPayment : courseScheduleStudentPayments) {
-				courseType = courseScheduleStudentPayment.getCourseSchedule().getType();
-				if (!list.contains(courseType)) {
-					list.add(courseType);
-
-					// 修改第一节课的金额
-					courseScheduleStudentPayment.setExpectPrice(courseScheduleStudentPayment.getExpectPrice().add(
-							totalCurrentPriceMap.get(courseType).subtract(totalPriceMap.get(courseType))));
-					
-					courseScheduleStudentPayment.setOriginalPrice(courseScheduleStudentPayment.getOriginalPrice().add(
-							totalOriginPriceMap.get(courseType).subtract(totalOrignPriceMap.get(courseType))));
-				}
-			}
-			courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
-		}
-
-		return true;
-	}
-
-	@Override
+            // 5、加入班级群组
+            ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())};
+            imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+
+        }
+
+        if (courseScheduleStudentPayments.size() > 0) {
+            // 排序
+            Collections.sort(courseScheduleStudentPayments);
+            List<CourseScheduleType> list = new ArrayList<CourseSchedule.CourseScheduleType>();
+            for (CourseScheduleStudentPayment courseScheduleStudentPayment : courseScheduleStudentPayments) {
+                courseType = courseScheduleStudentPayment.getCourseSchedule().getType();
+                if (!list.contains(courseType)) {
+                    list.add(courseType);
+
+                    // 修改第一节课的金额
+                    courseScheduleStudentPayment.setExpectPrice(courseScheduleStudentPayment.getExpectPrice().add(
+                            totalCurrentPriceMap.get(courseType).subtract(totalPriceMap.get(courseType))));
+
+                    courseScheduleStudentPayment.setOriginalPrice(courseScheduleStudentPayment.getOriginalPrice().add(
+                            totalOriginPriceMap.get(courseType).subtract(totalOrignPriceMap.get(courseType))));
+                }
+            }
+            courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
+        }
+
+        return true;
+    }
+
+    @Override
     public List<ClassGroup> findNoClassSubjects(String musicGroupId) {
         return classGroupDao.findNoClassSubjects(musicGroupId);
     }
@@ -1505,8 +1511,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-	public boolean updateClassStudentNum(Integer classGroupId) {
-    	ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
+    public boolean updateClassStudentNum(Integer classGroupId) {
+        ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
         if (Objects.isNull(classGroup)) {
             throw new BizException("班级不存在");
         }
@@ -1517,9 +1523,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroupDao.update(classGroup);
 
         return true;
-	}
+    }
 
-	@Override
+    @Override
     public TeacherClassHeadInfo findTeacherClassGroupInfo(Integer classGroupId) {
         if (Objects.isNull(classGroupId)) {
             throw new BizException("请指定班级");
@@ -1609,9 +1615,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         truantStudent.addAll(leaveStudent);
         if (!CollectionUtils.isEmpty(truantStudent)) {
             CourseSchedule schedule = courseScheduleDao.get(courseScheduleId);
-            if(schedule.getGroupType() == MUSIC){
+            if (schedule.getGroupType() == MUSIC) {
                 Set<Long> collect = truantStudent.stream().map(e -> e.getStudentId()).collect(Collectors.toSet());
-                Map<Integer,String> paymentStatusMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryUserCoursePaymentStatus(collect,schedule.getMusicGroupId()));
+                Map<Integer, String> paymentStatusMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryUserCoursePaymentStatus(collect, schedule.getMusicGroupId()));
                 truantStudent.forEach(studentAttendanceViewDto -> {
                     studentAttendanceViewDto.setPaymentStatus(paymentStatusMap.get(studentAttendanceViewDto.getStudentId().intValue()));
                 });
@@ -1664,7 +1670,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ClassGroup classGroupAdjust(List<ClassGroup4MixDto> classGroup4MixDtos){
+    public ClassGroup classGroupAdjust(List<ClassGroup4MixDto> classGroup4MixDtos) {
         Date date = new Date();
         String musicGroupId = classGroup4MixDtos.get(0).getMusicGroupId();
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
@@ -1694,7 +1700,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
         String subjectNames = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
 
-        if(classGroup4MixDtos.get(0).getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)){
+        if (classGroup4MixDtos.get(0).getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
             teachMode = TeachModeEnum.ONLINE;
             List<String> studentNames = studentDao.getStudentNames(studentIdList);
             classGroup4MixDtos.get(0).setClassGroupName(subjectNames + "•" + StringUtils.join(studentNames, ","));
@@ -1747,7 +1753,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroup4MixDtos.get(0).getClassGroupTeacherMapperList();
 
         Set<Integer> noRepeatTeacherIds = classGroupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getUserId).collect(Collectors.toSet());
-        if(noRepeatTeacherIds.size()!=classGroupTeacherMapperList.size()){
+        if (noRepeatTeacherIds.size() != classGroupTeacherMapperList.size()) {
             throw new BizException("主教与助教存在冲突");
         }
 
@@ -1784,7 +1790,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
-            if(classGroup4MixDto.getCourseTimeDtoList() == null || classGroup4MixDto.getCourseTimeDtoList().size() == 0){
+            if (classGroup4MixDto.getCourseTimeDtoList() == null || classGroup4MixDto.getCourseTimeDtoList().size() == 0) {
                 break;
             }
             //5、插入班级排课信息
@@ -1792,13 +1798,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             long totalCourseDuration = 0;
 
-            if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
+            if (!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())) {
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
             Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
 //            classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
-            if(classGroup4MixDto.getCourseTimes()<=0){
+            if (classGroup4MixDto.getCourseTimes() <= 0) {
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
@@ -1831,7 +1837,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                     totalCourseDuration += classCourseDuration;
 
-                    if (totalCourseDuration>totalMinutes) {
+                    if (totalCourseDuration > totalMinutes) {
                         break WhileNode;
                     }
 
@@ -1855,7 +1861,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     courseSchedule.setOrganId(musicGroup.getOrganId());
                     if (classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.MIX)) {
                         courseSchedule.setName(classGroup4MixDto.getCourseType().getMsg());
-                    }else if(classGroup4MixDto.getCourseType().equals(CourseScheduleType.MUSIC_NETWORK)){
+                    } else if (classGroup4MixDto.getCourseType().equals(CourseScheduleType.MUSIC_NETWORK)) {
                         courseSchedule.setName(classGroup.getName());
                     } else {
                         courseSchedule.setName(subjectNames + "-" + classGroup4MixDto.getCourseType().getMsg());
@@ -1885,9 +1891,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             }
         }
 
-        if(courseScheduleList.size() > 0){
+        if (courseScheduleList.size() > 0) {
             //检测新排课冲突
-            courseScheduleService.checkNewCourseSchedules(courseScheduleList, false,false);
+            courseScheduleService.checkNewCourseSchedules(courseScheduleList, false, false);
         }
 
         //老师结算表
@@ -1902,7 +1908,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public List<CourseSchedule> getCourseSchedules(ClassGroup4MixDto classGroup4MixDto,List<CourseSchedule> courseScheduleList,MusicGroupStudentClassAdjust classAdjust){
+    public List<CourseSchedule> getCourseSchedules(ClassGroup4MixDto classGroup4MixDto, List<CourseSchedule> courseScheduleList, MusicGroupStudentClassAdjust classAdjust) {
         Date date = new Date();
         String musicGroupId = classGroup4MixDto.getMusicGroupId();
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
@@ -1911,7 +1917,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         TeachModeEnum teachMode = TeachModeEnum.OFFLINE;
         if (classGroup4MixDto.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) {
             teachMode = TeachModeEnum.ONLINE;
-        }else if(classGroup4MixDto.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)){
+        } else if (classGroup4MixDto.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
             teachMode = TeachModeEnum.ONLINE;
         }
 
@@ -1938,7 +1944,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         long classCourseDuration = Integer.parseInt(jsonObject.get(classGroup4MixDto.getCourseType().getCode()).toString());
 //
         Map<String, Integer> classCourseMinuteMap = JSON.parseObject(classCourseMinute, Map.class);
-        classGroup4MixDto.setCourseTimes(classCourseMinuteMap.get(classGroup4MixDto.getCourseType().getCode())/(int)classCourseDuration);
+        classGroup4MixDto.setCourseTimes(classCourseMinuteMap.get(classGroup4MixDto.getCourseType().getCode()) / (int) classCourseDuration);
 
         List<Integer> studentIdList = classGroup4MixDto.getStudents();
         List<StudentRegistration> studentList = studentRegistrationService.findStudentListByUserIdList(musicGroupId, studentIdList);
@@ -1992,7 +1998,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseSchedule.setClassGroupId(classGroup.getId());
                 if (classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.MIX)) {
                     courseSchedule.setName(classGroup4MixDto.getCourseType().getMsg());
-                }else if(classGroup4MixDto.getCourseType().equals(CourseScheduleType.MUSIC_NETWORK)){
+                } else if (classGroup4MixDto.getCourseType().equals(CourseScheduleType.MUSIC_NETWORK)) {
                     courseSchedule.setName(classGroup.getName());
                 } else {
                     courseSchedule.setName(subjectNames + "-" + classGroup4MixDto.getCourseType().getMsg());
@@ -2011,7 +2017,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public ClassGroup createClassGroup(ClassGroup4MixDto classGroup4MixDto){
+    public ClassGroup createClassGroup(ClassGroup4MixDto classGroup4MixDto) {
         Date date = new Date();
         String musicGroupId = classGroup4MixDto.getMusicGroupId();
         List<Integer> studentIdList = classGroup4MixDto.getStudents();
@@ -2025,7 +2031,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdList);
         String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
-            //1、新建班级
+        //1、新建班级
         ClassGroup classGroup = new ClassGroup();
         classGroup.setMusicGroupId(classGroup4MixDto.getMusicGroupId());
         classGroup.setSubjectIdList(subjectIds);
@@ -2044,22 +2050,22 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public List<CourseSchedule> autoAdjust(ClassGroup4MixDto classGroup4MixDto,List<CourseSchedule> courseScheduleList,MusicGroupStudentClassAdjust classAdjust){
+    public List<CourseSchedule> autoAdjust(ClassGroup4MixDto classGroup4MixDto, List<CourseSchedule> courseScheduleList, MusicGroupStudentClassAdjust classAdjust) {
         Boolean checkFlag = courseScheduleService.checkNewCourseSchedules(courseScheduleList, false, true);
-        if(!checkFlag){
+        if (!checkFlag) {
             //排课开始时间加一周
             Date stringToDate = DateUtil.stringToDate(classGroup4MixDto.getStartDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
-            classGroup4MixDto.setStartDate(DateUtil.format(DateUtil.addDays(stringToDate, 7),DateUtil.ISO_EXPANDED_DATE_FORMAT));
+            classGroup4MixDto.setStartDate(DateUtil.format(DateUtil.addDays(stringToDate, 7), DateUtil.ISO_EXPANDED_DATE_FORMAT));
             //再次尝试排课
-            courseScheduleList = getCourseSchedules(classGroup4MixDto,courseScheduleList,classAdjust);
-            autoAdjust(classGroup4MixDto,courseScheduleList,classAdjust);
+            courseScheduleList = getCourseSchedules(classGroup4MixDto, courseScheduleList, classAdjust);
+            autoAdjust(classGroup4MixDto, courseScheduleList, classAdjust);
         }
         return courseScheduleList;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ClassGroup classGroupAdjust2(ClassGroup4MixDto classGroup4MixDto){
+    public ClassGroup classGroupAdjust2(ClassGroup4MixDto classGroup4MixDto) {
         Date date = new Date();
         String musicGroupId = classGroup4MixDto.getMusicGroupId();
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
@@ -2085,7 +2091,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         JSONObject jsonObject = JSON.parseObject(classAdjust.getDefaultCourseTypeMinute());
         long classCourseDuration = Integer.parseInt(jsonObject.get(classGroup4MixDto.getCourseType().getCode()).toString());
         ClassGroup classGroup = classGroup4MixDto.getClassGroup();
-        if(classGroup == null){
+        if (classGroup == null) {
             //建班
             classGroup = createClassGroup(classGroup4MixDto);
             classGroup4MixDto.setClassGroup(classGroup);
@@ -2124,12 +2130,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
         //排课
         List<CourseSchedule> courseScheduleList = new ArrayList<>();
-        getCourseSchedules(classGroup4MixDto,courseScheduleList,classAdjust);
+        getCourseSchedules(classGroup4MixDto, courseScheduleList, classAdjust);
 
         //自动排课,校验冲突
-        if(courseScheduleList.size() > 0){
+        if (courseScheduleList.size() > 0) {
             //冲突校验
-            courseScheduleList = autoAdjust(classGroup4MixDto,courseScheduleList,classAdjust);
+            courseScheduleList = autoAdjust(classGroup4MixDto, courseScheduleList, classAdjust);
 
             List<Integer> allTeacherIds = classGroupTeacherMapperList.stream()
                     .map(ClassGroupTeacherMapper::getUserId)
@@ -2169,7 +2175,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             }
             Integer musicGroupStudentClassAdjustId = classGroup4MixDto.getMusicGroupStudentClassAdjustId();
             //学生结算表
-            courseScheduleStudentPaymentService.createForMusicGroup(courseScheduleList, studentIdList,musicGroupStudentClassAdjustId);
+            courseScheduleStudentPaymentService.createForMusicGroup(courseScheduleList, studentIdList, musicGroupStudentClassAdjustId);
             return classGroup;
         }
         return null;
@@ -2213,7 +2219,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 imFeignService.groupJoin(new ImGroupModel(classGroupId.toString(), imGroupMembers, classGroup.getName()));
             });
         }
-        if (Objects.nonNull(classGroup4MixDtos.get(0).getCourseAddType())&&classGroup4MixDtos.get(0).getCourseAddType().equals("onlyUpdateTeacher")) {
+        if (Objects.nonNull(classGroup4MixDtos.get(0).getCourseAddType()) && classGroup4MixDtos.get(0).getCourseAddType().equals("onlyUpdateTeacher")) {
             List<Integer> classGroupIds = new ArrayList<>();
             classGroupIds.add(classGroupId);
             // 删除历史记录
@@ -2237,7 +2243,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
 
-        Integer schoolId = teachMode.equals(TeachModeEnum.ONLINE)? null : musicGroup.getSchoolId();
+        Integer schoolId = teachMode.equals(TeachModeEnum.ONLINE) ? null : musicGroup.getSchoolId();
 
         List<Subject> subjectList = subjectService.findBySubjectByIdList(classGroup.getSubjectIdList());
 
@@ -2247,7 +2253,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<ClassGroupTeacherMapper> newClassGroupTeacherMapperList = classGroup4MixDtos.get(0).getClassGroupTeacherMapperList();
 
         Set<Integer> noRepeatTeacherIds = newClassGroupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getUserId).collect(Collectors.toSet());
-        if(noRepeatTeacherIds.size()!=newClassGroupTeacherMapperList.size()){
+        if (noRepeatTeacherIds.size() != newClassGroupTeacherMapperList.size()) {
             throw new BizException("主教与助教存在冲突");
         }
 
@@ -2301,14 +2307,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             //3、插入班级排课信息
             LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
 
-            if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
+            if (!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())) {
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
             Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
             long totalCourseDuration = 0;
 //            classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
-            if(classGroup4MixDto.getCourseTimes()<=0){
+            if (classGroup4MixDto.getCourseTimes() <= 0) {
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
@@ -2340,7 +2346,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                     totalCourseDuration += classCourseDuration;
 
-                    if (totalCourseDuration>totalMinutes) {
+                    if (totalCourseDuration > totalMinutes) {
                         break WhileNode;
                     }
 
@@ -2396,7 +2402,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 //        if (classGroup.getType().equals(ClassGroupTypeEnum.SNAP)) {
 //            courseScheduleService.checkSnapCourseShchedules(courseScheduleList);
 //        } else {
-        courseScheduleService.checkNewCourseSchedules(courseScheduleList, false,false);
+        courseScheduleService.checkNewCourseSchedules(courseScheduleList, false, false);
 //        }
 
         //老师结算表
@@ -2476,7 +2482,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroup4MixDtos.get(0).getClassGroupTeacherMapperList();
 
         Set<Integer> noRepeatTeacherIds = classGroupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getUserId).collect(Collectors.toSet());
-        if(noRepeatTeacherIds.size()!=classGroupTeacherMapperList.size()){
+        if (noRepeatTeacherIds.size() != classGroupTeacherMapperList.size()) {
             throw new BizException("主教与助教存在冲突");
         }
 
@@ -2515,14 +2521,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             //5、插入班级排课信息
             LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
 
-            if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
+            if (!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())) {
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
             Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
             long totalCourseDuration = 0;
 //            classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
-            if(classGroup4MixDto.getCourseTimes()<=0){
+            if (classGroup4MixDto.getCourseTimes() <= 0) {
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
@@ -2555,7 +2561,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                     totalCourseDuration += classCourseDuration;
 
-                    if (totalCourseDuration>totalMinutes) {
+                    if (totalCourseDuration > totalMinutes) {
                         break WhileNode;
                     }
 
@@ -2611,7 +2617,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
 //        courseScheduleService.checkSnapCourseShchedules(courseScheduleList);
 
-        courseScheduleService.checkNewCourseSchedules(courseScheduleList, false,false);
+        courseScheduleService.checkNewCourseSchedules(courseScheduleList, false, false);
 
         //老师结算表
         if (courseScheduleTeacherSalaryList.size() > 0) {
@@ -3233,13 +3239,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         return classGroup;
     }
 
-	@Override
-	public List<RemainCourseTypeDurationDto> queryRemainCourseTypeDuration(String classGroupIdList) {
-		return courseScheduleDao.queryRemainCourseTypeDuration(classGroupIdList);
-	}
+    @Override
+    public List<RemainCourseTypeDurationDto> queryRemainCourseTypeDuration(String classGroupIdList) {
+        return courseScheduleDao.queryRemainCourseTypeDuration(classGroupIdList);
+    }
 
     @Override
-    public Map<String,Integer> classGroupSubCourseNum(Integer classGroupId) {
+    public Map<String, Integer> classGroupSubCourseNum(Integer classGroupId) {
         return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
 
 //        List<Map<String,Object>> result = new ArrayList<>();
@@ -3259,43 +3265,43 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-    public Map<String,Object> getDefaultPaymentCalender(List<Integer> classGroupIds) {
-        if(classGroupIds == null || classGroupIds.size() == 0){
+    public Map<String, Object> getDefaultPaymentCalender(List<Integer> classGroupIds) {
+        if (classGroupIds == null || classGroupIds.size() == 0) {
             throw new BizException("参数校验失败");
         }
-        Map<String,Object> result = new HashMap<>();
-        Map<Integer,Map<String,MusicGroupOrganizationCourseSettingsDetail>> resultMap = new HashMap<>();
+        Map<String, Object> result = new HashMap<>();
+        Map<Integer, Map<String, MusicGroupOrganizationCourseSettingsDetail>> resultMap = new HashMap<>();
         //获取默认的排课时长
 //        JSONObject jsonObject = JSON.parseObject(classAdjust.getDefaultCourseTypeMinute());
 //        String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
 //        JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
         //获取所选班级最大剩余课时
-        Map<String,Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
+        Map<String, Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
         //获取分布默认的课程类型单价
         MusicGroup musicGroup = musicGroupDao.findByClassGroupId(classGroupIds.get(0));
-        Map<String,BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(),musicGroup.getOrganId()));
+        Map<String, BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(), musicGroup.getOrganId()));
         Set<String> courseTypes = map.keySet();
         Set<String> groupType = new HashSet<>();
         for (Integer classGroupId : classGroupIds) {
-            Map<String,MusicGroupOrganizationCourseSettingsDetail> courseMap = new HashMap<>();
+            Map<String, MusicGroupOrganizationCourseSettingsDetail> courseMap = new HashMap<>();
             //获取当前班级剩余课次
-            Map<String,Long> subCourseNumMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
+            Map<String, Long> subCourseNumMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
             for (String courseType : courseTypes) {
                 groupType.add(courseType);
                 Long currentNum = subCourseNumMap.get(courseType);
-                if(currentNum == null){
+                if (currentNum == null) {
                     currentNum = 0l;
                 }
                 Long maxNum = map.get(courseType);
                 //如果当前课程类型不需要新增缴费项目
-                if(currentNum >= maxNum){
+                if (currentNum >= maxNum) {
                     continue;
                 }
                 Long subNum = maxNum - currentNum;
                 //生成缴费项目
                 MusicGroupOrganizationCourseSettingsDetail settingsDetail = new MusicGroupOrganizationCourseSettingsDetail();
                 BigDecimal unitPrice = unitPriceMap.get(courseType);
-                if(unitPrice == null){
+                if (unitPrice == null) {
                     throw new BizException("分部默认课程类型单价不存在,请设置");
                 }
                 settingsDetail.setCourseTotalNum(subNum.intValue());
@@ -3304,30 +3310,30 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 //                settingsDetail.setCourseTotalMinuties(Integer.parseInt(jsonObject.get(courseType).toString()) * subNum.intValue());
 //                settingsDetail.setCourseCurrentPrice(unitPrice.multiply(new BigDecimal(settingsDetail.getCourseTotalMinuties())));
 //                settingsDetail.setCourseOriginalPrice(settingsDetail.getCourseCurrentPrice());
-                courseMap.put(courseType,settingsDetail);
+                courseMap.put(courseType, settingsDetail);
             }
-            resultMap.put(classGroupId,courseMap);
+            resultMap.put(classGroupId, courseMap);
         }
-        result.put("defaultPaymentCalender",resultMap);
-        result.put("groupTypeSet",groupType);
-        result.put("classMaxCourseNumMap",map);
+        result.put("defaultPaymentCalender", resultMap);
+        result.put("groupTypeSet", groupType);
+        result.put("classMaxCourseNumMap", map);
         return result;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String mergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto){
+    public String mergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
         List<Integer> classGroupIds = mergeClassSplitClassAffirmDto.getClassGroupIds();
-        if(classGroupIds == null || classGroupIds.size() == 0){
+        if (classGroupIds == null || classGroupIds.size() == 0) {
             throw new BizException("参数校验失败");
         }
         //班级信息
         List<ClassGroup4MixDto> classGroup4MixDtos = mergeClassSplitClassAffirmDto.getClassGroup4MixDtos();
-        if(CollectionUtils.isEmpty(classGroup4MixDtos)){
+        if (CollectionUtils.isEmpty(classGroup4MixDtos)) {
             throw new BizException("请填写班级信息");
         }
         List<Integer> studentIds = mergeClassSplitClassAffirmDto.getStudentIds();
-        if(CollectionUtils.isEmpty(studentIds)){
+        if (CollectionUtils.isEmpty(studentIds)) {
             throw new BizException("学员列表不可为空");
         }
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -3337,9 +3343,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         MusicGroupPaymentCalender.PaymentCalenderStatusEnum status = null;
         List<MusicGroupPaymentCalenderDto> paymentCalenderDtos = mergeClassSplitClassAffirmDto.getMusicGroupPaymentCalenderDtos();
         StringBuffer batchNos = new StringBuffer();
-        if(paymentCalenderDtos != null && paymentCalenderDtos.size() > 0){
+        if (paymentCalenderDtos != null && paymentCalenderDtos.size() > 0) {
             for (MusicGroupPaymentCalenderDto calenderDto : paymentCalenderDtos) {
-                if(status == null || status != AUDITING){
+                if (status == null || status != AUDITING) {
                     List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = calenderDto.getMusicGroupPaymentCalenderCourseSettingsList();
                     for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
                         OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
@@ -3359,12 +3365,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             List<String> batchNoList = new ArrayList<>();
             //创建缴费项目,  多个缴费项目分成多个批次号
             for (MusicGroupPaymentCalenderDto calenderDto : paymentCalenderDtos) {
-                if(batchNoList.size() > 0){
+                if (batchNoList.size() > 0) {
                     calenderDto.setIgnoreBatchNoList(batchNoList);
                 }
                 calenderDto.setMergeClassFlag(true);
                 musicGroupPaymentCalenderService.create(calenderDto);
-                if(batchNos.length() > 0){
+                if (batchNos.length() > 0) {
                     batchNos.append(",");
                 }
                 batchNoList.add(calenderDto.getBatchNo());
@@ -3381,28 +3387,28 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         musicGroupStudentClassAdjust.setClassGroupIds(JSON.toJSONString(classGroupIds));
         musicGroupStudentClassAdjust.setStudentIds(JSON.toJSONString(studentIds));
         List<Map<Integer, String>> classGroupStudents = mergeClassSplitClassAffirmDto.getClassGroupStudents();
-        if(classGroupStudents != null && classGroupStudents.size() > 0){
+        if (classGroupStudents != null && classGroupStudents.size() > 0) {
             musicGroupStudentClassAdjust.setClassGroupStudents(JSON.toJSONString(mergeClassSplitClassAffirmDto.getClassGroupStudents()));
         }
 
         //获取需要冻结的课程
-        List<Long> allLockCourseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds,null);
+        List<Long> allLockCourseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, null);
         musicGroupStudentClassAdjust.setAllLockCourseIds(JSON.toJSONString(allLockCourseIds));
         //获取需要删除的学员关联的课程
-        List<Long> courseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds,studentIds);
+        List<Long> courseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
         musicGroupStudentClassAdjust.setSubLockCourseIds(JSON.toJSONString(courseIds));
-        List<Long> studentPaymentIds = courseScheduleStudentPaymentDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds,studentIds);
+        List<Long> studentPaymentIds = courseScheduleStudentPaymentDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
 
         musicGroupStudentClassAdjust.setStudentPaymentIds(JSON.toJSONString(studentPaymentIds));
         //保存老师选择的课程时长
         musicGroupStudentClassAdjust.setDefaultCourseTypeMinute(JSON.toJSONString(mergeClassSplitClassAffirmDto.getClassCourseMinuteMap()));
         //计算新增班级的可排课时长,总课次*默认时长  (用学员剩余的课程时长加上购买的时长,可能导致同一班级学员时长不一致)
-        musicGroupStudentClassAdjust.setClassCourseMinute(JSON.toJSONString(findClassCourseMinuteMap(classGroupIds,mergeClassSplitClassAffirmDto.getClassCourseMinuteMap())));
+        musicGroupStudentClassAdjust.setClassCourseMinute(JSON.toJSONString(findClassCourseMinuteMap(classGroupIds, mergeClassSplitClassAffirmDto.getClassCourseMinuteMap())));
         musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
         //如果需要审核,校验参数配置
         checkMergeClassSplitClassAffirmParam(mergeClassSplitClassAffirmDto);
         //如果缴费项目不需要审核,那么生成班级以及课表
-        if(status == null || status != AUDITING){
+        if (status == null || status != AUDITING) {
             //每种课程类型单独进行排课
             ClassGroup classGroup = null;
             for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
@@ -3412,18 +3418,18 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 classGroup = classGroupService.classGroupAdjust2(classGroup4MixDto);
             }
             //排课完成后删除所选课程
-            courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds,studentIds);
+            courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
             //删除班级关联的学员
-            if(classGroupStudents != null && classGroupStudents.size() > 0){
+            if (classGroupStudents != null && classGroupStudents.size() > 0) {
                 for (Map<Integer, String> classGroupStudent : classGroupStudents) {
                     Set<Integer> integers = classGroupStudent.keySet();
                     for (Integer integer : integers) {
-                        classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer,classGroupStudent.get(integer));
+                        classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer, classGroupStudent.get(integer));
                     }
                 }
             }
             List<Long> delCourseIds = courseScheduleDao.findNoStudentCourseIds(courseIds);
-            if(delCourseIds != null && delCourseIds.size() > 0){
+            if (delCourseIds != null && delCourseIds.size() > 0) {
                 //删除课程
                 courseScheduleDao.deleteCourseSchedulesByClassGroupIds(delCourseIds);
                 //删除教师考勤
@@ -3432,41 +3438,41 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
             }
             return "学员班级调整完成";
-        }else {
+        } else {
             //冻结班级
-            classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds,1);
+            classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 1);
             //冻结所选班级的课程
-            courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds,1);
+            courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds, 1);
             return "学员班级调整申请已提交,缴费项目审核中";
         }
     }
 
-    public void checkMergeClassSplitClassAffirmParam(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto){
+    public void checkMergeClassSplitClassAffirmParam(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
         ClassGroup4MixDto classGroup4MixDto = mergeClassSplitClassAffirmDto.getClassGroup4MixDtos().get(0);
         if (classGroup4MixDto.getCourseTimes().compareTo(0) <= 0) {
             throw new BizException("排课次数必须大于0");
         }
         List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroup4MixDto.getClassGroupTeacherMapperList();
-        if(classGroupTeacherMapperList == null || classGroupTeacherMapperList.size() == 0){
+        if (classGroupTeacherMapperList == null || classGroupTeacherMapperList.size() == 0) {
             throw new BizException("请设置上课老师");
         }
         Set<Integer> noRepeatTeacherIds = classGroupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getUserId).collect(Collectors.toSet());
-        if(noRepeatTeacherIds.size()!=classGroupTeacherMapperList.size()){
+        if (noRepeatTeacherIds.size() != classGroupTeacherMapperList.size()) {
             throw new BizException("主教与助教存在冲突");
         }
         //所选班级不能有未开始的临时合并课程
         List<Integer> classGroupIds = mergeClassSplitClassAffirmDto.getClassGroupIds();
-        if(classGroupIds == null || classGroupIds.size() == 0){
+        if (classGroupIds == null || classGroupIds.size() == 0) {
             throw new BizException("请填写班级信息");
         }
         //所选班级列表,是否包含已冻结的班级
         List<ClassGroup> lockClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds, 1);
-        if(lockClassGroupIds != null && lockClassGroupIds.size() > 0){
+        if (lockClassGroupIds != null && lockClassGroupIds.size() > 0) {
             throw new BizException("所选班级包含审核中的学员班级调整申请");
         }
         //所选班级不能有未开始的临时合并课程
         int courseNum = courseScheduleDao.findNoStartMasterCourseNum(classGroupIds);
-        if(courseNum > 0){
+        if (courseNum > 0) {
             throw new BizException("所选班级不能有未开始的临时合并课程");
         }
         List<Integer> allTeacherIds = classGroupTeacherMapperList.stream()
@@ -3500,18 +3506,36 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-    public Map<String,Long> findClassCourseMinuteMap(List<Integer> classGroupIds,Map<String,Long> classCourseMinuteMap){
-        Map<String,Long> resultMap = new HashMap<>();
+    public Map<String, Long> findClassCourseMinuteMap(List<Integer> classGroupIds, Map<String, Long> classCourseMinuteMap) {
+        Map<String, Long> resultMap = new HashMap<>();
         //获取默认的排课时长
 //        String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
 //        JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
         //获取所选班级最大剩余课时
-        Map<String,Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
+        Map<String, Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
         Set<String> courseTypes = map.keySet();
         for (String courseType : courseTypes) {
 //            剩余时长*默认排课时长
-            resultMap.put(courseType,classCourseMinuteMap.get(courseType) * map.get(courseType));
+            resultMap.put(courseType, classCourseMinuteMap.get(courseType) * map.get(courseType));
         }
         return resultMap;
     }
+
+    @Override
+    public HighClassGroupNumDto getSubjectMaxHighClassGroupNum(String musicGroupId, ClassGroupTypeEnum type, String subjectIds) {
+        //基础技能班和线上基础技能班,可分班原则为声部人数/6向上取整
+        String[] subjectIdArr = subjectIds.split(",");
+        List<String> subjectIdList = Arrays.asList(subjectIdArr);
+        if (subjectIdList.contains("14") || subjectIdList.contains("15")) {
+            subjectIds += ",14,15";
+        }
+        HighClassGroupNumDto highClassGroupNumDto = new HighClassGroupNumDto();
+        int nowClassGroupNum = classGroupDao.getMusicGroupHighClassNumBySubject(musicGroupId, subjectIds, type);
+        int subjectStudentNum = studentRegistrationDao.getMusicGroupSubjectStudentNum(musicGroupId, subjectIds);
+        int maxClassGroupNum = subjectStudentNum / 6;
+        maxClassGroupNum += (subjectStudentNum % 6) > 0 ? 1 : 0;
+        highClassGroupNumDto.setNowHighClassGroupNum(nowClassGroupNum);
+        highClassGroupNumDto.setMaxHighClassGroupNum(maxClassGroupNum);
+        return highClassGroupNumDto;
+    }
 }

+ 37 - 27
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -86,7 +86,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     private CourseScheduleDao courseScheduleDao;
     @Autowired
     private ClassGroupDao classGroupDao;
-    
+
     @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 
@@ -104,7 +104,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean delClassGroupStudent(Integer userId, Integer classGroupId,Boolean quitMusicGroup) {
+    public boolean delClassGroupStudent(Integer userId, Integer classGroupId, Boolean quitMusicGroup) {
         ClassGroup classGroup = classGroupService.get(classGroupId);
         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupId);
         /*if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
@@ -131,9 +131,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
         if (courseScheduleList.size() > 0) {
 
-            List<Long> tempMergedCourseIdList = courseScheduleList.stream().map(CourseSchedule :: getId).collect(Collectors.toList());
-            if(tempMergedCourseIdList != null && tempMergedCourseIdList.size() > 0){
-            	courseScheduleStudentPaymentDao.deleteStudentCourseSchedule(userId, tempMergedCourseIdList);
+            List<Long> tempMergedCourseIdList = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+            if (tempMergedCourseIdList != null && tempMergedCourseIdList.size() > 0) {
+                courseScheduleStudentPaymentDao.deleteStudentCourseSchedule(userId, tempMergedCourseIdList);
             }
         }
 
@@ -153,8 +153,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
-                    if(studentNum>5){
-                        studentNum=5;
+                    if (studentNum > 5) {
+                        studentNum = 5;
                     }
                     BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
 
@@ -321,8 +321,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
-                    if(studentNum>5){
-                        studentNum=5;
+                    if (studentNum > 5) {
+                        studentNum = 5;
                     }
                     BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
 
@@ -342,7 +342,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);
 
             List<Integer> studentIds = userIdStrSet.stream().map(e -> Integer.parseInt(e)).collect(Collectors.toList());
-            studentDao.updateStudentServiceTag(null,studentIds, YesOrNoEnum.YES.getCode());
+            studentDao.updateStudentServiceTag(null, studentIds, YesOrNoEnum.YES.getCode());
         }
 
         //乐团在合奏班
@@ -381,11 +381,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds) {
         ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId.intValue());
-        if(Objects.isNull(classGroup)){
+        if (Objects.isNull(classGroup)) {
             throw new BizException("班级信息错误");
         }
 
-        if(ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())){
+        if (ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())) {
             String subjectName = classGroup.getName().split("•")[0];
             List<String> studentNames = studentDao.getStudentNames(new ArrayList<>(studentIds));
             classGroup.setName(subjectName + "•" + studentNames);
@@ -399,15 +399,25 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         Set<Integer> addStudentIds;
         Set<Integer> removeStudentIds;
 
-        if(!CollectionUtils.isEmpty(studentIds)){
+        if (!CollectionUtils.isEmpty(studentIds)) {
             allStudentIds = studentIds;
         }
 
-        if(!CollectionUtils.isEmpty(classGroupStudents)){
+        if (!CollectionUtils.isEmpty(classGroupStudents)) {
             oldStudentIds = classGroupStudents.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
             oldNormalStudentIds = classGroupStudents.stream().filter(s -> ClassGroupStudentStatusEnum.NORMAL.equals(s.getStatus())).map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
         }
 
+        //线上基础技能班,原始分班人数不能小于3人大于6人
+        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) {
+            if (studentIds.size() < 3 && oldNormalStudentIds.size() <= 0) {
+                throw new BizException("线上基础技能班人数不能小于3人");
+            }
+            if (studentIds.size() > 6) {
+                throw new BizException("线上基础技能班人数不能大于6人");
+            }
+        }
+
         Set<Integer> repeatStudentIds = allStudentIds.stream().filter(oldNormalStudentIds::contains).collect(Collectors.toSet());
         addStudentIds = allStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
         removeStudentIds = oldNormalStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
@@ -415,24 +425,24 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         List<ClassGroupStudentMapper> needUpdateClassGroupStudents = new ArrayList<>();
 
         for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
-            if(addStudentIds.contains(classGroupStudent.getUserId())&&!classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.NORMAL)){
+            if (addStudentIds.contains(classGroupStudent.getUserId()) && !classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.NORMAL)) {
                 classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-            }else if(removeStudentIds.contains(classGroupStudent.getUserId())&&!classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){
+            } else if (removeStudentIds.contains(classGroupStudent.getUserId()) && !classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
                 classGroupStudent.setStatus(ClassGroupStudentStatusEnum.QUIT);
-            }else{
+            } else {
                 continue;
             }
             needUpdateClassGroupStudents.add(classGroupStudent);
         }
 
-        if(!CollectionUtils.isEmpty(needUpdateClassGroupStudents)){
+        if (!CollectionUtils.isEmpty(needUpdateClassGroupStudents)) {
             classGroupStudentMapperDao.batchUpdate(needUpdateClassGroupStudents);
         }
 
         Date now = new Date();
         List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
         for (Integer addStudentId : addStudentIds) {
-            if(oldStudentIds.contains(addStudentId)){
+            if (oldStudentIds.contains(addStudentId)) {
                 continue;
             }
             ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
@@ -452,11 +462,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         classGroupService.updateClassStudentNum(classGroupId.intValue(), allStudentIds.size());
 
         List<CourseSchedule> classGroupNotStartCourse = courseScheduleDao.findCoursesByClassGroupId(classGroupId.intValue(), CourseStatusEnum.NOT_START);
-        if(CollectionUtils.isEmpty(classGroupNotStartCourse)){
+        if (CollectionUtils.isEmpty(classGroupNotStartCourse)) {
             return;
         }
 
-        if(ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())){
+        if (ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())) {
             for (CourseSchedule courseSchedule : classGroupNotStartCourse) {
                 courseSchedule.setName(classGroup.getName());
             }
@@ -467,7 +477,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
         //4、调整未上课课酬
         List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroupId.intValue());
-        if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)||classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && classGroupNotStartCourse.size() > 0) {
+        if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && classGroupNotStartCourse.size() > 0) {
             Date nowDate = new Date();
             List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
             List<Long> courseScheduleIds = classGroupNotStartCourse.stream().map(CourseSchedule::getId).collect(Collectors.toList());
@@ -482,11 +492,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
 
                     int studentNum = studentIds.size();
-                    if(studentNum>5){
-                        studentNum=5;
+                    if (studentNum > 5) {
+                        studentNum = 5;
                     }
 
-                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum+"");
+                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                     courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -504,7 +514,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);
         }
 
-        if(!CollectionUtils.isEmpty(removeStudentIds)){
+        if (!CollectionUtils.isEmpty(removeStudentIds)) {
             courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, new ArrayList<>(removeStudentIds));
             List<ImGroupMember> imGroupMemberList = new ArrayList<>();
             for (Integer addStudentId : addStudentIds) {
@@ -515,7 +525,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             imFeignService.groupQuit(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
         }
 
-        if(!CollectionUtils.isEmpty(addStudentIds)){
+        if (!CollectionUtils.isEmpty(addStudentIds)) {
             courseScheduleStudentPaymentService.createForMusicGroup(classGroup.getMusicGroupId(), classGroupNotStartCourse, new ArrayList<>(addStudentIds));
             List<ImGroupMember> imGroupMemberList = new ArrayList<>();
             for (Integer addStudentId : addStudentIds) {

+ 64 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -6,32 +6,38 @@ import static com.ym.mec.biz.dal.enums.GroupType.VIP;
 import static com.ym.mec.biz.dal.enums.PracticeGroupType.CHARGE;
 import static com.ym.mec.biz.dal.enums.PracticeGroupType.FREE;
 import static com.ym.mec.biz.dal.enums.PracticeGroupType.TRIAL;
-import static java.math.BigDecimal.ONE;
 
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.enums.*;
-import com.ym.mec.biz.event.source.CourseEventSource;
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.tomcat.jni.Local;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -70,7 +76,9 @@ import com.ym.mec.biz.dal.dao.VipGroupDao;
 import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto;
+import com.ym.mec.biz.dal.dto.CourseMergeDto;
 import com.ym.mec.biz.dal.dto.CoursePostponeDto;
+import com.ym.mec.biz.dal.dto.CourseRepeatCheckDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleRateDto;
@@ -93,10 +101,49 @@ import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
 import com.ym.mec.biz.dal.entity.CourseGenerateDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.biz.dal.entity.CourseScheduleAuditDetailDto;
+import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
+import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.biz.dal.entity.CourseScheduleReview;
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
+import com.ym.mec.biz.dal.entity.CoursesGroup;
+import com.ym.mec.biz.dal.entity.CoursesGroupModifyLog;
+import com.ym.mec.biz.dal.entity.Group;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.PracticeGroup;
+import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.entity.StudentAttendance;
+import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
+import com.ym.mec.biz.dal.entity.Subject;
+import com.ym.mec.biz.dal.entity.SysConfig;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.entity.TeacherAttendance;
+import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
+import com.ym.mec.biz.dal.entity.TeacherDefaultPracticeGroupSalary;
+import com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary;
+import com.ym.mec.biz.dal.entity.VipGroup;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.GroupStatusEnum;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.ParamEnum;
+import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
+import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.biz.dal.enums.TeachTypeEnum;
+import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
+import com.ym.mec.biz.event.source.CourseEventSource;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
 import com.ym.mec.biz.service.CourseHomeworkService;
@@ -399,7 +446,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Override
 	public boolean enableIgnoreAttendanceTime(Date startClassTime, Integer teacherId, Integer schoolId) {
 		CourseSchedule prevCourse = courseScheduleDao.getTeacherAttendanceCourseBeforeStartTime(startClassTime, teacherId);
-		if(Objects.isNull(prevCourse)){
+		if(Objects.isNull(prevCourse)||Objects.isNull(prevCourse.getSchoolId())){
 			return false;
 		}
 		if(!schoolId.equals(prevCourse.getSchoolId())){
@@ -4291,6 +4338,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
                 if (courseTime.getDayOfWeek() == i) {
                     String dateYmdStr = DateUtil.dateToString(calendar.getTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
+                    if(StringUtils.isBlank(courseTime.getStartClassTime())){
+                    	throw new BizException("排课循环周期错误");
+					}
                     dateYmdStr = dateYmdStr + " " + courseTime.getStartClassTime();
                     Date courseStartTime = DateUtil.stringToDate(dateYmdStr, "yyyy-MM-dd HH:mm");
                     if(excludePastCourse&&courseStartTime.before(now)){
@@ -4335,10 +4385,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             results = courseScheduleDao.endFindCourseSchedules(params);
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             //Map<Long, String> studentIdMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.getStudentIdMap(courseScheduleIds));
-            //List<Integer> teacherIds=results.stream().filter(t->Objects.nonNull(t.getActualTeacherId())).map(CourseSchedule::getActualTeacherId).collect(Collectors.toList());
+            List<Integer> teacherIds=results.stream().filter(t->Objects.nonNull(t.getActualTeacherId())).map(CourseSchedule::getActualTeacherId).collect(Collectors.toList());
 
-            //List<Map<Integer, String>> nameIdMaps = teacherDao.queryNameByIdList(teacherIds);
-            //Map<Integer, String> nameIdMap=MapUtil.convertIntegerMap(nameIdMaps);
+            List<Map<Integer, String>> nameIdMaps = teacherDao.queryNameByIdList(teacherIds);
+            Map<Integer, String> nameIdMap=MapUtil.convertIntegerMap(nameIdMaps);
 
 			//List<Map<Long, String>> coursesSettlementTimeMaps = courseScheduleTeacherSalaryDao.getCoursesSettlementTime(courseScheduleIds);
 			//Map<Long, String> coursesSettlementTimeMap = MapUtil.convertIntegerMap(coursesSettlementTimeMaps);
@@ -4362,7 +4412,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             Map<Integer, String> classGroupSubjectNameMap = MapUtil.convertIntegerMap(classGroupSubjectNameMaps);
 			for (CourseScheduleEndDto result : results) {
 				result.setTeacher(null);
-				//result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
+				result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
 				result.setSubjectName(classGroupSubjectNameMap.get(result.getId()));
 				//result.setStudentId(studentIdMap.get(result.getId()));
 				//result.setPracticeGroup(idPracticeMap.get(Long.valueOf(result.getMusicGroupId())));

+ 91 - 35
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -144,6 +144,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                         courseScheduleTeacherSalary.setExpectSalary(offlineTeacherSalary);
                     }
                 }
+                courseScheduleTeacherSalary.setActualSalary(null);
                 if (Objects.isNull(courseScheduleTeacherSalary.getId())) {
                     courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
                 } else {
@@ -232,12 +233,12 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())){
                 //异常签到
                 int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignInTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
-                int signCourseTimeBetween = signCourseTimeBetweenSeconds/60;
-                if(signCourseTimeBetween<1&&signCourseTimeBetween>-3){
+                float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
+                if(signCourseTimeBetween<=1&&signCourseTimeBetween>-3){
                     //课程开始前1分钟至开始后3分钟进入教室
-                    deductCost = deductCost.add(new BigDecimal(50));
-                    deductReasons.add("课程开始前1分钟至开始后3分钟进入教室扣除50元");
-                }else if(signCourseTimeBetween<-3){
+                    deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
+                    deductReasons.add("课程开始前1分钟至开始后3分钟进入教室扣除一半课酬");
+                }else if(signCourseTimeBetween<=-3){
                     //课程开始后3分钟后进入教室
                     deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
                     deductReasons.add("课程开始后3分钟进入教室扣除全部课酬");
@@ -245,25 +246,22 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }
 
             if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignOutStatus())){
-                //未签退扣除一半课酬
-                deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
-                deductReasons.add("未签退扣除一半课酬");
+                //未签退扣除全部课酬
+                deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
+                deductReasons.add("未签退扣除全部课酬");
             }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignOutStatus())){
                 //异常签退
-                int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
-                float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
-
                 int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getEndClassTime());
                 float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
 
-                if(signCourseTimeBetween<=20&&signOutCourseTimeBetween>3){
+                if(signOutCourseTimeBetween>3){
                     //课程开始前20分钟至开始后3分钟退出教室
                     deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
-                    deductReasons.add("课程开始前20分钟至开始后3分钟退出教室扣除全部课酬");
+                    deductReasons.add("课程结束前3分钟之前退出教室扣除全部课酬");
                 }else if(signOutCourseTimeBetween<=3&&signOutCourseTimeBetween>0){
                     //课程结束前3分钟后至课程结束前退出教室
-                    deductCost = deductCost.add(new BigDecimal(50));
-                    deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除50元");
+                    deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
+                    deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除一半课酬");
                 }
             }
 
@@ -274,7 +272,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalary.setDeductionReason(StringUtils.join(deductReasons, ";"));
             }
 
-            courseScheduleTeacherSalary.setActualSalary(finalSalary);
+            courseScheduleTeacherSalary.setActualSalary(finalSalary.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:finalSalary);
             courseScheduleTeacherSalary.setSettlementTime(now);
             courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
         });
@@ -348,8 +346,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
                 if(signCourseTimeBetween<=1&&signCourseTimeBetween>-3){
                     //课程开始前1分钟至开始后3分钟进入教室
-                    deductCost = deductCost.add(new BigDecimal(50));
-                    deductReasons.add("课程开始前1分钟至开始后3分钟进入教室扣除50元");
+                    deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
+                    deductReasons.add("课程开始前1分钟至开始后3分钟进入教室扣除一半课酬");
                 }else if(signCourseTimeBetween<=-3){
                     //课程开始后3分钟后进入教室
                     deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
@@ -364,25 +362,22 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }
 
             if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignOutStatus())){
-                //未签退扣除一半课酬
-                deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
-                deductReasons.add("未签退扣除一半课酬");
+                //未签退扣除全部课酬
+                deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
+                deductReasons.add("未签退扣除全部课酬");
             }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignOutStatus())){
                 //异常签退
-                int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
-                float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
-
                 int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getEndClassTime());
                 float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
 
-                if(signCourseTimeBetween<=20&&signOutCourseTimeBetween>3){
+                if(signOutCourseTimeBetween>3){
                     //课程开始前20分钟至开始后3分钟退出教室
                     deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary());
-                    deductReasons.add("课程开始前20分钟至开始后3分钟退出教室扣除全部课酬");
+                    deductReasons.add("课程结束前3分钟之前退出教室扣除全部课酬");
                 }else if(signOutCourseTimeBetween<=3&&signOutCourseTimeBetween>0){
                     //课程结束前3分钟后至课程结束前退出教室
-                    deductCost = deductCost.add(new BigDecimal(50));
-                    deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除50元");
+                    deductCost = deductCost.add(courseScheduleTeacherSalary.getExpectSalary().divide(new BigDecimal(2)));
+                    deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除一半课酬");
                 }
 
                 if(TeachModeEnum.OFFLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
@@ -399,7 +394,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
             BigDecimal finalSalary = courseScheduleTeacherSalary.getExpectSalary().subtract(deductCost).setScale(BigDecimal.ZERO.intValue(), BigDecimal.ROUND_HALF_UP);
 
-            courseScheduleTeacherSalary.setActualSalary(finalSalary);
+            courseScheduleTeacherSalary.setActualSalary(finalSalary.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:finalSalary);
             courseScheduleTeacherSalary.setSettlementTime(now);
             courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
         });
@@ -464,15 +459,15 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                         || CourseSchedule.CourseScheduleType.HIGH.equals(c.getType()))
                 .map(CourseSchedule::getId).collect(Collectors.toList());
 
-        List<StudentAttendance> studentAttendances = null;
+        List<CourseScheduleStudentPayment> studentAttendances = null;
         if(!CollectionUtils.isEmpty(needStudentAttendanceCourseScheduleIds)){
-            studentAttendances = studentAttendanceDao.findByCourseIds(needStudentAttendanceCourseScheduleIds);
+            studentAttendances = courseScheduleStudentPaymentDao.findByCourseScheduleIds(needStudentAttendanceCourseScheduleIds);
         }
         Map<Long, Long> courseNormalStudentsMap = new HashMap<>();
         if(!CollectionUtils.isEmpty(studentAttendances)){
             courseNormalStudentsMap =studentAttendances.stream()
 //                    .filter(studentAttendance -> StudentAttendanceStatusEnum.NORMAL.equals(studentAttendance.getStatus()))
-                    .collect(Collectors.groupingBy(StudentAttendance::getCourseScheduleId, Collectors.counting()));
+                    .collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId, Collectors.counting()));
         }
 
         //课程对应乐团结算方式集合
@@ -522,6 +517,66 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 if(Objects.isNull(teacherSalary)){
                     teacherSalary = BigDecimal.ZERO;
                 }
+
+                //扣除费用
+                BigDecimal deductCost = new BigDecimal(0);
+                List<String> deductReasons = new ArrayList<>();
+                deductReasons.add("课程应到人数:" + normalStudentNum);
+                List<TeacherAttendance> courseTeacherAttendances = teacherCourseAttendanceMap.get(org.apache.commons.lang3.StringUtils.joinWith(":", courseScheduleTeacherSalary.getCourseScheduleId(), courseScheduleTeacherSalary.getUserId()));
+
+                TeacherAttendance teacherAttendance = courseTeacherAttendances.get(0);
+                if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignInStatus())){
+                    //未签到扣除全部课酬
+                    deductCost = deductCost.add(teacherSalary);
+                    deductReasons.add("未签到扣除全部课酬");
+                }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())){
+                    //异常签到
+                    int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignInTime(), courseSchedule.getStartClassTime());
+                    float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
+                    if(signCourseTimeBetween<=1&&signCourseTimeBetween>-3){
+                        //课程开始前1分钟至开始后3分钟进入教室
+                        deductCost = deductCost.add(teacherSalary.divide(new BigDecimal(2)));
+                        deductReasons.add("课程开始前1分钟至开始后3分钟进入教室扣除一半课酬");
+                    }else if(signCourseTimeBetween<=-3){
+                        //课程开始后3分钟后进入教室
+                        deductCost = deductCost.add(teacherSalary);
+                        deductReasons.add("课程开始后3分钟进入教室扣除全部课酬");
+                    }
+                }
+
+                if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignOutStatus())){
+                    //未签退扣除一半课酬
+                    deductCost = deductCost.add(teacherSalary.divide(new BigDecimal(2)));
+                    deductReasons.add("未签退扣除一半课酬");
+                }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignOutStatus())){
+                    //异常签退
+                    int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseSchedule.getEndClassTime());
+                    float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
+
+                    if(signOutCourseTimeBetween>3){
+                        //课程开始前20分钟至开始后3分钟退出教室
+                        deductCost = deductCost.add(teacherSalary);
+                        deductReasons.add("课程结束前3分钟之前退出教室扣除全部课酬");
+                    }else if(signOutCourseTimeBetween<=3&&signOutCourseTimeBetween>0){
+                        //课程结束前3分钟后至课程结束前退出教室
+                        deductCost = deductCost.add(teacherSalary.divide(new BigDecimal(2)));
+                        deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除一半课酬");
+                    }
+                }
+
+                BigDecimal finalSalary = teacherSalary.subtract(deductCost).setScale(BigDecimal.ZERO.intValue(), BigDecimal.ROUND_HALF_UP);
+
+                if(BigDecimal.ZERO.compareTo(deductCost)<0){
+                    deductReasons.add("扣除总费用:" + deductCost);
+                }
+                courseScheduleTeacherSalary.setDeductionReason(org.apache.commons.lang3.StringUtils.join(deductReasons, ";"));
+
+                //更新教师结算信息
+                courseScheduleTeacherSalary.setActualSalary(finalSalary.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:finalSalary);
+                courseScheduleTeacherSalary.setSettlementTime(now);
+                courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
+
+                continue;
             }else if(CourseSchedule.CourseScheduleType.HIGH.equals(courseSchedule.getType())){
                 //根据课程类型获取对应的默认课酬设置列表
                 List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalariesWithCourseType = teacherDefaultMusicGroupSalariesGroupByCourseType.get(courseSchedule.getType());
@@ -611,11 +666,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())){
                 int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignInTime(), courseSchedule.getStartClassTime());
                 float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
-                if(signCourseTimeBetween>=0&&signCourseTimeBetween<20){
+                if(signCourseTimeBetween>0&&signCourseTimeBetween<=20){
                     //未提前20分钟打卡扣除50元
                     deductCost = deductCost.add(new BigDecimal(50));
                     deductReasons.add("未提前20分钟打卡扣除50元");
-                }else if(signCourseTimeBetween<0&&signCourseTimeBetween>-30){
+                }else if(signCourseTimeBetween<=0&&signCourseTimeBetween>-30){
                     //迟到30分钟内扣除一半课酬
                     deductCost = deductCost.add(teacherSalary.divide(new BigDecimal(2)));
                     deductReasons.add("迟到30分钟内扣除一半课酬");
@@ -642,7 +697,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     //早退
                     deductCost = deductCost.add(teacherSalary);
                     deductReasons.add("早退扣除全部课酬");
-                }else if((signOutCourseTimeBetween<=3&&signOutCourseTimeBetween>0)||signOutCourseTimeBetween<3600){
+                }else if((signOutCourseTimeBetween<=3&&signOutCourseTimeBetween>0)||signOutCourseTimeBetween<=3600){
                     //异常签退,扣除50元
                     deductCost = deductCost.add(new BigDecimal(50));
                     deductReasons.add("异常签退,扣除50元");
@@ -1191,6 +1246,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             t.setTeacherRole(courseScheduleTeacherSalary.getTeacherRole());
             if(idTeacherAttendanceMap.containsKey(t.getTeacherId())){
                 TeacherAttendance teacherAttendance = idTeacherAttendanceMap.get(t.getTeacherId());
+                t.setTeacherAttendance(teacherAttendance);
                 t.setSignInTime(teacherAttendance.getSignInTime());
                 t.setSignInStatus(Objects.nonNull(teacherAttendance.getSignInStatus())?(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())?SignInStatusEnum.UNUSUAL:SignInStatusEnum.NORMAL):SignInStatusEnum.NO);
                 t.setSignOutTime(teacherAttendance.getSignOutTime());

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

@@ -4,6 +4,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_P
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -277,6 +278,13 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			throw new BizException("当前缴费状态不能添加学生");
 		}
 		
+		//判断学生是否已存在
+		Set<Integer> userList = musicGroupPaymentCalenderDetailDao.queryStudentIds(musicGroupPaymentCalenderId);
+
+		if(Collections.disjoint(userList, userIdList) == false){
+			throw new BizException("操作失败:包含已存在的学员");
+		}
+		
 		List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
 		
 		BigDecimal totalPrice = new BigDecimal(0);
@@ -316,7 +324,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
 			for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
-				userMap.put(cd.getUserId(), musicGroupPaymentCalenderDetail);
+				userMap.put(cd.getUserId(), cd);
 			}
 		}
 		//更新预计缴费人数
@@ -356,6 +364,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void batchAdd(String batchNo, List<Integer> userIdList) {
 		
 		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
@@ -376,6 +385,13 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 				throw new BizException("当前缴费状态不能添加学生");
 			}
 			
+			//判断学生是否已存在
+			Set<Integer> userList = musicGroupPaymentCalenderDetailDao.queryStudentIds(musicGroupPaymentCalenderId);
+
+			if(Collections.disjoint(userList, userIdList) == false){
+				throw new BizException("操作失败:包含已存在的学员");
+			}
+			
 			List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
 			
 			BigDecimal totalPrice = new BigDecimal(0);
@@ -416,7 +432,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			if (musicGroupPaymentCalenderDetailList.size() > 0) {
 				musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
 				for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
-					userMap.put(cd.getUserId(), musicGroupPaymentCalenderDetail);
+					userMap.put(cd.getUserId(), cd);
 				}
 			}
 			//更新预计缴费人数

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -858,6 +858,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_PAYMENT_DETAIL, receivers, null, 0,
 						null, null, calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate(),
 						maps.get(e));
+				Map<Integer, String> receivers1 = new HashMap<>(1);
+				receivers1.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherId().toString());
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_PAYMENT_DETAIL, receivers, null, 0,
+						null, "SYSTEM", calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate(),
+						maps.get(e));
 			});
 		}
 		// 获取离截止还有指定时间的缴费项,并发送推送消息给指定老师
@@ -872,6 +877,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				receivers.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherPhone());
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_PAYMENT_CREATE, receivers, null, 0,
 						null, null, calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate());
+				Map<Integer, String> receivers1 = new HashMap<>(1);
+				receivers1.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherId().toString());
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_PAYMENT_CREATE, receivers, null, 0,
+						null, "SYSTEM", calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate());
 			});
 		}
 
@@ -883,6 +892,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				receivers.put(e.getTeacherId(), e.getTeacherPhone());
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_PAYMENT_CREATE, receivers, null, 0,
 						null, null, e.getMusicGroupName(), e.getPaymentValidStartDate(), e.getPaymentValidEndDate());
+				Map<Integer, String> receivers1 = new HashMap<>(1);
+				receivers1.put(e.getTeacherId(), e.getTeacherId().toString());
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_PAYMENT_CREATE, receivers, null, 0,
+						null, "SYSTEM", e.getMusicGroupName(), e.getPaymentValidStartDate(), e.getPaymentValidEndDate());
 			});
 		}
 	}

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

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.service.SysConfigService;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -683,7 +684,7 @@ public class StudentManageServiceImpl implements StudentManageService {
     }
 
     @Override
-    public List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId,String search,Integer subjectId) {
-        return studentManageDao.queryCanAddStudent(musicGroupId, musicGroupPaymentCalenderId,search,subjectId);
+    public List<BasicUserDto> queryCanAddStudent(String musicGroupId, String batchNo,String search,Integer subjectId) {
+        return studentManageDao.queryCanAddStudent(musicGroupId, batchNo,search,subjectId);
     }
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -262,7 +262,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
 
                     BigDecimal hasRouteSellOrderActualAmount = BigDecimal.ZERO;
                     for (SellOrder sellOrder : sellOrderList) {
-                        if (!goodsMap.getKey().equals(sellOrder.getParentGoodsId().toString()) && !goodsMap.getKey().equals(sellOrder.getGoodsId().toString())) {
+                        if (Integer.valueOf(goodsMap.getKey()).equals(sellOrder.getParentGoodsId()) && !Integer.valueOf(goodsMap.getKey()).equals(sellOrder.getGoodsId())) {
                             continue;
                         }
                         BigDecimal sellOrderActualAmount = BigDecimal.ZERO;

+ 4 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -188,7 +188,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				if(!isInScore){
 					teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
 				}
-			}else if(date.compareTo(add20Minutes) > 0||date.compareTo(add60Minutes) < 0){
+			}else if(date.compareTo(add20Minutes) > 0){
 				if(StringUtils.isEmpty(teacherAttendance.getRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
 					//当前为异常签到,请填写原因!
 					result.put("status",2);
@@ -382,7 +382,9 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
 			teacherAttendance.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
 			Date add1Minutes = DateUtil.addMinutes(classStartDateTime, -1);
-			if(yesOrNoEnum != YesOrNoEnum.YES && DateUtil.minutesBetween(date,add1Minutes) <= 0){
+			int secondsBetween = DateUtil.secondsBetween(date, add1Minutes);
+
+			if(yesOrNoEnum != YesOrNoEnum.YES && secondsBetween <= 60){
 				teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
 			}
 			teacherAttendanceDao.update(teacherAttendance);
@@ -826,17 +828,4 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			throw new BizException("操作失败: 当前申述状态不允许该操作");
 		}
 	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void attendanceComplaintsAutoAffirmTask() {
-		String affirmDay = sysConfigDao.findConfigValue("attendance_complaints_auto_affirm_day");
-		if(StringUtils.isEmpty(affirmDay)){
-			affirmDay = "7";
-		}
-		List<TeacherAttendance> teacherAttendances = teacherAttendanceDao.queryAttendanceComplaintsAutoAffirmList(affirmDay);
-		teacherAttendances.forEach(e->{
-			agreeTeacherAttendanceComplaints(1,1,e.getId(),"系统自动审核通过");
-		});
-	}
 }

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -41,6 +41,9 @@ import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -1906,6 +1909,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<String, Object> pauseInfos = new HashMap<>();
 		//学生剩余课时
         List<StudentCourseInfoDto> userSurplusCourseInfoByGroup = courseScheduleDao.findUserSurplusCourseInfoByGroup(GroupType.VIP, vipGroupId.toString(), studentId);
+
+		int days = 0;
+        if(!CollectionUtils.isEmpty(userSurplusCourseInfoByGroup)){
+        	LocalDate nowDate = LocalDate.now(DateUtil.zoneId);
+			StudentCourseInfoDto studentCourseInfoDto = userSurplusCourseInfoByGroup.stream().max(Comparator.comparing(StudentCourseInfoDto::getClassDate)).get();
+			days = (int) nowDate
+					.until((LocalDateTime.ofInstant(studentCourseInfoDto.getClassDate().toInstant(), DateUtil.zoneId).toLocalDate()), ChronoUnit.DAYS);
+		}
         int[] teachModeSequence=new int[userSurplusCourseInfoByGroup.size()];
         List<BigDecimal> coursePrices = new ArrayList<>();
         List<Long> courseScheduleIds=new ArrayList<>();
@@ -1916,6 +1927,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
         pauseInfos.put("teaChModeSequence", teachModeSequence);
         pauseInfos.put("coursePriceInfo",coursePrices);
+        pauseInfos.put("days", days);
 
         StudentPauseInfo  studentPauseInfo=new StudentPauseInfo();
 		studentPauseInfo.setUserId(studentId);
@@ -2051,6 +2063,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				}
 				newCourseSchedules.get(i).setOrganId(vipGroup.getOrganId());
 			}
+
+			if(courseInfo1.containsKey("days")){
+				int surplusDays = Integer.valueOf(courseInfo1.get("days").toString());
+				LocalDate nowDate = LocalDate.now();
+				CourseSchedule courseSchedule = newCourseSchedules.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
+				int days = (int) nowDate.until(LocalDateTime.ofInstant(courseSchedule.getClassDate().toInstant(), DateUtil.zoneId), ChronoUnit.DAYS);
+				if(days>surplusDays){
+					throw new BizException("您必须在{}天内完成剩余课程", surplusDays);
+				}
+			}
+
 			courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
 
 			ClassGroupTeacherMapper oldClassGroupTeacherMapper = classGroupTeacherMapperDao.findByClassGroupAndTeacher(classGroup.getId(),oldTeacherId);
@@ -2152,6 +2175,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
 		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
 		studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
+
+		if(courseInfo.containsKey("days")){
+			int surplusDays = Integer.valueOf(courseInfo.get("days").toString());
+			studentRecoverInfoDto.setExpireDate(LocalDate.now().plusDays(surplusDays));
+		}
 		return studentRecoverInfoDto;
     }
 

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

@@ -1325,4 +1325,11 @@
             AND cg.group_type_ = #{groupType}
         </if>
     </select>
+
+    <!-- 获取乐团某声部基础技能班或基础技能提高班数量 -->
+    <select id="getMusicGroupHighClassNumBySubject" resultType="int">
+        SELECT COUNT(*) FROM class_group WHERE music_group_id_=#{musicGroupId}
+        AND type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND del_flag_ = '0'
+        AND INTE_ARRAY(subject_id_list_,#{subjectIds})
+    </select>
 </mapper>

+ 49 - 18
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -31,6 +31,7 @@
         <result column="teacher_name_" property="courseSchedule.teacherName"/>
         <result column="teach_mode_" property="courseSchedule.teachMode"/>
         <result column="course_type_" property="courseSchedule.type"/>
+        <result column="course_status_" property="courseSchedule.status"/>
         <result column="current_schedule_id_" property="courseSchedule.id"/>
         <result column="course_schedule_name_" property="courseSchedule.name"/>
         <result column="class_date_" property="courseSchedule.classDate"/>
@@ -483,67 +484,97 @@
     </select>
     
     <select id="findStudentAttendance" resultMap="StudentAttendance">
-        SELECT sa.*,su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,
-        cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ 
-        FROM student_attendance sa
-        LEFT JOIN sys_user su ON sa.user_id_ = su.id_
-        left join course_schedule cs on cs.id_ = sa.course_schedule_id_
+        SELECT cssp.course_schedule_id_,cssp.user_id_,cssp.group_type_,cssp.music_group_id_,sa.sign_in_time_,sa.sign_out_time_,sa.status_,
+        su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,cs.status_ course_status_,
+        cs.actual_teacher_id_ teacher_id_,cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ 
+        FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
+        left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
+        LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         left join sys_user tu on tu.id_ = cs.actual_teacher_id_
         left join organization o on o.id_ = cs.organ_id_
         <where>
         	<if test="courseScheduleId != null">
-        		sa.course_schedule_id_ = #{courseScheduleId}
+        		cssp.course_schedule_id_ = #{courseScheduleId}
         	</if>
         	<if test="search != null">
-        		sa.course_schedule_id_ = #{search}
+        		and cssp.course_schedule_id_ = #{search}
         	</if>
         	<if test="studentID != null">
-        		and sa.user_id_ = #{studentID}
+        		and cssp.user_id_ = #{studentID}
+        	</if>
+        	<if test="startDateOfCourse != null">
+        		and cs.class_date_ &gt;= #{startDateOfCourse}
+        	</if>
+        	<if test="endDateOfCourse != null">
+        		and cs.class_date_ &lt;= #{endDateOfCourse}
         	</if>
         	<if test="courseScheduleType != null">
         		and cs.type_ = #{courseScheduleType}
         	</if>
         	<if test="teacherId != null">
-        		and sa.teacher_id_ = #{teacherId}
+        		and cs.actual_teacher_id_ = #{teacherId}
+        	</if>
+        	<if test="courseStatus != null">
+        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="status != null">
         		and sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="groupType != null">
-        		and sa.group_type_ = #{groupType}
+        		and cssp.group_type_ = #{groupType}
         	</if>
         	<if test="musicGroupId != null">
-        		and sa.music_group_id_ = #{musicGroupId}
+        		and cssp.music_group_id_ = #{musicGroupId}
         	</if>
+            <if test="organId != null and organId != ''">
+                AND FIND_IN_SET(cs.organ_id_,#{organId})
+            </if>
         </where>
-        ORDER BY sa.id_ DESC
+        ORDER BY cs.id_ asc
         <include refid="global.limit"/>
     </select>
     
     <select id="countStudentAttendance" resultType="java.lang.Integer">
-        SELECT COUNT(sa.id_) FROM student_attendance sa left join course_schedule cs on sa.course_schedule_id_ = cs.id_
+        SELECT count(cssp.id_) 
+        FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
+        left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
         <where>
         	<if test="courseScheduleId != null">
-        		sa.course_schedule_id_ = #{courseScheduleId}
+        		cssp.course_schedule_id_ = #{courseScheduleId}
+        	</if>
+        	<if test="search != null">
+        		and cssp.course_schedule_id_ = #{search}
         	</if>
         	<if test="studentID != null">
-        		and sa.user_id_ = #{studentID}
+        		and cssp.user_id_ = #{studentID}
+        	</if>
+        	<if test="startDateOfCourse != null">
+        		and cs.class_date_ &gt;= #{startDateOfCourse}
+        	</if>
+        	<if test="endDateOfCourse != null">
+        		and cs.class_date_ &lt;= #{endDateOfCourse}
         	</if>
         	<if test="courseScheduleType != null">
         		and cs.type_ = #{courseScheduleType}
         	</if>
         	<if test="teacherId != null">
-        		and sa.teacher_id_ = #{teacherId}
+        		and cs.actual_teacher_id_ = #{teacherId}
+        	</if>
+        	<if test="courseStatus != null">
+        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="status != null">
         		and sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="groupType != null">
-        		and sa.group_type_ = #{groupType}
+        		and cssp.group_type_ = #{groupType}
         	</if>
         	<if test="musicGroupId != null">
-        		and sa.music_group_id_ = #{musicGroupId}
+        		and cssp.music_group_id_ = #{musicGroupId}
         	</if>
+            <if test="organId != null and organId != ''">
+                AND FIND_IN_SET(cs.organ_id_,#{organId})
+            </if>
         </where>
     </select>
     <select id="findByCourseId" resultMap="StudentAttendance">

+ 7 - 5
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -775,14 +775,15 @@
         </foreach>
 		GROUP BY sr.user_id_
     </select>
+    
     <select id="queryCanAddStudent" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
-        SELECT su.id_ user_id_,su.username_,su.phone_,s.name_ subject_name_ FROM music_group_payment_calender mgpc
-        LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
+        select su.id_ user_id_,su.username_,su.phone_,s.name_ subject_name_ from student_registration sr 
         LEFT JOIN sys_user su ON su.id_ = sr.user_id_
         LEFT JOIN `subject` s ON s.id_ = sr.subject_id_
-        WHERE mgpc.id_ = #{musicGroupPaymentCalenderId} AND mgpc.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ = 'NORMAL' AND sr.user_id_ NOT IN (
-        SELECT DISTINCT user_id_ FROM music_group_payment_calender_detail
-        WHERE music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId})
+        where sr.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ = 'NORMAL' AND sr.user_id_ NOT IN (
+        SELECT DISTINCT mgpcd.user_id_ FROM music_group_payment_calender_detail mgpcd left join music_group_payment_calender mgpc on mgpcd.music_group_payment_calender_id_ = mgpc.id_
+        WHERE mgpc.batch_no_ = #{batchNo} and mgpc.music_group_id_ = #{musicGroupId}
+        )
         <if test="search != null and search != ''">
             AND (sr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
         </if>
@@ -790,6 +791,7 @@
             AND sr.subject_id_ = #{subjectId}
         </if>
     </select>
+    
     <select id="queryHasCourseMap" resultType="java.util.Map">
         SELECT su.id_ 'key',COUNT(DISTINCT su.id_) 'value' FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = su.id_

+ 6 - 3
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -96,7 +96,10 @@
                 fee_flag_ = #{feeFlag},
             </if>
                 user_id_ = #{userId},
-            <if test="schoolId != null">
+            <if test="schoolId != null and schoolId==999999999">
+                school_id_ = null,
+            </if>
+            <if test="schoolId != null and schoolId!=999999999">
                 school_id_ = #{schoolId},
             </if>
             <if test="transNo != null">
@@ -338,7 +341,7 @@
         	<if test="type != null and type != ''">
         		and
         		<if test="type == 'SERVICE'">
-        			(spro.service_amount_ is not null and spro.service_amount_ &gt; 0) 
+        			(spro.service_amount_ is not null and spro.service_amount_ &gt; 0)
         		</if>
         		<if test="type == 'SELL'">
         			(spro.sale_amount_ is not null and spro.sale_amount_ &gt; 0)
@@ -367,7 +370,7 @@
         	<if test="type != null and type != ''">
         		and
         		<if test="type == 'SERVICE'">
-        			(spro.service_amount_ is not null and spro.service_amount_ &gt; 0) 
+        			(spro.service_amount_ is not null and spro.service_amount_ &gt; 0)
         		</if>
         		<if test="type == 'SELL'">
         			(spro.sale_amount_ is not null and spro.sale_amount_ &gt; 0)

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

@@ -612,7 +612,7 @@
         UPDATE sys_user SET real_name_ = #{realName},id_card_no_=#{idCardNo} WHERE id_=#{id}
     </update>
     <update id="updateCurrentClass" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
-        UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.update_time_ = NOW()
+        UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.current_grade_date_= NOW(),sr.update_time_ = NOW()
         WHERE sr.user_id_ = #{userId}
     </update>
 
@@ -702,4 +702,10 @@
     <select id="getNoPaymentStudent" resultMap="StudentRegistration">
         SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND payment_status_ IN (0,1)
     </select>
+
+    <!-- 获取乐团声部学生数量 -->
+    <select id="getMusicGroupSubjectStudentNum" resultType="int">
+        SELECT COUNT(*) FROM student_registration WHERE music_group_id_=#{musicGroupId}
+        AND INTE_ARRAY(actual_subject_id_,#{subjectIds}) AND music_group_status_ = 'NORMAL'
+    </select>
 </mapper>

+ 0 - 5
mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml

@@ -572,11 +572,6 @@
         WHERE ta.current_schedule_id_ = #{currentScheduleId} AND ta.teacher_id_ = #{userId}
         AND ta.sign_in_time_ IS NOT NULL ORDER BY ta.sign_in_time_ ASC LIMIT 1
     </select>
-    <select id="queryAttendanceComplaintsAutoAffirmList" resultMap="TeacherAttendance">
-        SELECT * FROM teacher_attendance
-        WHERE complaints_status_ = 2 AND TIMESTAMPDIFF(DAY,complaints_time_,NOW()) >= #{affirmDay}
-    </select>
-
     <update id="updateViPSignOutStatus" parameterType="string">
     	UPDATE teacher_attendance SET sign_out_status_ = 1,sign_out_time_= now()
     	WHERE FIND_IN_SET(course_schedule_id_,#{courseScheduleIdList}) AND sign_in_status_ = 1

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

@@ -22,6 +22,7 @@
         <result column="subject_id_" property="subjectId"/>
         <result column="entry_date_" property="entryDate"/>
         <result column="demission_date_" property="demissionDate"/>
+        <result column="formal_staff_date_" property="formalStaffDate"/>
         <result column="certificate_type_" property="certificateType"/>
         <result column="certificate_num_" property="certificateNum"/>
         <result column="flow_organ_range_" property="flowOrganRange"/>
@@ -112,7 +113,7 @@
     <select id="get" resultMap="Teacher">
         SELECT t.id_,t.organ_id_ teacher_organ_id_,t.job_type_,t.job_nature_,t.is_probation_period_,t.education_background_,t.graduate_school_,t.graduate_school_,
         t.technical_titles_,t.work_unit_,t.subject_id_,t.entry_date_,t.certificate_type_,t.certificate_num_,t.flow_organ_range_,t.update_time_,
-        t.create_time_,t.introduction_,t.demission_date_,t.is_support_course_schedule_rewards_rules_,t.is_support_extra_practice_lesson_,
+        t.create_time_,t.introduction_,t.demission_date_,t.formal_staff_date_,t.is_support_course_schedule_rewards_rules_,t.is_support_extra_practice_lesson_,
         t.lecture_num_,t.idcard_front_img_,t.idcard_back_img_,t.idcard_hand_img_,t.memo_,
         su.real_name_,su.id_card_no_,su.password_,su.salt_,su.phone_,su.avatar_,
         su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
@@ -137,8 +138,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO teacher
-        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_extra_practice_lesson_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_,memo_)
-        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportExtraPracticeLesson},#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg},#{memo})
+        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,formal_staff_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_extra_practice_lesson_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_,memo_)
+        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{formalStaffDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportExtraPracticeLesson},#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg},#{memo})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -156,9 +157,7 @@
             <if test="lectureNum != null">
                 lecture_num_ = #{lectureNum},
             </if>
-            <if test="memo != null">
                 memo_ = #{memo},
-            </if>
             <if test="graduateSchool != null">
                 graduate_school_ = #{graduateSchool},
             </if>
@@ -174,9 +173,8 @@
             <if test="entryDate != null">
                 entry_date_ = #{entryDate},
             </if>
-            <if test="demissionDate != null">
                 demission_date_ = #{demissionDate},
-            </if>
+                formal_staff_date_ = #{formalStaffDate},
             <if test="jobType != null">
                 job_type_ = #{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -295,7 +293,7 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="Teacher" parameterType="map">
         SELECT t.id_,su.real_name_,su.lock_flag_,t.subject_id_,su.phone_,t.organ_id_ teacher_organ_id_,t.organ_id_,t.is_support_extra_practice_lesson_,
-        t.job_nature_,t.is_probation_period_,t.memo_,GROUP_CONCAT(s.name_) subject_name_,su.del_flag_
+        t.job_nature_,t.demission_date_,t.formal_staff_date_,t.is_probation_period_,t.memo_,GROUP_CONCAT(s.name_) subject_name_,su.del_flag_
         FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
         LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)

+ 0 - 4
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -13,10 +13,6 @@ public interface TaskRemoteService {
 	// 教师异常考勤推送
 	public void pushTeacherExceptionAttendanceTask();
 
-	@GetMapping(value = "task/attendanceComplaintsAutoAffirmTask")
-	// 考勤申述7天未处理默认同意
-	public void attendanceComplaintsAutoAffirmTask();
-
 	@GetMapping(value = "task/updateMusicGroupStudentFeeStatus")
 	// 更新学员缴费状态(新)
 	public void updateMusicGroupStudentFeeStatus();

+ 0 - 5
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -157,11 +157,6 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 	}
 
 	@Override
-	public void attendanceComplaintsAutoAffirmTask() {
-		logger.info("考勤申述系统自动处理");
-	}
-
-	@Override
 	public void updateMusicGroupStudentFeeStatus() {
 		logger.info("更新乐团学员缴费状态失败");
 	}

+ 0 - 19
mec-task/src/main/java/com/ym/mec/task/jobs/AttendanceComplaintsAutoAffirmTask.java

@@ -1,19 +0,0 @@
-package com.ym.mec.task.jobs;
-
-import com.ym.mec.task.TaskRemoteService;
-import com.ym.mec.task.core.BaseTask;
-import com.ym.mec.task.core.TaskException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AttendanceComplaintsAutoAffirmTask extends BaseTask {
-
-	@Autowired
-	private TaskRemoteService taskRemoteService;
-
-	@Override
-	public void execute() throws TaskException {
-		taskRemoteService.attendanceComplaintsAutoAffirmTask();
-	}
-}

+ 9 - 1
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/provider/JiguangPushPlugin.java

@@ -127,7 +127,7 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 				base64_auth_string = encryptBASE64(this.teacherAppKey + ":" + this.teacherMasterSecret);
 				break;
 			default:
-				base64_auth_string = encryptBASE64(this.systemAppKey + ":" + this.systemMasterSecret);
+				base64_auth_string = encryptBASE64(this.studentAppKey + ":" + this.studentMasterSecret);
 				break;
 		}
 		String authorization = "Basic " + base64_auth_string;
@@ -215,10 +215,18 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 		this.teacherMasterSecret = teacherMasterSecret;
 	}
 
+	public String getSystemAppKey() {
+		return systemAppKey;
+	}
+
 	public void setSystemAppKey(String systemAppKey) {
 		this.systemAppKey = systemAppKey;
 	}
 
+	public String getSystemMasterSecret() {
+		return systemMasterSecret;
+	}
+
 	public void setSystemMasterSecret(String systemMasterSecret) {
 		this.systemMasterSecret = systemMasterSecret;
 	}

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

@@ -1,5 +1,7 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -22,10 +24,6 @@ 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.dto.ClassGroup4MixDto;
-import com.ym.mec.biz.dal.dto.HighClassGroupDto;
-import com.ym.mec.biz.dal.dto.MergeClassSplitClassAffirmDto;
-import com.ym.mec.biz.dal.dto.TestDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
@@ -57,7 +55,7 @@ public class ClassGroupController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryPage')")
     public HttpResponseResult<PageInfo<ClassGroup>> queryPage(ClassGroupQueryInfo queryInfo) {
-    	queryInfo.setDelFlag(0);
+        queryInfo.setDelFlag(0);
         return succeed(classGroupService.queryPage(queryInfo));
     }
 
@@ -152,8 +150,8 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "乐团所有班级列表")
     @GetMapping("/findAllClassGroupByMusicGroup")
     @PreAuthorize("@pcs.hasPermissions('classGroup/findAllClassGroupByMusicGroup')")
-    public HttpResponseResult findAllClassGroupByMusicGroup(String musicGroupId,String type) {
-        return succeed(classGroupService.findAllClassGroupByMusicGroup(musicGroupId,type));
+    public HttpResponseResult findAllClassGroupByMusicGroup(String musicGroupId, String type) {
+        return succeed(classGroupService.findAllClassGroupByMusicGroup(musicGroupId, type));
     }
 
     @ApiOperation(value = "乐团详情--班级详情列表")
@@ -185,7 +183,7 @@ public class ClassGroupController extends BaseController {
         if (classGroupTeacherMapperList.size() <= 0) {
             return failed("参数不合法");
         }
-        return succeed(classGroupTeacherMapperService.classGroupTeachersInsert(classGroupTeacherMapperList,true));
+        return succeed(classGroupTeacherMapperService.classGroupTeachersInsert(classGroupTeacherMapperList, true));
     }
 
     @ApiOperation(value = "获取乐团班级老师")
@@ -241,7 +239,7 @@ public class ClassGroupController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionAddClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "ClassGroup4MixDto", value = "添加班级结构", required = true, dataType = "String")})
     public HttpResponseResult revisionAddClassGroup(@RequestBody List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception {
-        if(CollectionUtils.isEmpty(classGroup4MixDtos)){
+        if (CollectionUtils.isEmpty(classGroup4MixDtos)) {
             return failed("请填写班级信息");
         }
         return succeed(classGroupService.classGroupAdjust(classGroup4MixDtos));
@@ -268,7 +266,7 @@ public class ClassGroupController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('classGroup/highClassGroups')")
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
     public HttpResponseResult highClassGroups(String musicGroupId) throws Exception {
-        return succeed(classGroupService.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId,null));
+        return succeed(classGroupService.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId, null));
     }
 
     @ApiOperation(value = "按班级类型查找班级(班级调整)")
@@ -279,7 +277,7 @@ public class ClassGroupController extends BaseController {
             @ApiImplicitParam(name = "type", value = "班级类型", required = true, dataType = "string"),
     })
     public HttpResponseResult classGroupAndTeacher(String musicGroupId, ClassGroupTypeEnum type) throws Exception {
-        return succeed(classGroupService.getClassGroupAndTeacherByType(musicGroupId,type));
+        return succeed(classGroupService.getClassGroupAndTeacherByType(musicGroupId, type));
     }
 
     @ApiOperation(value = "查询是否设置课酬")
@@ -288,17 +286,17 @@ public class ClassGroupController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "string")
     })
-    public HttpResponseResult checkSetSalary(String musicGroupId){
+    public HttpResponseResult checkSetSalary(String musicGroupId) {
         return succeed(classGroupService.checkSetSalary(musicGroupId));
     }
 
     @PostMapping("/enumTest")
-    public HttpResponseResult enumTest(@RequestBody TestDto testDto){
+    public HttpResponseResult enumTest(@RequestBody TestDto testDto) {
         return succeed(testDto.getDelFlag().getMsg());
     }
 
     @GetMapping("queryUserInfo")
-    public HttpResponseResult queryUserInfo(Integer userId){
+    public HttpResponseResult queryUserInfo(Integer userId) {
         SysUser sysUser = sysUserFeignService.queryUserById(userId);
         return succeed(sysUser.getUsername());
     }
@@ -309,7 +307,7 @@ public class ClassGroupController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")
     })
-    public HttpResponseResult getClassGroupTeachers(Integer classGroupId){
+    public HttpResponseResult getClassGroupTeachers(Integer classGroupId) {
         return succeed(classGroupTeacherMapperService.getClassGroupTeachers(classGroupId));
     }
 
@@ -324,29 +322,29 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "终极班级信息获取")
     @GetMapping("/superFindClassGroups")
     @PreAuthorize("@pcs.hasPermissions('classGroup/superFindClassGroups')")
-    public HttpResponseResult superFindClassGroups(EndCourseScheduleQueryInfo queryInfo){
+    public HttpResponseResult superFindClassGroups(EndCourseScheduleQueryInfo queryInfo) {
         return succeed(classGroupService.endFindClassGroups(queryInfo));
     }
 
     @ApiOperation(value = "获取班级剩余课程类型对应的时长(分钟)")
     @GetMapping("/queryRemainCourseTypeDuration")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryRemainCourseTypeDuration')")
-    public HttpResponseResult queryRemainCourseTypeDuration(String classGroupIdList){
-    	
+    public HttpResponseResult queryRemainCourseTypeDuration(String classGroupIdList) {
+
         return succeed(classGroupService.queryRemainCourseTypeDuration(classGroupIdList));
     }
 
     @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-班级剩余课次")
     @GetMapping("/classGroupSubCourseNum")
     @PreAuthorize("@pcs.hasPermissions('classGroup/classGroupSubCourseNum')")
-    public HttpResponseResult classGroupSubCourseNum(Integer classGroupId){
+    public HttpResponseResult classGroupSubCourseNum(Integer classGroupId) {
         return succeed(classGroupService.classGroupSubCourseNum(classGroupId));
     }
 
     @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-生成默认缴费信息")
     @PostMapping("/getDefaultPaymentCalender")
     @PreAuthorize("@pcs.hasPermissions('classGroup/getDefaultPaymentCalender')")
-    public HttpResponseResult studentClassAuditDetail(@RequestBody List<Integer> classGroupIds){
+    public HttpResponseResult studentClassAuditDetail(@RequestBody List<Integer> classGroupIds) {
         return succeed(classGroupService.getDefaultPaymentCalender(classGroupIds));
     }
 
@@ -363,4 +361,12 @@ public class ClassGroupController extends BaseController {
 //    public HttpResponseResult findClassCourseMinuteMap(@RequestBody List<Integer> classGroupIds){
 //        return succeed(classGroupService.findClassCourseMinuteMap(classGroupIds));
 //    }
+
+    @ApiOperation(value = "获取乐团声部现有及容许的最大班级数量")
+    @PostMapping("/getSubjectNowAndMaxHighClassGroupNum")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/getSubjectNowAndMaxHighClassGroupNum')")
+    public HttpResponseResult<HighClassGroupNumDto> getSubjectNowAndMaxHighClassGroupNum(String musicGroupId, ClassGroupTypeEnum type, String subjectIds) {
+        return succeed(classGroupService.getSubjectMaxHighClassGroupNum(musicGroupId, type, subjectIds));
+    }
+
 }

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -124,8 +124,8 @@ public class StudentManageController extends BaseController {
     @ApiOperation(value = "乐团修改--学员缴费记录--可新增学员列表")
     @GetMapping("/queryCanAddStudent")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryCanAddStudent')")
-    public Object queryCanAddStudent(String musicGroupId,Long musicGroupPaymentCalenderId,String search,Integer subjectId){
-        return succeed(studentManageService.queryCanAddStudent(musicGroupId,musicGroupPaymentCalenderId,search,subjectId));
+    public Object queryCanAddStudent(String musicGroupId,String batchNo,String search,Integer subjectId){
+        return succeed(studentManageService.queryCanAddStudent(musicGroupId,batchNo,search,subjectId));
     }
 
     @ApiOperation(value = "乐团管理--乐团详情--学员列表--查看班级")

+ 3 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -176,6 +176,9 @@ public class StudentPaymentRouteOrderController extends BaseController {
         	studentPaymentRouteOrder.setSaleAmount(BigDecimal.ZERO);
         }
         studentPaymentRouteOrder.setUpdateBy(sysUser.getId());
+        if(studentPaymentRouteOrder.getSchoolId() == null){
+            studentPaymentRouteOrder.setSchoolId(999999999);
+        }
 
         return succeed(studentPaymentRouteOrderService.updateOutOrder(studentPaymentRouteOrder));
     }

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

@@ -88,12 +88,6 @@ public class TaskController extends BaseController {
 		studentGoodsSellService.affirmReceive(null);
 	}
 
-	@GetMapping(value = "/attendanceComplaintsAutoAffirmTask")
-	// 考勤申述7天未处理默认同意
-	public void attendanceComplaintsAutoAffirmTask(){
-		teacherAttendanceService.attendanceComplaintsAutoAffirmTask();
-	}
-
 	@GetMapping(value = "/repertoryWarn")
 	// 商品库存预警
 	public void repertoryWarn(){

+ 13 - 12
mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java

@@ -1,17 +1,11 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
-import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
-import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
-import com.ym.mec.biz.service.TeacherAttendanceService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -20,8 +14,15 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.TeacherAttendance;
+import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
+import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
+import com.ym.mec.biz.service.TeacherAttendanceService;
+import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("teacherAttendance")
 @Api(tags = "教师签到服务")

+ 29 - 0
mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

@@ -1,8 +1,12 @@
 package com.ym.mec.web.controller.student;
 
+import java.util.Arrays;
+import java.util.List;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -11,7 +15,11 @@ 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.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.ClassGroupService;
@@ -28,6 +36,10 @@ public class StudentAttendanceController extends BaseController {
     private StudentAttendanceService studentAttendanceService;
     @Autowired
     private ClassGroupService classGroupService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
 
     //修复逻辑:是连堂课,有签退记录,某个月,遍历有学员签到记录的每节课
     @GetMapping("/repairStudentAttendance")
@@ -55,6 +67,23 @@ public class StudentAttendanceController extends BaseController {
     @GetMapping("/findStudentAttendance")
     @PreAuthorize("@pcs.hasPermissions('studentAttendance/findStudentAttendance')")
     public Object findStudentAttendance(StudentAttendanceQueryInfo queryInfo){
+    	SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
         return succeed(studentAttendanceService.findStudentAttendance(queryInfo));
     }