Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
044482f087

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GroupDao.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.Group;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author Joburgess
@@ -15,10 +16,10 @@ public interface GroupDao {
      * @describe 搜索团体
      * @author Joburgess
      * @date 2019/12/30
-     * @param search: 关键字
+     * @param params: 查询参数
      * @return java.util.List<com.ym.mec.biz.dal.entity.Group>
      */
-    List<Group> searchGroups(@Param("search") String search);
+    List<Group> searchGroups(Map<String, Object> params);
 
     /**
      * @describe 根据团体编号获取团体

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java

@@ -12,6 +12,46 @@ public class CourseScheduleEndDto extends CourseSchedule {
 
     private String teacherName;
 
+    private String organName;
+
+    private int isSignIn;
+
+    private int isSignOut;
+
+    private int isCallNames;
+
+    public int getIsSignIn() {
+        return isSignIn;
+    }
+
+    public void setIsSignIn(int isSignIn) {
+        this.isSignIn = isSignIn;
+    }
+
+    public int getIsSignOut() {
+        return isSignOut;
+    }
+
+    public void setIsSignOut(int isSignOut) {
+        this.isSignOut = isSignOut;
+    }
+
+    public int getIsCallNames() {
+        return isCallNames;
+    }
+
+    public void setIsCallNames(int isCallNames) {
+        this.isCallNames = isCallNames;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getTeacherName() {
         return teacherName;
     }

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

@@ -14,6 +14,16 @@ public class SuperClassGroupDto extends ClassGroup {
 
     private String teachingTeacherNames;
 
+    private String organName;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getBishopTeacherNames() {
         return bishopTeacherNames;
     }

+ 24 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Group.java

@@ -11,10 +11,16 @@ public class Group {
     @ApiModelProperty(value = "编号")
     private String id;
 
-    @ApiModelProperty(value = "名称")
+    @ApiModelProperty(value = "部门编号")
+    private Integer organId;
+
+    @ApiModelProperty(value = "部门名称")
+    private String organName;
+
+    @ApiModelProperty(value = "团体名称")
     private String groupName;
 
-    @ApiModelProperty(value = "类型")
+    @ApiModelProperty(value = "团体类型")
     private GroupType groupType;
 
     public Group() {
@@ -25,6 +31,22 @@ public class Group {
         this.groupType = groupType;
     }
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getId() {
         return id;
     }

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

@@ -49,6 +49,8 @@ public class VipGroupActivity {
 	
 	/** 薪水只读标识(1-只读 0-可写) */
 	private String salaryReadonlyFlag;
+
+	private Integer paymentReadonlyFlag;
 	
 	/** 赠送课时支付薪水标识(1-计课酬  0-不计课酬) */
 	private String giveClassPaySalaryFlag;
@@ -68,6 +70,14 @@ public class VipGroupActivity {
 
 	private Integer enable;
 
+	public Integer getPaymentReadonlyFlag() {
+		return paymentReadonlyFlag;
+	}
+
+	public void setPaymentReadonlyFlag(Integer paymentReadonlyFlag) {
+		this.paymentReadonlyFlag = paymentReadonlyFlag;
+	}
+
 	public Integer getEnable() {
 		return enable;
 	}

+ 71 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EndCourseScheduleQueryInfo.java

@@ -1,15 +1,23 @@
 package com.ym.mec.biz.dal.page;
 
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.Date;
+
 /**
  * @Author Joburgess
  * @Date 2019/12/27
  */
 public class EndCourseScheduleQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "部门编号列表")
+    private String organIdList;
+
     @ApiModelProperty(value = "团体类型")
     private GroupType groupType;
 
@@ -25,6 +33,69 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "教师编号")
     private Integer teacherId;
 
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "课程状态")
+    private CourseStatusEnum courseStatus;
+
+    @ApiModelProperty(value = "课程类型")
+    private CourseSchedule.CourseScheduleType courseType;
+
+    @ApiModelProperty(value = "班级类型")
+    private ClassGroupTypeEnum classGroupType;
+
+    public ClassGroupTypeEnum getClassGroupType() {
+        return classGroupType;
+    }
+
+    public void setClassGroupType(ClassGroupTypeEnum classGroupType) {
+        this.classGroupType = classGroupType;
+    }
+
+    public CourseStatusEnum getCourseStatus() {
+        return courseStatus;
+    }
+
+    public void setCourseStatus(CourseStatusEnum courseStatus) {
+        this.courseStatus = courseStatus;
+    }
+
+    public CourseSchedule.CourseScheduleType getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
+        this.courseType = courseType;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getOrganIdList() {
+        return organIdList;
+    }
+
+    public void setOrganIdList(String organIdList) {
+        this.organIdList = organIdList;
+    }
+
     public Integer getStudentId() {
         return studentId;
     }

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

