Explorar o código

网络教室中间页

zouxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
483560df9f
Modificáronse 21 ficheiros con 552 adicións e 19 borrados
  1. 0 1
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java
  2. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleComplaintsDao.java
  3. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  4. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java
  5. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  6. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java
  7. 44 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleComplaintsDto.java
  8. 85 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleRateDto.java
  9. 37 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherRemarkCommitDto.java
  10. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  11. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java
  12. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java
  13. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  14. 139 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  15. 12 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml
  16. 9 4
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  17. 52 4
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  18. 8 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  19. 5 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  20. 12 3
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  21. 27 5
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

+ 0 - 1
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java

@@ -36,7 +36,6 @@ public class SysUser implements Serializable{
 	@ApiModelProperty(value = "随机盐",required = false)
 	private String salt;
 
-	/** 简介 */
 	@ApiModelProperty(value = "手机号",required = false)
 	private String phone;
 

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleComplaintsDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.CourseScheduleComplaintsDto;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -25,5 +26,11 @@ public interface CourseScheduleComplaintsDao extends BaseDAO<Long, CourseSchedul
      * @describe 根据课程编号批量获取投诉记录
      */
     List<CourseScheduleComplaints> findByCourseScheduleIds(@Param("ids") List<Long> ids);
-	
+
+    /**
+     * 获取课程的学员评价
+     * @param courseScheduleId
+     * @return
+     */
+    List<CourseScheduleComplaintsDto> findByCourseScheduleId(Long courseScheduleId);
 }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1268,4 +1268,27 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
                                             @Param("groupType") GroupType groupType);
 
     List<CourseSchedule> findClassGroupLastTeacher(@Param("classGroupIds") List<Integer> classGroupIds);
+
+    /**
+     * 获取当前课程声部
+     * @param courseScheduleId
+     * @return
+     */
+    String getSubjectNameById(Long courseScheduleId);
+
+    /**
+     * 教师端中间页网络教室课程进度列表
+     * @param groupId
+     * @param groupType
+     * @return
+     */
+    List<CourseScheduleRateDto> findCourseRate(@Param("groupId") String groupId, @Param("groupType") String groupType);
+
+    /**
+     * 获取最后一次已结束的课程
+     * @param groupId
+     * @param groupType
+     * @return
+     */
+    CourseSchedule getLastEndCourse(@Param("groupId") String groupId, @Param("groupType") String groupType);
 }

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

@@ -32,4 +32,12 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
      */
     List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate")Date expiredDate);
+
+    /**
+     * 获取当前课程教师的评价列表
+     * @param teacherId
+     * @param courseScheduleId
+     * @return
+     */
+    List<CourseScheduleEvaluate> findByCourseAndTeacher(@Param("teacherId") Integer teacherId, @Param("courseScheduleId") Long courseScheduleId);
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.StudentAttendanceStatisticsResponse;
 import com.ym.mec.biz.dal.dto.VipGroupGiveCourseSortDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
@@ -221,4 +222,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      */
     int deleteByGroup(@Param("groupId") String groupId,
                       @Param("groupType")GroupType groupType);
+
+    /**
+     * 获取当前课程的学员列表
+     * @param courseScheduleId
+     * @return
+     */
+    List<BasicUserDto> findStudents(Long courseScheduleId);
 }

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

@@ -361,4 +361,11 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 	 * @return
 	 */
     Boolean isTeacher(@Param("groupId") Integer groupId, @Param("userId") Integer userId);
+
+	/**
+	 * 统计老师授课次数
+	 * @param userId
+	 * @return
+	 */
+	Integer countTeacherGiveLesson(Integer userId);
 }

+ 44 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleComplaintsDto.java

