浏览代码

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

yonge 5 年之前
父节点
当前提交
5a1d1d74f2

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

@@ -24,6 +24,9 @@ public interface TeacherAttendanceDao extends BaseDAO<Long, TeacherAttendance> {
 
 
     int batchDeleteByCourseSchedules(@Param("courseScheduleIds") List<Long> courseScheduleIds);
     int batchDeleteByCourseSchedules(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
 
+    int batchDeleteByCourseAndUsers(@Param("courseScheduleId") Integer courseScheduleId,
+                                    @Param("userIds") List<Integer> userIds);
+
     /**
     /**
      * 教师个人签到记录统计
      * 教师个人签到记录统计
      * @param params
      * @param params

+ 3 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java

@@ -72,7 +72,7 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      * @param userIds
      * @param userIds
      * @return
      * @return
      */
      */
-    List<Teacher> findTeachers(@Param("userIds") List<Integer> userIds);
+    List<TeacherBasicDto> findTeachers(@Param("userIds") List<Integer> userIds);
 
 
     /**
     /**
      * count上课结算列表
      * count上课结算列表
@@ -166,12 +166,10 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      * @describe 根据声部获取部门下的老师
      * @describe 根据声部获取部门下的老师
      * @author Joburgess
      * @author Joburgess
      * @date 2019/11/4
      * @date 2019/11/4
-     * @param organId: 部门编号
      * @param subjectId: 声部编号
      * @param subjectId: 声部编号
      * @return java.util.List<com.ym.mec.biz.dal.entity.Teacher>
      * @return java.util.List<com.ym.mec.biz.dal.entity.Teacher>
      */
      */
-    List<Teacher> findOrganTeacherBySubject(@Param("organId") String organId,
-                                            @Param("subjectId") Integer subjectId);
+    List<Teacher> findOrganTeacherBySubject(@Param("subjectId") Integer subjectId);
 
 
     /**
     /**
      * 根据分部查询老师数
      * 根据分部查询老师数
@@ -181,4 +179,4 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
     Map<String,Integer> queryOrganTeacherNum(@Param("organId") String organId);
     Map<String,Integer> queryOrganTeacherNum(@Param("organId") String organId);
 
 
     List<Teacher> findByFlowOrganRange(Map<String, Object> params);
     List<Teacher> findByFlowOrganRange(Map<String, Object> params);
-}
+}

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherBasicDto.java

@@ -0,0 +1,34 @@
+package com.ym.mec.biz.dal.dto;
+
+public class TeacherBasicDto {
+
+    private Integer id;
+
+    private String realName;
+
+    private String username;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+}

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

@@ -5,7 +5,6 @@ import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -75,18 +74,16 @@ public interface TeacherService extends BaseService<Integer, Teacher> {
      * @param organId
      * @param organId
      * @return
      * @return
      */
      */
-    List<Teacher> findTeachers(@Param("organId") String organId);
+    List<TeacherBasicDto> findTeachers(@Param("organId") String organId);
 
 
     /**
     /**
      * @describe 根据科目获取部门下的教师
      * @describe 根据科目获取部门下的教师
      * @author Joburgess
      * @author Joburgess
      * @date 2019/11/4
      * @date 2019/11/4
-     * @param organId: 部门编号
      * @param subjectId: 科目编号
      * @param subjectId: 科目编号
      * @return java.util.List<com.ym.mec.biz.dal.entity.Teacher>
      * @return java.util.List<com.ym.mec.biz.dal.entity.Teacher>
      */
      */
-    List<Teacher> findOrganTeacherBySubject(@Param("organId") String organId,
-                                            @Param("subjectId") Integer subjectId);
+    List<Teacher> findOrganTeacherBySubject(@Param("subjectId") Integer subjectId);
 
 
     /**
     /**
      * 获取教师上课结算列表
      * 获取教师上课结算列表

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

@@ -845,12 +845,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			if(Objects.nonNull(newCourseSchedule.getSchoolId())){
 			if(Objects.nonNull(newCourseSchedule.getSchoolId())){
 				oldCourseSchedule.setSchoolId(newCourseSchedule.getSchoolId());
 				oldCourseSchedule.setSchoolId(newCourseSchedule.getSchoolId());
 			}
 			}
+			oldCourseSchedule.setActualTeacherId(newCourseSchedule.getActualTeacherId());
 			courseScheduleDao.update(oldCourseSchedule);
 			courseScheduleDao.update(oldCourseSchedule);
-			//删除被修改的教师课酬记录
+			//删除被修改的教师课酬记录和考勤记录
 			if(!CollectionUtils.isEmpty(beReplaceTeacherIds)){
 			if(!CollectionUtils.isEmpty(beReplaceTeacherIds)){
 //				courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalary(newCourseSchedule.getId().intValue(),beReplaceTeacherIds);
 //				courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalary(newCourseSchedule.getId().intValue(),beReplaceTeacherIds);
 				courseScheduleTeacherSalaryDao.batchDeleteByCourseAndTeacher(newCourseSchedule.getId(),beReplaceTeacherIds);
 				courseScheduleTeacherSalaryDao.batchDeleteByCourseAndTeacher(newCourseSchedule.getId(),beReplaceTeacherIds);
-
+				teacherAttendanceDao.batchDeleteByCourseAndUsers(newCourseSchedule.getId().intValue(),beReplaceTeacherIds);
 			}
 			}
 		});
 		});
 		//生成修改后的教师课酬
 		//生成修改后的教师课酬

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

@@ -1268,6 +1268,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         		studentPaymentOrder.setBalancePaymentAmount(amount);
         		studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setUpdateTime(date);
                 studentPaymentOrder.setUpdateTime(date);
+                studentPaymentOrder.setPaymentChannel("BALANCE");
                 studentPaymentOrderService.update(studentPaymentOrder);
                 studentPaymentOrderService.update(studentPaymentOrder);
                 
                 
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");

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

@@ -283,6 +283,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
             ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
             sysUser.setImToken(register.getToken());
             sysUser.setImToken(register.getToken());
         }
         }
+        if(!sysUser.getUserType().equals(SysUserType.STUDENT)){
+            throw new BizException("您系统存在非学生的账户,不能注册学生");
+        }
         sysUser.setUserType(SysUserType.STUDENT);
         sysUser.setUserType(SysUserType.STUDENT);
         sysUser.setOrganId(studentRegistration.getOrganId());
         sysUser.setOrganId(studentRegistration.getOrganId());
         sysUser.setRealName(studentRegistration.getParentsName());
         sysUser.setRealName(studentRegistration.getParentsName());
@@ -533,6 +536,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             throw new Exception("参数校验失败");
             throw new Exception("参数校验失败");
         }
         }
         String musicGroupId = studentRegistration.getMusicGroupId();
         String musicGroupId = studentRegistration.getMusicGroupId();
+
         StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, studentRegistration.getParentsPhone());
         StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, studentRegistration.getParentsPhone());
         if (phoneAndMusicGroupId != null) {
         if (phoneAndMusicGroupId != null) {
             throw new Exception("该学员已存在");
             throw new Exception("该学员已存在");
@@ -594,14 +598,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 } else {
                 } else {
                     throw new Exception("班级不存在");
                     throw new Exception("班级不存在");
                 }
                 }
-                //新增班级学生关系(单技班)
-//                ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper(musicGroupId,userId,GroupType.MUSIC);
-//                classGroupStudentMapper.setClassGroupId(classGroupId);
-//                classGroupStudentMapperDao.insert(classGroupStudentMapper);
-                //新增班级学生关系(合奏班)
-//                ClassGroupRelation classGroupRelation = classGroupRelationDao.findClassGroupRelation(classGroupId);
-//                classGroupStudentMapper.setClassGroupId(classGroupRelation.getClassGroupId());
-//                classGroupStudentMapperDao.insert(classGroupStudentMapper);
+                //添加班级关联
                 addStudents(classGroup, userId);
                 addStudents(classGroup, userId);
                 Date date = new Date();
                 Date date = new Date();
                 //获取当前月
                 //获取当前月
@@ -652,14 +649,21 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                     studentPaymentOrder.setPayTime(date);
                     studentPaymentOrder.setPayTime(date);
                 }
                 }
                 studentPaymentOrder.setExpectAmount(reduce);
                 studentPaymentOrder.setExpectAmount(reduce);
-                studentRegistrationDao.insertBasic(studentRegistration);
+                //当前学员是否以前存在过当前乐团
+                StudentRegistration registration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+                if(registration != null){
+                    studentRegistration.setId(registration.getId());
+                    studentRegistrationDao.update(studentRegistration);
+                }else {
+                    studentRegistrationDao.insertBasic(studentRegistration);
+                }
                 studentPaymentOrderService.insert(studentPaymentOrder);
                 studentPaymentOrderService.insert(studentPaymentOrder);
                 studentPaymentOrderDetails.forEach(e -> {
                 studentPaymentOrderDetails.forEach(e -> {
                     e.setPaymentOrderId(studentPaymentOrder.getId());
                     e.setPaymentOrderId(studentPaymentOrder.getId());
                 });
                 });
                 studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetails);
                 studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetails);
             }
             }
-            studentRegistrationDao.updateCurrentClass(studentRegistration);
+//            studentRegistrationDao.updateCurrentClass(studentRegistration);
             Map<Integer, String> receivers = new HashMap<>(1);
             Map<Integer, String> receivers = new HashMap<>(1);
             receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
             receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
             String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
             String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
@@ -672,43 +676,45 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public void addStudents(ClassGroup classGroup, Integer userId) {
     public void addStudents(ClassGroup classGroup, Integer userId) {
         Date nowDate = new Date();
         Date nowDate = new Date();
         //1、班级关系添加
         //1、班级关系添加
-        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
-        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+//        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
+//        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
         Integer classGroupId = classGroup.getId();
         Integer classGroupId = classGroup.getId();
         ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
         ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
 
 
         //校验是否存在历史记录
         //校验是否存在历史记录
         ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
         ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
-        if (classGroupStudentMapper != null) {
+        if(classGroupStudentMapper != null){
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-        } else {
-            classGroupStudentMapper = new ClassGroupStudentMapper();
-            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
             classGroupStudentMapper.setClassGroupId(classGroupId);
             classGroupStudentMapper.setClassGroupId(classGroupId);
-            classGroupStudentMapper.setUserId(userId);
-            classGroupStudentMapper.setCreateTime(nowDate);
-            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-            classGroupStudentMapper.setGroupType(GroupType.MUSIC);
-            classGroupStudentMappers.add(classGroupStudentMapper);
-        }
-        //班级在合奏班中
-        if (classGroupRelation != null) {
+            classGroupStudentMapperDao.update(classGroupStudentMapper);
+        }else {
             classGroupStudentMapper = new ClassGroupStudentMapper();
             classGroupStudentMapper = new ClassGroupStudentMapper();
             classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
             classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
-            classGroupStudentMapper.setClassGroupId(classGroupRelation.getClassGroupId());
+            classGroupStudentMapper.setClassGroupId(classGroupId);
             classGroupStudentMapper.setUserId(userId);
             classGroupStudentMapper.setUserId(userId);
             classGroupStudentMapper.setCreateTime(nowDate);
             classGroupStudentMapper.setCreateTime(nowDate);
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentMapper.setGroupType(GroupType.MUSIC);
             classGroupStudentMapper.setGroupType(GroupType.MUSIC);
-            classGroupStudentMappers.add(classGroupStudentMapper);
+            classGroupStudentMapperDao.insert(classGroupStudentMapper);
         }
         }
-        imGroupMemberList.add(new ImGroupMember(userId.toString()));
-        if (classGroupStudentMappers.size() > 0) {
-            classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
+        ClassGroupStudentMapper classGroupStudentMapperMix = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupRelation.getClassGroupId());
+        if(classGroupStudentMapperMix != null){
+            classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
+            classGroupStudentMapperDao.update(classGroupStudentMapperMix);
+        }else {
+            classGroupStudentMapperMix = new ClassGroupStudentMapper();
+            classGroupStudentMapperMix.setMusicGroupId(classGroup.getMusicGroupId());
+            classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId());
+            classGroupStudentMapperMix.setUserId(userId);
+            classGroupStudentMapperMix.setCreateTime(nowDate);
+            classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMapperMix.setGroupType(GroupType.MUSIC);
+            classGroupStudentMapperDao.insert(classGroupStudentMapperMix);
         }
         }
-
+//        imGroupMemberList.add(new ImGroupMember(userId.toString()));
         //添加进IM群组
         //添加进IM群组
-        ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+        ImGroupMember[] imGroupMembers = {new ImGroupMember(userId.toString())};
         imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
         imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
 
 
         //2、班级人数调整
         //2、班级人数调整

+ 3 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -27,7 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 
 @Service
 @Service
 public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  implements TeacherService {
 public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  implements TeacherService {
@@ -197,7 +196,7 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 	}
 	}
 
 
     @Override
     @Override
-    public List<Teacher> findTeachers(String organId) {
+    public List<TeacherBasicDto> findTeachers(String organId) {
 		List<Teacher> teacherList = teacherDao.findByFlowOrganRange(null);
 		List<Teacher> teacherList = teacherDao.findByFlowOrganRange(null);
 		if(StringUtils.isNotEmpty(organId)){
 		if(StringUtils.isNotEmpty(organId)){
 			Set<String> list = new HashSet<>(Arrays.asList(organId.split(",")));
 			Set<String> list = new HashSet<>(Arrays.asList(organId.split(",")));
@@ -209,8 +208,8 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
     }
     }
 
 
 	@Override
 	@Override
-	public List<Teacher> findOrganTeacherBySubject(String organId, Integer subjectId) {
-		return teacherDao.findOrganTeacherBySubject(organId,subjectId);
+	public List<Teacher> findOrganTeacherBySubject(Integer subjectId) {
+		return teacherDao.findOrganTeacherBySubject(subjectId);
 	}
 	}
 
 
 	@Override
 	@Override

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

@@ -106,6 +106,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private StudentPaymentOrderService studentPaymentOrderService;
 	private StudentPaymentOrderService studentPaymentOrderService;
 	@Autowired
 	@Autowired
 	private ContractService contractService;
 	private ContractService contractService;
+	@Autowired
+    private TeacherService teacherService;
 
 
 	@Override
 	@Override
 	public BaseDAO<Long, VipGroup> getDAO() {
 	public BaseDAO<Long, VipGroup> getDAO() {
@@ -240,7 +242,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		}else{
 		}else{
 			vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
 			vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
 		}
 		}
-		vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(sysUser.getOrganId()));
+        Teacher teacher = teacherService.get(sysUser.getId());
+		if(teacher.getOrganId().indexOf(",")!=-1){
+		    throw new BizException("教师部门异常");
+        }
+        vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(teacher.getOrganId()));
 		//开课时间为排课的第一节课的开始时间
 		//开课时间为排课的第一节课的开始时间
 		vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
 		vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
 		//课程结束时间为排课的最后一节课的结束时间
 		//课程结束时间为排课的最后一节课的结束时间
@@ -978,11 +984,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				studentPaymentOrder.setActualAmount(new BigDecimal(0));
 				studentPaymentOrder.setActualAmount(new BigDecimal(0));
 				studentPaymentOrder.setBalancePaymentAmount(amount);
 				studentPaymentOrder.setBalancePaymentAmount(amount);
 				studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
 				studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
+				studentPaymentOrder.setPaymentChannel("BALANCE");
 				studentPaymentOrder.setUpdateTime(date);
 				studentPaymentOrder.setUpdateTime(date);
 
 
 				this.orderCallback(studentPaymentOrder);
 				this.orderCallback(studentPaymentOrder);
 
 
-				sysUserCashAccountService.updateBalance(user.getId(), amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
+				sysUserCashAccountService.updateBalance(user.getId(), amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"VIP课购买");
 
 
 				Map<String,Object> result=new HashMap<>();
 				Map<String,Object> result=new HashMap<>();
 				result.put("orderNo",studentPaymentOrder.getOrderNo());
 				result.put("orderNo",studentPaymentOrder.getOrderNo());

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

@@ -292,7 +292,9 @@
         <![CDATA[ AND create_time_ <= ]]> #{beforeTime}
         <![CDATA[ AND create_time_ <= ]]> #{beforeTime}
     </select>
     </select>
     <select id="countStudentPaymentNum" resultType="int">
     <select id="countStudentPaymentNum" resultType="int">
-        select count(1) from student_payment_order where  music_group_id_=#{musicGroupId} AND status_ = 'SUCCESS' AND type_='SMALL_CLASS_TO_BUY'
+        select count(1) from student_payment_order
+        where  music_group_id_=#{musicGroupId}
+        AND status_ = 'SUCCESS' AND type_='SMALL_CLASS_TO_BUY'
     </select>
     </select>
 
 
     <select id="countSurplusCourseByMusicGroupAndUser" resultType="int">
     <select id="countSurplusCourseByMusicGroupAndUser" resultType="int">

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

@@ -116,6 +116,14 @@
         </foreach>
         </foreach>
     </delete>
     </delete>
 
 
+    <delete id="batchDeleteByCourseAndUsers">
+        DELETE FROM teacher_attendance WHERE course_schedule_id_ = #{courseScheduleId}
+        AND teacher_id_ IN
+        <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
+            #{userId}
+        </foreach>
+    </delete>
+
     <!-- 分页查询 -->
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="TeacherAttendance" parameterType="map">
     <select id="queryPage" resultMap="TeacherAttendance" parameterType="map">
         SELECT * FROM teacher_attendance ORDER BY id_
         SELECT * FROM teacher_attendance ORDER BY id_

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

@@ -267,7 +267,12 @@
         select id_ `key`,phone_ `value` FROM sys_user s WHERE FIND_IN_SET(id_,#{userIds}) AND s.phone_ IS NOT NULL
         select id_ `key`,phone_ `value` FROM sys_user s WHERE FIND_IN_SET(id_,#{userIds}) AND s.phone_ IS NOT NULL
     </select>
     </select>
 
 
-    <select id="findTeachers" resultMap="Teacher">
+    <resultMap id="TeacherBasicDto" type="com.ym.mec.biz.dal.dto.TeacherBasicDto">
+        <result property="id" column="id_"/>
+        <result property="username" column="username_"/>
+        <result property="realName" column="real_name_"/>
+    </resultMap>
+    <select id="findTeachers" resultMap="TeacherBasicDto">
         SELECT su.id_,su.username_,su.real_name_ FROM sys_user su
         SELECT su.id_,su.username_,su.real_name_ FROM sys_user su
         <where>
         <where>
             <if test="userIds != null">
             <if test="userIds != null">
@@ -480,9 +485,6 @@
     <select id="findOrganTeacherBySubject" resultMap="Teacher">
     <select id="findOrganTeacherBySubject" resultMap="Teacher">
         SELECT su.* FROM teacher t
         SELECT su.* FROM teacher t
         LEFT JOIN sys_user su on t.id_ = su.id_ WHERE 1=1
         LEFT JOIN sys_user su on t.id_ = su.id_ WHERE 1=1
-        <if test="organId != null">
-            AND FIND_IN_SET(t.organ_id_,#{organId})
-        </if>
         <if test="subjectId != null">
         <if test="subjectId != null">
             AND FIND_IN_SET(#{subjectId},t.subject_id_)
             AND FIND_IN_SET(#{subjectId},t.subject_id_)
         </if>
         </if>

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

@@ -113,8 +113,7 @@ public class TeacherController extends BaseController {
     @GetMapping("/findOrganTeacherBySubject")
     @GetMapping("/findOrganTeacherBySubject")
     @PreAuthorize("@pcs.hasPermissions('teacher/findOrganTeacherBySubject')")
     @PreAuthorize("@pcs.hasPermissions('teacher/findOrganTeacherBySubject')")
     public HttpResponseResult findOrganTeacherBySubject(Integer subjecId) {
     public HttpResponseResult findOrganTeacherBySubject(Integer subjecId) {
-        String organId = sysUserFeignService.queryUserInfo().getOrganId();
-        return succeed(teacherService.findOrganTeacherBySubject(organId,subjecId));
+        return succeed(teacherService.findOrganTeacherBySubject(subjecId));
     }
     }
 
 
     @ApiOperation(value = "获取乐团所有老师")
     @ApiOperation(value = "获取乐团所有老师")