浏览代码

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

yonge 5 年之前
父节点
当前提交
07247cee74

+ 54 - 39
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -39,7 +39,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @params [musicGroupId]
      * @describe 获取所有班级
      */
-    List<ClassGroup> findAllClassGroupByMusicGroup(@Param("musicGroupId") String musicGroupId,@Param("classGroupType") String classGroupType);
+    List<ClassGroup> findAllClassGroupByMusicGroup(@Param("musicGroupId") String musicGroupId, @Param("classGroupType") String classGroupType);
 
     /**
      * 根据合奏班ID查询该合奏班下的子班级
@@ -74,11 +74,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<ClassGroup> findClassGroupByIds(@Param("ids") String ids);
 
     /**
+     * @param classGroupIds: 班级编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
      * @describe 获取班级列表
      * @author Joburgess
      * @date 2020/2/20
-     * @param classGroupIds: 班级编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
      */
     List<ClassGroup> findClassGroupWithIds(@Param("classGroupIds") List<Integer> classGroupIds);
 
@@ -149,7 +149,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @param vipIds
      * @return
      */
-    List<Map<String, String>> findVipStuNames(@Param("vipIds") String vipIds,@Param("groupType") String groupType);
+    List<Map<String, String>> findVipStuNames(@Param("vipIds") String vipIds, @Param("groupType") String groupType);
 
     /**
      * 获取班级下的学员列表
@@ -506,11 +506,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     int batchUpdateClassGroupCourseTimes(@Param("classGroupCourseTimes") Map<Integer, Integer> classGroupCourseTimes);
 
     /**
+     * @param classGroups:
+     * @return int
      * @describe
      * @author Joburgess
      * @date 2020/2/20
-     * @param classGroups:
-     * @return int
      */
     int batchUpdate(@Param("classGroups") List<ClassGroup> classGroups);
 
@@ -524,23 +524,23 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
 
     /**
+     * @param musicGroupId: 编号
+     * @param groupType:    类型
+     * @return com.ym.mec.biz.dal.entity.ClassGroup
      * @describe 根据乐团编号和类型获取班级
      * @author Joburgess
      * @date 2019/11/17
-     * @param musicGroupId: 编号
-     * @param groupType: 类型
-     * @return com.ym.mec.biz.dal.entity.ClassGroup
      */
     ClassGroup findByMusicGroupAndType(@Param("musicGroupId") String musicGroupId,
                                        @Param("groupType") String groupType);
 
     /**
+     * @param musicGroupId: 编号
+     * @param groupType:    类型
+     * @return com.ym.mec.biz.dal.entity.ClassGroup
      * @describe 根据乐团编号和类型获取班级
      * @author Joburgess
      * @date 2019/11/17
-     * @param musicGroupId: 编号
-     * @param groupType: 类型
-     * @return com.ym.mec.biz.dal.entity.ClassGroup
      */
     ClassGroup lockByMusicGroupAndType(@Param("musicGroupId") String musicGroupId,
                                        @Param("groupType") String groupType);
@@ -566,33 +566,33 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<ClassGroupTeachersDto> findClassGroupByType(@Param("musicGroupId") String musicGroupId, @Param("type") ClassGroupTypeEnum type);
 
     /**
+     * @param groupIds:  乐团或vip课编号
+     * @param groupType: 类型
+     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
      * @describe 统计指定乐团或vip课的总课次
      * @author Joburgess
      * @date 2019/11/21
-     * @param groupIds: 乐团或vip课编号
-     * @param groupType: 类型
-     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
      */
-    List<Map<String,Integer>> countGroupTotalClassTimes(@Param("groupIds") List<String> groupIds,
-                                                        @Param("groupType") String groupType);
+    List<Map<String, Integer>> countGroupTotalClassTimes(@Param("groupIds") List<String> groupIds,
+                                                         @Param("groupType") String groupType);
 
     /**
+     * @param groupIds:  乐团或vip课编号
+     * @param groupType: 类型
+     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
      * @describe 统计指定乐团或vip课的已上课次
      * @author Joburgess
      * @date 2019/11/21
-     * @param groupIds: 乐团或vip课编号
-     * @param groupType: 类型
-     * @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
      */
