瀏覽代碼

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

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
yonge 5 年之前
父節點
當前提交
51eff085ea

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/ResourceServerConfig.java

@@ -26,7 +26,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/task/**","/user/updatePassword").hasIpAddress("0.0.0.0/0").anyRequest().authenticated().and().httpBasic();
+				.authorizeRequests().antMatchers("/task/**","/user/updatePassword","/user/noAuth/queryUserByPhone").hasIpAddress("0.0.0.0/0").anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 13 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -11,6 +11,7 @@ import com.ym.mec.common.security.AuthUser;
 import com.ym.mec.common.security.SecurityConstants;
 import com.ym.mec.common.security.SecurityUtils;
 import com.ym.mec.common.service.IdGeneratorService;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -73,6 +74,15 @@ public class UserController extends BaseController {
 		return sysUserService.queryByPhone(mobile);
 	}
 
+	@GetMapping(value = "/noAuth/queryUserByPhone")
+	public Object noAuthQueryUserByPhone(String mobile) {
+		SysUser sysUser = sysUserService.queryByPhone(mobile);
+		if(sysUser == null){
+			return succeed(0);
+		}
+		return succeed(1);
+	}
+
 	@GetMapping(value = "/queryUserById/{userId}")
 	public SysUser queryUserById(@PathVariable("userId") Integer userId) {
 		return sysUserService.get(userId);
@@ -203,6 +213,9 @@ public class UserController extends BaseController {
 			Date date = new Date();
 			sysUser.setId(user.getUserId());
 			sysUser.setUpdateTime(date);
+			if(sysUser.getBirthdate() != null && DateUtil.daysBetween(sysUser.getBirthdate(),date) <= 0){
+				throw new BizException("出生日期不可超过当前时间");
+			}
 			sysUserService.updateBaseInfo(sysUser);
 			return succeed();
 		}

+ 2 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkListDto.java

@@ -1,12 +1,11 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-
 /**
  * @Author Joburgess
  * @Date 2019/9/19

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

@@ -44,10 +44,20 @@ public class TeacherHomeworkListDto {
     @ApiModelProperty(value = "乐团名称")
     private String musicGroupName;
 
+    private Date startClassTime;
+
     private int isReplied;
 
     private int isSubmit;
 
+    public Date getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(Date startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
     public int getIsSubmit() {
         return isSubmit;
     }

+ 11 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseHomeworkServiceImpl.java

@@ -15,16 +15,14 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -56,7 +54,6 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
 			List<Long> courseIds = dataList.stream().mapToLong(TeacherHomeworkListDto::getCourseScheduleId).boxed().collect(Collectors.toList());
 			List<StudentCourseHomework> allStudentCourseHomeworks = studentCourseHomeworkDao.findByCourses(courseIds);
 			Map<Long, List<StudentCourseHomework>> homeworkStudentMap = allStudentCourseHomeworks.stream().collect(Collectors.groupingBy(StudentCourseHomework::getCourseScheduleId));
-			Map<YesOrNoEnum, List<StudentCourseHomework>> statusStudentMpa = allStudentCourseHomeworks.stream().collect(Collectors.groupingBy(StudentCourseHomework::getStatus));
 			for (TeacherHomeworkListDto teacherHomeworkListDto : dataList) {
 				List<StudentCourseHomework> studentCourseHomeworks = homeworkStudentMap.get(teacherHomeworkListDto.getCourseScheduleId().longValue());
 				if(CollectionUtils.isEmpty(studentCourseHomeworks)){
@@ -66,17 +63,23 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
 				if(CollectionUtils.isEmpty(replyStudentsMap.get(YesOrNoEnum.NO))){
 					teacherHomeworkListDto.setIsReplied(YesOrNoEnum.YES.getCode());
 				}
-				List<StudentCourseHomework> studentCourseHomeworks1 = statusStudentMpa.get(YesOrNoEnum.YES);
-				if(!CollectionUtils.isEmpty(studentCourseHomeworks1)&&studentCourseHomeworks1.size()>0){
+				List<StudentCourseHomework> collect = studentCourseHomeworks.stream().filter(e -> Objects.nonNull(e.getAttachments())).collect(Collectors.toList());
+				if(!CollectionUtils.isEmpty(collect)&&collect.size()>0){
 					teacherHomeworkListDto.setIsSubmit(1);
 				}
 			}
 		}
 		if (count != 0) {
 			Map<String, List<TeacherHomeworkListDto>> collect = dataList.stream().collect(Collectors.groupingBy(TeacherHomeworkListDto::getDay));
-			for (String key : collect.keySet()) {
+			List<Date> dates=new ArrayList<>();
+			collect.keySet().forEach(ds-> dates.add(DateUtil.stringToDate(ds,"yyyy-MM-dd")));
+			dates.sort(Comparator.comparing(Date::getTime));
+			dates.sort(Comparator.reverseOrder());
+			for (Date date : dates) {
+				String key=DateUtil.dateToString(date, "yyyy-MM-dd");
 				Map<String, Object> r = new HashMap<>();
 				r.put("day", key);
+				collect.get(key).sort(Comparator.comparing(TeacherHomeworkListDto::getStartClassTime).reversed());
 				r.put("list", collect.get(key));
 				result.add(r);
 			}

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

@@ -68,10 +68,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     private StudentAttendanceDao studentAttendanceDao;
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-    
+
     @Autowired
     private TeacherDefaultPracticeGroupSalaryDao teacherDefaultPracticeGroupSalaryDao;
-    
+
     @Autowired
     private SysMessageService sysMessageService;
     @Autowired
@@ -116,10 +116,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     private SchoolDao schoolDao;
     @Autowired
 	private ImFeignService imFeignService;
-    
+
     @Autowired
     private CourseHomeworkService courseHomeworkService;
-    
+
     @Autowired
     private GroupDao groupDao;
     @Autowired
@@ -296,7 +296,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
 			subSidy = school.getSubsidy();
 		}
-		
+
 		//查询声部
 		String subjectName = subjectDao.findNames(classGroup.getSubjectIdList());
 
@@ -361,7 +361,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		// 查询班级学生信息
 		List<ClassGroupStudentMapper> classGroupStudentMapperList = classGroupStudentMapperDao.findByClassGroup(classGroupId);
 		String usernameList = classGroupStudentMapperList.stream().map(ClassGroupStudentMapper::getUserName).collect(Collectors.joining("、"));
-		
+
 		Map<Integer, List<CourseTimeDto>> dayOfWeekMap = new HashMap<Integer, List<CourseTimeDto>>();
 		for(CourseTimeDto dto : teachingArrangementList){
 			//检查是否有开始时间
@@ -395,7 +395,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
 		}
 		calendar.setTime(startDate);
-		
+
 		int currentCourseTimes = 0;
 		while (coursesTimes != currentCourseTimes) {
             if (holidayDays.containsKey(DateUtil.format(calendar.getTime(), "MMdd"))) {
@@ -441,7 +441,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							throw new BizException("必须设置上课结束时间");
 						}
 					}
-					
+
 					courseSchedule.setTeacherId(teacherId);
 					courseSchedule.setActualTeacherId(teacherId);
 					courseSchedule.setCreateTime(now);
@@ -457,7 +457,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					} else {
 						courseSchedule.setName(type.getMsg());
 					}
-					
+
 					// 判断课程时间是否超过排课结束时间
 					if(groupStartDate != null){
 						if(groupStartDate.after(calendar.getTime())){
@@ -469,7 +469,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							throw new BizException("排课时间超出排课截止日期({})", groupEndDate);
 						}
 					}
-					
+
 					courseScheduleDao.insert(courseSchedule);
 					courseScheduleList.add(courseSchedule);
 
@@ -573,7 +573,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
             calendar.add(Calendar.DATE, 1);
 		}
-		
+
 		//检查冲突
 		checkNewCourseSchedules(courseScheduleList, false);
 
@@ -2248,23 +2248,23 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Date now = new Date();
 		// 课程信息处理
 		List<Long> courseScheduleIds = newCourseSchedules.stream().map(CourseSchedule::getId).distinct().collect(Collectors.toList());
-        
+
         //已结算的课不能调整
         /*List<Map<Long, Integer>> courseSettlementMaps = courseScheduleTeacherSalaryDao.checkCoursesIsSettlement(courseScheduleIds);
         if(courseSettlementMaps!=null && courseSettlementMaps.size()>0){
         	throw new BizException("调整的课程中存在已结算的课程");
         }*/
