浏览代码

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

yonge 5 年之前
父节点
当前提交
b912f684b0
共有 18 个文件被更改,包括 201 次插入57 次删除
  1. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java
  2. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupActivityQueryInfo.java
  4. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java
  5. 0 10
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  6. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherService.java
  7. 43 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  8. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  9. 43 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  10. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  11. 1 25
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  12. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java
  13. 3 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  14. 23 0
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  15. 8 3
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  16. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  17. 14 10
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  18. 4 1
      mec-web/src/main/java/com/ym/mec/web/controller/education/ImController.java

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java

@@ -368,4 +368,12 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      * @return
      */
     BasicUserDto findTeacherInfo(Integer id);
+
+    /**
+     * 获取管理员通讯录
+     * @param userId
+     * @param search
+     * @return
+     */
+    List<BasicUserDto> queryEducationIpa(@Param("userId") Integer userId, @Param("search") String search);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java

@@ -11,7 +11,7 @@ public enum SporadicChargeTypeEnum implements BaseEnum<Integer, SporadicChargeTy
     LUCKY_BAG_ACTIVE(6,"福袋活动"),
     VISITING_FEE(7,"上门费"),
     VIP_BUY(8,"VIP课购买"),
-    RECHARGE(9,"VIP课购买");
+    RECHARGE(9,"账户余额");
 
     private Integer code;
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupActivityQueryInfo.java

@@ -10,6 +10,16 @@ public class VipGroupActivityQueryInfo extends QueryInfo {
 
     private String organId;
 
+    private Boolean enable;
+
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
     public String getOrganId() {
         return organId;
     }

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.enums.GroupType;
 
+import java.math.BigDecimal;
+
 /**
  * @Author Joburgess
  * @Date 2020/2/17
@@ -38,4 +40,15 @@ public interface GroupClassService {
      */
     boolean cleanGroupInfo(String groupId, GroupType groupType);
 
+    /**
+     * @describe 关闭课程组
+     * @author Joburgess
+     * @date 2020/3/4
+     * @param groupId: 课程组编号
+     * @param groupType: 课程组类型
+     * @param refundAmount: 退款金额
+     * @return void
+     */
+    void cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount);
+
 }

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

@@ -8,7 +8,6 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
-import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -254,13 +253,4 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 */
 	void pushStudyReport(Date expiredDate,String pushType);
 
-	/**
-	 * @describe 关闭网管课
-	 * @author Joburgess
-	 * @date 2020/3/4
-	 * @param groupId: 网管课编号
-	 * @param refundAmount: 退款金额
-	 * @return void
-	 */
-	void cancelPracticeGroup(Long groupId, BigDecimal refundAmount);
 }

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

@@ -151,4 +151,12 @@ public interface TeacherService extends BaseService<Integer, Teacher> {
      * @return
      */
     CourseHomework getCourseScheduleHomework(Integer courseScheduleId);
+
+    /**
+     * 获取教务端通讯录
+     * @param id
+     * @param search
+     * @return
+     */
+    List<BasicUserDto> queryEducationIpa(Integer id, String search);
 }

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

@@ -1425,6 +1425,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
         int singleClassMinutes = 0;
         int courseNum = 0;
+        Date coursesExpireDate = null;
+        Date coursesStartDate = null;
         GroupType groupType = vipGroupCourseAdjustInfo.getGroupType();
         switch (vipGroupCourseAdjustInfo.getGroupType()){
             case PRACTICE:
@@ -1434,6 +1436,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
                 singleClassMinutes = practiceGroup.getSingleClassMinutes();
                 courseNum = courseScheduleDao.countVipGroupCourses(practiceGroup.getId().intValue(),groupType.getCode());
+                coursesExpireDate = practiceGroup.getCoursesExpireDate();
+                coursesStartDate = practiceGroup.getCoursesStartDate();
                 break;
             default:
                 VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
@@ -1572,6 +1576,26 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             calendar.add(Calendar.DATE, 1);
         }
         checkNewCourseSchedules(courseSchedules, false);
