Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

zouxuan 4 tahun lalu
induk
melakukan
4a4c9b6070
18 mengubah file dengan 180 tambahan dan 18 penghapusan
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java
  3. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  4. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  5. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesService.java
  6. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  7. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java
  8. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java
  9. 24 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java
  10. 19 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  11. 1 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  12. 9 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml
  13. 2 2
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  14. 1 1
      mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml
  15. 13 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  16. 2 3
      mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml
  17. 25 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  18. 39 7
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesController.java

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
@@ -468,4 +469,14 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
                                                                             @Param("musicGroupId") String musicGroupId);
 
     List<Long> getLessThenThreeClassGroupIds(@Param("organIds") String organIds);
+
+    /**
+     * @describe 获取学员与老师所在班级
+     * @author Joburgess
+     * @date 2021/2/5 0005
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
+     */
+    List<ClassGroup> getStudentClassGroupWithTeacher(@Param("studentIds") Set<Integer> studentIds,
+                                                     @Param("teacherId") Integer teacherId);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java

@@ -37,6 +37,8 @@ public interface ExtracurricularExercisesDao extends BaseDAO<Long, Extracurricul
     List<BasicUserDto> findNoExercisesStudentsInThisWeekWithTeacher(@Param("teacherId") Integer teacherId,
                                                                     @Param("startDate") String startDate,
                                                                     @Param("musicGroupId") String musicGroupId,
+                                                                    @Param("classGroupId") Long classGroupId,
+                                                                    @Param("subjectId") Integer subjectId,
                                                                     @Param("search") String search);
 
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -6,12 +6,14 @@ import com.ym.mec.biz.dal.dto.Student4operating;
 import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
 import com.ym.mec.biz.dal.dto.StudentServeDto;
 import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.GroupType;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Student> {
 	
@@ -174,4 +176,13 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @param serviceTag
      */
     void updateServiceTag(@Param("studentIds") List<Integer> studentIds, @Param("serviceTag") Integer serviceTag);
+
+    /**
+     * @describe 获取学员声部列表
+     * @author Joburgess
+     * @date 2021/2/5 0005
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Subject>
+     */
+    List<Subject> getStudentSubjects(@Param("studentIds") Set<Integer> studentIds);
 }

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