-		
+
         //查询数据库中的课程信息
         List<CourseSchedule> oldCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(courseScheduleIds);
-        
+
 		Map<Long, CourseSchedule> oldCourseScheduleMap = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
-		
+
         for(CourseSchedule newCourseSchedule : newCourseSchedules){
 
         	//获取数据库中的记录
             CourseSchedule oldCourseSchedule = oldCourseScheduleMap.get(newCourseSchedule.getId());
-            
+
             //课程是否已结算
             int settlementNum = courseScheduleTeacherSalaryDao.checkCourseIsSettlement(oldCourseSchedule.getId().intValue());
             if (settlementNum > 0) {
@@ -2276,7 +2276,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                         DateUtil.dateToString(oldCourseSchedule.getEndClassTime(),
                                 DateUtil.EXPANDED_DATE_TIME_FORMAT));
             }
-            
+
 			if (newCourseSchedule.getGroupType() != GroupType.COMM) {
 				// 学生已点名不能调整(请假可以调整)
 				List<StudentAttendance> studentAttendanceList = studentAttendanceDao.findByCourseId(oldCourseSchedule.getId());
@@ -2295,7 +2295,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     throw new BizException("主教和助教不可重复");
                 }
             }
-            
+
             if(newCourseSchedule.getStatus() == oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.OVER){
             	throw new BizException("已结束的课程需要调整课程状态");
             }
