Browse Source

课程修改日志记录

zouxuan 4 năm trước cách đây
mục cha
commit
9892c8b6bf

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

@@ -100,6 +100,10 @@ public class CourseSchedule {
 	@ApiModelProperty(value = "实际上课教师", required = false)
 	private Integer actualTeacherId;
 
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师名称", required = false)
+	private String actualTeacherName;
+
 	@ApiModelProperty(value = "助教编号列表")
 	private List<Integer> teachingTeacherIdList = new ArrayList<Integer>();
 
@@ -158,6 +162,14 @@ public class CourseSchedule {
 
 	private int isSignOut = 3;
 
+	public String getActualTeacherName() {
+		return actualTeacherName;
+	}
+
+	public void setActualTeacherName(String actualTeacherName) {
+		this.actualTeacherName = actualTeacherName;
+	}
+
 	public Integer getOrganId() {
 		return organId;
 	}

+ 350 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleAuditDetailDto.java

@@ -0,0 +1,350 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.common.enums.BaseEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 对应数据库表(course_schedule):
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CourseScheduleAuditDetailDto {
+	/**  */
+	private Long id;
+
+	private GroupType groupType;
+
+	/**  */
+	@ApiModelProperty(value = "乐团编号",required = false)
+	private String musicGroupId;
+
+	/** 班级编号 */
+	@ApiModelProperty(value = "班级编号", required = false)
+	private Integer classGroupId;
+
+	/** 课程状态 */
+	@ApiModelProperty(value = "课程状态", required = false)
+	private CourseStatusEnum status;
+
+	/** 补贴 */
+	@ApiModelProperty(value = "补贴", required = false)
+	private BigDecimal subsidy;
+
+	/** 上课日期 */
+	@ApiModelProperty(value = "上课日期", required = false)
+	private String classDate;
+
+	/** 上课时间 */
+	@ApiModelProperty(value = "上课时间", required = false)
+	private String startClassTime;
+
+	/** 结束时间 */
+	@ApiModelProperty(value = "结束时间", required = false)
+	private String endClassTime;
+
+	/** 上课教师 */
+	@ApiModelProperty(value = "上课教师", required = false)
+	private Integer teacherId;
+
+	@ApiModelProperty(value = "上课老师名称", required = false)
+	private String teacherName;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师", required = false)
+	private Integer actualTeacherId;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师名称", required = false)
+	private String actualTeacherName;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "修改人", required = false)
+	private Integer operatorId;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "修改人名称", required = false)
+	private String operatorName;
+
+	/**  */
+	private Date createTime;
+
+	/**  */
+	private Date updateTime;
+
+	@ApiModelProperty(value = "修改时间", required = false)
+	private Date auditTime;
+
+	private TeachModeEnum teachMode;
+
+	private CourseSchedule.CourseScheduleType type;
+
+	private String name;
+
+	@ApiModelProperty(value = "实际上课人数")
+	private Integer studentNum;
+
+	@ApiModelProperty(value = "请假人数")
+	private Integer leaveStudentNum;
+
+	private Integer schoolId;
+
+	private String schoolName;
+
+	private Integer isLock;
+
+	private Integer organId;
+
+	private String teachingContent;
+
+	private String note;
+
+	public Date getAuditTime() {
+		return auditTime;
+	}
+
+	public void setAuditTime(Date auditTime) {
+		this.auditTime = auditTime;
+	}
+
+	public Integer getOperatorId() {
+		return operatorId;
+	}
+
+	public void setOperatorId(Integer operatorId) {
+		this.operatorId = operatorId;
+	}
+
+	public String getOperatorName() {
+		return operatorName;
+	}
+
+	public void setOperatorName(String operatorName) {
+		this.operatorName = operatorName;
+	}
+
+	public String getActualTeacherName() {
+		return actualTeacherName;
+	}
+
+	public void setActualTeacherName(String actualTeacherName) {
+		this.actualTeacherName = actualTeacherName;
+	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
+	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 Integer getIsLock() {
+		return isLock;
+	}
+
+	public void setIsLock(Integer isLock) {
+		this.isLock = isLock;
+	}
+
+	public String getTeacherName() {
+		return teacherName;
+	}
+
+	public void setTeacherName(String teacherName) {
+		this.teacherName = teacherName;
+	}
+
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
+	public Integer getStudentNum() {
+		return studentNum;
+	}
+
+	public void setStudentNum(Integer studentNum) {
+		this.studentNum = studentNum;
+	}
+
+	public Integer getLeaveStudentNum() {
+		return leaveStudentNum;
+	}
+
+	public void setLeaveStudentNum(Integer leaveStudentNum) {
+		this.leaveStudentNum = leaveStudentNum;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public GroupType getGroupType() {
+		return groupType;
+	}
+
+	public void setGroupType(GroupType groupType) {
+		this.groupType = groupType;
+	}
+
+	public String getMusicGroupId() {
+		return musicGroupId;
+	}
+
+	public void setMusicGroupId(String musicGroupId) {
+		this.musicGroupId = musicGroupId;
+	}
+
+	public void setClassGroupId(Integer classGroupId) {
+		this.classGroupId = classGroupId;
+	}
+
+	public Integer getClassGroupId() {
+		return this.classGroupId;
+	}
+
+	public CourseStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(CourseStatusEnum status) {
+		this.status = status;
+	}
+
+	public void setSubsidy(BigDecimal subsidy) {
+		this.subsidy = subsidy;
+	}
+
+	public BigDecimal getSubsidy() {
+		return this.subsidy;
+	}
+
+	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 Integer getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(Integer teacherId) {
+		this.teacherId = teacherId;
+	}
+
+	public Integer getActualTeacherId() {
+		return actualTeacherId;
+	}
+
+	public void setActualTeacherId(Integer actualTeacherId) {
+		this.actualTeacherId = actualTeacherId;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getCreateTime() {
+		return this.createTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public Date getUpdateTime() {
+		return this.updateTime;
+	}
+
+	public TeachModeEnum getTeachMode() {
+		return teachMode;
+	}
+
+	public void setTeachMode(TeachModeEnum teachMode) {
+		this.teachMode = teachMode;
+	}
+
+	public CourseSchedule.CourseScheduleType getType() {
+		return type;
+	}
+
+	public void setType(CourseSchedule.CourseScheduleType type) {
+		this.type = type;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Integer schoolId) {
+		this.schoolId = schoolId;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.CourseGenerateDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.biz.dal.entity.CourseScheduleAuditDetailDto;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
@@ -601,4 +602,13 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param educationalTeacherId
 	 */
 	void batchPracticeGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId,Integer oldTeacherId);
+
+	/**
+	 * 获取课程调整时间轴
+	 * @author zouxuan
+	 * @param courseScheduleId
+	 * @return
+	 */
+	List<CourseScheduleAuditDetailDto> queryCourseAdjustDetail(Long courseScheduleId);
+
 }

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

@@ -29,6 +29,7 @@ import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -92,35 +93,7 @@ import com.ym.mec.biz.dal.dto.TeacherRemarkCommitDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
-import com.ym.mec.biz.dal.entity.CourseGenerateDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
-import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
-import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
-import com.ym.mec.biz.dal.entity.CourseScheduleReview;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.entity.CoursesGroup;
-import com.ym.mec.biz.dal.entity.CoursesGroupModifyLog;
-import com.ym.mec.biz.dal.entity.Group;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.PracticeGroup;
-import com.ym.mec.biz.dal.entity.School;
-import com.ym.mec.biz.dal.entity.StudentAttendance;
-import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
-import com.ym.mec.biz.dal.entity.Subject;
-import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultPracticeGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary;
-import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
@@ -1450,6 +1423,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			int singleClassMinutes = DateUtil.minutesBetween(existCours.getStartClassTime(), existCours.getEndClassTime());
 
 			existCours.setClassDate(ac.getClassDate());
+			existCours.setUpdateTime(now);
 			existCours.setStartClassTime(ac.getStartClassTime());
 			existCours.setEndClassTime(DateUtil.addMinutes(existCours.getStartClassTime(), singleClassMinutes));
 
@@ -1472,6 +1446,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 
 		checkNewCourseSchedules(existCourses, false);
+
 		courseScheduleDao.batchUpdate(existCourses);
 
 		studentAttendanceDao.deleteByCourseSchedules(courseIds);
@@ -3120,8 +3095,6 @@ 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) {
@@ -3378,23 +3351,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					insertCourseScheduleTeacherSalaryList.add(ts);
 				}
 			}
-
-			// 调整日志
-			CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
-			courseScheduleModifyLog.setCourseScheduleId(courseScheduleId);
-			courseScheduleModifyLog.setCreateTime(date);
-			courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(newCourseSchedule));
-			courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(oldCourseSchedule));
-
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			if (null == sysUser) {
-				throw new BizException("获取用户信息失败");
-			}
-
-			courseScheduleModifyLog.setOperatorId(sysUser.getId());
-
-			insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
-
 		}
 
 		if (insertTeacherAttendanceList.size() > 0) {
@@ -3405,10 +3361,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			courseScheduleTeacherSalaryDao.batchInsert(insertCourseScheduleTeacherSalaryList);
 		}
 
