소스 검색

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

zouxuan 5 년 전
부모
커밋
427c4a8771
21개의 변경된 파일927개의 추가작업 그리고 328개의 파일을 삭제
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/AppVersionInfoDao.java
  2. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleModifyLogDao.java
  3. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherFreeTimeDao.java
  4. 125 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/AppVersionInfo.java
  5. 81 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleModifyLog.java
  6. 146 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherFreeTime.java
  7. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/AppVersionInfoService.java
  8. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleModifyLogService.java
  9. 2 11
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  10. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherFreeTimeService.java
  11. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/AppVersionInfoServiceImpl.java
  12. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleModifyLogServiceImpl.java
  13. 44 314
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  14. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherFreeTimeServiceImpl.java
  15. 99 0
      mec-biz/src/main/resources/config/mybatis/AppVersionInfoMapper.xml
  16. 47 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleModifyLogMapper.xml
  17. 105 0
      mec-biz/src/main/resources/config/mybatis/TeacherFreeTimeMapper.xml
  18. 0 1
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  19. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java
  20. 84 0
      mec-web/src/main/java/com/ym/mec/web/controller/AppVersionInfoController.java
  21. 60 0
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherFreeTimeController.java

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

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.dal.dao;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface AppVersionInfoDao extends BaseDAO<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleModifyLogDao.java

