Browse Source

Merge remote-tracking branch 'origin/online1' into online1

Joburgess 4 năm trước cách đây
mục cha
commit
a233a303e5
22 tập tin đã thay đổi với 612 bổ sung71 xóa
  1. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  2. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  3. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java
  4. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  5. 71 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseRepeatCheckDto.java
  6. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentVipDouble11Dto.java
  7. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyDto.java
  8. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  9. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  10. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  11. 70 35
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  12. 70 29
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  13. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  14. 27 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  15. 22 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  16. 24 0
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  17. 77 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  18. 0 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCompetitionController.java
  19. 78 1
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipGroupController.java
  20. 27 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupActivityController.java
  21. 8 0
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  22. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

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

@@ -1575,4 +1575,12 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @return
      */
     List<Map<Integer, Integer>> queryHasReatClass(@Param("classGroupIds") Set<String> classGroupIds, @Param("teacherId") String teacherId);
+
+    /**
+     * @describe 获取检测课程冲突需要的数据
+     * @author qnc99
+     * @date 2020/11/25 0025
+     * @return java.util.List<com.ym.mec.biz.dal.dto.CourseRepeatCheckDto>
+     */
+    List<CourseRepeatCheckDto> getCourseRepeatCheckInfos();
 }

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

@@ -338,4 +338,15 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
 
     List<CourseScheduleStudentPayment> queryAll(Map<String, Object> params);
     int countAll(Map<String, Object> params);
+
+    /**
+     * @describe 统计学员通过双十一活动排课的数量
+     * @author qnc99
+     * @date 2020/11/25 0025
+     * @param userIds:
+     * @param activityIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipDouble11Dto>
+     */
+    List<StudentVipDouble11Dto> countStudentDouble11CourseTime(@Param("userIds") List<Integer> userIds,
+                                                               @Param("specialActivityIds") List<Integer> specialActivityIds);
 }

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java

@@ -7,6 +7,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeInfo> {
     SporadicChargeInfo findInfoById(@Param("id") Integer id);
@@ -22,6 +23,8 @@ public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeIn
      */
     List<SporadicChargeInfo> getOrganActiveInfo(@Param("organId") Integer organId, @Param("chargeType") Integer chargeType);
 
+    List<SporadicChargeInfo> findSporadicChargeInfos(Map<String, Object> params);
+
     /**
      * 获取所有的活动分部
      *
@@ -36,4 +39,4 @@ public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeIn
      * @return
      */
     List<OrganMaxAmountDto> getActiveOrgansMaxAmount(@Param("type") Integer type);
-}
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -352,4 +352,16 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @return
      */
     List<StudentPaymentOrder> getUserOrderByType(@Param("userId") Integer userId, @Param("type") OrderTypeEnum type, @Param("status") DealStatusEnum status);
+
+    /**
+     * @describe 获取参与双十一的学员
+     * @author qnc99
+     * @date 2020/11/25 0025
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipDouble11Dto>
+     */
+    List<StudentVipDouble11Dto> queryDouble11Students(Map<String, Object> params);
+    int countDouble11Students(Map<String, Object> params);
+
+    List<StudentVipDouble11Dto> findStudentsDouble11Infos(@Param("studentIds") List<Integer> studentIds);
 }

+ 71 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseRepeatCheckDto.java