-		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());
@@ -3416,6 +3368,25 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 classGroupService.updateClassGroupsCourseInfo(classGroupIds);
             }
         }
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (null == sysUser) {
+			throw new BizException("获取用户信息失败");
+		}
+		List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<>();
+		oldCourseScheduleList.forEach(e->{
+			// 调整日志
+			CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
+			courseScheduleModifyLog.setCourseScheduleId(e.getId());
+			courseScheduleModifyLog.setCreateTime(date);
+			courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(e));
+			courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(courseScheduleDao.get(e.getId())));
+			courseScheduleModifyLog.setOperatorId(sysUser.getId());
+			insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
+		});
+
+		if (insertCourseScheduleModifyLogList.size() > 0) {
+			courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
+		}
 
 		if(insertCourseScheduleStudentPaymentList.size() > 0){
 			courseScheduleStudentPaymentDao.batchInsert(insertCourseScheduleStudentPaymentList);
@@ -5137,4 +5108,49 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		return courseScheduleRateDtos;
 	}
+
+	@Override
+	public List<CourseScheduleAuditDetailDto> queryCourseAdjustDetail(Long courseScheduleId) {
+		//获取所有的更改记录
+		Map<String,Object> param = new HashMap(1);
+		param.put("courseScheduleId",courseScheduleId);
+		List<CourseScheduleModifyLog> scheduleModifyLogs = courseScheduleModifyLogDao.findAll(param);
+		if(scheduleModifyLogs == null || scheduleModifyLogs.size() == 0){
+			return null;
+		}
+		List<CourseScheduleAuditDetailDto> courseSchedules = new ArrayList<>();
+		for (int i = 0; i < scheduleModifyLogs.size(); i++) {
+			CourseScheduleModifyLog modifyLog = scheduleModifyLogs.get(i);
+			if(i == 0){
+				//如果是第一次调整
+				CourseScheduleAuditDetailDto dto = JSON.parseObject(modifyLog.getPreviousCourseSchedule(), CourseScheduleAuditDetailDto.class);
+				dto.setOperatorId(modifyLog.getOperatorId());
+				dto.setAuditTime(modifyLog.getCreateTime());
+				courseSchedules.add(dto);
+			}
+			if(i == 1){
+				continue;
+			}
+			CourseScheduleAuditDetailDto detailDto = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
+			detailDto.setOperatorId(modifyLog.getOperatorId());
+			detailDto.setAuditTime(modifyLog.getCreateTime());
+			courseSchedules.add(detailDto);
+		}
+		if(courseSchedules.size() > 0){
+			Set<Integer> actualTeacherIds = courseSchedules.stream().map(e -> e.getActualTeacherId()).collect(Collectors.toSet());
+			actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getTeacherId()).collect(Collectors.toSet()));
+			actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getActualTeacherId()).collect(Collectors.toSet()));
+			Set<Integer> schoolIds = courseSchedules.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
+			Map<Integer, String> actualTeacherMap = getMap("sys_user", "id_", "real_name_", actualTeacherIds, Integer.class, String.class);
+			Map<Integer, String> schoolMap = getMap("school", "id_", "name_", schoolIds, Integer.class, String.class);
+			courseSchedules.forEach(e->{
+				e.setTeacherName(actualTeacherMap.get(e.getTeacherId()));
+				e.setActualTeacherName(actualTeacherMap.get(e.getActualTeacherId()));
+				e.setSchoolName(schoolMap.get(e.getSchoolId()));
+				e.setOperatorName(actualTeacherMap.get(e.getOperatorId()));
+			});
+			return courseSchedules;
+		}
+		return null;
+	}
 }

