Przeglądaj źródła

1、添加教务老师字段

Joburgess 5 lat temu
rodzic
commit
c4b93869f3
20 zmienionych plików z 238 dodań i 45 usunięć
  1. 22 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeDao.java
  2. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeGroupDto.java
  3. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java
  4. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java
  5. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/PracticeGroupQueryInfo.java
  6. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java
  7. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  8. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java
  9. 14 1
      mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeService.java
  10. 18 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  11. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java
  12. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java
  13. 27 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  14. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  15. 24 0
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  16. 3 0
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  17. 3 0
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  18. 18 36
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  19. 19 0
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  20. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

+ 22 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeDao.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.EmployeeDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.common.dal.BaseDAO;
 
@@ -72,4 +73,24 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
      * @return
      */
     List<Integer> queryUserRole(Integer userId);
-}
+
+    /**
+     * @describe 根据角色和用户查找用户
+     * @author Joburgess
+     * @date 2020/3/12
+     * @param roleIds: 角色编号列表
+     * @param organIds: 部门编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findByRole(@Param("roleIds") String roleIds,
+                                   @Param("organIds") String organIds);
+
+    /**
+     * @describe 根据用户编号获取用户
+     * @author Joburgess
+     * @date 2020/3/12
+     * @param userIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findByIds(@Param("userIds") List<Integer> userIds);
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeGroupDto.java

@@ -28,6 +28,16 @@ public class PracticeGroupDto extends PracticeGroup {
 
     private Integer evaluateStatus;
 
+    private String educationalTeacherName;
+
+    public String getEducationalTeacherName() {
+        return educationalTeacherName;
+    }
+
+    public void setEducationalTeacherName(String educationalTeacherName) {
+        this.educationalTeacherName = educationalTeacherName;
+    }
+
     public Integer getSubClassTimes() {
         return subClassTimes;
     }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java

@@ -31,6 +31,9 @@ public class SimpleUserDto {
         this.userName = userName;
     }
 
+    public SimpleUserDto() {
+    }
+
     public String getAvatar() {
         return avatar;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java

@@ -126,6 +126,16 @@ public class VipGroup {
 
 	private Integer educationalTeacherId;
 
+	private String educationalTeacherName;
+
+	public String getEducationalTeacherName() {
+		return educationalTeacherName;
+	}
+
+	public void setEducationalTeacherName(String educationalTeacherName) {
+		this.educationalTeacherName = educationalTeacherName;
+	}
+
 	public Integer getEducationalTeacherId() {
 		return educationalTeacherId;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/PracticeGroupQueryInfo.java

@@ -22,8 +22,18 @@ public class PracticeGroupQueryInfo extends QueryInfo {
 
     private Integer hasReport;
 
+    private Integer educationalTeacherId;
+
     private boolean isExport = false;
 
+    public Integer getEducationalTeacherId() {
+        return educationalTeacherId;
+    }
+
+    public void setEducationalTeacherId(Integer educationalTeacherId) {
+        this.educationalTeacherId = educationalTeacherId;
+    }
+
     public boolean getIsExport() {
         return isExport;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java

@@ -20,6 +20,16 @@ public class VipGroupQueryInfo extends QueryInfo {
 
     private boolean isExport = false;
 
+    private Integer educationalTeacherId;
+
+    public Integer getEducationalTeacherId() {
+        return educationalTeacherId;
+    }
+
+    public void setEducationalTeacherId(Integer educationalTeacherId) {
+        this.educationalTeacherId = educationalTeacherId;
+    }
+
     public boolean getIsExport() {
         return isExport;
     }

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

@@ -442,7 +442,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param practiceGroupId
 	 * @param teacherId
 	 */