+        //如果是陪练课,调整时间不允许超过有效期
+        if(groupType == GroupType.PRACTICE){
+            for (CourseSchedule e:courseSchedules) {
+                //已点名的不允许调整
+                List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseId(e.getId());
+                if(studentAttendances != null && studentAttendances.size() > 0){
+                    throw new BizException("调整失败: 课程已点名");
+                }
+                String classDate = DateUtil.format(e.getClassDate(), DateUtil.DEFAULT_PATTERN);
+                String startClassTime = DateUtil.format(e.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+                Date startDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+                Date endDateTime = DateUtil.addMinutes(startDateTime,singleClassMinutes);
+                if(DateUtil.minutesBetween(startDateTime,coursesStartDate) > 0){
+                    throw new BizException("调整失败: 课程{}调整时间早于有效期",e.getId());
+                }
+                if(DateUtil.minutesBetween(coursesExpireDate,endDateTime) > 0){
+                    throw new BizException("调整失败: 课程{}截止时间超过课程有效期",e.getId());
+                }
+            }
+        }
         courseScheduleDao.batchUpdate(courseSchedules);
         classGroupService.updateClassGroupInfo(classGroup.getId());
         if(vipGroupCourseAdjustInfo.getCourseCreateStartTime().after(now)){
@@ -3185,13 +3209,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if(Objects.isNull(courseSchedule.getStartClassTime())){
             throw new BizException("请指定上课时间");
         }
-        CourseSchedule oldCourseSchedule = courseScheduleDao.getSurplusCourseWithGroup(courseScheduleId);
+        CourseSchedule oldCourseSchedule = courseScheduleDao.get(courseScheduleId);
         if(Objects.isNull(oldCourseSchedule)){
-            throw new BizException("调整失败: 课程状态异常");
+            throw new BizException("课程不存在");
         }
         if(!oldCourseSchedule.getGroupType().equals(GroupType.PRACTICE)){
             throw new BizException("请选择网管课");
         }
+        //已点名的不允许调整
+        List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseId(courseScheduleId);
+        if(studentAttendances != null && studentAttendances.size() > 0){
+            throw new BizException("调整失败: 课程已点名");
+        }
         //已结算的课酬不能调整
         CourseScheduleTeacherSalary teacherSalary = courseScheduleTeacherSalaryDao.queryByCourseScheduleIdAndUserId(oldCourseSchedule.getId(), oldCourseSchedule.getActualTeacherId());
         if(teacherSalary != null && teacherSalary.getSettlementTime() != null){
@@ -3202,6 +3231,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
         Date startDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
         Date endDateTime = DateUtil.addMinutes(startDateTime,practiceGroup.getSingleClassMinutes());
+        if(DateUtil.minutesBetween(startDateTime,practiceGroup.getCoursesStartDate()) > 0){
+            throw new BizException("调整失败: 调整时间不得早于开课时间");
+        }
         if(DateUtil.minutesBetween(practiceGroup.getCoursesExpireDate(),endDateTime) > 0){
             throw new BizException("调整失败: 截止时间超过课程有效期");
         }
@@ -3263,7 +3295,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
         CourseSchedule oldCourseSchedule = courseScheduleDao.getSurplusCourseWithGroup(courseScheduleId);
         if(Objects.isNull(oldCourseSchedule)){
-            throw new BizException("调整失败: 课程状态异常");
+            throw new BizException("调整失败: 课程已结束");
         }
         if(!oldCourseSchedule.getGroupType().equals(GroupType.PRACTICE)){
             throw new BizException("请选择网管课");
@@ -3271,7 +3303,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if(teacherId.equals(oldCourseSchedule.getActualTeacherId())){
             throw new BizException("请选择不同的老师");
         }
-
         //保存修改记录
         Date date = new Date();
         CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
@@ -3289,6 +3320,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         checkNewCourseSchedules(courseSchedules,false);
 
         courseScheduleDao.update(oldCourseSchedule);
+        List<TeacherDefaultPracticeGroupSalary> teacherDefaultPracticeGroupSalaries = teacherDefaultPracticeGroupSalaryDao.queryByUserId(teacherId);
+        if(teacherDefaultPracticeGroupSalaries == null || teacherDefaultPracticeGroupSalaries.size() == 0){
+            throw new BizException("请设置老师默认课酬");
+        }
         teacherAttendanceDao.batchUpdateTeacher(courseScheduleIds,teacherId);
         courseScheduleTeacherSalaryDao.batchUpdateTeacher(courseScheduleIds,teacherId);
         courseScheduleModifyLogDao.insert(scheduleModifyLog);
@@ -3348,6 +3383,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Set<Long> courseScheduleIds = courseSchedules.stream().map(e -> e.getId()).collect(Collectors.toSet());
         courseScheduleTeacherSalaryDao.batchUpdateTeacher(courseScheduleIds,teacherId);
 
+        List<TeacherDefaultPracticeGroupSalary> teacherDefaultPracticeGroupSalaries = teacherDefaultPracticeGroupSalaryDao.queryByUserId(teacherId);
+        if(teacherDefaultPracticeGroupSalaries == null || teacherDefaultPracticeGroupSalaries.size() == 0){
+            throw new BizException("请设置老师默认课酬");
+        }
         teacherAttendanceDao.batchUpdateTeacher(courseScheduleIds,teacherId);
         courseScheduleModifyLogDao.batchInsert(scheduleModifyLogs);
 

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

@@ -242,7 +242,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 return;
             }
             for (StudentAttendance courseStudentAttendance : courseStudentAttendances) {
-                if(courseStudentAttendance.getStatus().equals(StudentAttendanceStatusEnum.NORMAL)){
+                if(Objects.nonNull(courseStudentAttendance.getStatus())&&courseStudentAttendance.getStatus().equals(StudentAttendanceStatusEnum.NORMAL)){
                     normalStudentNum+=1;
                 }
             }

+ 43 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java

@@ -2,14 +2,23 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.PracticeGroup;
+import com.ym.mec.biz.dal.enums.GroupStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 import com.ym.mec.biz.service.GroupClassService;
+import com.ym.mec.biz.service.SysUserCashAccountService;
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -39,6 +48,10 @@ public class GroupClassServiceImpl implements GroupClassService {
     private TeacherAttendanceDao teacherAttendanceDao;
     @Autowired
     private StudentAttendanceDao studentAttendanceDao;
+    @Autowired
+    private PracticeGroupDao practiceGroupDao;
+    @Autowired
+    private SysUserCashAccountService sysUserCashAccountService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -88,4 +101,34 @@ public class GroupClassServiceImpl implements GroupClassService {
         studentAttendanceDao.deleteByCourseSchedules(courseIds);
         return true;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+    public void cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount) {
+        if(Objects.isNull(groupId)){
+            throw new BizException("请指定课程组");
+        }
+        if(Objects.isNull(groupType)){
+            throw new BizException("请指定课程组类型");
+        }
+        if(groupType.equals(GroupType.PRACTICE)){
+            PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
+            if(Objects.isNull(practiceGroup)){
+                throw new BizException("指定的课程组不存在");
+            }
+            Date now=new Date();
+            if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)||practiceGroup.getCoursesExpireDate().before(now)){
+                throw new BizException("当前课程组不可关闭");
+            }
+            if(Objects.isNull(refundAmount)){
+                throw new BizException("请指定退款金额");
+            }
+            sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后团关闭网管课");
+            cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
+            practiceGroup.setMemo("后台关闭网管课");
+            practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
+            practiceGroup.setUpdateTime(now);
+            practiceGroupDao.update(practiceGroup);
+        }
+    }
 }

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

@@ -305,6 +305,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setVersion(0);
         Date date = new Date();
         if (sporadicPayDto.getUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
+            if(chargeInfo.getChargeType().getCode().equals(9)){
+                throw new BizException("账户充值不支持余额支付");
+            }
             SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
 
             if (userCashAccount == null) {

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

@@ -2676,6 +2676,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 if(Objects.nonNull(lastExpiredDay)&&lastExpiredDay.compareTo(courseStartDay)>=0){
                     courseStartDay=lastExpiredDay;
                 }
+                practiceGroupBuyParams.setBeRenewGroupId(practiceGroupBuyParams.getGroupId());
             }else{
                 return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "需要续费的课程组不存在");
             }
@@ -3437,29 +3438,4 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleEvaluateDao.update(report);
         }
     }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public void cancelPracticeGroup(Long groupId, BigDecimal refundAmount) {
-        if(Objects.isNull(groupId)){
-            throw new BizException("请指定课程组");
-        }
-        PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
-        if(Objects.isNull(practiceGroup)){
-            throw new BizException("指定的课程组不存在");
-        }
-        Date now=new Date();
-        if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)||practiceGroup.getCoursesExpireDate().before(now)){
-            throw new BizException("当前课程组不可关闭");
-        }
-        if(Objects.isNull(refundAmount)){
-            throw new BizException("请指定退款金额");
-        }
-        sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后团关闭网管课");
-        groupService.cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
-        practiceGroup.setMemo("后台关闭网管课");
-        practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
-        practiceGroup.setUpdateTime(now);
-        practiceGroupDao.update(practiceGroup);
-    }
 }

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -26,6 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 @Service
@@ -355,6 +358,20 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 	}
 
 	@Override