@@ -0,0 +1,71 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author qnc99
+ * @Date 2020/11/25 0025
+ */
+public class CourseRepeatCheckDto {
+
+    private Long courseId;
+
+    private Date classDate;
+
+    private Date startClassTime;
+
+    private java.util.Date endClassTime;
+
+    private List<Integer> teacherIds;
+
+    private List<Integer> studentIds;
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public Date getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(Date startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public Date getEndClassTime() {
+        return endClassTime;
+    }
+
+    public void setEndClassTime(Date endClassTime) {
+        this.endClassTime = endClassTime;
+    }
+
+    public List<Integer> getTeacherIds() {
+        return teacherIds;
+    }
+
+    public void setTeacherIds(List<Integer> teacherIds) {
+        this.teacherIds = teacherIds;
+    }
+
+    public List<Integer> getStudentIds() {
+        return studentIds;
+    }
+
+    public void setStudentIds(List<Integer> studentIds) {
+        this.studentIds = studentIds;
+    }
+}

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentVipDouble11Dto.java

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author qnc99
+ * @Date 2020/11/25 0025
+ */
+public class StudentVipDouble11Dto extends SimpleUserDto{
+
+    @ApiModelProperty(value = "双十一活动1V1支付次数")
+    private Integer paymentOneToOneTime;
+
+    @ApiModelProperty(value = "双十一活动1V2支付次数")
+    private Integer paymentOneToTwoTime;
+
+    @ApiModelProperty(value = "1V1可排课次数")
+    private Integer courseOneToOneTime;
+
+    @ApiModelProperty(value = "1V2可排课次数")
+    private Integer courseOneToTwoTime;
+
+    public Integer getPaymentOneToOneTime() {
+        return paymentOneToOneTime;
+    }
+
+    public void setPaymentOneToOneTime(Integer paymentOneToOneTime) {
+        this.paymentOneToOneTime = paymentOneToOneTime;
+    }
+
+    public Integer getPaymentOneToTwoTime() {
+        return paymentOneToTwoTime;
+    }
+
+    public void setPaymentOneToTwoTime(Integer paymentOneToTwoTime) {
+        this.paymentOneToTwoTime = paymentOneToTwoTime;
+    }
+
+    public Integer getCourseOneToOneTime() {
+        return courseOneToOneTime;
+    }
+
+    public void setCourseOneToOneTime(Integer courseOneToOneTime) {
+        this.courseOneToOneTime = courseOneToOneTime;
+    }
+
+    public Integer getCourseOneToTwoTime() {
+        return courseOneToTwoTime;
+    }
+
+    public void setCourseOneToTwoTime(Integer courseOneToTwoTime) {
+        this.courseOneToTwoTime = courseOneToTwoTime;
+    }
+}

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

@@ -18,6 +18,9 @@ public class VipGroupApplyDto {
     @ApiModelProperty(value = "课程计划列表",required = false)
     private List<CourseSchedule> courseSchedules;
 
+    @ApiModelProperty(value = "课程组只能是正常状态")
+    private boolean onlyProgress;
+
     private BigDecimal singleClassPrice;
 
     public BigDecimal getSingleClassPrice() {
@@ -53,4 +56,12 @@ public class VipGroupApplyDto {
     public void setCourseSchedules(List<CourseSchedule> courseSchedules) {
         this.courseSchedules = courseSchedules;
     }
+
+    public boolean getOnlyProgress() {
+        return onlyProgress;
+    }
+
+    public void setOnlyProgress(boolean onlyProgress) {
+        this.onlyProgress = onlyProgress;
+    }
 }

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

@@ -601,4 +601,12 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param educationalTeacherId
 	 */
 	void batchPracticeGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId,Integer oldTeacherId);
+
+	/**
+	 * @describe 重叠课程查找
+	 * @author qnc99
+	 * @date 2020/11/25 0025
+	 * @return void
+	 */
+	void courseRepeatCheck();
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -33,6 +33,24 @@ public interface StudentManageService {
     PageInfo<SimpleUserDto> queryStudentsWithTeacher(StudentManageQueryInfo queryInfo);
 
     /**
+     * @describe 双11活动学员查询
+     * @author qnc99
+     * @date 2020/11/25 0025
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    PageInfo<StudentVipDouble11Dto> queryDouble11Students(StudentManageQueryInfo queryInfo);
+
+    /**
+     * @describe 获取学员双11记录
+     * @author qnc99
+     * @date 2020/11/26 0026
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipDouble11Dto>
+     */
+    List<StudentVipDouble11Dto> getStudentDouble11Info(List<Integer> studentIds);
+
+    /**
      * @Author: Joburgess
      * @Date: 2019/9/20
      * 根据学生ID获取学生基本报名信息

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -205,6 +205,8 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     
     String END_TIME_OF_1111 = "end_time_of_1111";
 
+    String VIP_SPECIAL_ACTIVITY_IDS = "vip_special_activity_ids";
+
     /**
      * @return com.ym.mec.biz.dal.entity.SysConfig
      * @params paramName

+ 70 - 35
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -29,6 +29,7 @@ import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.enums.*;
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -73,25 +74,6 @@ import com.ym.mec.biz.dal.dao.TeacherDefaultMusicGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.TeacherDefaultPracticeGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.TeacherDefaultVipGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.VipGroupDao;
-import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
-import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
-import com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto;
-import com.ym.mec.biz.dal.dto.CoursePostponeDto;
-import com.ym.mec.biz.dal.dto.CourseScheduleDto;
-import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
-import com.ym.mec.biz.dal.dto.CourseScheduleRateDto;
-import com.ym.mec.biz.dal.dto.CourseScheduleStudentDto;
-import com.ym.mec.biz.dal.dto.CourseTimeDto;
-import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
-import com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto;
-import com.ym.mec.biz.dal.dto.Mapper;
-import com.ym.mec.biz.dal.dto.StudentNameAndPhoneDto;
-import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
-import com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto;
-import com.ym.mec.biz.dal.dto.TeacherRemarkCommitDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
-import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
@@ -1826,9 +1808,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
 
         //所有课程编号
-		List<Long> allCourseScheduleIds = allCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+		Set<Long> allCourseScheduleIds = allCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toSet());
         //所有课程学员签到记录
-		List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseIds(allCourseScheduleIds);
+		List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseIds(new ArrayList<>(allCourseScheduleIds));
 		//课程请假学员字典
 		Map<Long, Set<Integer>> courseLeaveStudentMap = studentAttendances.stream()
 				.filter(e -> StudentAttendanceStatusEnum.LEAVE.equals(e.getStatus()))
@@ -1897,24 +1879,27 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 //                        }
 
                         //助教冲突检测
-                        if (Objects.isNull(preCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
-                        } else if (existCourseScheduleIdsSet.contains(preCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
+						if (allCourseScheduleIds.contains(preCourseSchedule.getId())) {
+							IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(preCourseSchedule.getId());
+							if (Objects.nonNull(integerAndIntegerListDto)) {
+								preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+							}
+						}
+                        if (CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())) {
+                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId().longValue());
                             if (Objects.nonNull(integerAndIntegerListDto)) {
                                 preCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                             }
                         }
-                        if (Objects.isNull(backCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId());
-                            if (Objects.nonNull(integerAndIntegerListDto)) {
-                                backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
-                            }
-                        } else if (existCourseScheduleIdsSet.contains(backCourseSchedule.getId())) {
-                            IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
+
+						if (allCourseScheduleIds.contains(backCourseSchedule.getId())) {
+							IntegerAndIntegerListDto integerAndIntegerListDto = courseScheduleTeachingTeacherMap.get(backCourseSchedule.getId());
+							if (Objects.nonNull(integerAndIntegerListDto)) {
+								backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
+							}
+						}
+                        if (CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
+                            IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(backCourseSchedule.getClassGroupId().longValue());
                             if (Objects.nonNull(integerAndIntegerListDto)) {
                                 backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                             }
@@ -5149,4 +5134,54 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		return courseScheduleRateDtos;
 	}
+
+	@Override
+	public void courseRepeatCheck() {
+		List<CourseRepeatCheckDto> courseRepeatCheckInfos = courseScheduleDao.getCourseRepeatCheckInfos();
+		courseRepeatCheckInfos.sort(Comparator.comparing(CourseRepeatCheckDto::getStartClassTime));
+		Map<Date, List<CourseRepeatCheckDto>> dayCourseMap = courseRepeatCheckInfos.stream().collect(Collectors.groupingBy(CourseRepeatCheckDto::getClassDate));
+		Map<Long, List<Long>> courseRepeatIdMap = new HashMap<>();
+		for (CourseRepeatCheckDto cs1 : courseRepeatCheckInfos) {
+			if(!courseRepeatIdMap.containsKey(cs1.getCourseId())){
+				courseRepeatIdMap.put(cs1.getCourseId(), new ArrayList<>());
+			}else{
+				continue;
+			}
+			List<CourseRepeatCheckDto> dayCourses = dayCourseMap.get(cs1.getClassDate());
+			for (CourseRepeatCheckDto cs2 : dayCourses) {
+				if(cs1.getCourseId().equals(cs2.getCourseId())){
+					continue;
+				}
+				if(cs2.getEndClassTime().compareTo(cs1.getStartClassTime())<=0){
+					continue;
+				}
+				if(cs2.getStartClassTime().compareTo(cs1.getEndClassTime())>=0){
+					if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
+						courseRepeatIdMap.remove(cs1.getCourseId());
+					}
+					break;
+				}
+				if(cs1.getStartClassTime().compareTo(cs2.getEndClassTime())>=0||cs1.getEndClassTime().compareTo(cs2.getStartClassTime())<=0){
+					continue;
+				}
+				long repeatTeacherNums = cs1.getTeacherIds().stream().filter(teacherId -> cs2.getTeacherIds().contains(teacherId)).count();
+				if(repeatTeacherNums>0){
+					System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
+					courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
+					continue;
+				}
+//				long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
+//				if(repeatStudentNums>0){
+//					System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
+//					courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
+//					continue;
+//				}
+			}
+			if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
+				courseRepeatIdMap.remove(cs1.getCourseId());
+			}
+		}
+		System.out.println("重复课程:" + JSON.toJSONString(courseRepeatIdMap));
+		System.out.println("重复课程数量:" + courseRepeatIdMap.size());
+	}
 }

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

@@ -1,16 +1,13 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
+import com.ym.mec.biz.service.SysConfigService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -19,27 +16,6 @@ import org.springframework.util.CollectionUtils;
 
 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.CourseScheduleStudentPaymentDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
-import com.ym.mec.biz.dal.dao.StudentManageDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.SubjectChangeDao;
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.dao.VipGroupDao;
-import com.ym.mec.biz.dal.entity.MusicGroupQuit;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.entity.SubjectChange;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
@@ -102,6 +78,10 @@ public class StudentManageServiceImpl implements StudentManageService {
     private MusicGroupQuitDao musicGroupQuitDao;
     @Autowired
     private SubjectChangeDao subjectChangeDao;
+    @Autowired
+    private SysConfigService sysConfigService;
+    @Autowired
+    private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 
     @Override
     public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -214,6 +194,67 @@ public class StudentManageServiceImpl implements StudentManageService {
     }
 
     @Override
+    public PageInfo<StudentVipDouble11Dto> queryDouble11Students(StudentManageQueryInfo queryInfo) {
+        PageInfo<StudentVipDouble11Dto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<StudentVipDouble11Dto> dataList = new ArrayList<>();
+        int count = studentPaymentOrderDao.countDouble11Students(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = studentPaymentOrderDao.queryDouble11Students(params);
+            SysConfig vipSpecialActivityConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
+            Map<Integer, StudentVipDouble11Dto> studentCourseTimeMap = new HashMap<>();
+            if(Objects.nonNull(vipSpecialActivityConfig)&&StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())){
+                Set<Integer> studentIds = dataList.stream().map(StudentVipDouble11Dto::getUserId).collect(Collectors.toSet());
+                Set<Integer> specialActivityIds = Arrays.stream(vipSpecialActivityConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
+                List<StudentVipDouble11Dto> studentCourseTimeList = courseScheduleStudentPaymentDao.countStudentDouble11CourseTime(new ArrayList<>(studentIds), new ArrayList<>(specialActivityIds));
+                studentCourseTimeMap = studentCourseTimeList.stream().collect(Collectors.toMap(StudentVipDouble11Dto::getUserId, s -> s));
+            }
+            for (StudentVipDouble11Dto studentVipDouble11Dto : dataList) {
+                StudentVipDouble11Dto studentCourseTime = studentCourseTimeMap.get(studentVipDouble11Dto.getUserId());
+                studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToOneTime()));
+                if(studentVipDouble11Dto.getCourseOneToOneTime()<0){
+                    studentVipDouble11Dto.setCourseOneToOneTime(0);
+                }
+                studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToTwoTime()));
+                if(studentVipDouble11Dto.getCourseOneToTwoTime()<0){
+                    studentVipDouble11Dto.setCourseOneToTwoTime(0);
+                }
+            }
+        }
+        pageInfo.setRows(dataList);
+
+        return pageInfo;
+    }
+
+    @Override
+    public List<StudentVipDouble11Dto> getStudentDouble11Info(List<Integer> studentIds) {
+        List<StudentVipDouble11Dto> studentsDouble11Infos = studentPaymentOrderDao.findStudentsDouble11Infos(studentIds);
+        SysConfig vipSpecialActivityConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
+        Map<Integer, StudentVipDouble11Dto> studentCourseTimeMap = new HashMap<>();
+        if(Objects.nonNull(vipSpecialActivityConfig)&&StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())){
+            Set<Integer> specialActivityIds = Arrays.stream(vipSpecialActivityConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
+            List<StudentVipDouble11Dto> studentCourseTimeList = courseScheduleStudentPaymentDao.countStudentDouble11CourseTime(studentIds, new ArrayList<>(specialActivityIds));
+            studentCourseTimeMap = studentCourseTimeList.stream().collect(Collectors.toMap(StudentVipDouble11Dto::getUserId, s -> s));
+        }
+        for (StudentVipDouble11Dto studentVipDouble11Dto : studentsDouble11Infos) {
+            StudentVipDouble11Dto studentCourseTime = studentCourseTimeMap.get(studentVipDouble11Dto.getUserId());
+            studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToOneTime()));
+            if(studentVipDouble11Dto.getCourseOneToOneTime()<0){
+                studentVipDouble11Dto.setCourseOneToOneTime(0);
+            }
+            studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToTwoTime()));
+            if(studentVipDouble11Dto.getCourseOneToTwoTime()<0){
+                studentVipDouble11Dto.setCourseOneToTwoTime(0);
+            }
+        }
+        return studentsDouble11Infos;
+    }
+
+    @Override
     public StudentManageListDto findStudentManageBaseInfo(Integer userId) {
         return studentManageDao.findStudentBaseInfoByUserID(userId);
     }

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

@@ -345,8 +345,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             }
         }
 
+        if(vipGroup.getOnlyProgress()){
+			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
+		}
+
 		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
 
+        vipGroup.getVipGroupApplyBaseInfo().setId(vipGroupApplyBaseInfoDto.getId());
+
 		//创建班级信息
 		ClassGroup classGroup=new ClassGroup();
 		classGroup.setSubjectIdList(vipGroupApplyBaseInfoDto.getSubjectIdList());
@@ -2895,6 +2901,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
 		}
 
+		courseScheduleService.checkNewCourseSchedules(surplusCourses, false);
+
 		VipGroupStatusEnum vipGroupStatus = vipGroup.getStatus();
 
         Integer currentStudentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());

+ 27 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3309,4 +3309,31 @@
         ORDER BY start_class_time_ DESC LIMIT 1;
     </select>
 
+    <resultMap id="CourseRepeatCheckDto" type="com.ym.mec.biz.dal.dto.CourseRepeatCheckDto">
+        <result column="course_id_" property="courseId"/>
+        <result column="class_date_" property="classDate"/>
+        <result column="class_start_time_" property="startClassTime"/>
+        <result column="class_end_time_" property="endClassTime"/>
+        <collection property="teacherIds" ofType="int" javaType="list">
+            <result column="teacher_id_"/>
+        </collection>
+        <collection property="studentIds" ofType="int" javaType="list">
+            <result column="student_id_"/>
+        </collection>
+    </resultMap>
+
+    <select id="getCourseRepeatCheckInfos" resultMap="CourseRepeatCheckDto">
+        SELECT
+            cs.id_ course_id_,
+            cs.class_date_ class_date_,
+            CONCAT(cs.class_date_, ' ', cs.start_class_time_) class_start_time_,
+            CONCAT(cs.class_date_, ' ', cs.end_class_time_) class_end_time_,
+            cssp.user_id_ teacher_id_,
+            csts.user_id_ student_id_
+        FROM course_schedule cs
+        LEFT JOIN course_schedule_student_payment cssp ON cs.id_=cssp.course_schedule_id_
+        LEFT JOIN course_schedule_teacher_salary csts ON cs.id_=csts.course_schedule_id_
+        WHERE cs.organ_id_!=41 AND cs.del_flag_=0 AND cs.create_time_>'2020-01-01 00:00:00' AND cs.create_time_&lt;'3000-01-01 00:00:00'
+    </select>
+
 </mapper>

+ 22 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -542,4 +542,26 @@
 		SELECT COUNT(*) FROM course_schedule_student_payment
 		<include refid="queryAllCondition" />
 	</select>
+
+    <select id="countStudentDouble11CourseTime" resultMap="com.ym.mec.biz.dal.dao.StudentPaymentOrderDao.StudentVipDouble11Dto">
+		SELECT
+			cssp.user_id_ userId,
+			SUM(CASE vgc.student_num_ WHEN 1 THEN 1 ELSE 0 END) course_one_to_one_time_,
+			SUM(CASE vgc.student_num_ WHEN 2 THEN 1 ELSE 0 END) course_one_to_two_time_
+		FROM
+			course_schedule_student_payment cssp
+			LEFT JOIN vip_group vg ON cssp.music_group_id_ = vg.id_
+			LEFT JOIN vip_group_category vgc ON vg.vip_group_category_id_ = vgc.id_
+		WHERE
+			cssp.user_id_ IN
+			<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
+				#{userId}
+			</foreach>
+			AND vg.vip_group_activity_id_ IN
+			<foreach collection="specialActivityIds" item="specialActivityId" open="(" close=")" separator=",">
+				#{specialActivityId}
+			</foreach>
+		GROUP BY
+			cssp.user_id_
+    </select>
 </mapper>

+ 24 - 0
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -194,4 +194,28 @@
         AND sci.del_flag_ = 0
         GROUP BY o.id_
     </select>
+
+    <sql id="findSporadicChargeInfosCondition">
+        <where>
+            del_flag_ = 0
+            <if test="organId!=null">
+                AND organ_id_=#{organId}
+            </if>
+            <if test="organIds!=null">
+                AND organ_id_ IN
+                <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+                    #{organId}
+                </foreach>
+            </if>
+            <if test="chargeType!=null">
+                AND charge_type_ = #{chargeType}
+            </if>
+        </where>
+    </sql>
+
+    <select id="findSporadicChargeInfos" resultMap="SporadicChargeInfo">
+        SELECT *
+        FROM sporadic_charge_info
+        <include refid="findSporadicChargeInfosCondition" />
+    </select>
 </mapper>

+ 77 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -67,6 +67,13 @@
         <result column="complement_goods_id_list_" property="complementGoodsIdList"/>
     </resultMap>
 
+    <resultMap id="StudentVipDouble11Dto" type="com.ym.mec.biz.dal.dto.StudentVipDouble11Dto">
+        <result column="payment_one_to_one_time_" property="paymentOneToOneTime"/>
+        <result column="payment_one_to_two_time_" property="paymentOneToTwoTime"/>
+        <result column="course_one_to_one_time_" property="courseOneToOneTime"/>
+        <result column="course_one_to_two_time_" property="courseOneToTwoTime"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentPaymentOrder">
         SELECT *
@@ -752,4 +759,74 @@
     <select id="getUserOrderByType" resultMap="StudentPaymentOrder">
         SELECT * FROM student_payment_order WHERE user_id_=#{userId} AND type_=#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
     </select>
+
+    <select id="queryDouble11Students" resultMap="StudentVipDouble11Dto">
+        SELECT
+            su.id_ userId,
+            su.username_ userName,
+            su.phone_ phone,
+            su.avatar_ avatar,
+            SUM(CASE WHEN sci.title_ LIKE '%1V1%' THEN spo.class_group_id_ ELSE 0 END) payment_one_to_one_time_,
+            SUM(CASE WHEN sci.title_ LIKE '%1V2%' THEN spo.class_group_id_ ELSE 0 END) payment_one_to_two_time_
+        FROM
+            student_payment_order spo
+            LEFT JOIN sporadic_charge_info sci ON spo.music_group_id_=sci.id_
+            LEFT JOIN student s ON spo.user_id_=s.user_id_
+            LEFT JOIN sys_user su ON spo.user_id_ = su.id_
+        WHERE
+            spo.status_ = 'SUCCESS'
+            AND spo.type_ = 'DOUBLE_ELEVEN2020'
+            AND sci.title_ LIKE '双十一%'
+            AND s.teacher_id_= #{teacherId}
+            <if test="search!=null and search!=''">
+                AND (su.phone_=#{search} OR su.username_ LIKE CONCAT('%', #{search}, '%'))
+            </if>
+        GROUP BY
+            spo.user_id_
+        ORDER BY spo.user_id_
+        <include refid="global.limit" />
+    </select>
+
+    <select id="countDouble11Students" resultType="int">
+        SELECT
+            COUNT(DISTINCT spo.user_id_)
+        FROM
+        student_payment_order spo
+        LEFT JOIN sporadic_charge_info sci ON spo.music_group_id_=sci.id_
+        LEFT JOIN student s ON spo.user_id_=s.user_id_
+        LEFT JOIN sys_user su ON spo.user_id_ = su.id_
+        WHERE
+            spo.status_ = 'SUCCESS'
+            AND spo.type_ = 'DOUBLE_ELEVEN2020'
+            AND sci.title_ LIKE '双十一%'
+            AND s.teacher_id_= #{teacherId}
+        <if test="search!=null and search!=''">
+            AND (su.phone_=#{search} OR su.username_ LIKE CONCAT('%', #{search}, '%'))
+        </if>;
+    </select>
+
+    <select id="findStudentsDouble11Infos" resultMap="StudentVipDouble11Dto">
+        SELECT
+            su.id_ userId,
+            su.username_ userName,
+            su.phone_ phone,
+            su.avatar_ avatar,
+            SUM(CASE WHEN sci.title_ LIKE '%1V1%' THEN spo.class_group_id_ ELSE 0 END) payment_one_to_one_time_,
+            SUM(CASE WHEN sci.title_ LIKE '%1V2%' THEN spo.class_group_id_ ELSE 0 END) payment_one_to_two_time_
+        FROM
+            student_payment_order spo
+            LEFT JOIN sporadic_charge_info sci ON spo.music_group_id_=sci.id_
+            LEFT JOIN student s ON spo.user_id_=s.user_id_
+            LEFT JOIN sys_user su ON spo.user_id_ = su.id_
+        WHERE
+            spo.status_ = 'SUCCESS'
+            AND spo.type_ = 'DOUBLE_ELEVEN2020'
+            AND sci.title_ LIKE '双十一%'
+            AND spo.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+            GROUP BY
+                spo.user_id_
+    </select>
 </mapper>

+ 0 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentCompetitionController.java

@@ -44,7 +44,6 @@ public class StudentCompetitionController extends BaseController {
         if (sysUser == null) {
             return failed("请登录");
         }
-        contractService.register(sysUser.getId(), studentCompetition.getUsername(), studentCompetition.getIdCardNo(),sysUser.getPhone());
         studentCompetition.setUserId(sysUser.getId());
         studentCompetitionService.addStudentCompetition(studentCompetition);
         return succeed();

+ 78 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipGroupController.java

@@ -3,22 +3,30 @@ package com.ym.mec.teacher.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.dao.VipGroupCategoryDao;
+import com.ym.mec.biz.dal.dto.StudentVipDouble11Dto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.dto.VipGroupCostCountParamsDto;
 import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Objects;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Author Joburgess
@@ -37,6 +45,8 @@ public class TeacherVipGroupController extends BaseController {
 	private TeacherDao teacherDao;
 	@Autowired
 	private StudentManageService studentManageService;
+	@Autowired
+	private VipGroupCategoryDao vipGroupCategoryDao;
 
 	@ApiOperation("vip课申请")
 	@PostMapping("/vipGroupApply")
@@ -55,6 +65,62 @@ public class TeacherVipGroupController extends BaseController {
 		return succeed();
 	}
 
+	@ApiOperation("vip课申请-双11")
+	@PostMapping("/vipGroupApplyForDouble11")
+	@Transactional(rollbackFor = Exception.class)
+	public Object vipGroupApplyForDouble11(@RequestBody VipGroupApplyDto vipGroupApplyDto) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (Objects.isNull(user)) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		Integer userId = user.getId();
+		Teacher teacher = teacherDao.get(userId);
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setUserId(userId);
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setTeacherId(Long.valueOf(userId));
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganIdList(teacher.getTeacherOrganId().toString());
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganId(teacher.getTeacherOrganId());
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setRegistrationStartTime(DateUtil.addDays(new Date(), -1));
+		vipGroupApplyDto.getVipGroupApplyBaseInfo().setPaymentExpireDate(vipGroupApplyDto.getVipGroupApplyBaseInfo().getRegistrationStartTime());
+		vipGroupApplyDto.setOnlyProgress(true);
+
+		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroupApplyDto.getVipGroupApplyBaseInfo().getVipGroupCategoryId());
+		if(Objects.isNull(vipGroupCategory)){
+			return failed("课程形式错误");
+		}
+
+		List<Integer> studentIds = Arrays.stream(vipGroupApplyDto.getVipGroupApplyBaseInfo().getStudentIdList().split(",")).map(Integer::valueOf).collect(Collectors.toList());
+		List<StudentVipDouble11Dto> studentDouble11Info = studentManageService.getStudentDouble11Info(studentIds);
+		Map<Integer, StudentVipDouble11Dto> idStudentInfoMap = new HashMap<>();
+		if(!CollectionUtils.isEmpty(studentDouble11Info)){
+			idStudentInfoMap = studentDouble11Info.stream().collect(Collectors.toMap(StudentVipDouble11Dto::getUserId, s->s, (s1, s2)->s1));
+		}
+		for (Integer studentId : studentIds) {
+			StudentVipDouble11Dto studentVipDouble11Dto = idStudentInfoMap.get(studentId);
+			if(Objects.isNull(studentVipDouble11Dto)){
+				return failed("部分学员可排课次不足");
+			}
+			boolean enableApply = false;
+			switch (vipGroupCategory.getStudentNum()){
+				case 1:
+					enableApply = studentVipDouble11Dto.getCourseOneToOneTime()>=vipGroupApplyDto.getVipGroupApplyBaseInfo().getTotalClassTimes();
+					break;
+				case 2:
+					enableApply = studentVipDouble11Dto.getCourseOneToTwoTime()>=vipGroupApplyDto.getVipGroupApplyBaseInfo().getTotalClassTimes();
+					break;
+				default:
+
+					break;
+			}
+			if(!enableApply){
+				return failed("部分学员可排课次不足");
+			}
+		}
+
+		vipGroupService.createVipGroup(vipGroupApplyDto);
+		vipGroupService.addVipGroupStudents(vipGroupApplyDto.getVipGroupApplyBaseInfo().getId(), studentIds);
+		return succeed();
+	}
+
 	@ApiOperation("获取vip课课程和课酬总费用")
 	@PostMapping("/getVipGroupCostCount")
 	public Object getVipGroupCostCount(VipGroupCostCountParamsDto vipGroupCostCountParamsDto) {
@@ -83,4 +149,15 @@ public class TeacherVipGroupController extends BaseController {
 		return succeed(studentManageService.queryStudentsWithTeacher(queryInfo));
 	}
 
+	@ApiOperation(value = "获取参与双十一活动学员列表")
+	@GetMapping("/queryDouble11Students")
+	public HttpResponseResult queryDouble11Students(StudentManageQueryInfo queryInfo){
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (Objects.isNull(user)) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		queryInfo.setTeacherId(user.getId());
+		return succeed(studentManageService.queryDouble11Students(queryInfo));
+	}
+
 }

+ 27 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupActivityController.java

@@ -3,14 +3,21 @@ package com.ym.mec.teacher.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
+import com.ym.mec.biz.dal.entity.SysConfig;
+import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
+import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.*;
+import java.util.stream.Collectors;
+
 /**
  * @Author Joburgess
  * @Date 2019/10/1
@@ -25,6 +32,8 @@ public class VipGroupActivityController extends BaseController {
     private VipGroupActivityService vipGroupActivityService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private SysConfigService sysConfigService;
 
     @ApiOperation(value = "新增vip课活动方案")
     @PostMapping("/addVipGroupActivity")
@@ -48,12 +57,28 @@ public class VipGroupActivityController extends BaseController {
 
     @ApiOperation(value = "根据课程类型获取对应课程活动方案")
     @GetMapping("/findByVipGroupCategory")
-    public Object findByVipGroupCategory(Long categoryId){
+    public Object findByVipGroupCategory(Long categoryId, boolean onlySpecialActivity){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(sysUser == null){
             return failed("用户信息获取失败");
         }
-        return succeed(vipGroupActivityService.findByVipGroupCategory(categoryId,sysUser.getId()));
+        List<VipGroupActivity> vipGroupActivities = vipGroupActivityService.findByVipGroupCategory(categoryId, sysUser.getId());
+        SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
+        if(onlySpecialActivity){
+            if(Objects.isNull(sysConfig)|| StringUtils.isBlank(sysConfig.getParanValue())){
+                return succeed(Collections.EMPTY_LIST);
+            }
+            Set<Integer> specialActivityIds = Arrays.stream(sysConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
+            List<VipGroupActivity> results = vipGroupActivities.stream().filter(e -> specialActivityIds.contains(e.getId())).collect(Collectors.toList());
+            return succeed(results);
+        }else{
+            if(Objects.isNull(sysConfig)|| StringUtils.isBlank(sysConfig.getParanValue())){
+                return succeed(vipGroupActivities);
+            }
+            Set<Integer> specialActivityIds = Arrays.stream(sysConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
+            List<VipGroupActivity> results = vipGroupActivities.stream().filter(e -> !specialActivityIds.contains(e.getId())).collect(Collectors.toList());
+            return succeed(results);
+        }
     }
 
 }

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

@@ -21,6 +21,7 @@ import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -409,5 +410,12 @@ public class CourseScheduleController extends BaseController {
         courseScheduleService.cleanAttendance(courseScheduleIds);
         return succeed();
     }
+
+    @ApiOperation(value = "清空老师和学生考勤记录")
+    @GetMapping("/courseRepeatCheck")
+    public HttpResponseResult courseRepeatCheck(){
+        courseScheduleService.courseRepeatCheck();
+        return succeed();
+    }
 }
 

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

@@ -1007,9 +1007,9 @@ public class ExportController extends BaseController {
         }
 
         try {
-            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "应付金额", "现金支付", "余额支付", "到账时间",
+            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "到账时间",
                     "关联乐团ID/VIP课ID", "课程形态", "课程费用", "新生专享课程费用", "乐器减免费用", "课程减免费用", "押金", "乐器", "教辅费用", "维修费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "合作机构", "备注"};
-            String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "expectAmount", "actualAmount", "balancePaymentAmount", "payTime", "musicGroupId",
+            String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "expectAmount", "actualAmount", "balancePaymentAmount", "payTime", "musicGroupId",
                     "groupType.desc", "courseFee", "highOnlineCourseFee", "remitFee", "courseRemitFee", "leaseFee", "musicalFee", "teachingFee", "repairFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
             response.setContentType("application/octet-stream");