-    List<Map<String,Integer>> countGroupOverClassTimes(@Param("groupIds") List<String> groupIds,
+    List<Map<String, Integer>> countGroupOverClassTimes(@Param("groupIds") List<String> groupIds,
                                                         @Param("groupType") String groupType);
 
     /**
+     * @param classGroupIds: 班级编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
      * @describe 获取班级列表
      * @author Joburgess
      * @date 2019/11/21
-     * @param classGroupIds: 班级编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
      */
     List<ClassGroup> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds);
 
@@ -604,6 +604,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 批量更新班级学生数减一
+     *
      * @param classGroupIdList
      * @return
      */
@@ -612,46 +613,48 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     int updateTest(@Param("delFlag") YesOrNoEnum delFlag);
 
     /**
+     * @param groupId:   乐团编号
+     * @param groupType: 乐团类型
+     * @return com.ym.mec.biz.dal.entity.ClassGroup
      * @describe 根据乐团编号和类型获取班级
      * @author Joburgess
      * @date 2019/12/11
-     * @param groupId: 乐团编号
-     * @param groupType: 乐团类型
-     * @return com.ym.mec.biz.dal.entity.ClassGroup
      */
     ClassGroup findByGroupAndType(@Param("groupId") String groupId,
                                   @Param("groupType") String groupType);
 
     /**
+     * @param params: 查询条件
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SuperClassGroupDtio>
      * @describe 终极班级查询
      * @author Joburgess
      * @date 2019/12/30
-     * @param params: 查询条件
-     * @return java.util.List<com.ym.mec.biz.dal.dto.SuperClassGroupDtio>
      */
     List<SuperClassGroupDto> superFindClassGroups(Map<String, Object> params);
+
     int superCountClassGroups(Map<String, Object> params);
 
     /**
+     * @param search:
+     * @return java.util.List<java.lang.Integer>
      * @describe 根据关键字查询学生相关的班级编号
      * @author Joburgess
      * @date 2019/12/31
-     * @param search:
-     * @return java.util.List<java.lang.Integer>
      */
     List<Integer> findClassGroupIdsByStudent(@Param("search") String search);
 
     /**
+     * @param search:
+     * @return java.util.List<java.lang.Integer>
      * @describe 根据关键字查询教师相关的班级编号
      * @author Joburgess
      * @date 2019/12/31
-     * @param search:
-     * @return java.util.List<java.lang.Integer>
      */
     List<Integer> findClassGroupIdsByTeacher(@Param("search") String search);
 
     /**
      * 获取基础技能版数量
+     *
      * @param musicGroupId
      * @return
      */
@@ -659,35 +662,37 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 获取对应班级的声部名称列表
+     *
      * @param courseScheduleIds
      * @return
      */
     List<Map<Integer, String>> findClassGroupSubjectNameMaps(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
     /**
-     * @describe 根据团体删除班级
-     * @author Joburgess
-     * @date 2020/2/17
      * @param groupId:
      * @param groupType:
      * @return int
+     * @describe 根据团体删除班级
+     * @author Joburgess
+     * @date 2020/2/17
      */
     int deleteByGroup(@Param("groupId") String groupId,
-                      @Param("groupType")GroupType groupType);
+                      @Param("groupType") GroupType groupType);
 
     /**
-     * @describe 根据团体删除班级-逻辑删除
-     * @author Joburgess
-     * @date 2020/3/4
      * @param groupId:
      * @param groupType:
      * @return int
+     * @describe 根据团体删除班级-逻辑删除
+     * @author Joburgess
+     * @date 2020/3/4
      */
     int deleteByGroupWithLogic(@Param("groupId") String groupId,
                                @Param("groupType") GroupType groupType);
 
     /**
      * 获取vip所有班级列表
+     *
      * @param vipGroupIds
      * @return
      */
@@ -695,8 +700,18 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
     /**
      * 根据群编号,修改群名称
+     *
      * @param groupId
      * @param groupName
      */
     void updateGroupName(@Param("groupId") Integer groupId, @Param("groupName") String groupName);
+
+    /**
+     * 获取进行中乐团报名中基础技能班
+     * @param musicGroupId
+     * @param subjectId
+     * @param type
+     * @return
+     */
+    List<HighClassGroupDto> findHighClassGroupByTypeAndSubjectId(@Param("musicGroupId") String musicGroupId, @Param("subjectId") Integer subjectId, @Param("type") String type);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendancesDto.java