@@ -2320,7 +2320,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             if (Objects.isNull(newCourseSchedule.getTeachMode())) {
                 newCourseSchedule.setTeachMode(oldCourseSchedule.getTeachMode());
             }
-            
+
 			if (newCourseSchedule.getGroupType() == GroupType.VIP) {
 				if (newCourseSchedule.getTeachMode() != oldCourseSchedule.getTeachMode() && newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE) {
 					throw new BizException("不允许将线上课调整为线下课");
@@ -2333,7 +2333,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			if (newCourseSchedule.getTeachMode() != oldCourseSchedule.getTeachMode() && newCourseSchedule.getTeachMode() == TeachModeEnum.ONLINE) {
 				newCourseSchedule.setSchoolId(null);
 			}
-			
+
             if (Objects.isNull(newCourseSchedule.getActualTeacherId())) {
                 newCourseSchedule.setActualTeacherId(oldCourseSchedule.getActualTeacherId());
             }
@@ -2362,9 +2362,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             if (newCourseSchedule.getEndClassTime().before(now)) {
                 newCourseSchedule.setStatus(CourseStatusEnum.OVER);
             }
-        
+
         }
-        
+
         //课程冲突检测
         checkNewCourseSchedules(newCourseSchedules, false);
 
@@ -2393,10 +2393,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		// 课程对应乐团结算方式集合
 		List<Map<String, String>> musicGroupSettlementTypeByCourse = courseScheduleTeacherSalaryDao.findMusicGroupSettlementTypeByCourse(courseScheduleIds);
 		Map<String, String> musicGroupSettlementsMap = MapUtil.convertMybatisMap(musicGroupSettlementTypeByCourse);
-		
+
 		Map<Long,Map<Integer,CourseScheduleTeacherSalary>> courseScheduleTeacherSalaryMap = new HashMap<Long, Map<Integer,CourseScheduleTeacherSalary>>();
 		List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = courseScheduleTeacherSalaryDao.findByCourseSchedules(courseScheduleIds);
-		
+
 		for (CourseScheduleTeacherSalary ts : courseScheduleTeacherSalaryList) {
 			Map<Integer, CourseScheduleTeacherSalary> map = courseScheduleTeacherSalaryMap.get(ts.getCourseScheduleId());
 			if (map == null) {
@@ -2409,7 +2409,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(), "yyyy-MM-dd");
 
 		List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<CourseScheduleModifyLog>();
-		
+
 		List<CourseScheduleStudentPayment> insertCourseScheduleStudentPaymentList = new ArrayList<CourseScheduleStudentPayment>();
 
 		for (CourseSchedule newCourseSchedule : newCourseSchedules) {
@@ -2441,7 +2441,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					insertTeacherAttendanceList.add(ta);
 				}
 			}
-			
+
 			if(newCourseSchedule.getStatus() == CourseStatusEnum.NOT_START && newCourseSchedule.getGroupType() == GroupType.MUSIC){
 				//查询新生(之前排课没有这个人,后来新进来的学生)
 				List<ClassGroupStudentMapper> newStudentList = classGroupStudentMapperDao.queryNewStudentListByCourseScheduleId(courseScheduleId);
@@ -2457,7 +2457,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 						sp.setMusicGroupId(newCourseSchedule.getMusicGroupId());
 						sp.setUpdateTime(date);
 						sp.setUserId(cgsm.getUserId());
-						
+
 						insertCourseScheduleStudentPaymentList.add(sp);
 					}
 				}