@@ -2226,7 +2226,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         MapUtil.populateMap(params, queryInfo);
 
         if(StringUtils.isNotBlank(queryInfo.getSearch())){
-            List<Group> groups = groupDao.searchGroups(queryInfo.getSearch());
+            List<Group> groups = groupDao.searchGroups(params);
             if(!CollectionUtils.isEmpty(groups)){
                 params.put("groups", groups);
             }
@@ -2263,6 +2263,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     List<Group> groupTemps = groupsTypeMap.get(result.getGroupType());
                     if(!CollectionUtils.isEmpty(groupTemps)){
                         result.setGroupName(groupTemps.get(0).getGroupName());
+                        result.setOrganName(groupTemps.get(0).getOrganName());
                     }
                 }
                 Map<TeachTypeEnum, List<ClassGroupTeacherMapDto>> teachTypeEnumListMap = classTeacherTypeMaps.get(result.getId());

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

@@ -2157,10 +2157,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<String, Object> params = new HashMap<>(16);
         MapUtil.populateMap(params, queryInfo);
 
-        if(StringUtils.isNotBlank(queryInfo.getSearch())){
-            List<Group> groups = groupDao.searchGroups(queryInfo.getSearch());
+        if(StringUtils.isNotBlank(queryInfo.getSearch())||StringUtils.isNotBlank(queryInfo.getOrganIdList())){
+            List<Group> groups = groupDao.searchGroups(params);
             if(!CollectionUtils.isEmpty(groups)){
                 params.put("groups", groups);
+            }else{
+                if(StringUtils.isNotBlank(queryInfo.getOrganIdList())){
+                    return pageInfo;
+                }
             }
             List<Integer> studentCourseIds=courseScheduleDao.findCourseIdsByStudent(queryInfo.getSearch());
             List<Integer> teacherCourseIds=courseScheduleDao.findCourseIdsByTeacher(queryInfo.getSearch());
@@ -2176,6 +2180,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             results = courseScheduleDao.endFindCourseSchedules(params);
+            List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
+            List<TeacherAttendance> teacherAttendances = teacherAttendanceDao.findTeacherIdByCourseSchedule(courseScheduleIds);
+            Map<Long, List<TeacherAttendance>> courseTeacherAttendanceMap = teacherAttendances.stream().collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
+            List<Map<Integer, Integer>> studentNumCourseMaps = studentAttendanceDao.countStudentAttendancesByCourses(courseScheduleIds);
+            Map<Integer, Long> studentNumCourseMap = MapUtil.convertIntegerMap(studentNumCourseMaps);
             List<Group> groups=new ArrayList<>();
             groups.add(null);
             List<Integer> teacherIds=new ArrayList<>();
@@ -2190,13 +2199,27 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             Map<String, Map<GroupType, List<Group>>> groupsGroupByGroup = groups.stream().collect(Collectors.groupingBy(Group::getId, Collectors.groupingBy(Group::getGroupType)));
             results.forEach(result -> {
                 Map<GroupType, List<Group>> groupsTypeMap = groupsGroupByGroup.get(result.getMusicGroupId());
+                result.setTeacher(null);
                 if(Objects.nonNull(groupsTypeMap)){
                     List<Group> groupTemps = groupsTypeMap.get(result.getGroupType());
                     if(!CollectionUtils.isEmpty(groupTemps)){
                         result.setGroupName(groupTemps.get(0).getGroupName());
+                        result.setOrganName(groupTemps.get(0).getOrganName());
                     }
                     result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
                 }
+                List<TeacherAttendance> courseTeacherAttendances = courseTeacherAttendanceMap.get(result.getId());
+                if(!CollectionUtils.isEmpty(courseTeacherAttendances)){
+                    TeacherAttendance teacherAttendance=courseTeacherAttendances.get(0);
+                    result.setIsSignIn(Objects.isNull(teacherAttendance.getSignInStatus())?3:teacherAttendance.getSignInStatus().getCode());
+                    result.setIsSignOut(Objects.isNull(teacherAttendance.getSignOutStatus())?3:teacherAttendance.getSignOutStatus().getCode());
+                }
+                Long studentNum = studentNumCourseMap.get(result.getId());
+                if (Objects.nonNull(studentNum)) {
+                    result.setIsCallNames(studentNum > 0 ? 0 : 1);
+                } else {
+                    result.setIsCallNames(1);
+                }
             });
         }
         pageInfo.setRows(results);

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -271,14 +271,14 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 		Date date = new Date();
 		
-		int days = 1;
+		int hours = 4;
 		String str = sysConfigDao.findConfigValue(SysConfigService.ADVANCE_LEAVE_HOURS);
 		if (StringUtils.isNotBlank(str)) {
-			days = Integer.parseInt(str);
+			hours = Integer.parseInt(str);
 		}
 
-		if(DateUtil.addDays1(date, days).after(courseSchedule.getStartClassTime())){
-			throw new BizException("开课{}天之前才可以请假",days);
+		if(DateUtil.addHours(date, hours).after(courseSchedule.getStartClassTime())){
+			throw new BizException("开课{}小时之前才可以请假",hours);
 		}
 		
 		StudentAttendance studentAttendance  = studentAttendanceDao.findByStatusAndCourseScheduleId(userId,courseScheduleId.intValue());

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

@@ -258,8 +258,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //		}
 
 		//如果默认课酬与实际课酬不匹配则需要审批
-		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())>0||
-			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())>0
+		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())<0||
+			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())<0
 			&&StringUtils.isBlank(studentIds)){
 			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 		}else{

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -951,6 +951,9 @@
             <if test="classGroupId != null">
                 AND cg.id_=#{classGroupId}
             </if>
+            <if test="classGroupType!=null">
+                AND cg.type_=#{classGroupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         </where>
     </sql>
     <select id="superFindClassGroups" resultMap="SuperClassGroupInfo">

+ 32 - 3
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -1855,13 +1855,13 @@
         <where>
             <if test="search != null">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
-                  <if test="groups != null">
+                  <if test="groups != null and organIdList==null">
                       OR cs.music_group_id_ IN
                       <foreach collection="groups" item="group" open="(" close=")" separator=",">
                           #{group.id}
                       </foreach>
                   </if>
-                  <if test="courseIds != null">
+                  <if test="courseIds != null and organIdList==null">
                     OR cs.id_ IN
                     <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
                         #{courseId}
@@ -1869,6 +1869,18 @@
                   </if>
                 )
             </if>