+ 33 - 98
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -116,50 +116,47 @@
         <result column="teacher_id_" property="teacherId"/>
         <result column="current_class_times_" property="currentClassTimes"/>
     </resultMap>
+    <sql id="resultSql">
+        cs.id_,
+        cs.music_group_id_,
+        cs.group_type_,
+        cs.class_group_id_,
+        cs.status_,
+        cs.subsidy_,
+        cs.class_date_,
+        CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+        CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
+        cs.start_class_time_                              start_class_time_str_,
+        cs.end_class_time_                                end_class_time_str_,
+        cs.teacher_id_,
+        cs.actual_teacher_id_,
+        cs.create_time_,
+        cs.update_time_,
+        cs.teach_mode_,
+        cs.type_,
+        cs.name_,
+        cs.student_num_,
+        cs.leave_student_num_,
+        cs.schoole_id_
+    </sql>
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="CourseSchedule">
-        SELECT id_,
-               music_group_id_,
-               group_type_,
-               class_group_id_,
-               status_,
-               subsidy_,
-               class_date_,
-               CONCAT(class_date_, ' ', start_class_time_) start_class_time_,
-               CONCAT(class_date_, ' ', end_class_time_)   end_class_time_,
-               teacher_id_,
-               actual_teacher_id_,
-               create_time_,
-               update_time_,
-               teach_mode_,
-               type_,
-               name_,
-               student_num_,
-               leave_student_num_,
-               teaching_content_,
-               note_,
-               schoole_id_,
-               organ_id_
-        FROM course_schedule
-        WHERE id_ = #{id}
+        SELECT <include refid="resultSql"/>
+        FROM course_schedule cs
+        WHERE cs.id_ = #{id}
     </select>
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="CourseSchedule">
-        SELECT *
-        FROM course_schedule
-        ORDER BY id_
+        SELECT <include refid="resultSql"/>
+        FROM course_schedule cs
+        ORDER BY cs.id_
     </select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </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_,