-	void practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId);
+	void practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId);
 
 	/**
 	 * 清空老师和学生考勤

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java

@@ -9,6 +9,7 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
+import java.util.Map;
 
 public interface CoursesGroupService extends BaseService<Long, CoursesGroup> {
 
@@ -40,6 +41,15 @@ public interface CoursesGroupService extends BaseService<Long, CoursesGroup> {
     GroupHeadInfoDto getGroupHeadInfo(Long courseScheduleId);
 
     /**
+     * @describe 获取课程组详情
+     * @author Joburgess
+     * @date 2020/3/12
+     * @param groupId:
+     * @return Map<String,Object>
+     */
+    Map<String,Object> getGroupDetail(Long groupId);
+
+    /**
      * @describe 购买课程组
      * @author Joburgess
      * @date 2020/3/11

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeService.java

@@ -1,11 +1,14 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface EmployeeService extends BaseService<Integer, Employee> {
 
     /**
@@ -40,4 +43,14 @@ public interface EmployeeService extends BaseService<Integer, Employee> {
      * 删除员工
      */
     void deleteEmployee(Long userId);
-}
+
+    /**
+     * @describe 根据角色和部门获取用户
+     * @author Joburgess
+     * @date 2020/3/12
+     * @param roleIds: 角色编号列表
+     * @param organIds: 用户编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findByRole(String roleIds,String organIds);
+}

+ 18 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -16,18 +16,19 @@ import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.entity.ImGroupMember;
+import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.im.ImFeignService;
 import com.ym.mec.jiari.JiaRiFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.ListUtil;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.json.JsonUtil;
-
 import feign.codec.DecodeException;
-
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -110,6 +111,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     private SysConfigService sysConfigService;
     @Autowired
     private SchoolDao schoolDao;
+    @Autowired
+	private ImFeignService imFeignService;
     
     @Autowired
     private CourseHomeworkService courseHomeworkService;
@@ -3765,7 +3768,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId) {
+    public void practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (null == user) {
             throw new BizException("获取用户信息失败");
@@ -3781,6 +3784,17 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             courseSchedules = courseSchedules.stream().filter(courseSchedule -> !courseSchedule.getActualTeacherId().equals(teacherId)).collect(Collectors.toList());
         }
 		PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(practiceGroupId));
+		ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(practiceGroupId, GroupType.PRACTICE.getCode());
+        if(Objects.nonNull(educationalTeacherId)&&!educationalTeacherId.equals(practiceGroup.getEducationalTeacherId())){
+			if(Objects.nonNull(practiceGroup.getEducationalTeacherId())){
+				ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(practiceGroup.getEducationalTeacherId().toString())};
+				imFeignService.groupQuit(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+			}
+
+			practiceGroup.setEducationalTeacherId(educationalTeacherId);
+			ImGroupMember[] newImGroupMemberList = new ImGroupMember[]{new ImGroupMember(practiceGroup.getEducationalTeacherId().toString())};
+			imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), newImGroupMemberList,classGroup.getName()));
+		}
 		if(Objects.nonNull(subjectId)&&!subjectId.equals(practiceGroup.getSubjectId())){
 			Subject subject = subjectDao.get(subjectId);
 			String groupName = practiceGroup.getName();
@@ -3788,14 +3802,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			groupName=subject.getName()+groupName;
 			practiceGroup.setName(groupName);
 			practiceGroup.setSubjectId(subjectId);
-			practiceGroupDao.update(practiceGroup);
-			ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(practiceGroupId, GroupType.PRACTICE.getCode());
 			classGroup.setSubjectIdList(subjectId.toString());
 			classGroup.setName(groupName);
 			classGroup.setSubjectIdList(subjectId.toString());
 			classGroupDao.update(classGroup);
 			courseScheduleDao.updateCourseNameByGroup(practiceGroupId,GroupType.PRACTICE,groupName);
 		}
+		practiceGroupDao.update(practiceGroup);
         classGroupTeacherMapperService.updateTeacher(practiceGroupId,teacherId,GroupType.PRACTICE.getCode());
         classGroupTeacherSalaryDao.updateTeacher(practiceGroupId,teacherId,GroupType.PRACTICE.getCode());
         practiceGroupDao.updateUserId(practiceGroupId,teacherId);

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java

@@ -280,6 +280,26 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
     }
 
     @Override
+    public Map<String, Object> getGroupDetail(Long groupId) {
+        if(Objects.isNull(groupId)){
+            throw new BizException("请指定课程组");
+        }
+        CoursesGroup coursesGroup = coursesGroupDao.get(groupId);
+        Teacher teacher = teacherDao.get(coursesGroup.getTeacherId());
+        Map<String, Object> result=new HashMap<>();
+        result.put("groupId", groupId);
+        result.put("groupName", coursesGroup.getName());
+        result.put("courseStartDate",coursesGroup.getCoursesStartDate());
+        result.put("courseEndDate", coursesGroup.getCoursesEndDate());
+        result.put("teacherName", teacher.getRealName());
+        result.put("introduction", teacher.getIntroduction());
+        result.put("lectureNum", teacher.getLectureNum());
+        List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId.toString(), GroupType.COMM);
+        result.put("courseSchedules",groupNotStartCourses);
+        return result;
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public HttpResponseResult buyCourseGroup(Integer userId, Long courseGroupId, boolean isUseBalancePayment) {
         if(Objects.isNull(courseGroupId)){

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

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.EmployeeDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.SysUserCashAccount;
 import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
@@ -157,4 +158,9 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 				break;
 		}
 	}
-}
+
+	@Override
+	public List<SimpleUserDto> findByRole(String roleIds, String organIds) {
+		return employeeDao.findByRole(roleIds,organIds);
+	}
+}

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -120,6 +120,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     private PracticeLessonApplyDao practiceLessonApplyDao;
     @Autowired
     private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
 
     private static Map<Integer, Map<Integer, List<Integer>>> schoolSubjectTeachersMap;
 
@@ -1674,6 +1676,14 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 //            }
 //        }
 
+        List<String> musicGroupIds = studentRegistrationDao.queryStudentMusicGroup(practiceGroup.getStudentId());
+        if(!CollectionUtils.isEmpty(musicGroupIds)){
+            MusicGroup musicGroup = musicGroupDao.get(musicGroupIds.get(0));
+            if(Objects.nonNull(musicGroup)){
+                practiceGroup.setEducationalTeacherId(musicGroup.getEducationalTeacherId());
+            }
+        }
+
         List<Date> allCourseDates = new ArrayList<>();
         allCourseDates.add(practiceGroup.getFirstCourseTime());
         allCourseDates.add(practiceGroup.getSecondCourseTime());
@@ -2069,6 +2079,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 List<Integer> subjectIds = dataList.stream().map(practiceGroup -> practiceGroup.getSubjectId()).distinct().collect(Collectors.toList());
                 Set<Integer> organIds = dataList.stream().map(practiceGroup -> practiceGroup.getOrganId()).collect(Collectors.toSet());
                 List<String> practiceGroupIds = dataList.stream().map(e -> String.valueOf(e.getId())).distinct().collect(Collectors.toList());
+                List<Integer> educationalTeacherIds=dataList.stream().filter(data -> Objects.nonNull(data.getEducationalTeacherId())).map(PracticeGroupDto::getEducationalTeacherId).collect(Collectors.toList());
 
                 List<ClassGroup> classGroupsByVipGroups = classGroupDao
                         .findByMusicGroupsAndType(practiceGroupIds.stream().map(groupId -> String.valueOf(groupId)).collect(Collectors.toList()),
@@ -2081,6 +2092,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 //声部名称列表
                 Map<Long, String> subjectNames = MapUtil.convertMybatisMap(subjectDao.findBySubjecIds(StringUtils.join(subjectIds, ",")));
                 Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMapList(organIds));
+
+                List<SimpleUserDto> educationalUsers = employeeDao.findByIds(educationalTeacherIds);
+                Map<Integer, String> idNameMap = educationalUsers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, user -> user.getUserName()));
+
                 dataList.forEach(e -> {
                     e.setSubjectName(subjectNames.get(e.getSubjectId().intValue()));
                     e.setOrganName(organNames.get(e.getOrganId()));
@@ -2092,6 +2107,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                     e.setTotalClassTimes(aLong == null ? 0 : aLong.intValue());
                     Long aLong1 = currentClassTimeMap.get(e.getId() + "");
                     e.setCurrentClassTimes(aLong1 == null ? 0 : aLong1.intValue());
+                    e.setEducationalTeacherName(idNameMap.get(e.getEducationalTeacherId()));
                 });
             }
         }
@@ -2684,11 +2700,22 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                     courseStartDay=lastExpiredDay;
                 }
                 practiceGroupBuyParams.setBeRenewGroupId(practiceGroupBuyParams.getGroupId());
+                practiceGroupBuyParams.setEducationalTeacherId(userLatestPracticeGroup.getEducationalTeacherId());
             }else{
                 return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "需要续费的课程组不存在");
             }
         }
 
+        if(Objects.isNull(practiceGroupBuyParams.getEducationalTeacherId())){
+            List<String> musicGroupIds = studentRegistrationDao.queryStudentMusicGroup(practiceGroupBuyParams.getStudentId());
+            if(!CollectionUtils.isEmpty(musicGroupIds)){
+                MusicGroup musicGroup = musicGroupDao.get(musicGroupIds.get(0));
+                if(Objects.nonNull(musicGroup)){
+                    practiceGroupBuyParams.setEducationalTeacherId(musicGroup.getEducationalTeacherId());
+                }
+            }
+        }
+
         courseStartDay=courseStartDay.plusDays(1);
         Date courseStartDate=Date.from(courseStartDay.atStartOfDay(DateUtil.zoneId).toInstant());
         practiceGroupBuyParams.setCoursesStartDate(courseStartDate);

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

@@ -121,6 +121,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private IdGeneratorService idGeneratorService;
 	@Autowired
 	private StudentAttendanceDao studentAttendanceDao;
+	@Autowired
+	private EmployeeDao employeeDao;
 
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(VipGroup.class);
@@ -568,6 +570,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				List<String> vipGroupIds = dataList.stream().map(vipGroup -> String.valueOf(vipGroup.getId())).distinct().collect(Collectors.toList());
 				List<Map<Long, Integer>> vipGroupOverCourses = courseScheduleDao.countGroupOverCourse(vipGroupIds,"VIP");
 				Map<String,Integer> vipGroupOverCourseMaps = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(vipGroupOverCourses)),HashMap.class);
+				List<Integer> educationalTeacherIds=dataList.stream().filter(data -> Objects.nonNull(data.getEducationalTeacherId())).map(VipGroup::getEducationalTeacherId).collect(Collectors.toList());
 
 				List<ClassGroup> classGroupsByVipGroups = classGroupDao
 						.findByMusicGroupsAndType(vipGroupIds.stream().map(vipGroupId->String.valueOf(vipGroupId)).collect(Collectors.toList()),
@@ -578,6 +581,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				Map<String,Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(vipGroupIds,"VIP"));
 				Map<String,Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(vipGroupIds,"VIP"));
 
+				List<SimpleUserDto> educationalUsers = employeeDao.findByIds(educationalTeacherIds);
+				Map<Integer, String> idNameMap = educationalUsers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, user -> user.getUserName()));
+
 				dataList.forEach(vipGroup -> {
 					Integer overCourses = vipGroupOverCourseMaps.get(vipGroup.getId().toString());
 					ClassGroup classGroup = vipGroupClassGroupMap.get(vipGroup.getId().toString());
@@ -590,6 +596,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					Long aLong1 = currentClassTimeMap.get(vipGroup.getId() + "");
 					vipGroup.setCurrentClassTimes(aLong1==null?0:aLong1.intValue());
 
+					vipGroup.setEducationalTeacherName(idNameMap.get(vipGroup.getEducationalTeacherId()));
+
 					Integer totalClassTimes=vipGroup.getTotalClassTimes();
 					if(Objects.isNull(totalClassTimes) || Objects.isNull(overCourses)){
 						vipGroup.setMonthConsumeRate(0);

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

@@ -228,4 +228,28 @@
     <select id="queryUserRole" resultType="java.lang.Integer">
         SELECT sur.role_id_ FROM sys_user_role sur WHERE sur.user_id_ = #{userId}
     </select>
+
+    <select id="findByRole" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
+        SELECT
+          su.id_ userId,
+          su.real_name_ userName,
+          su.avatar_ avatar
+        FROM
+            sys_user su
+            LEFT JOIN sys_user_role sur ON su.id_ = sur.user_id_
+            LEFT JOIN employee e ON e.user_id_ = su.id_
+        WHERE
+            FIND_IN_SET(sur.role_id_, #{roleIds})
+            <if test="organIds!=null and organIds!=''">
+                AND INTE_ARRAY(e.organ_id_list_,#{organIds})
+            </if>
+    </select>
+    <select id="findByIds" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
+        SELECT su.id_ userId,su.real_name_ userName
+        FROM sys_user
+        WHERE id_ IN
+        <foreach collection="userIds" item="userId" separator="," open="(" close=")">
+            #{userId}
+        </foreach>
+    </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -236,6 +236,9 @@
             <if test="organId != null">
                 AND FIND_IN_SET(pg.organ_id_,#{organId})
             </if>
+            <if test="educationalTeacherId!=null">
+                AND pg.educational_teacher_id_=#{educationalTeacherId}
+            </if>
         </where>
     </sql>
 

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -180,6 +180,9 @@
             <if test="organId != null">
                 AND FIND_IN_SET(vg.organ_id_,#{organId})
             </if>
+            <if test="educationalTeacherId!=null">
+                AND vg.educational_teacher_id_=#{educationalTeacherId}
+            </if>
         </where>
     </sql>
 

+ 18 - 36
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -1,33 +1,5 @@
 package com.ym.mec.web.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang.ArrayUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-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.ClassGroupDao;
@@ -37,13 +9,8 @@ import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
 import com.ym.mec.biz.dal.dto.CoursePostponeDto;
 import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
 import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
@@ -57,6 +24,21 @@ import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Author Joburgess
@@ -369,8 +351,8 @@ public class CourseScheduleController extends BaseController {
     @ApiOperation(value = "陪练课课程组老师调整")
     @PostMapping("/practiceGroupTeacherAdjust")
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/practiceGroupTeacherAdjust')")
-    public Object practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId){
-        scheduleService.practiceGroupTeacherAdjust(practiceGroupId,teacherId,subjectId);
+    public Object practiceGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId){
+        scheduleService.practiceGroupTeacherAdjust(practiceGroupId,teacherId,subjectId, educationalTeacherId);
         return succeed();
     }
 

+ 19 - 0
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -9,12 +9,14 @@ import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 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.*;
+
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -126,4 +128,21 @@ public class EmployeeController extends BaseController {
         }
         return failed("获取用户信息失败");
     }
+
+    @ApiOperation(value = "获取教务人员")
+    @GetMapping("/findEducationUsers")
+    public HttpResponseResult findEducationUsers(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        String organIds=new String();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeService.get(sysUser.getId());
+            if (StringUtils.isEmpty(organIds)) {
+                organIds=employee.getOrganIdList();
+            }
+        }
+        return succeed(employeeService.findByRole("4,5",organIds));
+    }
 }

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

@@ -131,6 +131,7 @@ public class EduPracticeGroupController extends BaseController {
         if(Objects.isNull(practiceGroupBuyParams.getStudentId())){
             throw new BizException("请指定学生");
         }
+        practiceGroupBuyParams.setEducationalTeacherId(sysUser.getId());
         return eduPracticeGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
     }