+            <if test="groups != null and organIdList!=null">
+                AND cs.music_group_id_ IN
+                <foreach collection="groups" item="group" open="(" close=")" separator=",">
+                    #{group.id}
+                </foreach>
+            </if>
+            <if test="courseIds != null and organIdList!=null">
+                AND cs.id_ IN
+                <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+                    #{courseId}
+                </foreach>
+            </if>
             <if test="groupType != null">
                 AND cs.group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -1878,6 +1890,21 @@
             <if test="classGroupId != null">
                 AND cs.class_group_id_=#{classGroupId}
             </if>
+            <if test="startTime!=null and endTime==null">
+                AND course_start_time_ &gt; #{startTime}
+            </if>
+            <if test="startTime==null and endTime!=null">
+                AND course_start_time_ &lt; #{endTime}
+            </if>
+            <if test="startTime!=null and endTime!=null">
+                AND course_start_time_ BETWEEN #{startTime} AND #{endTime}
+            </if>
+            <if test="courseStatus!=null">
+                AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="courseType!=null">
+                AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         </where>
     </sql>
 
@@ -1895,10 +1922,12 @@
             cs.teach_mode_,
             cs.type_,
             cs.schoole_id_,
-            cg.name_ class_group_name_
+            cg.name_ class_group_name_,
+            s.name_ schoole_name_,
         FROM
           course_schedule cs
           LEFT JOIN class_group cg ON cg.id_=cs.class_group_id_