@@ -0,0 +1,10 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.dal.BaseDAO;
+
+
+public interface CourseScheduleModifyLogDao extends BaseDAO<Integer, CourseScheduleModifyLog> {
+
+	
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherFreeTimeDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface TeacherFreeTimeDao extends BaseDAO<Integer, TeacherFreeTime> {
+
+	
+}

+ 125 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/AppVersionInfo.java

@@ -0,0 +1,125 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(app_version_info):
+ */
+public class AppVersionInfo {
+
+	/**  */
+	private Integer id;
+	
+	/** 平台(andorid/ios) */
+	private String platform;
+	
+	/** 版本号(以V开头) */
+	private String version;
+	
+	/** 状态(newest/history) */
+	private String status;
+	
+	/** 是否强制更新 */
+	private boolean isForceUpdate;
+	
+	/** 更新描述 */
+	private String description;
+	
+	/** 下载地址 */
+	private byte[] downloadUrl;
+	
+	/** 创建人 */
+	private Integer operatorId;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setPlatform(String platform){
+		this.platform = platform;
+	}
+	
+	public String getPlatform(){
+		return this.platform;
+	}
+			
+	public void setVersion(String version){
+		this.version = version;
+	}
+	
+	public String getVersion(){
+		return this.version;
+	}
+			
+	public void setStatus(String status){
+		this.status = status;
+	}
+	
+	public String getStatus(){
+		return this.status;
+	}
+			
+	public void setIsForceUpdate(boolean isForceUpdate){
+		this.isForceUpdate = isForceUpdate;
+	}
+	
+	public boolean isIsForceUpdate(){
+		return this.isForceUpdate;
+	}
+			
+	public void setDescription(String description){
+		this.description = description;
+	}
+	
+	public String getDescription(){
+		return this.description;
+	}
+			
+	public void setDownloadUrl(byte[] downloadUrl){
+		this.downloadUrl = downloadUrl;
+	}
+	
+	public byte[] getDownloadUrl(){
+		return this.downloadUrl;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 81 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleModifyLog.java

@@ -0,0 +1,81 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(course_schedule_modify_log):
+ */
+public class CourseScheduleModifyLog {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long courseScheduleId;
+	
+	/**  */
+	private Integer operatorId;
+	
+	/**  */
+	private String previousCourseSchedule;
+	
+	/**  */
+	private String currentCourseSchedule;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setCourseScheduleId(Long courseScheduleId){
+		this.courseScheduleId = courseScheduleId;
+	}
+	
+	public Long getCourseScheduleId(){
+		return this.courseScheduleId;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	public void setPreviousCourseSchedule(String previousCourseSchedule){
+		this.previousCourseSchedule = previousCourseSchedule;
+	}
+	
+	public String getPreviousCourseSchedule(){
+		return this.previousCourseSchedule;
+	}
+			
+	public void setCurrentCourseSchedule(String currentCourseSchedule){
+		this.currentCourseSchedule = currentCourseSchedule;
+	}
+	
+	public String getCurrentCourseSchedule(){
+		return this.currentCourseSchedule;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 146 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherFreeTime.java

@@ -0,0 +1,146 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(teacher_free_time):
+ */
+public class TeacherFreeTime {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private String monday;
+	
+	/**  */
+	private String tuesday;
+	
+	/**  */
+	private String wednesday;
+	
+	/**  */
+	private String thursday;
+	
+	/**  */
+	private String friday;
+	
+	/**  */
+	private String saturday;
+	
+	/**  */
+	private String sunday;
+	
+	private Integer totalTimes;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setMonday(String monday){
+		this.monday = monday;
+	}
+	
+	public String getMonday(){
+		return this.monday;
+	}
+			
+	public void setTuesday(String tuesday){
+		this.tuesday = tuesday;
+	}
+	
+	public String getTuesday(){
+		return this.tuesday;
+	}
+			
+	public void setWednesday(String wednesday){
+		this.wednesday = wednesday;
+	}
+	
+	public String getWednesday(){
+		return this.wednesday;
+	}
+			
+	public void setThursday(String thursday){
+		this.thursday = thursday;
+	}
+	
+	public String getThursday(){
+		return this.thursday;
+	}
+			
+	public void setFriday(String friday){
+		this.friday = friday;
+	}
+	
+	public String getFriday(){
+		return this.friday;
+	}
+			
+	public void setSaturday(String saturday){
+		this.saturday = saturday;
+	}
+	
+	public String getSaturday(){
+		return this.saturday;
+	}
+			
+	public void setSunday(String sunday){
+		this.sunday = sunday;
+	}
+	
+	public String getSunday(){
+		return this.sunday;
+	}
+			
+	public Integer getTotalTimes() {
+		return totalTimes;
+	}
+
+	public void setTotalTimes(Integer totalTimes) {
+		this.totalTimes = totalTimes;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/AppVersionInfoService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.service;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.common.service.BaseService;
+
+public interface AppVersionInfoService extends BaseService<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+}

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.service.BaseService;
+
+public interface CourseScheduleModifyLogService extends BaseService<Integer, CourseScheduleModifyLog> {
+
+}

+ 2 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -90,23 +90,14 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
      */
 	List<Date> getEnableApplyDates(Date startDay,Date endDay);
 
-    /**
-     * @describe 陪练课预约
-     * @author Joburgess
-     * @date 2020/1/31
-     * @param practiceGroup: 预约信息
-     * @return java.util.Map
-     */
-    Map practiceApply(PracticeGroup practiceGroup);
-
 	/**
-	 * @describe 陪练课预约2
+	 * @describe 陪练课预约
 	 * @author Joburgess
 	 * @date 2020/1/31
 	 * @param practiceGroup: 预约信息
 	 * @return java.util.Map
 	 */
-	Map practiceApply2(PracticeGroup practiceGroup);
+	Map practiceApply(PracticeGroup practiceGroup);
 
 	/**
 	 * 获取陪练课列表

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.common.service.BaseService;
+
+public interface TeacherFreeTimeService extends BaseService<Integer, TeacherFreeTime> {
+
+}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/AppVersionInfoServiceImpl.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.AppVersionInfoDao;
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.biz.service.AppVersionInfoService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class AppVersionInfoServiceImpl extends BaseServiceImpl<Integer, AppVersionInfo>  implements AppVersionInfoService {
+	
+	@Autowired
+	private AppVersionInfoDao appVersionInfoDao;
+
+	@Override
+	public BaseDAO<Integer, AppVersionInfo> getDAO() {
+		return appVersionInfoDao;
+	}
+
+	@Override
+	public List<AppVersionInfo> queryNewestByPlatform(String platform) {
+		return appVersionInfoDao.queryNewestByPlatform(platform);
+	}
+	
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleModifyLogServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.CourseScheduleModifyLogDao;
+import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class CourseScheduleModifyLogServiceImpl extends BaseServiceImpl<Integer,CourseScheduleModifyLog>{
+	
+	@Autowired
+	private CourseScheduleModifyLogDao courseScheduleModifyLogDao;
+
+	@Override
+	public BaseDAO<Integer, CourseScheduleModifyLog> getDAO() {
+		return courseScheduleModifyLogDao;
+	}
+	
+}

+ 44 - 314
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -90,6 +90,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     private static Date activityStartDate, activityEndDate, applyStartDay, courseExpireDate;
 
+    private static List<String> applyDayTimes=new ArrayList<>();
+
     static {
         applyStartDay = DateUtil.stringToDate("2020-02-08 00:00:00");
         activityStartDate = DateUtil.stringToDate("2020-02-09 00:00:00");
@@ -135,6 +137,22 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         for (Integer schoolId : schoolIds3) {
             schoolSubjectTeachersMap.put(schoolId, subjectTeachersMap3);
         }
+
+        applyDayTimes.add("09:00:00");
+        applyDayTimes.add("09:30:00");
+        applyDayTimes.add("10:00:00");
+        applyDayTimes.add("11:00:00");
+        applyDayTimes.add("11:30:00");
+        applyDayTimes.add("12:00:00");
+        applyDayTimes.add("14:00:00");
+        applyDayTimes.add("14:30:00");
+        applyDayTimes.add("15:00:00");
+        applyDayTimes.add("16:00:00");
+        applyDayTimes.add("16:30:00");
+        applyDayTimes.add("17:00:00");
+        applyDayTimes.add("19:00:00");
+        applyDayTimes.add("19:30:00");
+        applyDayTimes.add("20:00:00");
     }
 
     @Override
@@ -929,11 +947,30 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         }
 
         List<Date> tempEnableApplyDates = new ArrayList<>();
+        Date yesterday=null;
+        Date tomorrow=null;
+        if(Objects.nonNull(firstClassTime)){
+            Calendar tempCalendar=Calendar.getInstance();
+            tempCalendar.setTime(firstClassTime);
+            tempCalendar.add(Calendar.DATE,-1);
+            yesterday=tempCalendar.getTime();
+            tempCalendar.add(Calendar.DATE,2);
+            tomorrow=tempCalendar.getTime();
+        }
         for (Date enableApplyDate : enableApplyDates) {
             Date enableApplyDateCourseEndTime = DateUtil.addMinutes(enableApplyDate, practiceCourseMinutes);
-            if (Objects.nonNull(firstClassTime) && DateUtil.isSameDay(enableApplyDate, firstClassTime)) {
-                continue;
+            if (Objects.nonNull(firstClassTime)) {
+                if(DateUtil.isSameDay(enableApplyDate, firstClassTime)){
+                    continue;
+                }
+                if(DateUtil.isSameDay(enableApplyDate, tomorrow)){
+                    continue;
+                }
+                if(DateUtil.isSameDay(enableApplyDate, yesterday)){
+                    continue;
+                }
             }
+
             if (teacherId == 100473) {
                 checkTeacherLeaveDate = false;
                 Calendar tempCalendar = Calendar.getInstance();
@@ -1379,327 +1416,20 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             calendar.set(Calendar.HOUR_OF_DAY, Integer.valueOf(enableEndTimeStr.split(":")[0]));
             calendar.set(Calendar.MINUTE, Integer.valueOf(enableEndTimeStr.split(":")[1]));
             Date enableApplyDayEndTime = calendar.getTime();
-            result.add(enableApplyDayStartTime);
             Calendar applyStartCalendar = Calendar.getInstance();
             applyStartCalendar.setTime(enableApplyDayStartTime);
-            while (true) {
-                applyStartCalendar.add(Calendar.MINUTE, practiceApplyIntervalMinutes);
-                if (applyStartCalendar.getTime().after(enableApplyDayEndTime)) {
-                    break;
-                }
-                result.add(applyStartCalendar.getTime());
-            }
-        }
-        return result;
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map practiceApply(PracticeGroup practiceGroup) {
-        Map result = new HashMap();
-        SysConfig practiceSubjectIdListConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_SUBJECT_ID_LIST);
-        if (!Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).contains(practiceGroup.getSubjectId().toString())) {
-            result.put("status", "DISABLE_SUBJECT");
-            return result;
-        }
-        Integer practiceCourseMinutes = 25;
-        SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
-        if (Objects.nonNull(practiceCourseMinutesConfig)) {
-            practiceCourseMinutes = practiceCourseMinutesConfig.getParanValue(Integer.class);
-        }
-        SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
-        Date now = new Date();
-        if (practiceGroup.getFirstCourseTime().before(activityStartDate)
-                || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            return result;
-        }
-        if (practiceGroup.getSecondCourseTime().before(activityStartDate)
-                || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            return result;
-        }
-        if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
-            result.put("status", "TWO_DATE_ON_ONE_DAY");
-            return result;
-        }
-
-        List<Date> allCourseDates = new ArrayList<>();
-        allCourseDates.add(practiceGroup.getFirstCourseTime());
-        allCourseDates.add(practiceGroup.getSecondCourseTime());
-        allCourseDates.add(DateUtil.addDays(practiceGroup.getFirstCourseTime(), 7));
-        if (DateUtil.isSameDay(allCourseDates.get(1), allCourseDates.get(2))) {
-            Date tempDate = allCourseDates.get(2);
-            allCourseDates.remove(2);
-            allCourseDates.add(DateUtil.addDays(tempDate, 7));
-        }
-        allCourseDates.add(DateUtil.addDays(practiceGroup.getSecondCourseTime(), 7));
-        if (DateUtil.isSameDay(allCourseDates.get(2), allCourseDates.get(3))) {
-            Date tempDate = allCourseDates.get(3);
-            allCourseDates.remove(3);
-            allCourseDates.add(DateUtil.addDays(tempDate, 7));
-        }
-        if (allCourseDates.get(2).before(activityStartDate)
-                || allCourseDates.get(2).after(courseExpireDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            return result;
-        }
-        if (allCourseDates.get(3).before(activityStartDate)
-                || allCourseDates.get(3).after(courseExpireDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            return result;
-        }
-        allCourseDates.sort(Comparator.comparing(Date::getTime));
-
-        studentDao.lockUser(practiceGroup.getStudentId());
-
-        Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(practiceGroup.getStudentId());
-
-        if (applyTimes >= 1) {
-            result.put("status", "IS_APPLIED");
-            return result;
-        }
-        applyTimes += 1;
-
-        practiceGroup.setCoursesStartDate(allCourseDates.get(0));
-        practiceGroup.setCoursesExpireDate(DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
-        Integer teacherId = searchTeacherId(practiceGroup);
-        if (Objects.isNull(teacherId)) {
-            result.put("status", "NO_TEACHER");
-            return result;
-        }
-        practiceGroup.setUserId(teacherId);
-        Teacher teacher = teacherService.getDetail(teacherId);
-        Employee employee = employeeDao.get(teacherId);
-        if (Objects.isNull(employee) || StringUtils.isEmpty(employee.getOrganIdList()) || employee.getOrganIdList().contains(",")) {
-            practiceGroup.setOrganId(teacher.getTeacherOrganId());
-        } else {
-            practiceGroup.setOrganId(Integer.parseInt(employee.getOrganIdList()));
-        }
-        Subject subject = subjectDao.get(practiceGroup.getSubjectId());
-        if (Objects.isNull(subject)) {
-            result.put("status", "DISABLE_SUBJECT");
-            return result;
-        }
-        SysUser sysUser = sysUserFeignService.queryUserById(practiceGroup.getStudentId());
-        practiceGroup.setName(subject.getName() + "•" + sysUser.getUsername());
-        practiceGroup.setSingleClassMinutes(practiceCourseMinutes);
-        practiceGroupDao.insert(practiceGroup);
-
-        //创建班级信息
-        ClassGroup classGroup = new ClassGroup();
-        classGroup.setSubjectIdList(practiceGroup.getSubjectId().toString());
-        classGroup.setExpectStudentNum(1);
-        classGroup.setStudentNum(1);
-        classGroup.setName(practiceGroup.getName());
-        classGroup.setTotalClassTimes(allCourseDates.size());
-        classGroup.setType(ClassGroupTypeEnum.PRACTICE);
-        classGroup.setDelFlag(0);
-        classGroup.setGroupType(GroupType.PRACTICE);
-        classGroup.setMusicGroupId(practiceGroup.getId().toString());
-        classGroup.setCreateTime(now);
-        classGroup.setUpdateTime(now);
-        classGroupDao.insert(classGroup);
-
-        //创建班级老师关联记录
-        ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
-        classGroupTeacherMapper.setMusicGroupId(practiceGroup.getId().toString());
-        classGroupTeacherMapper.setClassGroupId(classGroup.getId());
-        classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
-        classGroupTeacherMapper.setUserId(teacherId);
-        classGroupTeacherMapper.setGroupType(GroupType.PRACTICE);
-        classGroupTeacherMapper.setCreateTime(now);
-        classGroupTeacherMapper.setUpdateTime(now);
-        classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
-
-        //创建班级与老师课酬记录
-        ClassGroupTeacherSalary classGroupTeacherSalary = new ClassGroupTeacherSalary();
-        classGroupTeacherSalary.setMusicGroupId(practiceGroup.getId().toString());
-        classGroupTeacherSalary.setClassGroupId(classGroup.getId());
-        classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
-        classGroupTeacherSalary.setUserId(teacherId);
-        classGroupTeacherSalary.setSalary(new BigDecimal(practiceCourseSalaryConfig.getParanValue(Integer.class)));
-        classGroupTeacherSalary.setOnlineClassesSalary(new BigDecimal(practiceCourseSalaryConfig.getParanValue(Integer.class)));
-        classGroupTeacherSalary.setGroupType(GroupType.PRACTICE);
-        classGroupTeacherSalary.setCreateTime(now);
-        classGroupTeacherSalary.setUpdateTime(now);
-        classGroupTeacherSalaryDao.insert(classGroupTeacherSalary);
-
-        //班级学生关联表
-        ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
-        classGroupStudentMapper.setMusicGroupId(practiceGroup.getId().toString());
-        classGroupStudentMapper.setClassGroupId(classGroup.getId());
-        classGroupStudentMapper.setUserId(practiceGroup.getStudentId());
-        classGroupStudentMapper.setCreateTime(now);
-        classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-        classGroupStudentMapper.setGroupType(GroupType.PRACTICE);
-        classGroupStudentMapperDao.insert(classGroupStudentMapper);
-
-        List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
-        List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
-        List<TeacherAttendance> teacherAttendances = new ArrayList<>();
-
-        for (Date courseDate : allCourseDates) {
-            //课表
-            CourseSchedule courseSchedule = new CourseSchedule();
-            courseSchedule.setMusicGroupId(practiceGroup.getId().toString());
-            courseSchedule.setClassGroupId(classGroup.getId());
-            courseSchedule.setStatus(CourseStatusEnum.NOT_START);
-            courseSchedule.setClassDate(courseDate);
-            courseSchedule.setStartClassTime(courseDate);
-            courseSchedule.setEndClassTime(DateUtil.addMinutes(courseDate, practiceCourseMinutes));
-            courseSchedule.setTeacherId(teacherId);
-            courseSchedule.setActualTeacherId(teacherId);
-            courseSchedule.setCreateTime(now);
-            courseSchedule.setUpdateTime(now);
-            courseSchedule.setTeachMode(TeachModeEnum.ONLINE);
-            courseSchedule.setType(CourseSchedule.CourseScheduleType.PRACTICE);
-            courseSchedule.setGroupType(GroupType.PRACTICE);
-            courseSchedule.setName(practiceGroup.getName());
-            courseScheduleDao.insert(courseSchedule);
-
-            //课程与老师薪水表
-            CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
-            courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
-            courseScheduleTeacherSalary.setGroupType(GroupType.PRACTICE);
-            courseScheduleTeacherSalary.setMusicGroupId(practiceGroup.getId().toString());
-            courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
-            courseScheduleTeacherSalary.setUserId(teacherId);
-            courseScheduleTeacherSalary.setExpectSalary(new BigDecimal(practiceCourseSalaryConfig.getParanValue()));
-            courseScheduleTeacherSalary.setCreateTime(now);
-            courseScheduleTeacherSalary.setUpdateTime(now);
-            courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
-            courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
-
-            //学生缴费记录
-            CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
-            courseScheduleStudentPayment.setGroupType(GroupType.PRACTICE);
-            courseScheduleStudentPayment.setMusicGroupId(practiceGroup.getId().toString());
-            courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
-            courseScheduleStudentPayment.setUserId(practiceGroup.getStudentId());
-            courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
-            courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
-            courseScheduleStudentPayment.setCreateTime(now);
-            courseScheduleStudentPayment.setUpdateTime(now);
-            courseScheduleStudentPayments.add(courseScheduleStudentPayment);
-
-            //教师签到记录
-            TeacherAttendance teacherAttendance = new TeacherAttendance();
-            teacherAttendance.setMusicGroupId(practiceGroup.getId().toString());
-            teacherAttendance.setTeacherId(teacherId);
-            teacherAttendance.setClassGroupId(classGroup.getId());
-            teacherAttendance.setGroupType(GroupType.PRACTICE);
-            teacherAttendance.setCourseScheduleId(courseSchedule.getId());
-            teacherAttendance.setCreateTime(now);
-            teacherAttendances.add(teacherAttendance);
-        }
-        courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
-        courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
-        teacherAttendanceDao.batchInsert(teacherAttendances);
-
-        Student student = studentDao.get(practiceGroup.getStudentId());
-        if (Objects.isNull(student)) {
-            student = new Student();
-            student.setUserId(practiceGroup.getStudentId());
-            student.setSubjectIdList(practiceGroup.getSubjectId().toString());
-            studentDao.insert(student);
-        } else {
-            if (Objects.isNull(student.getSubjectIdList())) {
-                student.setSubjectIdList(practiceGroup.getSubjectId().toString());
-            } else {
-                String[] studentIdStrings = student.getSubjectIdList().split(",");
-                List<String> studentIds = new ArrayList<>(Arrays.asList(studentIdStrings));
-                if (!studentIds.contains(practiceGroup.getSubjectId().toString())) {
-                    studentIds.add(practiceGroup.getSubjectId().toString());
-                }
-                student.setSubjectIdList(StringUtils.join(studentIds.toArray(), ","));
+            for (String applyDayTime : applyDayTimes) {
+                String temp=DateUtil.dateToString(applyStartCalendar.getTime(),"yyyy-MM-dd");
+                temp=temp+" "+applyDayTime;
+                result.add(DateUtil.stringToDate(temp,"yyyy-MM-dd HH:mm:ss"));
             }
-            studentDao.update(student);
-        }
-
-        List<CourseSchedule> studentRepeatCourse1 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(0), DateUtil.addMinutes(allCourseDates.get(2), practiceCourseMinutes));
-        if (CollectionUtils.isEmpty(studentRepeatCourse1)) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            result.put("status", "STUDENT_COURSE_REPEAT");
-            return result;
-//            throw new BizException("您预约的时间端和您现有的课程冲突");
-        }
-        List<CourseSchedule> studentRepeatCourse2 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(1), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
-        if (CollectionUtils.isEmpty(studentRepeatCourse2)) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            result.put("status", "STUDENT_COURSE_REPEAT");
-            return result;
-//            throw new BizException("您预约的时间端和您现有的课程冲突");
-        }
-        List<CourseSchedule> studentRepeatCourse3 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(2), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
-        if (CollectionUtils.isEmpty(studentRepeatCourse3)) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            result.put("status", "STUDENT_COURSE_REPEAT");
-            return result;
-//            throw new BizException("您预约的时间端和您现有的课程冲突");
         }
-        List<CourseSchedule> studentRepeatCourse4 = courseScheduleDao.findStudentCoursesWithIncludeDateRange(practiceGroup.getStudentId(), allCourseDates.get(3), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
-        if (CollectionUtils.isEmpty(studentRepeatCourse4)) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            result.put("status", "STUDENT_COURSE_REPEAT");
-            return result;
-//            throw new BizException("您预约的时间端和您现有的课程冲突");
-        }
-
-        //推送
-        List<CourseSchedule> courseSchedules1 = courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId, allCourseDates.get(2), DateUtil.addMinutes(allCourseDates.get(2), practiceCourseMinutes));
-        List<CourseSchedule> courseSchedules2 = courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId, allCourseDates.get(3), DateUtil.addMinutes(allCourseDates.get(3), practiceCourseMinutes));
-        if (!CollectionUtils.isEmpty(courseSchedules1) || !CollectionUtils.isEmpty(courseSchedules2)) {
-            if (courseSchedules1 == null) {
-                courseSchedules1 = new ArrayList<>();
-            }
-            if (courseSchedules2 == null) {
-                courseSchedules2 = new ArrayList<>();
-            }
-            courseSchedules1.addAll(courseSchedules2);
-            List<String> courseDates = new ArrayList<>();
-            List<String> courseNames = new ArrayList<>();
-            for (int i = 0; i < courseSchedules1.size(); i++) {
-                if (courseSchedules1.get(i).getGroupType().equals(GroupType.PRACTICE)) {
-                    if (courseSchedules1.get(i).getMusicGroupId().equals(practiceGroup.getId().toString())) {
-                        continue;
-                    } else {
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                        result.put("status", "TEACHER_PRACTICE_REPEAT");
-                        return result;
-//                        throw new BizException("指派的老师存在课程冲突");
-                    }
-                }
-                courseDates.add(DateUtil.dateToString(courseSchedules1.get(i).getStartClassTime(), "yyyy-MM-dd HH:mm:ss"));
-                courseNames.add(courseSchedules1.get(i).getName());
-            }
-            if (!CollectionUtils.isEmpty(courseDates)) {
-                String courseDatesStr = StringUtils.join(courseDates, "、");
-                String courseNamesStr = StringUtils.join(courseNames, "、");
-                Map<Integer, String> teacherMap = new HashMap<>();
-                teacherMap.put(teacherId, teacherId.toString());
-                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.PUSH_TEACHER_COURSE_COLLIDE,
-                        teacherMap, null, 0, null, "TEACHER", Objects.isNull(sysUser.getUsername()) ? sysUser.getPhone() : sysUser.getUsername(), courseDatesStr, courseNamesStr, courseNamesStr);
-            }
-        }
-
-        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
-        imGroupMemberList.add(new ImGroupMember(practiceGroup.getUserId().toString()));
-        imGroupMemberList.add(new ImGroupMember(practiceGroup.getStudentId().toString()));
-        ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
-        // 创建群组
-        imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
-
-        result.put("teacherName", teacher.getRealName());
-        result.put("enableApply", applyTimes < 1 ? 1 : 0);
-        result.put("status", "SUCCESS");
         return result;
     }
 
-
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public Map practiceApply2(PracticeGroup practiceGroup) {
+    public Map practiceApply(PracticeGroup practiceGroup) {
         if(Objects.isNull(practiceGroup.getUserId())){
             throw new BizException("请选择老师");
         }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherFreeTimeServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.TeacherFreeTimeDao;
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.biz.service.TeacherFreeTimeService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class TeacherFreeTimeServiceImpl extends BaseServiceImpl<Integer, TeacherFreeTime> implements TeacherFreeTimeService {
+
+	@Autowired
+	private TeacherFreeTimeDao teacherFreeTimeDao;
+
+	@Override
+	public BaseDAO<Integer, TeacherFreeTime> getDAO() {
+		return teacherFreeTimeDao;
+	}
+
+}

+ 99 - 0
mec-biz/src/main/resources/config/mybatis/AppVersionInfoMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.AppVersionInfoDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.AppVersionInfo"
+		id="AppVersionInfo">
+		<result column="id_" property="id" />
+		<result column="platform_" property="platform" />
+		<result column="version_" property="version" />
+		<result column="status_" property="status" />
+		<result column="is_force_update_" property="isForceUpdate" />
+		<result column="description_" property="description" />
+		<result column="download_url_" property="downloadUrl" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="update_time_" property="updateTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="AppVersionInfo">
+		SELECT * FROM
+		app_version_info WHERE id_ = #{id}
+	</select>
+	
+	<select id="queryNewestByPlatform" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info WHERE platform_ = #{platform} and status_ = 'newest'
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.AppVersionInfo"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO app_version_info
+		(id_,platform_,version_,status_,is_force_update_,description_,download_url_,operator_id_,update_time_,create_time_)
+		VALUES(#{id},#{platform},#{version},#{status},#{isForceUpdate},#{description},#{downloadUrl},#{operatorId},#{updateTime},#{createTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.AppVersionInfo">
+		UPDATE app_version_info
+		<set>
+			<if test="operatorId != null">
+				operator_id_ = #{operatorId},
+			</if>
+			<if test="status != null">
+				status_ = #{status},
+			</if>
+			<if test="downloadUrl != null">
+				download_url_ = #{downloadUrl},
+			</if>
+			<if test="platform != null">
+				platform_ = #{platform},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="version != null">
+				version_ = #{version},
+			</if>
+			<if test="description != null">
+				description_ = #{description},
+			</if>
+			<if test="isForceUpdate != null">
+				is_force_update_ = #{isForceUpdate},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM app_version_info WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="AppVersionInfo" parameterType="map">
+		SELECT * FROM app_version_info ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM app_version_info
+	</select>
+</mapper>

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

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleModifyLogDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleModifyLog"
+		id="CourseScheduleModifyLog">
+		<result column="id_" property="id" />
+		<result column="course_schedule_id_" property="courseScheduleId" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="previous_course_schedule_" property="previousCourseSchedule" />
+		<result column="current_course_schedule_" property="currentCourseSchedule" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CourseScheduleModifyLog">
+		SELECT * FROM
+		course_schedule_modify_log
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleModifyLog"
+		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_modify_log
+		(id_,course_schedule_id_,operator_id_,previous_course_schedule_,current_course_schedule_,create_time_)
+		VALUES(#{id},#{courseScheduleId},#{operatorId},#{previousCourseSchedule},#{currentCourseSchedule},#{createTime})
+	</insert>
+
+
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CourseScheduleModifyLog"
+		parameterType="map">
+		SELECT * FROM course_schedule_modify_log
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		course_schedule_modify_log
+	</select>
+</mapper>

+ 105 - 0
mec-biz/src/main/resources/config/mybatis/TeacherFreeTimeMapper.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.TeacherFreeTimeDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.TeacherFreeTime"
+		id="TeacherFreeTime">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="monday_" property="monday" />
+		<result column="tuesday_" property="tuesday" />
+		<result column="wednesday_" property="wednesday" />
+		<result column="thursday_" property="thursday" />
+		<result column="friday_" property="friday" />
+		<result column="saturday_" property="saturday" />
+		<result column="sunday_" property="sunday" />
+		<result column="total_times_" property="totalTimes" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="TeacherFreeTime">
+		SELECT * FROM
+		teacher_free_time WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="TeacherFreeTime">
+		SELECT * FROM teacher_free_time
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherFreeTime"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO teacher_free_time
+		(id_,user_id_,monday_,tuesday_,wednesday_,thursday_,friday_,saturday_,sunday_,total_times_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{monday},#{tuesday},#{wednesday},#{thursday},#{friday},#{saturday},#{sunday},#{totalTimes},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherFreeTime">
+		UPDATE teacher_free_time
+		<set>
+			<if test="monday != null">
+				monday_ = #{monday},
+			</if>
+			<if test="userId != null">
+				user_id_ = #{userId},
+			</if>
+			<if test="thursday != null">
+				thursday_ = #{thursday},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="saturday != null">
+				saturday_ = #{saturday},
+			</if>
+			<if test="wednesday != null">
+				wednesday_ = #{wednesday},
+			</if>
+			<if test="friday != null">
+				friday_ = #{friday},
+			</if>
+			<if test="tuesday != null">
+				tuesday_ = #{tuesday},
+			</if>
+			<if test="sunday != null">
+				sunday_ = #{sunday},
+			</if>
+			<if test="totalTimes != null">
+				total_times_ = #{totalTimes},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM teacher_free_time WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="TeacherFreeTime"
+		parameterType="map">
+		SELECT * FROM teacher_free_time ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		teacher_free_time
+	</select>
+</mapper>

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

@@ -328,7 +328,6 @@
             AND t.job_nature_='FULL_TIME'
             AND su.del_flag_=0 AND su.lock_flag_=0
             AND t.organ_id_!=36 AND t.organ_id_!=38
-            AND t.organ_id_!=7 AND t.organ_id_!=37
     </select>
     <select id="findTeaTeachersByOrganAndSubject1" resultMap="ExtendTeacherBasicDto">
         SELECT

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java

@@ -33,7 +33,7 @@ public class PracticeGroupController extends BaseController {
     private PracticeGroupService practiceGroupService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
-    List<Integer> excludeOrganIds=new ArrayList<>(Arrays.asList(new Integer[]{7,36,37,38}));
+    List<Integer> excludeOrganIds=new ArrayList<>(Arrays.asList(new Integer[]{36,38}));
 
     @ApiOperation("获取学生的陪练课")
     @GetMapping(value = "/findUserPracticeCourses")
@@ -96,7 +96,7 @@ public class PracticeGroupController extends BaseController {
             throw new BizException("请联系老师确认您的所属分部");
         }
         practiceGroup.setStudentId(sysUser.getId());
-        return succeed(practiceGroupService.practiceApply2(practiceGroup));
+        return succeed(practiceGroupService.practiceApply(practiceGroup));
     }
 
 }

+ 84 - 0
mec-web/src/main/java/com/ym/mec/web/controller/AppVersionInfoController.java

@@ -0,0 +1,84 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
+import com.ym.mec.biz.service.AppVersionInfoService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("appVersionInfo")
+@Api(tags = "APP版本信息服务")
+@RestController
+public class AppVersionInfoController extends BaseController {
+
+	@Autowired
+	private AppVersionInfoService appVersionInfoService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(appVersionInfoService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("根据app客户端查询对象")
+	@ApiImplicitParam(name = "platform", value = "平台名称", required = true, dataType = "String", paramType = "path")
+	@GetMapping(value = "/queryByPlatform")
+	public Object queryByPlatform(String platform) {
+		List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(platform);
+		if (list.size() > 0) {
+			return succeed(list.get(0));
+		}
+		return failed();
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	public Object query(Integer id) {
+
+		return succeed(appVersionInfoService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object add(AppVersionInfo appVersionInfo) {
+		Date date = new Date();
+		appVersionInfo.setCreateTime(date);
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(appVersionInfo.getPlatform());
+			if (list.size() > 0) {
+				return failed("一个平台只能有一个最新状态的记录");
+			}
+		}
+		return succeed(appVersionInfoService.insert(appVersionInfo));
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object update(AppVersionInfo appVersionInfo) {
+		Date date = new Date();
+		appVersionInfo.setUpdateTime(date);
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(appVersionInfo.getPlatform());
+			if (list.size() > 0) {
+				return failed("一个平台只能有一个最新状态的记录");
+			}
+		}
+		return succeed(appVersionInfoService.update(appVersionInfo));
+	}
+
+}

+ 60 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TeacherFreeTimeController.java

@@ -0,0 +1,60 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+import com.ym.mec.biz.dal.entity.TeacherFreeTime;
+import com.ym.mec.biz.service.TeacherFreeTimeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("teacherFreeTime")
+@Api(tags = "老师空余时间设置服务")
+@RestController
+public class TeacherFreeTimeController extends BaseController {
+
+	@Autowired
+	private TeacherFreeTimeService teacherFreeTimeService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(teacherFreeTimeService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	public Object query(Integer id) {
+
+		return succeed(teacherFreeTimeService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object add(TeacherFreeTime teacherFreeTime) {
+		Date date = new Date();
+		teacherFreeTime.setCreateTime(date);
+		return succeed(teacherFreeTimeService.insert(teacherFreeTime));
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object update(TeacherFreeTime teacherFreeTime) {
+		Date date = new Date();
+		teacherFreeTime.setUpdateTime(date);
+
+		return succeed(teacherFreeTimeService.update(teacherFreeTime));
+	}
+
+}