@@ -0,0 +1,44 @@
+package com.ym.mec.biz.dal.dto;
+
+public class CourseScheduleComplaintsDto{
+
+    private String username;
+
+    private String reason;
+
+    private Integer score;
+
+    private String avatar;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Integer getScore() {
+        return score;
+    }
+
+    public void setScore(Integer score) {
+        this.score = score;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+}

+ 85 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleRateDto.java

@@ -0,0 +1,85 @@
+package com.ym.mec.biz.dal.dto;
+
+
+public class CourseScheduleRateDto {
+    private String classDate;
+
+    private Long courseScheduleId;
+
+    private String startClassTime;
+
+    private String endClassTime;
+
+    private String teachingContent;
+
+    private String comment;
+
+    private String courseStatus;
+
+    private Boolean isDefault = false;
+
+    public Boolean getIsDefault() {
+        return isDefault;
+    }
+
+    public void setIsDefault(Boolean aDefault) {
+        isDefault = aDefault;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public String getCourseStatus() {
+        return courseStatus;
+    }
+
+    public void setCourseStatus(String courseStatus) {
+        this.courseStatus = courseStatus;
+    }
+
+    public String getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(String classDate) {
+        this.classDate = classDate;
+    }
+
+    public String getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(String startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public String getEndClassTime() {
+        return endClassTime;
+    }
+
+    public void setEndClassTime(String endClassTime) {
+        this.endClassTime = endClassTime;
+    }
+
+    public String getTeachingContent() {
+        return teachingContent;
+    }
+
+    public void setTeachingContent(String teachingContent) {
+        this.teachingContent = teachingContent;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+}
+

+ 37 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherRemarkCommitDto.java

@@ -0,0 +1,37 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
+
+import java.util.List;
+
+public class TeacherRemarkCommitDto {
+    private Long courseScheduleId;
+
+    private String teachingContent;
+
+    private List<CourseScheduleEvaluate> courseScheduleEvaluates;
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public String getTeachingContent() {
+        return teachingContent;
+    }
+
+    public void setTeachingContent(String teachingContent) {
+        this.teachingContent = teachingContent;
+    }
+
+    public List<CourseScheduleEvaluate> getCourseScheduleEvaluates() {
+        return courseScheduleEvaluates;
+    }
+
+    public void setCourseScheduleEvaluates(List<CourseScheduleEvaluate> courseScheduleEvaluates) {
+        this.courseScheduleEvaluates = courseScheduleEvaluates;
+    }
+}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java

@@ -145,6 +145,26 @@ public class CourseSchedule {
 
 	private YesOrNoEnum isCallNames;
 
+	private String teachingContent;
+
+	private String note;
+
+	public String getTeachingContent() {
+		return teachingContent;
+	}
+
+	public void setTeachingContent(String teachingContent) {
+		this.teachingContent = teachingContent;
+	}
+
+	public String getNote() {
+		return note;
+	}
+
+	public void setNote(String note) {
+		this.note = note;
+	}
+
 	public YesOrNoEnum getIsCallNames() {
 		return isCallNames;
 	}

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

@@ -45,6 +45,16 @@ public class CourseScheduleEvaluate {
 
     private Integer isPushed;
 
+    private String studentIdList;
+
+    public String getStudentIdList() {
+        return studentIdList;
+    }
+
+    public void setStudentIdList(String studentIdList) {
+        this.studentIdList = studentIdList;
+    }
+
     public Integer getIsPushed() {
         return isPushed;
     }

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

@@ -103,6 +103,16 @@ public class Teacher extends SysUser {
 
 	private List<School> teacherSchools;
 
+	private Integer lectureNum;
+
+	public Integer getLectureNum() {
+		return lectureNum;
+	}
+
+	public void setLectureNum(Integer lectureNum) {
+		this.lectureNum = lectureNum;
+	}
+
 	public Integer getTeacherOrganId() {
 		return teacherOrganId;
 	}

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

@@ -449,4 +449,32 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param courseScheduleIds
 	 */
     void cleanAttendance(String courseScheduleIds);
+
+	/**
+	 * 教师端中间页课程评价数据获取
+	 * @param courseScheduleId
+	 * @return
+	 */
+	Object teacherCourseRemarkInfo(Long courseScheduleId);
+
+	/**
+	 * 教师端中间页课程评价数据提交
+	 * @param teacherRemarkCommitDto
+	 * @return
+	 */
+	void teacherCourseRemarkCommit(TeacherRemarkCommitDto teacherRemarkCommitDto);
+
+	/**
+	 * 教师端中间页网络教室头部详情
+	 * @param courseScheduleId
+	 * @return
+	 */
+    Object teacherCourseHeadInfo(Long courseScheduleId);
+
+	/**
+	 * 教师端中间页网络教室课程进度列表
+	 * @param courseScheduleId
+	 * @return
+	 */
+	Object teacherCourseRates(Long courseScheduleId);
 }

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

@@ -59,6 +59,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Autowired
     private CourseScheduleComplaintsDao courseScheduleComplaintsDao;
     @Autowired
+    private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
+    @Autowired
     private SysConfigDao sysConfigDao;
     @Autowired
     private StudentAttendanceDao studentAttendanceDao;
@@ -3833,4 +3835,141 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         teacherAttendanceDao.batchCleanCourseTeacherSignInfo(courseScheduleId);
         studentAttendanceDao.deleteByCourseSchedules(courseScheduleId);
     }
+
+	@Override
+	public Object teacherCourseRemarkInfo(Long courseScheduleId) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (null == user) {
+			throw new BizException("获取用户信息失败");
+		}
+		if(courseScheduleId == null){
+			throw new BizException("参数校验失败");
+		}
+		Map<String,Object> resultMap = new HashMap<>(7);
+		//获取课程详情
+		CourseSchedule schedule = courseScheduleDao.get(courseScheduleId);
+		resultMap.put("courseScheduleName",schedule.getName());
+		resultMap.put("courseScheduleClassDate",schedule.getClassDate());
+		resultMap.put("courseScheduleStartClassTime",schedule.getStartClassTime());
+		resultMap.put("courseScheduleEndClassTime",schedule.getEndClassTime());
+		resultMap.put("courseScheduleContent",schedule.getTeachingContent());
+		//获取当前课程的声部
+		resultMap.put("subjectName",courseScheduleDao.getSubjectNameById(courseScheduleId));
+		//获取学员评论详情
+		resultMap.put("studentRemark",courseScheduleComplaintsDao.findByCourseScheduleId(courseScheduleId));
+		//获取当前课程的学员列表
+		resultMap.put("students",courseScheduleStudentPaymentDao.findStudents(courseScheduleId));
+		//获取当前课程老师的评价列表
+		resultMap.put("teacherRemark",courseScheduleEvaluateDao.findByCourseAndTeacher(user.getId(),courseScheduleId));
+		return resultMap;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void teacherCourseRemarkCommit(TeacherRemarkCommitDto teacherRemarkCommitDt) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (null == user) {
+			throw new BizException("获取用户信息失败");
+		}
+		Long courseScheduleId = teacherRemarkCommitDt.getCourseScheduleId();
+		CourseSchedule schedule = courseScheduleDao.get(courseScheduleId);
+		if(schedule == null){
+			throw new BizException("课程不存在");
+		}
+		if(StringUtils.isNotEmpty(schedule.getTeachingContent())){
+			throw new BizException("您已提交过课程评价,请勿重复提交");
+		}
+		//是否提交过评论
+		List<CourseScheduleEvaluate> byCourseAndTeacher = courseScheduleEvaluateDao.findByCourseAndTeacher(user.getId(), courseScheduleId);
+		if(byCourseAndTeacher != null && byCourseAndTeacher.size() > 0){
+			throw new BizException("您已提交过课程评价,请勿重复提交");
+		}
+		//修改教学内容
+		if(StringUtils.isNotEmpty(teacherRemarkCommitDt.getTeachingContent())){
+			schedule.setTeachingContent(teacherRemarkCommitDt.getTeachingContent());
+			schedule.setUpdateTime(new Date());
+			courseScheduleDao.update(schedule);
+		}
+		List<CourseScheduleEvaluate> courseScheduleEvaluates = teacherRemarkCommitDt.getCourseScheduleEvaluates();
+		if(courseScheduleEvaluates != null || courseScheduleEvaluates.size() > 0){
+			courseScheduleEvaluates.forEach(e->{
+				e.setMusicGroupId(schedule.getMusicGroupId());
+				e.setClassGroupId(schedule.getClassGroupId());
+				e.setTeacherId(user.getId());
+				e.setCourseScheduleId(courseScheduleId);
+				e.setIsPushed(0);
+				courseScheduleEvaluateDao.insert(e);
+			});
+		}
+	}
+
+	@Override
+	public Object teacherCourseHeadInfo(Long courseScheduleId) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (null == user) {
+			throw new BizException("获取用户信息失败");
+		}
+		CourseSchedule schedule = courseScheduleDao.get(courseScheduleId);
+		if(schedule == null){
+			throw new BizException("课程不存在");
+		}
+		GroupType groupType = schedule.getGroupType();
+		Map<String,Object> resultMap = new HashMap<>(8);
+		Teacher teacher;
+		switch (groupType){
+			case PRACTICE:
+				PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(schedule.getMusicGroupId()));
+				resultMap.put("groupName",practiceGroup.getName());
+				resultMap.put("startTime",practiceGroup.getCoursesStartDate());
+				resultMap.put("endTime",practiceGroup.getCoursesExpireDate());
+				resultMap.put("groupStatus",practiceGroup.getGroupStatus().getDesc());
+				teacher = teacherDao.get(practiceGroup.getUserId());
+				resultMap.put("groupTeacher",teacher.getRealName());
+				resultMap.put("teacherIntroduction",teacher.getIntroduction());
+				resultMap.put("teacherAvatar",teacher.getAvatar());
+				//统计授课次数
+				resultMap.put("teacherGiveLesson",courseScheduleTeacherSalaryDao.countTeacherGiveLesson(practiceGroup.getUserId()));
+				break;
+			case VIP:
+				VipGroup vipGroup = vipGroupDao.get(Long.parseLong(schedule.getMusicGroupId()));
+				resultMap.put("groupName",vipGroup.getName());
+				resultMap.put("startTime",vipGroup.getCourseStartDate());
+				resultMap.put("endTime",vipGroup.getCoursesExpireDate());
+				resultMap.put("groupStatus",vipGroup.getStatus().getMsg());
+				teacher = teacherDao.get(vipGroup.getUserId());
+				resultMap.put("groupTeacher",teacher.getRealName());
+				resultMap.put("teacherIntroduction",teacher.getIntroduction());
+				resultMap.put("teacherAvatar",teacher.getAvatar());
+				//统计授课次数
+				resultMap.put("teacherGiveLesson",courseScheduleTeacherSalaryDao.countTeacherGiveLesson(vipGroup.getUserId()));
+				break;
+			default:
+				throw new BizException("课程类型错误");
+		}
+		return resultMap;
+	}
+
+	@Override
+	public Object teacherCourseRates(Long courseScheduleId) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (null == user) {
+			throw new BizException("获取用户信息失败");
+		}
+		CourseSchedule schedule = courseScheduleDao.get(courseScheduleId);
+		if(schedule == null){
+			throw new BizException("课程不存在");
+		}
+		//获取课程列表
+		List<CourseScheduleRateDto> courseScheduleRateDtos = courseScheduleDao.findCourseRate(schedule.getMusicGroupId(),schedule.getGroupType().getCode());
+		//获取最近一次已结束的课程
+		CourseSchedule courseSchedule = courseScheduleDao.getLastEndCourse(schedule.getMusicGroupId(),schedule.getGroupType().getCode());
+		//标记当前课程的上一节课
+		for (CourseScheduleRateDto e:courseScheduleRateDtos) {
+			if(e.getCourseScheduleId().equals(courseSchedule.getId())){
+				e.setIsDefault(true);
+				break;
+			}
+		}
+		return courseScheduleRateDtos;
+	}
 }

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml

@@ -106,4 +106,16 @@
 		</foreach>
 		AND status_!='REJECT' AND score_ &lt;= 2
 	</select>
+	<resultMap id="CourseScheduleComplaintsDtoMap" type="com.ym.mec.biz.dal.dto.CourseScheduleComplaintsDto">
+		<result property="username" column="username_"/>
+		<result property="reason" column="reason_"/>
+		<result property="score" column="score_"/>
+		<result property="avatar" column="avatar_"/>
+	</resultMap>
+	<select id="findByCourseScheduleId" resultMap="CourseScheduleComplaintsDtoMap">
+		SELECT su.username_,csc.reason_,csc.score_,su.avatar_
+		FROM course_schedule_complaints csc
+		LEFT JOIN sys_user su ON su.id_ = csc.user_id_
+		WHERE csc.course_schedule_id_ = #{courseScheduleId}
+	</select>
 </mapper>

+ 9 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -13,15 +13,16 @@
         <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
         <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
         <result column="is_pushed_" jdbcType="INTEGER" property="isPushed"/>
+        <result column="student_id_list_" jdbcType="VARCHAR" property="studentIdList"/>
     </resultMap>
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        insert into course_schedule_evaluate (music_group_id_, class_group_id_, course_schedule_id_,
+        INSERT INTO course_schedule_evaluate (music_group_id_, class_group_id_, course_schedule_id_,
                                               teacher_id_, item_, comment_,
-                                              create_time_)
-        values (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
+                                              create_time_,student_id_list_)
+        VALUES (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
                 #{teacherId,jdbcType=INTEGER}, #{item,jdbcType=VARCHAR}, #{comment,jdbcType=LONGVARCHAR},
-                #{createTime,jdbcType=TIMESTAMP})
+                NOW(),#{studentIdList})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate">
@@ -108,4 +109,8 @@
       WHERE create_time_ &lt;= #{expiredDate}
       AND (is_pushed_ = 0 OR is_pushed_ IS NULL)
     </select>
+    <select id="findByCourseAndTeacher" resultMap="CourseScheduleEvaluate">
+        SELECT * FROM course_schedule_evaluate cse
+        WHERE cse.teacher_id_ = #{teacherId} AND cse.course_schedule_id_ = #{courseScheduleId}
+    </select>
 </mapper>

+ 52 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -31,6 +31,8 @@
         <result column="schoole_name_" property="schoolName"/>
         <result column="class_group_name_" property="classGroupName"/>
         <result column="class_group_type_" property="classGroupType"/>
+        <result column="teaching_content_" property="teachingContent"/>
+        <result column="note_" property="note"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="Mapper">
@@ -122,6 +124,8 @@
                name_,
                student_num_,
                leave_student_num_,
+               teaching_content_,
+               note_,
                schoole_id_
         FROM course_schedule
         WHERE id_ = #{id}
@@ -143,17 +147,25 @@
         </selectKey>
         -->
         INSERT INTO course_schedule
-        (id_,group_type_,music_group_id_,class_group_id_,status_,subsidy_,class_date_,start_class_time_,end_class_time_,teacher_id_,actual_teacher_id_,create_time_,update_time_,type_,name_,teach_mode_,student_num_,leave_student_num_,schoole_id_,is_lock_)
-        VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subsidy},#{classDate},#{startClassTime},#{endClassTime},#{teacherId},#{teacherId},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{name},#{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{studentNum},#{leaveStudentNum},#{schoolId},#{isLock})
+        (id_,group_type_,music_group_id_,class_group_id_,status_,subsidy_,class_date_,start_class_time_,end_class_time_,teacher_id_,actual_teacher_id_,create_time_,update_time_,type_,name_,teach_mode_,student_num_,leave_student_num_,schoole_id_,is_lock_,note_,teaching_content_)
+        VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{classGroupId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subsidy},#{classDate},#{startClassTime},#{endClassTime},#{teacherId},#{teacherId},now(),now(),
+        #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{name},#{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{studentNum},#{leaveStudentNum},#{schoolId},#{isLock},#{note},#{teachingContent})
     </insert>
 
     <insert id="batchAddCourseSchedules" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO course_schedule
-        (group_type_,music_group_id_,class_group_id_,status_,subsidy_,class_date_,start_class_time_,end_class_time_,teacher_id_,actual_teacher_id_,create_time_,update_time_,type_,name_,teach_mode_,student_num_,leave_student_num_,schoole_id_,is_lock_)
+        (group_type_,music_group_id_,class_group_id_,status_,subsidy_,class_date_,start_class_time_,end_class_time_,
+        teacher_id_,actual_teacher_id_,create_time_,update_time_,type_,name_,teach_mode_,student_num_,leave_student_num_,
+        schoole_id_,is_lock_,note_,teaching_content_)
         VALUE
         <foreach collection="list" item="course" separator=",">
-            (#{course.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.musicGroupId},#{course.classGroupId},#{course.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.subsidy},#{course.classDate},#{course.startClassTime},#{course.endClassTime},#{course.teacherId},#{course.teacherId},now(),now(),#{course.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.name},#{course.teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.studentNum},#{course.leaveStudentNum},#{course.schoolId},#{course.isLock})
+            (#{course.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.musicGroupId},
+            #{course.classGroupId},#{course.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{course.subsidy},#{course.classDate},#{course.startClassTime},#{course.endClassTime},#{course.teacherId},
+            #{course.teacherId},now(),now(),#{course.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{course.name},#{course.teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{course.studentNum},
+            #{course.leaveStudentNum},#{course.schoolId},#{course.isLock},#{course.note},#{course.teachingContent})
         </foreach>
     </insert>
 
@@ -161,6 +173,12 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule">
         UPDATE course_schedule
         <set>
+            <if test="note != null">
+                note_ = #{note},
+            </if>
+            <if test="teachingContent != null">
+                teaching_content_ = #{teachingContent},
+            </if>
             <if test="classDate != null">
                 class_date_ = #{classDate},
             </if>
@@ -2592,6 +2610,36 @@
     <select id="findGroupNotStartCourses" resultMap="CourseSchedule">
         SELECT * FROM course_schedule WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND music_group_id_ = #{groupId} AND CONCAT(class_date_, ' ', start_class_time_)>NOW()
     </select>
+    <select id="getSubjectNameById" resultType="java.lang.String">
+        SELECT GROUP_CONCAT(DISTINCT s.name_) FROM course_schedule cs
+        LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
+        WHERE cs.id_ = #{courseScheduleId}
+        GROUP BY cg.id_
+    </select>
+    <resultMap id="CourseScheduleRateDtoMap" type="com.ym.mec.biz.dal.dto.CourseScheduleRateDto">
+        <result property="teachingContent" column=""/>
+        <result property="classDate" column="class_date_"/>
+        <result property="startClassTime" column="start_class_time_"/>
+        <result property="comment" column="comment_"/>
+        <result property="endClassTime" column="end_class_time_"/>
+        <result property="courseStatus" column="status_"/>
+        <result property="courseScheduleId" column="id_"/>
+    </resultMap>
+    <select id="findCourseRate" resultMap="CourseScheduleRateDtoMap">
+        SELECT cs.class_date_,cs.start_class_time_,cs.end_class_time_,cs.id_,
+        cs.teaching_content_,GROUP_CONCAT(cse.comment_ SEPARATOR ";") comment_,cs.status_
+        FROM course_schedule cs
+        LEFT JOIN course_schedule_evaluate cse ON cs.id_ = cse.course_schedule_id_
+        WHERE cs.music_group_id_ = #{groupId} AND cs.group_type_ = #{groupType}
+        GROUP BY cs.id_
+        ORDER BY cs.class_date_,cs.start_class_time_ DESC
+    </select>
+    <select id="getLastEndCourse" resultMap="CourseSchedule">
+        SELECT cs.id_ FROM course_schedule cs
+        WHERE cs.music_group_id_ = #{groupId} AND cs.group_type_ = #{groupType} AND NOW() > CONCAT(cs.class_date_,' ',cs.end_class_time_)
+        ORDER BY cs.class_date_,cs.end_class_time_ ASC LIMIT 1
+    </select>
 
     <update id="updateCourseNameByGroup">
         UPDATE course_schedule SET name_=#{name} WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND music_group_id_ = #{groupId};

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

@@ -286,8 +286,15 @@
 	<select id="countStudentNum" resultType="java.lang.Integer">
 		SELECT COUNT(id_) FROM course_schedule_student_payment WHERE course_schedule_id_ = #{courseScheduleId}
 	</select>
+    <select id="findStudents" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
+		SELECT su.id_ user_id_,su.username_,su.avatar_ head_url_,su.gender_
+		FROM course_schedule_student_payment cssp
+		LEFT JOIN sys_user su ON su.id_ = cssp.user_id_
+		WHERE cssp.course_schedule_id_ = #{courseScheduleId}
+		GROUP BY su.id_
+	</select>
 
-	<delete id="deleteStudentCourseSchedule">
+    <delete id="deleteStudentCourseSchedule">
 		DELETE FROM course_schedule_student_payment WHERE user_id_ = #{userId} AND course_schedule_id_ IN
 		<foreach collection="courseScheduleList" item="courseSchedule" index="index" open="(" close=")" separator=",">
 			#{courseSchedule.id}

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

@@ -657,4 +657,9 @@
 		SELECT COUNT(DISTINCT csts.user_id_) FROM class_group_teacher_mapper csts
 		WHERE csts.class_group_id_ = #{groupId} AND csts.user_id_ = #{userId}
 	</select>
+    <select id="countTeacherGiveLesson" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT csts.id_) FROM course_schedule_teacher_salary csts
+		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+		WHERE NOW() >= CONCAT(cs.class_date_ ,' ',cs.end_class_time_) AND csts.user_id_ = #{userId}
+	</select>
 </mapper>

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

@@ -30,6 +30,7 @@
         <result column="is_support_course_schedule_rewards_rules_" property="isSupportCourseScheduleRewardsRules"/>
         <result column="update_time_" property="updateTime"/>
         <result column="create_time_" property="createTime"/>
+        <result column="lecture_num_" property="lectureNum"/>
 
         <result column="username_" property="username"/>
         <result column="password_" property="password"/>
@@ -54,7 +55,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.is_support_course_schedule_rewards_rules_,t.is_support_extra_practice_lesson_,t.lecture_num_,
         su.real_name_,su.password_,su.salt_,su.phone_,su.avatar_,
         su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
         su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,su.username_,su.organ_id_
@@ -74,8 +75,13 @@
     <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_)
-        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})
+        (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_,lecture_num_)
+        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}#{lectureNum})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -90,6 +96,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Teacher">
         UPDATE teacher
         <set>