@@ -16,6 +16,14 @@ import com.ym.mec.common.enums.BaseEnum;
  */
 public class MusicGroupPaymentCalender {
 
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
+
 	public enum PaymentCalenderStatusEnum implements BaseEnum<String, PaymentCalenderStatusEnum> {
 		AUDITING("审核中"), REJECT("拒绝"), NO("未开启缴费"), OPEN("开启缴费"), OVER("缴费已结束"), PAID("已缴费");
 
@@ -140,6 +148,9 @@ public class MusicGroupPaymentCalender {
 	@ApiModelProperty(value = "批次号", required = false)
 	private String batchNo;
 
+	@ApiModelProperty(value = "chargeTypeId", required = false)
+	private Integer chargeTypeId;
+
 	public String getAuditMemo() {
 		return auditMemo;
 	}

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

@@ -36,7 +36,7 @@ public interface ExtracurricularExercisesService extends BaseService<Long, Extra
      * @param search:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
-    List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId);
+    List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId,Long classGroupId,Integer subjectId);
 
     /**
      * @describe 应布置课外训练提醒

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

@@ -3129,7 +3129,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					if (DateUtil.minutesBetween(newCourseSchedule.getStartClassTime(), practiceGroup.getCoursesStartDate()) > 0) {
 						throw new BizException("调整失败: 调整时间不得早于开课时间");
 					}
-					if (DateUtil.isSameDay(practiceGroup.getCoursesExpireDate(), newCourseSchedule.getEndClassTime())&&DateUtil.minutesBetween(practiceGroup.getCoursesExpireDate(), newCourseSchedule.getEndClassTime()) > 0) {
+					if (!DateUtil.isSameDay(practiceGroup.getCoursesExpireDate(), newCourseSchedule.getEndClassTime())&&DateUtil.minutesBetween(practiceGroup.getCoursesExpireDate(), newCourseSchedule.getEndClassTime()) > 0) {
 						throw new BizException("调整失败: 截止时间超过课程有效期");
 					}
 				}

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

@@ -168,10 +168,10 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 	}
 
 	@Override
-	public List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId) {
+	public List<BasicUserDto> getDontServeStudents(Integer teacherId, String search, String musicGroupId,Long classGroupId,Integer subjectId) {
 		LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-		return extracurricularExercisesDao.findNoExercisesStudentsInThisWeekWithTeacher(teacherId, monDayDate.toString(), musicGroupId, search);
+		return extracurricularExercisesDao.findNoExercisesStudentsInThisWeekWithTeacher(teacherId, monDayDate.toString(), musicGroupId, classGroupId, subjectId, search);
 	}
 
 	@Override

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

@@ -38,6 +38,12 @@ public class InspectionItemServiceImpl extends BaseServiceImpl<Long, InspectionI
             queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(queryInfo.getMonth())));
         }
+        if (queryInfo.getStartTime() != null) {
+            queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getStartTime()));
+        }
+        if (queryInfo.getEndTime() != null) {
+            queryInfo.setEndTime(DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(queryInfo.getEndTime())));
+        }
         PageInfo<InspectionItem> pageInfo = this.queryPage(queryInfo);
         if (pageInfo.getTotal() <= 0) {
             return pageInfo;

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java

@@ -163,6 +163,18 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
 											ts.setExpectSalary(duration.divide(new BigDecimal(mins), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher90MinSalary()));
 										}
 									}
+									if(CourseScheduleType.HIGH.equals(tdms.getCourseScheduleType())){
+										if (!classGroupStudentNumMap.containsKey(ts.getClassGroupId())) {
+											// 查询 班级人数
+											String[] strs = classGroupStudentMapperDao.findStudentNumByClassGroupId(ts.getClassGroupId());
+											classGroupStudentNumMap.put(ts.getClassGroupId(), strs.length);
+										}
+										Integer studentNum = classGroupStudentNumMap.get(ts.getClassGroupId());
+										if(studentNum == null || studentNum == 0){
+											studentNum = 1;
+										}
+										ts.setExpectSalary(ts.getExpectSalary().multiply(new BigDecimal(studentNum)));
+									}
 									list.add(ts);
 								} else if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT) {// 默认课酬
 									mins = 30;
@@ -181,6 +193,18 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
 											ts.setExpectSalary(duration.divide(minsDecimal, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher30MinSalary()));
 										}
 									}
+									if(CourseScheduleType.HIGH.equals(tdms.getCourseScheduleType())){
+										if (!classGroupStudentNumMap.containsKey(ts.getClassGroupId())) {
+											// 查询 班级人数
+											String[] strs = classGroupStudentMapperDao.findStudentNumByClassGroupId(ts.getClassGroupId());
+											classGroupStudentNumMap.put(ts.getClassGroupId(), strs.length);
+										}
+										Integer studentNum = classGroupStudentNumMap.get(ts.getClassGroupId());
+										if(studentNum == null || studentNum == 0){
+											studentNum = 1;
+										}
+										ts.setExpectSalary(ts.getExpectSalary().multiply(new BigDecimal(studentNum)));
+									}
 									list.add(ts);
 								}
 								if(ts.getExpectSalary() == null){

+ 19 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -653,4 +653,23 @@
         HAVING
         COUNT(CASE WHEN cgsm.status_ = 'NORMAL' THEN 1 ELSE NULL END) &lt; 3
     </select>
+
+    <select id="getStudentClassGroupWithTeacher" resultMap="com.ym.mec.biz.dal.dao.ClassGroupDao.ClassGroup">
+        SELECT
+            cg.*
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
+            LEFT JOIN class_group cg ON cg.id_ = cgsm.class_group_id_
+        WHERE
+            cg.del_flag_ = 0
+            AND cg.lock_flag_ =0
+            AND cgsm.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+            <if test="teacherId!=null">
+                AND cgtm.user_id_ = #{teacherId}
+            </if>
+    </select>
 </mapper>

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

@@ -2485,6 +2485,7 @@
             AND (cs.music_group_id_=#{search} OR cs.id_=#{search} OR cs.name_ LIKE CONCAT( '%', #{search}, '%' ))
         </if>
         <if test="searchType == 'ERR_ATTENDANCE'">
+            AND cs.class_date_>='2021-02-20'
             AND ta.teacher_id_ = cs.actual_teacher_id_
             AND cs.status_ = 'OVER'
             AND (ta.sign_in_status_ != 1 OR ta.sign_out_status_ != 1 OR sa.status_ != 'NORMAL') AND ta.dispose_content_ IS NULL

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml

@@ -172,6 +172,9 @@
 			<if test="musicGroupId!=null and musicGroupId!=''">
 				LEFT JOIN student_registration sr ON sees.student_id_=sr.user_id_
 			</if>
+			<if test="classGroupId!=null">
+				LEFT JOIN class_group_student_mapper cgsm ON sees.student_id_ = cgsm.user_id_
+			</if>
 			LEFT JOIN student stu ON stu.user_id_ = sees.student_id_
 			LEFT JOIN sys_user su ON su.id_ = sees.student_id_
 			LEFT JOIN `subject` sub ON FIND_IN_SET( sub.id_, stu.subject_id_list_ )
@@ -183,6 +186,12 @@
 			<if test="musicGroupId!=null and musicGroupId!=''">
 				AND sr.music_group_id_=#{musicGroupId}
 			</if>
+			<if test="classGroupId!=null">
+				AND cgsm.class_group_id_ = #{classGroupId}
+			</if>
+			<if test="subjectId!=null">
+				AND FIND_IN_SET(stu.subject_id_list_, #{subjectId})
+			</if>
 			<if test="search!=null">
 				AND (su.username_ LIKE CONCAT('%', #{search}, '%') OR su.phone_ LIKE CONCAT(#{search}, '%'))
 			</if>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -590,7 +590,7 @@
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
 		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime}
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime} AND cs.class_date_>='2021-02-20'
 		AND (ta.sign_in_status_ != 1 OR ta.sign_out_status_ != 1 OR sa.status_ != 'NORMAL') AND ta.dispose_content_ IS NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 		<if test="organIds != null and organIds != ''">
@@ -649,7 +649,7 @@
 		LEFT JOIN inspection i ON ii.inspection_id_ = i.id_
 		WHERE ii.item_ = 'VISIT' AND ii.memo_ =''
 		AND ii.times_ > (SELECT COUNT(DISTINCT sv.id_) FROM student_visit sv
-		WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(ii.create_time_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
+		WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(i.month_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
 		AND i.month_ >= #{startTime} AND i.month_ &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
 		<if test="organIdsStr != null and organIdsStr != ''">
 			AND FIND_IN_SET(ii.organ_id_,#{organIdsStr})

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

@@ -173,7 +173,7 @@
                 <if test="searchType == 'STUDENT_VISIT'">
                     AND ii.item_ = 'VISIT' AND ii.memo_ ='' AND DATE_FORMAT(i.month_,'%Y-%m-%d') >= #{searchStartTime}
                     AND ii.times_ > (SELECT COUNT(DISTINCT sv.id_) FROM student_visit sv
-                    WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(ii.create_time_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
+                    WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(i.month_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
                 </if>
             </if>
             <if test="organId != null">

+ 13 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -629,4 +629,17 @@
         GROUP BY s.user_id_ HAVING COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 ELSE NULL END) = 0
         AND COUNT(CASE WHEN sr.music_group_status_ = 'NORMAL' AND mg.status_ = 'PROGRESS' THEN 1 ELSE NULL END) = 0;
     </select>
+
+    <select id="getStudentSubjects" resultMap="com.ym.mec.biz.dal.dao.SubjectDao.Subject">
+        SELECT
+            DISTINCT sub.*
+        FROM
+            student stu
+            LEFT JOIN `subject` sub ON FIND_IN_SET( stu.subject_id_list_, sub.id_ )
+        WHERE
+            stu.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+    </select>
 </mapper>

+ 2 - 3
mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml

@@ -182,15 +182,14 @@
         </foreach>
     </select>
     <select id="getTeacherVisitCount" resultType="com.ym.mec.biz.dal.dto.TeacherVisitDto">
-        SELECT organ_id_ organId, teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
+        SELECT teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
         FROM student_visit
         WHERE teacher_id_ IN
         <foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
             #{teacherId}
         </foreach>
         AND visit_time_ >= #{startTime}
-        <![CDATA[AND visit_time_ <= #{endTime}
-        ]]>
+        <![CDATA[ AND visit_time_ <= #{endTime} ]]>
         GROUP BY teacher_id_,date_format(visit_time_, '%Y-%m')
     </select>
 </mapper>

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

@@ -83,6 +83,10 @@ public class StudentOrderController extends BaseController {
     private DegreeRegistrationDao degreeRegistrationDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
 
 
     @Value("${spring.profiles.active:dev}")
@@ -144,6 +148,14 @@ public class StudentOrderController extends BaseController {
             orderDetail.put("ownershipType", musicGroup.getOwnershipType());
             orderDetail.put("detailType", orderDetailType);
             orderDetail.put("chargeTypeId", musicGroup.getChargeTypeId());
+
+            //新的课程形态10.27
+            MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(musicGroup.getId());
+            if (musicGroupRegCalender != null) {
+                List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getMusicGroupRegCalenderCourseSettings(musicGroup.getId());
+                musicGroupRegCalender.setMusicGroupPaymentCalenderCourseSettingsList(courseSettings);
+            }
+            orderDetail.put("calender", musicGroupRegCalender);
         } else if (orderByOrderNo.getGroupType().equals(GroupType.VIP)) {
             VipBuyResultDto vipBuyResultInfo = vipGroupService.findVipBuyResultInfo(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
             orderDetail.put("detail", vipBuyResultInfo);
@@ -333,7 +345,7 @@ public class StudentOrderController extends BaseController {
 
         String[] statusArr = {"0", "1", "7"};
         for (StudentPaymentOrder payingOrder : payingOrders) {
-            if(StringUtils.isNotBlank(orderNo)&&!orderNo.equals(payingOrder.getOrderNo())){
+            if (StringUtils.isNotBlank(orderNo) && !orderNo.equals(payingOrder.getOrderNo())) {
                 continue;
             }
             Map<String, String> rpMap = new HashMap<>();
@@ -774,5 +786,17 @@ public class StudentOrderController extends BaseController {
         return succeed(studentPaymentOrderService.reConfirmOrder(startTime, endTime));
     }
 
+    @GetMapping("/getMusicGroupApplyCalender")
+    public HttpResponseResult<MusicGroupPaymentCalender> getMusicGroupApplyCalender(String musicGroupId){
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(musicGroupId);
+        if (musicGroupRegCalender != null) {
+            MusicGroup musicGroup = musicGroupService.get(musicGroupId);
+            musicGroupRegCalender.setChargeTypeId(musicGroup.getChargeTypeId());
+            List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getMusicGroupRegCalenderCourseSettings(musicGroupId);
+            musicGroupRegCalender.setMusicGroupPaymentCalenderCourseSettingsList(courseSettings);
+        }
+        return succeed(musicGroupRegCalender);
+    }
+
 
 }

+ 39 - 7
mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesController.java

@@ -2,10 +2,14 @@ package com.ym.mec.teacher.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
 import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
 import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
 import com.ym.mec.biz.service.ExtracurricularExercisesService;
@@ -22,10 +26,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -45,6 +46,10 @@ public class ExtracurricularExercisesController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private StudentRegistrationDao studentRegistrationDao;
+    @Autowired
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+    @Autowired
+    private StudentDao studentDao;
 
     @ApiOperation(value = "创建课外训练")
     @PostMapping("/createExtraExercises")
@@ -81,12 +86,12 @@ public class ExtracurricularExercisesController extends BaseController {
 
     @ApiOperation(value = "获取待布置学员列表")
     @GetMapping("/getDontServeStudents")
-    public HttpResponseResult getDontServeStudents(String search, String musicGroupId){
+    public HttpResponseResult getDontServeStudents(String search, String musicGroupId, Long classGroupId, Integer subjectId){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(Objects.isNull(sysUser)){
             return failed(HttpStatus.FORBIDDEN,"请登录");
         }
-        return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId));
+        return succeed(extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, musicGroupId, classGroupId, subjectId));
     }
 
     @ApiOperation(value = "获取待布置学员乐团列表")
@@ -96,7 +101,7 @@ public class ExtracurricularExercisesController extends BaseController {
         if(Objects.isNull(sysUser)){
             return failed(HttpStatus.FORBIDDEN,"请登录");
         }
-        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null);
+        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), search, null, null,null);
         if(CollectionUtils.isEmpty(dontServeStudents)){
             return succeed(Collections.emptyList());
         }
@@ -104,4 +109,31 @@ public class ExtracurricularExercisesController extends BaseController {
         List<MusicGroup> studentNormalMusicGroups = studentRegistrationDao.getStudentNormalMusicGroups(studentIds);
         return succeed(studentNormalMusicGroups);
     }
+
+    @ApiOperation(value = "获取服务学员查询条件")
+    @GetMapping("/getDontServeStudentQueryCondition")
+    public HttpResponseResult getDontServeStudentQueryCondition(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        Map<String, Object> result = new HashMap<>();
+        List<BasicUserDto> dontServeStudents = extracurricularExercisesService.getDontServeStudents(sysUser.getId(), null, null, null, null);
+        if(CollectionUtils.isEmpty(dontServeStudents)){
+            result.put("musicGroups", Collections.emptyList());
+            result.put("classGroups", Collections.emptyList());
+            result.put("subjects", Collections.emptyList());
+            return succeed(result);
+        }
+        Set<Integer> studentIds = dontServeStudents.stream().map(BasicUserDto::getUserId).collect(Collectors.toSet());
+        List<MusicGroup> studentNormalMusicGroups = studentRegistrationDao.getStudentNormalMusicGroups(studentIds);
+        result.put("musicGroups", studentNormalMusicGroups);
+
+        List<ClassGroup> classGroups = classGroupStudentMapperDao.getStudentClassGroupWithTeacher(studentIds, sysUser.getId());
+        result.put("classGroups", classGroups);
+
+        List<Subject> studentSubjects = studentDao.getStudentSubjects(studentIds);
+        result.put("subjects", studentSubjects);
+        return succeed(result);
+    }
 }