+          LEFT JOIN school s ON cs.schoole_id_=s.id_
         <include refid="endFindCourseSchedulesCondition"/>
           ORDER BY course_start_time_
         <include refid="global.limit"/>

+ 29 - 4
mec-biz/src/main/resources/config/mybatis/GroupMapper.xml

@@ -7,17 +7,40 @@
 <mapper namespace="com.ym.mec.biz.dal.dao.GroupDao">
 
     <resultMap type="com.ym.mec.biz.dal.entity.Group" id="Group">
+        <result column="organ_id_" property="organId"/>
+        <result column="organ_name_" property="organName"/>
         <result column="id_" property="id"/>
         <result column="group_name_" property="groupName"/>
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
+    <sql id="searchGroupsCondition">
+        <where>
+            <if test="search!=null">
+                AND g.id_ = #{search} OR g.name_ LIKE CONCAT( '%', #{search}, '%' )
+            </if>
+            <if test="organIdList!=null">
+                AND FIND_IN_SET(g.organ_id_,#{organIdList})
+            </if>
+        </where>
+    </sql>
+
     <select id="searchGroups" resultMap="Group">
-        ( SELECT id_, name_ group_name_, 'MUSIC' group_type_ FROM music_group WHERE id_ = #{search} OR name_ LIKE CONCAT( '%', #{search}, '%' ) ) UNION
-        ( SELECT id_, name_ group_name_, 'VIP' group_type_ FROM vip_group WHERE id_ = #{search} OR name_ LIKE CONCAT( '%', #{search}, '%' ) );
+        ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'MUSIC' group_type_
+        FROM music_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        <include refid="searchGroupsCondition"/> )
+        UNION
+        ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'VIP' group_type_
+        FROM vip_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        <include refid="searchGroupsCondition"/> );
     </select>
     <select id="findByGroupIds" resultMap="Group">
-      ( SELECT id_, name_ group_name_, 'MUSIC' group_type_ FROM music_group WHERE id_ IN
+      ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'MUSIC' group_type_
+        FROM music_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        WHERE g.id_ IN
         <foreach collection="groups" item="group" open="(" close=")" separator=",">
             <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@MUSIC">
                 #{group.id}
@@ -28,7 +51,9 @@
         </foreach>
       )
       UNION
-      ( SELECT id_, name_ group_name_, 'VIP' group_type_ FROM vip_group WHERE id_ IN
+      ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'VIP' group_type_
+      FROM vip_group g LEFT JOIN organization o ON g.organ_id_ = o.id_
+      WHERE g.id_ IN
         <foreach collection="groups" item="group" open="(" close=")" separator=",">
             <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@VIP">
                 #{group.id}

+ 4 - 5
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -518,20 +518,20 @@
         <result property="totalClassTimes" column="total_class_times_"/>
     </resultMap>
     <select id="findStudentVipGroupClass" resultMap="StudentManageVipGroupClassDto">
-        SELECT vg.id_,vg.name_ vip_group_name_,vg.status_,cgtm.user_id_,cg.student_num_,
+        SELECT vg.id_,vg.name_ vip_group_name_,vg.status_,vg.user_id_,cg.student_num_,
         vgc.name_,vg.courses_start_date,cg.current_class_times_,cg.total_class_times_
         FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
-        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN vip_group_activity vgc ON vgc.id_ = vg.vip_group_activity_id_
-        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
+        WHERE cg.group_type_ = 'VIP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
         <if test="vipGroupName != null">
             AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
         </if>
         <if test="vipGroupStatus != null">
             AND vg.status_ = #{vipGroupStatus}
         </if>
+        ORDER BY vg.create_time_ DESC
         <include refid="global.limit"/>
     </select>
     <select id="countStudentVipGroupClass" resultType="java.lang.Integer">
@@ -539,8 +539,7 @@
         FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
-        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
-        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
+        WHERE cg.group_type_ = 'VIP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
         <if test="vipGroupName != null">
             AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
         </if>

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

@@ -21,6 +21,7 @@
 		<result column="attribute2_" property="attribute2" />
 		<result column="attribute3_" property="attribute3" />
 		<result column="salary_readonly_flag_" property="salaryReadonlyFlag" />
+		<result column="payment_readonly_flag_" property="paymentReadonlyFlag" />
 		<result column="give_class_pay_salary_flag_" property="giveClassPaySalaryFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -47,7 +48,8 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO vip_group_activity (id_,name_,description_,vip_group_category_id_list_,start_time_,end_time_,organ_id_,courses_start_time_,courses_end_time_,type_,attribute1_,attribute2_,attribute3_,salary_readonly_flag_,give_class_pay_salary_flag_,create_time_,update_time_,salary_settlement_json_,del_flag_) VALUES(#{id},#{name},#{description},#{vipGroupCategoryIdList},#{startTime},#{endTime},#{organId},#{coursesStartTime},#{coursesEndTime},#{type},#{attribute1},#{attribute2},#{attribute3},#{salaryReadonlyFlag},#{giveClassPaySalaryFlag},now(),now(),#{salarySettlementJson},#{delFlag})
+		INSERT INTO vip_group_activity (id_,name_,description_,vip_group_category_id_list_,start_time_,end_time_,organ_id_,courses_start_time_,courses_end_time_,type_,attribute1_,attribute2_,attribute3_,salary_readonly_flag_,give_class_pay_salary_flag_,create_time_,update_time_,salary_settlement_json_,del_flag_,payment_readonly_flag_)
+		VALUES(#{id},#{name},#{description},#{vipGroupCategoryIdList},#{startTime},#{endTime},#{organId},#{coursesStartTime},#{coursesEndTime},#{type},#{attribute1},#{attribute2},#{attribute3},#{salaryReadonlyFlag},#{giveClassPaySalaryFlag},now(),now(),#{salarySettlementJson},#{delFlag},#{paymentReadonlyFlag})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -110,6 +112,9 @@
 			<if test="delFlag != null">
 			del_flag_ = #{delFlag},
 			</if>
+			<if test="paymentReadonlyFlag != null">
+				payment_readonly_flag_ = #{paymentReadonlyFlag},
+			</if>
 			</set> WHERE id_ = #{id}
 	</update>
 	

+ 22 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -9,14 +9,17 @@ import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
+import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
@@ -149,6 +152,19 @@ public class TeacherCourseScheduleController extends BaseController {
         if(Objects.isNull(classDateAdjustDto.getClassGroupId())){
             classDateAdjustDto.setClassGroupId(oldCourseSchedule.getClassGroupId());
         }
+        Date now=new Date();
+        if(DateUtils.isSameDay(now,oldCourseSchedule.getClassDate())){
+            return failed("不能调整今天的课程");
+        }
+        Date tomorrow = DateUtil.addDays1(now, 1);
+        if(DateUtils.isSameDay(tomorrow,oldCourseSchedule.getClassDate())){
+            Calendar calendar=Calendar.getInstance();
+            calendar.setTime(now);
+            System.out.println(calendar.get(Calendar.HOUR_OF_DAY));
+            if(calendar.get(Calendar.HOUR_OF_DAY)>22){
+                return failed("当前时间不可对此课程进行课程调整");
+            }
+        }
         List<CourseSchedule> courseSchedules=new ArrayList<>();
         courseSchedules.add(classDateAdjustDto);
         scheduleService.courseAdjust(courseSchedules);
@@ -177,4 +193,10 @@ public class TeacherCourseScheduleController extends BaseController {
         return succeed(studentAttendanceService.statisticsList(queryInfo));
     }
 
+    @ApiOperation(value = "终极课表获取")
+    @GetMapping("/superFindCourseSchedules")
+    public Object superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo){
+        return succeed(scheduleService.endFindCourseSchedules(queryInfo));
+    }
+
 }