+            <if test="lectureNum != null">
+                lecture_num_ = #{lectureNum},
+            </if>
             <if test="graduateSchool != null">
                 graduate_school_ = #{graduateSchool},
             </if>

+ 27 - 5
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.biz.dal.dto.TeacherRemarkCommitDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -14,11 +15,7 @@ import java.util.Objects;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
@@ -253,4 +250,29 @@ public class TeacherCourseScheduleController extends BaseController {
         return succeed(scheduleService.endFindCourseSchedules(queryInfo));
     }
 
+    @ApiOperation(value = "教师端中间页课程评价数据获取")
+    @GetMapping("/teacherCourseRemarkInfo")
+    public Object teacherCourseRemarkInfo(Long courseScheduleId){
+        return succeed(scheduleService.teacherCourseRemarkInfo(courseScheduleId));
+    }
+
+    @ApiOperation(value = "教师端中间页课程评价数据提交")
+    @PostMapping("/teacherCourseRemarkCommit")
+    public Object teacherCourseRemarkCommit(@RequestBody TeacherRemarkCommitDto teacherRemarkCommitDto){
+        scheduleService.teacherCourseRemarkCommit(teacherRemarkCommitDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "教师端中间页网络教室头部详情")
+    @GetMapping("/teacherCourseHeadInfo")
+    public Object teacherCourseHeadInfo(Long courseScheduleId){
+        return succeed(scheduleService.teacherCourseHeadInfo(courseScheduleId));
+    }
+
+    @ApiOperation(value = "教师端中间页网络教室课程进度列表")
+    @GetMapping("/teacherCourseRates")
+    public Object teacherCourseRates(Long courseScheduleId){
+        return succeed(scheduleService.teacherCourseRates(courseScheduleId));
+    }
+
 }