@@ -482,25 +479,7 @@
 
     <select id="findByCourseScheduleIds" resultMap="CourseSchedule">
         SELECT
-        cs.id_,
-        cs.music_group_id_,
-        cs.group_type_,
-        cs.class_group_id_,
-        cs.status_,
-        cs.subsidy_,
-        cs.class_date_,
-        CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
-        CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-        cs.teacher_id_,
-        cs.actual_teacher_id_,
-        cs.create_time_,
-        cs.update_time_,
-        cs.teach_mode_,
-        cs.type_,
-        cs.name_,
-        cs.student_num_,
-        cs.leave_student_num_,
-        cs.schoole_id_
+        <include refid="resultSql"/>
         FROM
         course_schedule cs
         WHERE cs.id_ IN
@@ -2245,15 +2224,7 @@
           AND music_group_id_ = #{groupId}
     </select>
     <select id="findSurplusCourseWithGroup" resultMap="CourseSchedule">
-        SELECT cs.id_,
-               cs.music_group_id_,
-               cs.class_group_id_,
-               cs.status_,
-               cs.class_date_,
-               CONCAT(cs.class_date_, ' ', cs.start_class_time_) start_class_time_,
-               CONCAT(cs.class_date_, ' ', cs.end_class_time_)   end_class_time_,
-               cs.actual_teacher_id_,
-               cs.teach_mode_
+        SELECT <include refid="resultSql"/>
         FROM course_schedule cs
         WHERE (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
           AND cs.group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
@@ -2262,25 +2233,7 @@
     </select>
 
     <select id="getSurplusCourseWithGroup" resultMap="CourseSchedule">
-        SELECT cs.id_,
-               cs.music_group_id_,
-               cs.group_type_,
-               cs.class_group_id_,
-               cs.status_,
-               cs.subsidy_,
-               cs.class_date_,
-               CONCAT(cs.class_date_, ' ', cs.start_class_time_) start_class_time_,
-               CONCAT(cs.class_date_, ' ', cs.end_class_time_)   end_class_time_,
-               cs.teacher_id_,
-               cs.actual_teacher_id_,
-               cs.create_time_,
-               cs.update_time_,
-               cs.teach_mode_,
-               cs.type_,
-               cs.name_,
-               cs.student_num_,
-               cs.leave_student_num_,
-               cs.schoole_id_
+        SELECT <include refid="resultSql"/>
         FROM course_schedule cs
         WHERE (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
           AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) > NOW()
@@ -2353,25 +2306,7 @@
            OR su.id_ = #{search}
     </select>
     <select id="findClassGroupCourseSchedulesWithDate" resultMap="CourseSchedule">
-        SELECT cs.id_,
-               cs.class_group_id_,
-               cs.status_,
-               cs.subsidy_,
-               cs.class_date_,
-               CONCAT(cs.class_date_, ' ', cs.start_class_time_) start_class_time_,
-               CONCAT(cs.class_date_, ' ', cs.end_class_time_)   end_class_time_,
-               cs.start_class_time_                              start_class_time_str_,
-               cs.end_class_time_                                end_class_time_str_,
-               cs.teacher_id_,
-               cs.actual_teacher_id_,
-               cs.create_time_,
-               cs.update_time_,
-               cs.teach_mode_,
-               cs.type_,
-               cs.name_,
-               cs.student_num_,
-               cs.leave_student_num_,
-               cs.schoole_id_
+        SELECT <include refid="resultSql"/>
         FROM course_schedule cs
         WHERE FIND_IN_SET(cs.class_group_id_, #{classGroupIds})
           AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW()

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleModifyLogMapper.xml

@@ -18,6 +18,8 @@
 	<select id="findAll" resultMap="CourseScheduleModifyLog">
 		SELECT * FROM
 		course_schedule_modify_log
+		<include refid="queryPageSql"/>
+		ORDER BY id_ ASC
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -37,11 +39,19 @@
 			(#{item.courseScheduleId},#{item.operatorId},#{item.previousCourseSchedule},#{item.currentCourseSchedule},#{item.createTime})
 		</foreach>
 	</insert>
+	<sql id="queryPageSql">
+		<where>
+			<if test="courseScheduleId != null">
+				AND course_schedule_id_ = #{courseScheduleId}
+			</if>
+		</where>
+	</sql>
 
     <!-- 分页查询 -->
 	<select id="queryPage" resultMap="CourseScheduleModifyLog"
 		parameterType="map">
 		SELECT * FROM course_schedule_modify_log
+		<include refid="queryPageSql"/>
 		<include refid="global.limit" />
 	</select>
 
@@ -49,5 +59,6 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM
 		course_schedule_modify_log
+		<include refid="queryPageSql"/>
 	</select>
 </mapper>

+ 2 - 5
mec-common/common-core/src/main/java/com/ym/mec/common/service/BaseService.java

@@ -12,10 +12,7 @@ import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -89,7 +86,7 @@ public interface BaseService<PK extends Serializable, T> {
 	 * @param ids: key条件
 	 * @return java.util.List<java.util.Map>
 	 */
-	<K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids, Class<Y> keyType, Class<Z> valueType);
+	<K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids, Class<Y> keyType, Class<Z> valueType);
 
 	/**
 	 * @describe 获取columnKey-columnValue集合

+ 1 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/BaseServiceImpl.java

@@ -118,7 +118,7 @@ public abstract class BaseServiceImpl<PK extends Serializable, T> implements Bas
 
 
 	@Override
-	public <K extends List, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids, Class<Y> keyType, Class<Z> valueType){
+	public <K extends Collection, Y, Z> Map<Y,Z> getMap(String tableName, String columnKey, String columnValue, K ids, Class<Y> keyType, Class<Z> valueType){
 		if(CollectionUtils.isEmpty(ids)){
 			return Collections.emptyMap();
 		}

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -409,5 +409,12 @@ public class CourseScheduleController extends BaseController {
         courseScheduleService.cleanAttendance(courseScheduleIds);
         return succeed();
     }
+
+    @ApiOperation(value = "获取课程调整时间轴")
+    @PostMapping("/queryCourseAdjustDetail")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/queryCourseAdjustDetail')")
+    public Object queryCourseAdjustDetail(Long courseScheduleId){
+        return succeed(courseScheduleService.queryCourseAdjustDetail(courseScheduleId));
+    }
 }