@@ -11,6 +11,9 @@ public class TeacherAttendancesDto {
     @ApiModelProperty(value = "老师名",required = false)
 	private String teacherName;
 
+    @ApiModelProperty(value = "分部名",required = false)
+	private String organName;
+
     @ApiModelProperty(value = "教师编号",required = false)
     private Integer teacherId;
 
@@ -52,6 +55,14 @@ public class TeacherAttendancesDto {
     @ApiModelProperty(value = "签退时间",required = false)
     private Date signOutTime;
 
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getClassDate() {
         return classDate;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherCloseQueryInfo.java

@@ -19,6 +19,9 @@ public class TeacherCloseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "课程类型")
     private String courseScheduleType;
 
+    @ApiModelProperty(value = "课程状态")
+    private String courseScheduleStatus;
+
     @ApiModelProperty(value = "课程名称")
     private String classGroupName;
 
@@ -31,6 +34,14 @@ public class TeacherCloseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    public String getCourseScheduleStatus() {
+        return courseScheduleStatus;
+    }
+
+    public void setCourseScheduleStatus(String courseScheduleStatus) {
+        this.courseScheduleStatus = courseScheduleStatus;
+    }
+
     public String getSignOutStatus() {
         return signOutStatus;
     }

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

@@ -15,6 +15,7 @@ import com.ym.mec.biz.dal.dto.SporadicPayDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
 import com.ym.mec.biz.dal.entity.ApprovalStatus;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
@@ -273,7 +274,7 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	 * 乐团筹备结束后,3.0乐团推送小班课缴费信息
 	 * @param musicGroupId
 	 */
-	void pushMessage(String musicGroupId) throws IOException;
+	void pushMessage(String musicGroupId, Set<Integer> classGroupIds) throws IOException;
 
 	/**
 	 * 补全musicGroupStudentFee表数据

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

@@ -1041,7 +1041,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     }
 
     @Override
-    public void pushMessage(String musicGroupId) throws IOException {
+    public void pushMessage(String musicGroupId,Set<Integer> classGroupIds) throws IOException {
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
             //是否有基础训练班

+ 31 - 28
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -1298,7 +1298,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (Objects.isNull(subjectId)) {
             throw new BizException("请选择声部");
         }
-        SysUser sysUser = sysUserFeignService.queryUserById(userId);
+        SysUser sysUser = teacherDao.getUser(userId);
         if (Objects.isNull(sysUser)) {
             throw new BizException("用户不存在");
         }
@@ -1346,6 +1346,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             checkTeacherLeaveDate = false;
         }
 
+        SysConfig practiceFreeApplyExpireDateConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_FREE_APPLY_EXPIRE_DATE);
+        Date practiceFreeApplyExpireDate = DateUtil.stringToDate(practiceFreeApplyExpireDateConfig.getParanValue());
+
         Date now = new Date();
         if (now.before(applyStartDay)) {
             now = applyStartDay;
@@ -1356,13 +1359,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         calendar.set(Calendar.MINUTE, 0);
         calendar.set(Calendar.SECOND, 0);
         calendar.set(Calendar.MILLISECOND, 0);
-        while (calendar.getTime().before(activityEndDate)) {
+        while (calendar.getTime().before(practiceFreeApplyExpireDate)) {
             calendar.add(Calendar.DATE, 1);
             Date applyStartDay = calendar.getTime();
             calendar.add(Calendar.DATE, 6);
             Date applyEndDay = calendar.getTime();
-            if (applyEndDay.after(activityEndDate)) {
-                applyEndDay = activityEndDate;
+            if (applyEndDay.after(practiceFreeApplyExpireDate)) {
+                applyEndDay = practiceFreeApplyExpireDate;
             }
             Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDay, Calendar.MONDAY);
             Date secondMonday = DateUtil.getWeekDayWithDate(applyEndDay, Calendar.MONDAY);
@@ -1698,18 +1701,18 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             practiceGroup.setSecondCourseTime(practiceGroup.getFirstCourseTime());
             practiceGroup.setFirstCourseTime(tmp);
         }
-        if (practiceGroup.getFirstCourseTime().before(now)
-                || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
-            return result;
-        }
-        if (practiceGroup.getSecondCourseTime().before(now)
-                || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
-            return result;
-        }
+//        if (practiceGroup.getFirstCourseTime().before(now)
+//                || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
+//            result.put("status", "APPLY_DATE_OVERFLOW");
+//            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
+//            return result;
+//        }
+//        if (practiceGroup.getSecondCourseTime().before(now)
+//                || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
+//            result.put("status", "APPLY_DATE_OVERFLOW");
+//            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
+//            return result;
+//        }
         if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
             result.put("status", "TWO_DATE_ON_ONE_DAY");
             result.put("info", "预约失败,网管课选择时间重复,请重试。");
@@ -1758,18 +1761,18 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             allCourseDates.remove(3);
             allCourseDates.add(DateUtil.addDays(tempDate, 7));
         }
-        if (allCourseDates.get(2).before(now)
-                || allCourseDates.get(2).after(courseExpireDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
-            return result;
-        }
-        if (allCourseDates.get(3).before(now)
-                || allCourseDates.get(3).after(courseExpireDate)) {
-            result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
-            return result;
-        }
+//        if (allCourseDates.get(2).before(now)
+//                || allCourseDates.get(2).after(courseExpireDate)) {
+//            result.put("status", "APPLY_DATE_OVERFLOW");
+//            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
+//            return result;
+//        }
+//        if (allCourseDates.get(3).before(now)
+//                || allCourseDates.get(3).after(courseExpireDate)) {
+//            result.put("status", "APPLY_DATE_OVERFLOW");
+//            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
+//            return result;
+//        }
         allCourseDates.sort(Comparator.comparing(Date::getTime));
 
         studentDao.lockUser(practiceGroup.getStudentId());

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

@@ -425,7 +425,7 @@ public class StudentManageServiceImpl implements StudentManageService {
         student.setServiceTag(sysUser.getServiceTag());
         student.setTeacherId(sysUser.getTeacherId());
         studentService.upSet(student);
-        if(new Integer(1).equals(student.getServiceTag())){
+        if(new Integer(0).equals(student.getServiceTag())){
             studentExtracurricularExercisesSituationDao.deleteByStudent(sysUser.getId());
         }
         return userId;

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

@@ -123,7 +123,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                     long replyNum = studentHomeworks.stream().filter(e -> YesOrNoEnum.YES.equals(e.getStatus())).count();
                     studentExtracurricularExercisesSituation.setExercisesReplyNum(replyNum>0?1:0);
                     if(replyNum>0){
-                        Date lastSubmitTime = studentHomeworks.stream().max(Comparator.comparing(StudentServeCourseHomeworkDto::getSubmitTime)).get().getSubmitTime();
+                        Date lastSubmitTime = studentHomeworks.stream().filter(e->Objects.nonNull(e.getSubmitTime())).max(Comparator.comparing(StudentServeCourseHomeworkDto::getSubmitTime)).get().getSubmitTime();
                         studentExtracurricularExercisesSituation.setLastSubmitTime(lastSubmitTime);
                     }
                     int exercisesMessageNum=0;
@@ -160,7 +160,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                 long replyNum = studentExercises.stream().filter(e -> e.getStatus()==1).count();
                 studentExtracurricularExercisesSituation.setExercisesReplyNum(replyNum>0?1:0);
                 if(replyNum>0){
-                    Date lastSubmitTime = studentExercises.stream().max(Comparator.comparing(ExtracurricularExercisesReply::getSubmitTime)).get().getSubmitTime();
+                    Date lastSubmitTime = studentExercises.stream().filter(e->Objects.nonNull(e.getSubmitTime())).max(Comparator.comparing(ExtracurricularExercisesReply::getSubmitTime)).get().getSubmitTime();
                     studentExtracurricularExercisesSituation.setLastSubmitTime(lastSubmitTime);
                 }
                 int exercisesMessageNum=0;

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

@@ -1273,4 +1273,14 @@
             #{classGroupId}
         </foreach>
     </select>
+    <select id="findHighClassGroupByTypeAndSubjectId" resultMap="HighClassGroup">
+        SELECT * FROM class_group WHERE music_group_id_=#{musicGroupId}
+        <if test="subjectId != null and type=='HIGH'">
+            AND FIND_IN_SET(#{subjectId},subject_id_list_)
+        </if>
+        <if test="subjectId != null and type=='HIGH_ONLINE'">
+            AND FIND_IN_SET(#{subjectId},memo_)
+        </if>
+        AND type_ = #{type} AND total_class_times_=0 AND del_flag_='0';
+    </select>
 </mapper>

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

@@ -174,6 +174,7 @@
         <result column="course_schedule_status_" property="courseScheduleStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="course_schedule_name_" property="courseScheduleName"/>
         <result column="teacher_name_" property="teacherName"/>
+        <result column="organ_name_" property="organName"/>
         <result column="teacher_id_" property="teacherId"/>
         <result column="sign_in_status_" property="signInStatus"/>
         <result column="sign_out_status_" property="signOutStatus"/>
@@ -221,10 +222,10 @@
             <if test="search != null and search != ''">
                 AND (su.id_ = #{search} OR su.real_name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%'))
             </if>
-            <if test="courseStartDate != null">
+            <if test="courseStartDate != null and courseStartDate != ''">
                 AND cs.class_date_ &gt;= #{courseStartDate}
             </if>
-            <if test="courseEndDate != null">
+            <if test="courseEndDate != null and courseEndDate != ''">
                 AND cs.class_date_ &lt;= #{courseEndDate}
             </if>
             <if test="signInStatus != null and signInStatus != '' and signInStatus != 3">
@@ -239,9 +240,12 @@
             <if test="signInStatus != null and signInStatus != '' and signInStatus == 3">
                 AND ta.sign_in_status_ IS NULL
             </if>
-            <if test="courseScheduleType != null">
+            <if test="courseScheduleType != null  and courseScheduleType != ''">
                 AND cs.type_ = #{courseScheduleType}
             </if>
+            <if test="courseScheduleStatus != null  and courseScheduleStatus != ''">
+                AND cs.status_ = #{courseScheduleStatus}
+            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(t.organ_id_,#{organId})
             </if>
@@ -268,11 +272,12 @@
         cs.class_date_,cs.start_class_time_,cs.end_class_time_,cs.type_ course_schedule_type_,
         IF(ta.sign_in_status_ IS NULL,3,ta.sign_in_status_) sign_in_status_,
         IF(ta.sign_out_status_ IS NULL,3,ta.sign_out_status_) sign_out_status_,
-        ta.sign_in_time_,ta.sign_out_time_,ta.remark_
+        ta.sign_in_time_,ta.sign_out_time_,ta.remark_,o.name_ organ_name_
         FROM course_schedule cs
         LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
         LEFT JOIN teacher t ON t.id_ = ta.teacher_id_
         LEFT JOIN sys_user su ON su.id_ = t.id_
+        LEFT JOIN organization o ON o.id_ = t.organ_id_
         <include refid="queryTeacherAttendancesCondition"/>
         ORDER BY cs.class_date_ ASC,cs.start_class_time_ ASC
         <include refid="global.limit"/>

+ 21 - 4
mec-student/src/main/java/com/ym/mec/student/controller/ClassGroupController.java

@@ -2,13 +2,17 @@ package com.ym.mec.student.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dto.HighClassGroupDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
@@ -24,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,6 +47,10 @@ public class ClassGroupController extends BaseController {
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     @Autowired
     private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private ClassGroupDao classGroupDao;
 
     @ApiOperation(value = "基础提高班报名")
     @PostMapping("/highReg")
@@ -49,7 +58,7 @@ public class ClassGroupController extends BaseController {
     public HttpResponseResult highReg(Integer classGroupId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         ClassGroup classGroup = classGroupService.get(classGroupId);
-        if (classGroup == null || (!classGroup.getType().equals(ClassGroupTypeEnum.HIGH)&&!classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) || classGroup.getDelFlag().equals(1)) {
+        if (classGroup == null || (!classGroup.getType().equals(ClassGroupTypeEnum.HIGH) && !classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) || classGroup.getDelFlag().equals(1)) {
             return failed("报名的班级不存在");
         }
         if (classGroup.getStudentNum().compareTo(classGroup.getExpectStudentNum()) >= 0) {
@@ -73,10 +82,18 @@ public class ClassGroupController extends BaseController {
         if (studentRegistration == null || studentRegistration.getActualSubjectId() == null) {
             return failed("学生不在该乐团");
         }
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         Map<String, Object> classGroupAndStatusMap = new HashMap<>();
-        List<HighClassGroupDto> highClassGroups = classGroupService.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId, studentRegistration.getActualSubjectId());
-        List<ClassGroupStudentMapper> ClassGroupStudentMapper = classGroupStudentMapperDao.findHighClassGroupHasUser(musicGroupId, userId,ClassGroupTypeEnum.HIGH);
-        List<ClassGroupStudentMapper> highOnlineClassGroupStudentMapper = classGroupStudentMapperDao.findHighClassGroupHasUser(musicGroupId, userId,ClassGroupTypeEnum.HIGH_ONLINE);
+        List<HighClassGroupDto> highClassGroups = new ArrayList<>();
+        if (musicGroup.getStatus().equals(MusicGroupStatusEnum.PROGRESS)) {
+            highClassGroups = classGroupDao.findHighClassGroupByTypeAndSubjectId(musicGroupId, studentRegistration.getActualSubjectId(), "HIGH");
+            List<HighClassGroupDto> highOnlineClassGroup = classGroupDao.findHighClassGroupByTypeAndSubjectId(musicGroupId, studentRegistration.getActualSubjectId(), "HIGH_ONLINE");
+            highClassGroups.addAll(highOnlineClassGroup);
+        } else {
+            highClassGroups = classGroupService.findClassGroupByMusicGroupIdAndSubjectId(musicGroupId, studentRegistration.getActualSubjectId());
+        }
+        List<ClassGroupStudentMapper> ClassGroupStudentMapper = classGroupStudentMapperDao.findHighClassGroupHasUser(musicGroupId, userId, ClassGroupTypeEnum.HIGH);
+        List<ClassGroupStudentMapper> highOnlineClassGroupStudentMapper = classGroupStudentMapperDao.findHighClassGroupHasUser(musicGroupId, userId, ClassGroupTypeEnum.HIGH_ONLINE);
         classGroupAndStatusMap.put("highClassGroups", highClassGroups);
         classGroupAndStatusMap.put("hasReg", false);
         classGroupAndStatusMap.put("onlineHasReg", false);

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

@@ -55,7 +55,7 @@ public class PracticeGroupController extends BaseController {
     @Autowired
     private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
 
-    private static final Set<Integer> ENABLE_APPLY_ORGANIDS = new HashSet<>(Arrays.asList(new Integer[]{28,34,37}));
+//    private static final Set<Integer> ENABLE_APPLY_ORGANIDS = new HashSet<>(Arrays.asList(new Integer[]{28,34,37}));
 
     @ApiOperation("获取学生的陪练课")
     @GetMapping(value = "/findUserPracticeCourses")
@@ -75,12 +75,12 @@ public class PracticeGroupController extends BaseController {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         Map<String,Object> result=practiceGroupService.checkCanApplyFreePracticeGroup(sysUser.getId());
-        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
-            Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(sysUser.getId());
-            result.put("canApply", applyTimes < 1 ? 1 : 0);
-        }else{
-            result.put("canApply", 0);
-        }
+//        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+        Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(sysUser.getId());
+        result.put("canApply", applyTimes < 1 ? 1 : 0);
+//        }else{
+//            result.put("canApply", 0);
+//        }
         result.put("organId", sysUser.getOrganId());
         return succeed(result);
     }
@@ -93,12 +93,12 @@ public class PracticeGroupController extends BaseController {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         Map<String,Object> result=practiceGroupService.getPracticeApplyParams(sysUser.getId());
-        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+//        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
             Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(sysUser.getId());
             result.put("enableApply", applyTimes < 1 ? 1 : 0);
-        }else{
-            result.put("enableApply", 0);
-        }
+//        }else{
+//            result.put("enableApply", 0);
+//        }
         return succeed(result);
     }
 
@@ -152,9 +152,9 @@ public class PracticeGroupController extends BaseController {
         if(excludeOrganIds.contains(sysUser.getOrganId())){
             throw new BizException("请联系老师确认您的所属分部");
         }
-        if(!ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
-            throw new BizException("陪练课预约活动已结束");
-        }
+//        if(!ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+//            throw new BizException("陪练课预约活动已结束");
+//        }
         practiceGroup.setStudentId(sysUser.getId());
         return succeed(practiceGroupService.practiceApply(practiceGroup));
     }

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java

@@ -130,7 +130,7 @@ public class MusicGroupController extends BaseController {
 	@ApiOperation(value = "乐团筹备结束后,3.0乐团推送小班课缴费信息")
 	@PostMapping("/pushMessage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroup/pushMessage')")
-	public Object pushMessage(String musicGroupId) throws Exception {
+	public Object pushMessage(String musicGroupId,Set<Integer> classGroupIds) throws Exception {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null || sysUser.getId() == null) {
 			return failed("获取用户信息失败");
@@ -138,7 +138,7 @@ public class MusicGroupController extends BaseController {
 		if(StringUtils.isEmpty(musicGroupId)){
 			throw new BizException("参数校验错误");
 		}
-		musicGroupService.pushMessage(musicGroupId);
+		musicGroupService.pushMessage(musicGroupId,classGroupIds);
 		return succeed();
 	}