+	public List<BasicUserDto> queryEducationIpa(Integer userId, String search) {
+		List<BasicUserDto> basicUserDtos = queryGroupStudents(userId, search);
+		//获取当前管理人员所在分部,所有老师,以及没有乐团的学生
+		List<BasicUserDto> userDtos = teacherDao.queryEducationIpa(userId, search);
+		userDtos.addAll(basicUserDtos);
+		userDtos.parallelStream().filter(distinctByKey(BasicUserDto::getUserId)).forEach(System.out::println);
+		return userDtos;
+	}
+	public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
+		Set<Object> seen = ConcurrentHashMap.newKeySet();
+		return t -> seen.add(keyExtractor.apply(t));
+	}
+
+	@Override
 	public List<BasicUserDto> queryMusicGroupTeacher(String musicGroupId) {
 		if(Objects.isNull(musicGroupId)){
 			throw new BizException("请指定乐团");

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

@@ -359,7 +359,9 @@
 		</foreach>
 	</update>
     <update id="batchUpdateTeacher">
-		UPDATE course_schedule_teacher_salary csts SET csts.user_id_ = #{teacherId},csts.update_time_ = NOW()
+		UPDATE course_schedule_teacher_salary csts SET csts.user_id_ = #{teacherId},csts.update_time_ = NOW(),
+		csts.expect_salary_ =
+		(SELECT main_teacher_salary_ FROM teacher_default_practice_group_salary WHERE user_id_ = #{teacherId} LIMIT 1)
 		WHERE csts.course_schedule_id_ IN
 		<foreach collection="courseScheduleIds" item="courseScheduleId" open="(" close=")" separator=",">
 			#{courseScheduleId}

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

@@ -837,4 +837,27 @@
         LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
         WHERE su.id_ = #{id}
     </select>
+    <select id="queryEducationIpa" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
+        SELECT su.real_name_ username_,su.id_ user_id_,su.avatar_ head_url_,su.gender_,GROUP_CONCAT(s.name_) subject_name_,su.user_type_
+        FROM employee e
+        LEFT JOIN teacher t ON INTE_ARRAY(e.organ_id_list_,t.flow_organ_range_) OR FIND_IN_SET(t.organ_id_,e.organ_id_list_)
+        LEFT JOIN sys_user su ON t.id_ = su.id_
+        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
+        WHERE e.user_id_ = #{userId}
+        <if test="search != null and search != ''">
+            AND su.real_name_ LIKE CONCAT('%',#{search},'%')
+        </if>
+        GROUP BY t.id_
+        UNION ALL
+        SELECT su.username_,su.id_ user_id_,su.avatar_ head_url_,su.gender_,NULL subject_name_,su.user_type_
+        FROM employee e
+        LEFT JOIN sys_user su ON FIND_IN_SET(su.organ_id_,e.organ_id_list_)
+        LEFT JOIN student_registration sr ON su.id_ = sr.user_id_ AND sr.music_group_status_ != 'QUIT'
+        LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_ AND mg.status_ = 'PROGRESS'
+        WHERE e.user_id_ = #{userId} AND sr.id_ IS NULL AND mg.id_ IS NULL
+        <if test="search != null and search != ''">
+            AND su.username_ LIKE CONCAT('%',#{search},'%')
+        </if>
+        GROUP BY su.id_
+    </select>
 </mapper>

+ 8 - 3
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -135,7 +135,13 @@
 		<where>
 			vga.del_flag_=0
 			<if test="organId != null">
-			AND INTE_ARRAY(organ_id_,#{organId})
+				AND INTE_ARRAY(organ_id_,#{organId})
+			</if>
+			<if test="enable != null and enable == true">
+				AND ((NOW() &lt; end_time_ AND NOW() > start_time_) OR end_time_ IS NULL)
+			</if>
+			<if test="enable != null and enable == false">
+				AND (NOW() >= end_time_ OR NOW() &lt;= start_time_)
 			</if>
 		</where>
 	</sql>
@@ -143,8 +149,7 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="VipGroupActivity" parameterType="map">
 		SELECT
-		vga.*,
-		((NOW() &lt; end_time_ AND NOW() > start_time_) OR end_time_ IS NULL) enable,
+		vga.*,((NOW() &lt; end_time_ AND NOW() > start_time_) OR end_time_ IS NULL) enable,
 		GROUP_CONCAT(vgc.name_) vip_group_category_names_
 		FROM vip_group_activity vga
 		LEFT JOIN vip_group_category vgc ON FIND_IN_SET(vgc.id_,vga.vip_group_category_id_list_)

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -514,7 +514,7 @@ public class ExportController extends BaseController {
                     }else if (row.getChargeType().equals(7)) {
                         row.setSporadicType("上门费");
                     }else if (row.getChargeType().equals(9)) {
-                        row.setSporadicType("账户余额充值");
+                        row.setSporadicType("账户充值");
                     }
                 }
                 School userSchool = musicGroupDao.findUserSchool(row.getUserId());

+ 14 - 10
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -4,7 +4,9 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
+import com.ym.mec.biz.service.GroupClassService;
 import com.ym.mec.biz.service.PracticeGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -37,6 +39,8 @@ public class PracticeGroupManageController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private GroupClassService groupService;
 
     @ApiOperation(value = "全查询")
     @GetMapping("/queryAll")
@@ -46,15 +50,15 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        if(!sysUser.getIsSuperAdmin()){
+        if (!sysUser.getIsSuperAdmin()) {
             Employee employee = employeeDao.get(sysUser.getId());
             if (StringUtils.isEmpty(queryInfo.getOrganId())) {
                 queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
                 return failed("用户所在分部异常");
-            }else {
+            } else {
                 List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
                     return failed("非法请求");
                 }
             }
@@ -65,15 +69,15 @@ public class PracticeGroupManageController extends BaseController {
     @ApiOperation(value = "获取陪练课课程计划")
     @GetMapping(value = "/findPracticeGroupCourseSchedules")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/findPracticeGroupCourseSchedules')")
-    public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo){
+    public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo) {
         return succeed(practiceGroupService.findPracticeGroupCourseSchedules(queryInfo));
     }
 
-    @ApiOperation(value = "关闭网管课")
-    @PostMapping(value = "/cancelPracticeGroup")
-    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/cancelPracticeGroup')")
-    public HttpResponseResult cancelPracticeGroup(Long groupId, BigDecimal refundAmount){
-        practiceGroupService.cancelPracticeGroup(groupId,refundAmount);
+    @ApiOperation(value = "关闭课程组")
+    @PostMapping(value = "/cancelGroup")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/cancelGroup')")
+    public HttpResponseResult cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount) {
+        groupService.cancelGroup(groupId, groupType, refundAmount);
         return succeed();
     }
 }

+ 4 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/ImController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller.education;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.controller.BaseController;
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @Api(tags = "即时通讯相关服务")
 @RequestMapping("im")
 @RestController
@@ -44,7 +47,7 @@ public class ImController extends BaseController {
         if(sysUser == null){
             return failed("获取用户信息失败");
         }
-        return succeed(teacherService.queryGroupStudents(sysUser.getId(),search));
+        return succeed(teacherService.queryEducationIpa(sysUser.getId(),search));
     }
 
     @ApiOperation(value = "根据群编号,获取群组基本信息")