@@ -2469,7 +2469,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             }
 
             if ((newCourseSchedule.getStatus() != oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.NOT_START)) {
-				
+
 				if(newCourseSchedule.getGroupType() == GroupType.MUSIC){
 					//清理课程作业
 					courseHomeworkService.delHomwworkByCourseScheduleId(courseScheduleId);
@@ -2590,7 +2590,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 								ts.setExpectSalary(new BigDecimal(tdms.getAssistantTeacher90MinSalary().doubleValue() * newMinutes / unitMinutes));
 							}
 						}
-					
+
 					} else if (newCourseSchedule.getGroupType() == GroupType.VIP) {
 						/*Map<Integer, TeacherDefaultVipGroupSalary> map = vipGroupSalaryMap.get(teacherId);
 						if (map == null) {
@@ -2658,7 +2658,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if (insertCourseScheduleModifyLogList.size() > 0) {
 			courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
 		}
-		
+
 		if(newCourseSchedules.size() > 0){
 			courseScheduleDao.batchUpdate(newCourseSchedules);
             List<Integer> classGroupIds = newCourseSchedules.stream().filter(courseSchedule -> Objects.nonNull(courseSchedule.getClassGroupId())).map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
@@ -2666,7 +2666,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 classGroupService.updateClassGroupsCourseInfo(classGroupIds);
             }
         }
-		
+
 		if(insertCourseScheduleStudentPaymentList.size() > 0){
 			courseScheduleStudentPaymentDao.batchInsert(insertCourseScheduleStudentPaymentList);
 		}
@@ -4137,6 +4137,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					List<CourseScheduleReview> review = reviews.get(e.getCourseScheduleId().intValue());
 					e.setTeachingContent(review.get(0).getTeachingMaterial());
 				}
+			}
+			for (CourseScheduleRateDto e:courseScheduleRateDtos) {
 				if(e.getCourseScheduleId().equals(courseSchedule.getId())){
 					e.setIsDefault(true);
 					break;

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

@@ -356,7 +356,7 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
         result.put("teacherName", teacher.getRealName());
         result.put("avatar",teacher.getAvatar());
         result.put("introduction", teacher.getIntroduction());
-        result.put("lectureNum", teacher.getLectureNum());
+        result.put("lectureNum", courseScheduleTeacherSalaryDao.countTeacherGiveLesson(coursesGroup.getTeacherId()));
         result.put("subjectNames", StringUtils.join(subjectNames,","));
         List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId.toString(), GroupType.COMM);
         result.put("courseSchedules",groupNotStartCourses);

+ 9 - 3
mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -167,6 +167,7 @@
 		<result property="musicGroupName" column="music_group_name_"/>
 		<result property="createTime" column="create_time_"/>
 		<result property="day" column="day_"/>
+		<result property="startClassTime" column="start_class_time_"/>
 	</resultMap>
 
 	<select id="findByClassGroupAndTeacher" resultMap="teacherHomeworkListDto">
@@ -174,7 +175,8 @@
 			cs.id_ course_homework_id_,
 			ch.content_,
 			ch.create_time_,
-			DATE_FORMAT(ch.create_time_,'%Y-%m-%d') 'day_',
+			DATE_FORMAT(cs.class_date_,'%Y-%m-%d') 'day_',
+			CONCAT( class_date_, ' ', start_class_time_ ) start_class_time_,
 			ch.expect_num_,
 			ch.completed_num_,
 			cs.name_ course_schedule_name_,
@@ -187,7 +189,7 @@
 			LEFT JOIN course_schedule cs ON ch.course_schedule_id_=cs.id_
 			LEFT JOIN course_schedule_teacher_salary csts ON ch.course_schedule_id_=csts.course_schedule_id_
 			LEFT JOIN class_group cg ON ch.class_group_id_=cg.id_
-			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_ AND cs.group_type_='MUSIC'
+			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
 			WHERE
 			(cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
 			AND csts.user_id_=#{userId}
@@ -195,7 +197,7 @@
 				AND ch.class_group_id_=#{classGroupId}
 			</if>
 			<if test="createTime!=null">
-				AND DATE_FORMAT(ch.create_time_,'%Y%m')=DATE_FORMAT(#{createTime},'%Y%m')
+				AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
 			</if>
 		  ORDER BY ch.id_ DESC
 	</select>
@@ -204,11 +206,15 @@
 			COUNT(*)
 		FROM
 			course_homework ch
+			LEFT JOIN course_schedule cs ON ch.course_schedule_id_=cs.id_
 			LEFT JOIN course_schedule_teacher_salary csts ON ch.course_schedule_id_=csts.course_schedule_id_
 			WHERE csts.user_id_=#{userId}
 			<if test="classGroupId!=null">
 				AND ch.class_group_id_=#{classGroupId}
 			</if>
+			<if test="createTime!=null">
+				AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{createTime}, '%Y-%m')
+			</if>
 	</select>
 	<select id="findByTeacherAndCourseHomewok" resultMap="CourseHomework">
 		SELECT

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

@@ -329,7 +329,7 @@
         FROM course_schedule
         WHERE class_group_id_ = #{classGroupId}
           AND status_ = 'OVER'
-        ORDER BY class_date_ DESC
+        ORDER BY class_date_ DESC,start_class_time_ DESC
     </select>
 
     <select id="findByCourseScheduleId" resultMap="CourseScheduleReview">

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

@@ -170,6 +170,7 @@
             ch.*,
             mg.name_ music_group_name_,
             cg.name_ class_group_name_,
+            CONCAT( class_date_, ' ', start_class_time_ ) start_class_time_,
             temp.next_class_date_,
             sch.remark_,
             sch.status_,
@@ -187,7 +188,7 @@
                 WHERE CONCAT( class_date_, ' ', start_class_time_ )>now()
                 GROUP BY class_group_id_) temp ON ch.class_group_id_=temp.class_group_id_
             <include refid="queryCondition"/>
-        ORDER BY ch.id_
+        ORDER BY CONCAT( class_date_, ' ', start_class_time_ ) DESC
         <include refid="global.limit"/>
     </select>
 
@@ -323,6 +324,8 @@
             LEFT JOIN course_schedule cs ON cs.id_ = sch.course_schedule_id_
         WHERE sch.user_id_=#{userId}
         AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{classDate}, '%Y-%m')
+        ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_) DESC
+        <include refid="global.limit"/>
     </select>
     <select id="countStudentHomeworkRecord" resultType="int">
         SELECT

+ 3 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.service.StudentCourseHomeworkService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -76,7 +77,8 @@ public class StudentCourseHomeworkController extends BaseController {
         if(queryInfo == null){
             queryInfo = new CourseHomeworkQueryInfo();
         }
-        return succeed(studentCourseHomeworkService.queryPage(queryInfo));
+        PageInfo<StudentCourseHomework> studentCourseHomeworkPageInfo = studentCourseHomeworkService.queryPage(queryInfo);
+        return succeed(studentCourseHomeworkPageInfo);
     }
 
 }