Procházet zdrojové kódy

Merge branch 'online1' into music_score

Joburgess před 4 roky
rodič
revize
a5665190e8
68 změnil soubory, kde provedl 2741 přidání a 343 odebrání
  1. 16 0
      cms/src/main/resources/bootstrap-dev_server.properties
  2. 16 0
      mec-auth/mec-auth-server/src/main/resources/bootstrap-dev_server.properties
  3. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java
  4. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  5. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  6. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseReviewDto.java
  8. 64 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PageInfoReg.java
  9. 234 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterDto.java
  10. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentApplyDetailDto.java
  11. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java
  12. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java
  13. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java
  14. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  15. 14 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupActivity.java
  16. 40 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ActivityCourseType.java
  17. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java
  18. 70 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/RegistrationOrPreQueryInfo.java
  19. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageQueryInfo.java
  20. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentRegistrationQueryInfo.java
  21. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherNameQueryInfo.java
  22. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupActivityQueryInfo.java
  23. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  24. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  25. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantPaymentOrderService.java
  26. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  27. 35 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayDegreeInfoServiceImpl.java
  28. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayReserveServiceImpl.java
  29. 56 37
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  30. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  31. 0 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  32. 14 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupOrganizationCourseSettingsServiceImpl.java
  33. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  34. 18 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  35. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  36. 79 12
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  37. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantPaymentOrderServiceImpl.java
  38. 597 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  39. 1 1
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  40. 5 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  41. 2 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleReviewMapper.xml
  42. 4 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  43. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  44. 1 1
      mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml
  45. 6 0
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  46. 16 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  47. 450 185
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  48. 5 2
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  49. 13 2
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  50. 16 0
      mec-im/src/main/resources/bootstrap-dev_server.properties
  51. 8 0
      mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayController.java
  52. 7 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  53. 16 0
      mec-student/src/main/resources/bootstrap-dev_server.properties
  54. 1 1
      mec-teacher/src/main/java/com/ym/mec/teacher/config/ResourceServerConfig.java
  55. 28 4
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java
  56. 16 0
      mec-teacher/src/main/resources/bootstrap-dev_server.properties
  57. 63 40
      mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java
  58. 2 0
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  59. 91 13
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  60. 10 10
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java
  61. 52 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduSchoolController.java
  62. 58 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentStudentController.java
  63. 9 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java
  64. 93 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupActivityController.java
  65. 58 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupCategoryController.java
  66. 72 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupManageController.java
  67. 143 0
      mec-web/src/main/resources/application.yml
  68. 16 0
      mec-web/src/main/resources/bootstrap-dev_server.properties

+ 16 - 0
cms/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=cms
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 16 - 0
mec-auth/mec-auth-server/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=auth
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -27,6 +27,8 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 	 */
 	int batchInsert(List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries);
 
+	int updateEnableChangeSalaryByClassGroup(@Param("classGroupId") Long classGroupId, @Param("enableChangeSalary") Boolean enableChangeSalary);
+
 	/**
 	 * @param courseScheduleIds: 课程编号列表
 	 * @return int

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -23,6 +23,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
     List<Student> findByStudentIds(@Param("studentIds") List<Integer> studentIds);
 
+    List<Student> lockStudents(@Param("studentIds") List<Integer> studentIds);
+
     SysUser lockUserReturnInfo(@Param("userId") Integer userId);
 
     SysUser getUser(@Param("userId") Integer userId);

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -539,9 +539,50 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 获取支付中的缴费和审核的人数
+     *
      * @param musicGroupId
      * @param payingStatus
      * @return
      */
     List<Map<Integer, Integer>> countPayingNum(@Param("musicGroupId") String musicGroupId, @Param("payingStatus") Integer payingStatus);
+
+    /**
+     * 获取预报名或者报名的列表
+     *
+     * @param params
+     * @return
+     */
+    List<RegisterDto> getRegisterOrPreList(Map<String, Object> params);
+
+
+    /**
+     * 获取预报名或者报名总数
+     *
+     * @param params
+     * @return
+     */
+    int getRegisterOrPreCount(Map<String, Object> params);
+
+    /**
+     * 获取最小预报名时间和最小支付时间
+     *
+     * @return
+     */
+    RegisterDto getRegisterOrPreMinTime(@Param("musicGroupId") String musicGroupId);
+
+
+    /**
+     * 获取报名总人数
+     *
+     * @param musicGroupId
+     * @return
+     */
+    int getRegisterNum(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 获取某时间段的缴费人数
+     *
+     * @return
+     */
+    int getFirstPayNum(@Param("musicGroupId") String musicGroupId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java

@@ -28,6 +28,8 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
 
 	List<VipGroupActivity> queryByIds(@Param("activityIds") String activityIds);
 
+	List<VipGroupActivity> findByName(@Param("name") String name);
+
 	/**
 	 * 导出vip活动
 	 * @param params

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseReviewDto.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.PracticeGroupType;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -16,6 +17,9 @@ public class CourseReviewDto {
     @ApiModelProperty(value = "课程编号",required = false)
     private Integer id;
 
+    @ApiModelProperty(value = "课程组类型")
+    private GroupType groupType;
+
     @ApiModelProperty(value = "课程上课日期",required = false)
     private Date classDate;
 
@@ -178,6 +182,14 @@ public class CourseReviewDto {
         this.id = id;
     }
 
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
     public String getCourseName() {
         return courseName;
     }

+ 64 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PageInfoReg.java

@@ -0,0 +1,64 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class PageInfoReg<T> extends PageInfo<T> {
+
+    @ApiModelProperty(value = "报名人数")
+    private Integer regNum = 0;
+
+    @ApiModelProperty(value = "第一天缴费人数")
+    private Integer firstDayPayNum = 0;
+
+    @ApiModelProperty(value = "总缴费人数")
+    private Integer payNum = 0;
+
+    @ApiModelProperty(value = "首天缴费人数占比")
+    private BigDecimal payScale = BigDecimal.ZERO;
+
+    public PageInfoReg() {
+    }
+
+    public PageInfoReg(Integer pageNo) {
+        super(pageNo);
+    }
+
+    public PageInfoReg(Integer pageNo, int pageSize) {
+        super(pageNo, pageSize);
+    }
+
+    public Integer getRegNum() {
+        return regNum;
+    }
+
+    public void setRegNum(Integer regNum) {
+        this.regNum = regNum;
+    }
+
+    public Integer getFirstDayPayNum() {
+        return firstDayPayNum;
+    }
+
+    public void setFirstDayPayNum(Integer firstDayPayNum) {
+        this.firstDayPayNum = firstDayPayNum;
+    }
+
+    public Integer getPayNum() {
+        return payNum;
+    }
+
+    public void setPayNum(Integer payNum) {
+        this.payNum = payNum;
+    }
+
+    public BigDecimal getPayScale() {
+        return payScale;
+    }
+
+    public void setPayScale(BigDecimal payScale) {
+        this.payScale = payScale;
+    }
+}

+ 234 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterDto.java

@@ -0,0 +1,234 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.SubjectChange;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.common.enums.UserGenderEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class RegisterDto {
+
+
+    @ApiModelProperty(value = "学生编号",required = false)
+    private Integer userId;
+
+    @ApiModelProperty(value = "学生姓名",required = false)
+    private String studentName;
+
+    @ApiModelProperty(value = "家长姓名",required = false)
+    private String parentsName;
+
+    @ApiModelProperty(value = "联系电话",required = false)
+    private String parentsPhone;
+
+    /** 当前所在年级 */
+    @ApiModelProperty(value = "当前所在年级",required = false)
+    private String currentGrade;
+
+    /** 当前所在班级 */
+    @ApiModelProperty(value = "当前所在班级",required = false)
+    private String currentClass;
+
+    @ApiModelProperty(value = "性别",required = false)
+    private UserGenderEnum gender;
+
+
+    @ApiModelProperty(value = "实际专业名称",required = false)
+    private String actualSubjectName;
+
+    @ApiModelProperty(value = "报名专业名称",required = false)
+    private Integer actualSubjectId;
+
+    /** 是否允许调剂 */
+    @ApiModelProperty(value = "是否允许调剂",required = false)
+    private YesOrNoEnum isAllowAdjust;
+
+
+    @ApiModelProperty(value = "预报名时间",required = false)
+    private Date perRegisterTime;
+
+    @ApiModelProperty(value = "与首位预报名时间差",required = false)
+    private Integer perRegInterval;
+
+    @ApiModelProperty(value = "缴费时间",required = false)
+    private Date payTime;
+
+    @ApiModelProperty(value = "与首位缴费时间差",required = false)
+    private Integer payInterval;
+
+    private String perRegIntervalStr;
+
+    private String payIntervalStr;
+
+    private Date minPerRegisterTime;
+
+    private Date minPayTime;
+
+    private Integer perRegSort;
+
+    private Integer paySort;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getParentsName() {
+        return parentsName;
+    }
+
+    public void setParentsName(String parentsName) {
+        this.parentsName = parentsName;
+    }
+
+    public String getParentsPhone() {
+        return parentsPhone;
+    }
+
+    public void setParentsPhone(String parentsPhone) {
+        this.parentsPhone = parentsPhone;
+    }
+
+    public String getCurrentGrade() {
+        return currentGrade;
+    }
+
+    public void setCurrentGrade(String currentGrade) {
+        this.currentGrade = currentGrade;
+    }
+
+    public String getCurrentClass() {
+        return currentClass;
+    }
+
+    public void setCurrentClass(String currentClass) {
+        this.currentClass = currentClass;
+    }
+
+    public UserGenderEnum getGender() {
+        return gender;
+    }
+
+    public void setGender(UserGenderEnum gender) {
+        this.gender = gender;
+    }
+
+    public String getActualSubjectName() {
+        return actualSubjectName;
+    }
+
+    public void setActualSubjectName(String actualSubjectName) {
+        this.actualSubjectName = actualSubjectName;
+    }
+
+    public Integer getActualSubjectId() {
+        return actualSubjectId;
+    }
+
+    public void setActualSubjectId(Integer actualSubjectId) {
+        this.actualSubjectId = actualSubjectId;
+    }
+
+    public YesOrNoEnum getIsAllowAdjust() {
+        return isAllowAdjust;
+    }
+
+    public void setIsAllowAdjust(YesOrNoEnum isAllowAdjust) {
+        this.isAllowAdjust = isAllowAdjust;
+    }
+
+    public Date getPerRegisterTime() {
+        return perRegisterTime;
+    }
+
+    public void setPerRegisterTime(Date perRegisterTime) {
+        this.perRegisterTime = perRegisterTime;
+    }
+
+    public Integer getPerRegInterval() {
+        return perRegInterval;
+    }
+
+    public void setPerRegInterval(Integer perRegInterval) {
+        this.perRegInterval = perRegInterval;
+    }
+
+    public Date getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(Date payTime) {
+        this.payTime = payTime;
+    }
+
+    public Integer getPayInterval() {
+        return payInterval;
+    }
+
+    public void setPayInterval(Integer payInterval) {
+        this.payInterval = payInterval;
+    }
+
+    public String getPerRegIntervalStr() {
+        return perRegIntervalStr;
+    }
+
+    public void setPerRegIntervalStr(String perRegIntervalStr) {
+        this.perRegIntervalStr = perRegIntervalStr;
+    }
+
+    public String getPayIntervalStr() {
+        return payIntervalStr;
+    }
+
+    public void setPayIntervalStr(String payIntervalStr) {
+        this.payIntervalStr = payIntervalStr;
+    }
+
+    public Date getMinPerRegisterTime() {
+        return minPerRegisterTime;
+    }
+
+    public void setMinPerRegisterTime(Date minPerRegisterTime) {
+        this.minPerRegisterTime = minPerRegisterTime;
+    }
+
+    public Date getMinPayTime() {
+        return minPayTime;
+    }
+
+    public void setMinPayTime(Date minPayTime) {
+        this.minPayTime = minPayTime;
+    }
+
+    public Integer getPerRegSort() {
+        return perRegSort;
+    }
+
+    public void setPerRegSort(Integer perRegSort) {
+        this.perRegSort = perRegSort;
+    }
+
+    public Integer getPaySort() {
+        return paySort;
+    }
+
+    public void setPaySort(Integer paySort) {
+        this.paySort = paySort;
+    }
+}

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

@@ -89,6 +89,9 @@ public class StudentApplyDetailDto{
 
     private String payingStatusStr;
 
+    @ApiModelProperty(value = "不需要要购买云教练",required = false)
+    private Integer noneNeedCloudTeacher;
+
     public KitGroupPurchaseTypeEnum getKitGroupPurchaseTypeEnum() {
         return kitGroupPurchaseTypeEnum;
     }
@@ -280,4 +283,12 @@ public class StudentApplyDetailDto{
     public void setPayingStatusStr(String payingStatusStr) {
         this.payingStatusStr = payingStatusStr;
     }
+
+    public Integer getNoneNeedCloudTeacher() {
+        return noneNeedCloudTeacher;
+    }
+
+    public void setNoneNeedCloudTeacher(Integer noneNeedCloudTeacher) {
+        this.noneNeedCloudTeacher = noneNeedCloudTeacher;
+    }
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.entity.VipGroupStudentCoursePrice;
+import com.ym.mec.biz.dal.enums.ActivityCourseType;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -40,6 +41,17 @@ public class VipGroupApplyBaseInfoDto extends VipGroup {
     @ApiModelProperty(value = "第一个选择的学员")
     private Integer firstStudentId;
 
+    @ApiModelProperty(value = "活动课程类型")
+    private ActivityCourseType activityCourseType;
+
+    public ActivityCourseType getActivityCourseType() {
+        return activityCourseType;
+    }
+
+    public void setActivityCourseType(ActivityCourseType activityCourseType) {
+        this.activityCourseType = activityCourseType;
+    }
+
     public Integer getFirstStudentId() {
         return firstStudentId;
     }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java

@@ -74,6 +74,9 @@ public class CourseScheduleEvaluate {
 
     private Integer subjectId;
 
+    @ApiModelProperty(value = "头像")
+    private String studentAvatar;
+
     public String getStudentIdList() {
         return studentIdList;
     }
@@ -82,7 +85,13 @@ public class CourseScheduleEvaluate {
         this.studentIdList = studentIdList;
     }
 
+    public String getStudentAvatar() {
+        return studentAvatar;
+    }
 
+    public void setStudentAvatar(String studentAvatar) {
+        this.studentAvatar = studentAvatar;
+    }
 
     public Integer getIsPushed() {
         return isPushed;

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -56,11 +56,22 @@ public class Student extends SysUser {
 
 	private Integer cooperationOrganId;
 
+	@ApiModelProperty(value = "活动排课信息")
+	private String activityCourseDetail;
+
 	public Student(Integer userId, String subjectIdList) {
 		this.userId = userId;
 		this.subjectIdList = subjectIdList;
 	}
 
+	public String getActivityCourseDetail() {
+		return activityCourseDetail;
+	}
+
+	public void setActivityCourseDetail(String activityCourseDetail) {
+		this.activityCourseDetail = activityCourseDetail;
+	}
+
 	public Boolean getIsNewUser() {
 		return isNewUser;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -133,6 +133,9 @@ public class StudentRegistration {
     @ApiModelProperty(value = "是否购买云教练 0-没有 1-有",required = true)
     private Integer hasCloudTeacher = 0;
 
+    @ApiModelProperty(value = "是否不需要云教练 0-需要 1-不需要",required = true)
+    private Integer noneNeedCloudTeacher = 0;
+
     public String getCertificateType() {
         return certificateType;
     }
@@ -467,4 +470,12 @@ public class StudentRegistration {
     public void setHasCloudTeacher(Integer hasCloudTeacher) {
         this.hasCloudTeacher = hasCloudTeacher;
     }
+
+    public Integer getNoneNeedCloudTeacher() {
+        return noneNeedCloudTeacher;
+    }
+
+    public void setNoneNeedCloudTeacher(Integer noneNeedCloudTeacher) {
+        this.noneNeedCloudTeacher = noneNeedCloudTeacher;
+    }
 }

+ 14 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupActivity.java

@@ -90,13 +90,24 @@ public class VipGroupActivity {
 	private Integer studentMaxUsedTimes;
 
 	@ApiModelProperty(value = "适用学生类型:-1:所有;0:老用户;1:新用户")
-	private int  applyToStudentType = -1;
+	private Integer  applyToStudentType = -1;
 
-	public int getApplyToStudentType() {
+	@ApiModelProperty(value = "课程可调整方向:0双向可调,1禁止线上到线下,2禁止线下到线上,3双向不可调")
+	private Integer allowOnlineToOffline = 0;
+
+	public Integer getAllowOnlineToOffline() {
+		return allowOnlineToOffline;
+	}
+
+	public void setAllowOnlineToOffline(Integer allowOnlineToOffline) {
+		this.allowOnlineToOffline = allowOnlineToOffline;
+	}
+
+	public Integer getApplyToStudentType() {
 		return applyToStudentType;
 	}
 
-	public void setApplyToStudentType(int applyToStudentType) {
+	public void setApplyToStudentType(Integer applyToStudentType) {
 		this.applyToStudentType = applyToStudentType;
 	}
 

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ActivityCourseType.java

@@ -0,0 +1,40 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/6/10 0010
+ **/
+public enum ActivityCourseType implements BaseEnum<String, ComplaintsStatusEnum> {
+    FREE_VIP("free_vip", "考级活动赠送课"),
+    VIP1("vip1", "考级活动1v1VIP课"),
+    VIP2("vip2", "考级活动1v2VIP课"),
+    MUSIC_THEORY("music_theory", "考级活动乐理课");
+
+    private String code;
+
+    private String msg;
+
+    ActivityCourseType(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

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

@@ -169,10 +169,14 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     BACKSTAGE_STUDENT_APPEAL("BACKSTAGE_STUDENT_APPEAL", "学员申述"),
     BACKSTAGE_STUDENT_APPLY_QUIT_GROUP("BACKSTAGE_STUDENT_APPLY_QUIT_GROUP", "学员申请退团"),
 
+    CHILDREN_DAY_VIP_COURSE_TEACHER_PUSH("CHILDREN_DAY_VIP_COURSE_TEACHER_PUSH", "六一活动课程安排"),
+    CHILDREN_DAY_VIP_COURSE_STUDENT_PUSH("CHILDREN_DAY_VIP_COURSE_STUDENT_PUSH", "六一活动课程安排"),
+
     BACKSTAGE_STUDENT_APPLY_QUIT_COURSE("BACKSTAGE_STUDENT_APPLY_QUIT_COURSE", "学员申请退课"),
     BACKSTAGE_STUDENT_APPLY_WITHDRAW("BACKSTAGE_STUDENT_APPLY_WITHDRAW", "学员申请提现"),
     CHILDREN_DAY_NOTICE_PUSH("CHILDREN_DAY_NOTICE_PUSH", "技能评测考级报名推送"),
-    CHILDREN_DAY_NOTICE_MSG("CHILDREN_DAY_NOTICE_MSG", "技能评测考级报名短信");
+    CHILDREN_DAY_NOTICE_MSG("CHILDREN_DAY_NOTICE_MSG", "技能评测考级报名短信"),
+    NO_BUY_CLOUD_TEACHER_MSG("NO_BUY_CLOUD_TEACHER_MSG", "未购买买云教练短信");
 
     MessageTypeEnum(String code, String msg) {
         this.code = code;

+ 70 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/RegistrationOrPreQueryInfo.java

@@ -0,0 +1,70 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class RegistrationOrPreQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "乐团编号",required = false)
+    private String musicGroupId;
+
+    private Integer subjectId;
+
+    private List<Integer> userIds;
+
+    private String orderByPerRegister;
+
+    private String orderByPayTime;
+
+    private boolean isExport = false;
+
+    public boolean getIsExport() {
+        return isExport;
+    }
+
+    public void setIsExport(boolean export) {
+        isExport = export;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public List<Integer> getUserIds() {
+        return userIds;
+    }
+
+    public void setUserIds(List<Integer> userIds) {
+        this.userIds = userIds;
+    }
+
+    public String getOrderByPayTime() {
+        return orderByPayTime;
+    }
+
+    public void setOrderByPayTime(String orderByPayTime) {
+        this.orderByPayTime = orderByPayTime;
+    }
+
+    public String getOrderByPerRegister() {
+        return orderByPerRegister;
+    }
+
+    public void setOrderByPerRegister(String orderByPerRegister) {
+        this.orderByPerRegister = orderByPerRegister;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageQueryInfo.java

@@ -38,12 +38,42 @@ public class StudentManageQueryInfo extends QueryInfo {
     
     private Integer teacherId;
 
+    private Integer teacherIdForOrgan;
+
     private Integer isNewUser;
 
     private Integer carePackage;
 
     private Integer comeOnPackage;
 
+    private Integer subjectId;
+
+    private String activityCourseType;
+
+    public Integer getTeacherIdForOrgan() {
+        return teacherIdForOrgan;
+    }
+
+    public void setTeacherIdForOrgan(Integer teacherIdForOrgan) {
+        this.teacherIdForOrgan = teacherIdForOrgan;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getActivityCourseType() {
+        return activityCourseType;
+    }
+
+    public void setActivityCourseType(String activityCourseType) {
+        this.activityCourseType = activityCourseType;
+    }
+
     public Integer getCarePackage() {
         return carePackage;
     }

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

@@ -42,6 +42,9 @@ public class StudentRegistrationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否购买云教练 0-没有 1-有",required = false)
     private Integer hasCloudTeacher;
 
+    @ApiModelProperty(value = "是否不需要云教练 0-需要 1-不需要",required = false)
+    private Integer noneNeedCloudTeacher;
+
     private boolean isExport = false;
 
     public boolean getIsExport() {
@@ -139,4 +142,12 @@ public class StudentRegistrationQueryInfo extends QueryInfo {
     public void setHasCloudTeacher(Integer hasCloudTeacher) {
         this.hasCloudTeacher = hasCloudTeacher;
     }
+
+    public Integer getNoneNeedCloudTeacher() {
+        return noneNeedCloudTeacher;
+    }
+
+    public void setNoneNeedCloudTeacher(Integer noneNeedCloudTeacher) {
+        this.noneNeedCloudTeacher = noneNeedCloudTeacher;
+    }
 }

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

@@ -14,6 +14,16 @@ public class TeacherNameQueryInfo extends QueryInfo {
 
     private String jobNature;
 
+    private Boolean includeFlowOrgan;
+
+    public Boolean getIncludeFlowOrgan() {
+        return includeFlowOrgan;
+    }
+
+    public void setIncludeFlowOrgan(Boolean includeFlowOrgan) {
+        this.includeFlowOrgan = includeFlowOrgan;
+    }
+
     public Integer getTeacherId() {
         return teacherId;
     }

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

@@ -16,6 +16,16 @@ public class VipGroupActivityQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "适用学生类型:-1:所有;0:老用户;1:新用户")
     private Integer  applyToStudentType;
 
+    private Integer allowOnlineToOffline;
+
+    public Integer getAllowOnlineToOffline() {
+        return allowOnlineToOffline;
+    }
+
+    public void setAllowOnlineToOffline(Integer allowOnlineToOffline) {
+        this.allowOnlineToOffline = allowOnlineToOffline;
+    }
+
     public Boolean getEnable() {
         return enable;
     }

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

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
+import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
@@ -395,4 +396,21 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @return
      */
     List<Map<String, Integer>> countNormalNum(List<String> musicGroupIds);
+
+
+    /**
+     * 获取预报名或者报名列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfoReg<RegisterDto> getRegisterOrPreList(RegistrationOrPreQueryInfo queryInfo);
+
+
+    /**
+     * 设置不需要云教练
+     * @param id
+     * @return
+     */
+    Boolean setNoneCloudTeacher(Long id);
+
 }

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

@@ -213,6 +213,8 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
 
     String WARNING_MIN_COURSE_SALARY = "warning_min_course_salary";
 
+    String CHILDREN_DAY_VIP_ACTIVITY_IDS = "children_day_vip_activity_ids";
+
     /**
      * @return com.ym.mec.biz.dal.entity.SysConfig
      * @params paramName

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantPaymentOrderService.java

@@ -36,4 +36,7 @@ public interface TenantPaymentOrderService extends BaseService<Long, TenantPayme
 	public TenantPaymentOrder queryByOrderNo(String orderNo);
 
 	Object queryTenanPaymentPage(TenantPaymentOrderQueryInfo queryInfo);
-}
+
+
+	Boolean confirmOrder(TenantPaymentOrder order);
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -28,6 +28,7 @@ import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import org.springframework.web.multipart.MultipartFile;
 
 public interface VipGroupService extends BaseService<Long, VipGroup> {
 
@@ -41,6 +42,17 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     HttpResponseResult createVipGroup(VipGroupApplyDto vipGroup);
 
     /**
+     * @describe 创建vip课
+     * @author Joburgess
+     * @date 2019/10/30
+     * @param vipGroup: VIP课申请信息
+     * @return void
+     */
+    HttpResponseResult createActivityVipGroup(VipGroupApplyDto vipGroup);
+
+    HttpResponseResult importActivityVipGroup(String data);
+
+    /**
      * @describe 获取教务与教师共有分部
      * @author Joburgess
      * @date 2020.07.08

+ 35 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayDegreeInfoServiceImpl.java

@@ -1,19 +1,27 @@
 package com.ym.mec.biz.service.impl;
 
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.ChildrenDayDegreeDetailDao;
 import com.ym.mec.biz.dal.dao.ChildrenDayDegreeInfoDao;
+import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo;
+import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.enums.ActivityCourseType;
 import com.ym.mec.biz.service.ChildrenDayDegreeInfoService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, ChildrenDayDegreeInfo> implements ChildrenDayDegreeInfoService {
@@ -21,6 +29,8 @@ public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, C
     private ChildrenDayDegreeInfoDao childrenDayDegreeInfoDao;
     @Autowired
     private ChildrenDayDegreeDetailDao childrenDayDegreeDetailDao;
+    @Autowired
+    private StudentDao studentDao;
 
     @Override
     public BaseDAO<Integer, ChildrenDayDegreeInfo> getDAO() {
@@ -32,6 +42,14 @@ public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, C
     public ChildrenDayDegreeInfo addInfo(Long orderId) {
         List<ChildrenDayDegreeDetail> details = childrenDayDegreeDetailDao.getByOrderId(orderId);
         ChildrenDayDegreeInfo childrenDayDegreeInfo = new ChildrenDayDegreeInfo();
+        Student student = null;
+        JSONObject courseDetail = new JSONObject();
+        if(!CollectionUtils.isEmpty(details)){
+            student = studentDao.get(details.get(0).getUserId());
+        }
+        if(Objects.nonNull(student)&& StringUtils.isNotBlank(student.getActivityCourseDetail())){
+            courseDetail = JSON.parseObject(student.getActivityCourseDetail());
+        }
         BigDecimal totalAmount = BigDecimal.ZERO;
         for (ChildrenDayDegreeDetail detail : details) {
             switch (detail.getType()) {
@@ -39,6 +57,9 @@ public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, C
                     childrenDayDegreeInfo.setSubjectId(detail.getSubjectId());
                     childrenDayDegreeInfo.setGradeLevel(detail.getLevel());
                     childrenDayDegreeInfo.setGradePrice(detail.getPrice());
+                    if(detail.getPrice().compareTo(BigDecimal.ZERO)>0&&!courseDetail.containsKey(ActivityCourseType.FREE_VIP.getCode())){
+                        courseDetail.put(ActivityCourseType.FREE_VIP.getCode(), 1);
+                    }
                     break;
                 case 2:
                     childrenDayDegreeInfo.setTheoryLevel(detail.getLevel());
@@ -46,12 +67,22 @@ public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, C
                     break;
                 case 3:
                     childrenDayDegreeInfo.setVip1v1Price(detail.getPrice());
+                    if(detail.getPrice().compareTo(BigDecimal.ZERO)>0&&!courseDetail.containsKey(ActivityCourseType.VIP1.getCode())){
+                        courseDetail.put(ActivityCourseType.VIP1.getCode(), 1);
+                    }
                     break;
                 case 4:
                     childrenDayDegreeInfo.setVip1v2Price(detail.getPrice());
+                    if(detail.getPrice().compareTo(BigDecimal.ZERO)>0&&!courseDetail.containsKey(ActivityCourseType.VIP2.getCode())){
+                        courseDetail.put(ActivityCourseType.VIP2.getCode(), 1);
+                    }
                     break;
                 case 5:
                     childrenDayDegreeInfo.setTheoryCoursePrice(detail.getPrice());
+                    if(detail.getPrice().compareTo(BigDecimal.ZERO)>0&&!courseDetail.containsKey(ActivityCourseType.MUSIC_THEORY.getCode())){
+                        courseDetail.put(ActivityCourseType.MUSIC_THEORY.getCode(), 1);
+                        courseDetail.put("music_theory_price", detail.getPrice());
+                    }
                     break;
                 default:
                     break;
@@ -65,6 +96,10 @@ public class ChildrenDayDegreeInfoServiceImpl extends BaseServiceImpl<Integer, C
         if (childrenDayDegreeInfoDao.insert(childrenDayDegreeInfo) <= 0) {
             throw new BizException("汇总信息插入失败");
         }
+        if(Objects.nonNull(student)){
+            student.setActivityCourseDetail(courseDetail.toJSONString());
+            studentDao.update(student);
+        }
         return childrenDayDegreeInfo;
     }
 

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

@@ -468,7 +468,7 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
         }
 
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
-        String pushUrl = baseApiUrl + "/#/childrenPayment";
+        String pushUrl = baseApiUrl + "/#/childrenPayment?dHlwZT0x";
 
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.CHILDREN_DAY_NOTICE_PUSH,
                 userMap, null, 0, "5?" + pushUrl, "STUDENT");

+ 56 - 37
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -18,6 +18,7 @@ import java.util.stream.Stream;
 
 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.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
@@ -42,36 +43,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
-import com.ym.mec.biz.dal.entity.CourseGenerateDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleAuditDetailDto;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
-import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
-import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
-import com.ym.mec.biz.dal.entity.CourseScheduleReview;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.entity.CoursesGroup;
-import com.ym.mec.biz.dal.entity.CoursesGroupModifyLog;
-import com.ym.mec.biz.dal.entity.Group;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.PracticeGroup;
-import com.ym.mec.biz.dal.entity.School;
-import com.ym.mec.biz.dal.entity.StudentAttendance;
-import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
-import com.ym.mec.biz.dal.entity.Subject;
-import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultPracticeGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary;
-import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
@@ -180,6 +152,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private StudentServeService studentServeService;
     @Autowired
 	private EmployeeDao employeeDao;
+    @Autowired
+	private VipGroupActivityDao vipGroupActivityDao;
 
     private final Logger LOGGER = LoggerFactory
             .getLogger(this.getClass());
@@ -2652,6 +2626,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Date coursesExpireDate = null;
         Date coursesStartDate = null;
         GroupType groupType = vipGroupCourseAdjustInfo.getGroupType();
+
+		VipGroup vipGroup=null;
+		VipGroupActivity vipGroupActivity = null;
+
+		if(groupType == VIP) {
+			vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
+			if(Objects.isNull(vipGroup)){
+				throw new BizException("课程组信息不存在");
+			}
+			vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
+		}
+
         switch (vipGroupCourseAdjustInfo.getGroupType()){
             case PRACTICE:
                 PracticeGroup practiceGroup = practiceGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
@@ -2664,7 +2650,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 coursesStartDate = practiceGroup.getCoursesStartDate();
                 break;
             default:
-                VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
                 if (Objects.isNull(vipGroup)) {
                     throw new BizException("指定课程不存在");
                 }
@@ -2764,10 +2749,19 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     courseSchedules.get(courseStartDates.size() - 1).setStartClassTime(courseStartTime);
                     courseSchedules.get(courseStartDates.size() - 1).setEndClassTime(courseEndTime);
                     if (Objects.nonNull(vipGroupCourseAdjustInfo.getTeachMode())) {
-                        if(courseSchedules.get(courseStartDates.size() - 1).getTeachMode().equals(TeachModeEnum.ONLINE)
-                            &&vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)){
-                            throw new BizException("VIP课不支持从线上调整到线下");
+                    	boolean onlineToOffline = courseSchedules.get(courseStartDates.size() - 1).getTeachMode().equals(TeachModeEnum.ONLINE)
+								&&vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE);
+						boolean offlineToOnline = courseSchedules.get(courseStartDates.size() - 1).getTeachMode().equals(TeachModeEnum.OFFLINE)
+								&&vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.ONLINE);
+                        if(onlineToOffline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==0||vipGroupActivity.getAllowOnlineToOffline()==3)){
+                            throw new BizException("此VIP课活动不支持线上课调整为线下课");
                         }
+						if(offlineToOnline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==2||vipGroupActivity.getAllowOnlineToOffline()==3)){
+							throw new BizException("此VIP课活动不支持线下课调整为线上课");
+						}
+						if(onlineToOffline&&Objects.isNull(vipGroupCourseAdjustInfo.getSchoolId())){
+							throw new BizException("请选择教学点");
+						}
                         courseSchedules.get(courseStartDates.size() - 1).setTeachMode(vipGroupCourseAdjustInfo.getTeachMode());
                         if (vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)) {
                             if(Objects.nonNull(vipGroupCourseAdjustInfo.getSchoolId())){
@@ -2809,8 +2803,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             }
         }
 		if(groupType == VIP){
-			VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
-
 			CourseSchedule courseSchedule = courseSchedules.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
 //
 //			BigDecimal teacherSalary=BigDecimal.ZERO;
@@ -2953,6 +2945,23 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			if(!CourseStatusEnum.NOT_START.equals(oldCourses.get(i).getStatus())){
 				throw new BizException("选择的课程中存在进行中或已结束的课程,无法进行调整");
 			}
+
+			if(VIP.equals(oldCourses.get(i).getGroupType())){
+				VipGroup vipGroup = vipGroupDao.get(Long.valueOf(oldCourses.get(i).getMusicGroupId()));
+				if(Objects.isNull(vipGroup)){
+					throw new BizException("课程组信息不存在");
+				}
+				VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
+				boolean onlineToOffline = TeachModeEnum.ONLINE.equals(oldCourses.get(i).getTeachMode())&&TeachModeEnum.OFFLINE.equals(courseAdjustInfo.getTeachMode());
+				boolean offlineToOnline = TeachModeEnum.OFFLINE.equals(oldCourses.get(i).getTeachMode())&&TeachModeEnum.ONLINE.equals(courseAdjustInfo.getTeachMode());
+				if(onlineToOffline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==0||vipGroupActivity.getAllowOnlineToOffline()==3)){
+					throw new BizException("此VIP课活动不支持线上课调整为线下课");
+				}
+				if(offlineToOnline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==2||vipGroupActivity.getAllowOnlineToOffline()==3)){
+					throw new BizException("此VIP课活动不支持线下课调整为线上课");
+				}
+			}
+
 			//上课日期变更
 			if(betweenDays!=0){
 				LocalDate classDate = LocalDateTime.ofInstant(oldCourses.get(i).getClassDate().toInstant(), DateUtil.zoneId).toLocalDate();
@@ -3380,8 +3389,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
 
 			if (VIP.equals(newCourseSchedule.getGroupType())){
-				if(TeachModeEnum.OFFLINE.equals(newCourseSchedule.getTeachMode())&&TeachModeEnum.ONLINE.equals(oldCourseSchedule.getTeachMode())){
-					throw new BizException("VIP课不支持从线上调整到线下");
+				VipGroup vipGroup = vipGroupDao.get(Long.valueOf(oldCourseSchedule.getMusicGroupId()));
+				if(Objects.isNull(vipGroup)){
+					throw new BizException("课程组信息不存在");
+				}
+				VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
+				boolean onlineToOffline = TeachModeEnum.OFFLINE.equals(newCourseSchedule.getTeachMode())&&TeachModeEnum.ONLINE.equals(oldCourseSchedule.getTeachMode());
+				if(onlineToOffline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==0||vipGroupActivity.getAllowOnlineToOffline()==3)){
+					throw new BizException("此VIP课活动不支持线上课调整为线下课");
+				}
+				boolean offlineToOnline = TeachModeEnum.ONLINE.equals(newCourseSchedule.getTeachMode())&&TeachModeEnum.OFFLINE.equals(oldCourseSchedule.getTeachMode());
+				if(offlineToOnline&&Objects.nonNull(vipGroupActivity)&&(vipGroupActivity.getAllowOnlineToOffline()==2||vipGroupActivity.getAllowOnlineToOffline()==3)){
+					throw new BizException("此VIP课活动不支持线下课调整为线上课");
 				}
 			}
 

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

@@ -109,13 +109,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                                                      List<CourseSchedule> vipCourseSchedules,
                                                      BigDecimal onlineTeacherSalary,
                                                      BigDecimal offlineTeacherSalary) {
-
-        School school = schoolService.get(vipGroup.getTeacherSchoolId());
-        BigDecimal subsidy = new BigDecimal(0);
-        if (Objects.nonNull(school)) {
-            subsidy=school.getSubsidy();
-        }
-
         //获取活动信息
         VipGroupActivity vipGroupActivity = null;
         if(vipGroup.getVipGroupActivityId() != null){

+ 0 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -956,12 +956,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		resultMap.put("studentInfo",flag2);
 		boolean flag3 = false;
-		if(!flag3){
-			int teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr,startTime);
-			if(teacherLeave > 0){
-				flag3 = true;
-			}
-		}
 
 		Integer userId = null;
 		if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {

+ 14 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupOrganizationCourseSettingsServiceImpl.java

@@ -34,8 +34,8 @@ public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseService
         }
 
 		for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
-			if (detail.getCourseTotalMinuties() <= 0) {
-				throw new BizException(detail.getCourseType().getMsg() + "课程总时长必须大于0");
+			if (detail.getCourseTotalMinuties() < 0) {
+				throw new BizException(detail.getCourseType().getMsg() + "课程总时长不能为负数");
 			}
 			setting.setTotalCurrentPrice(setting.getTotalCurrentPrice().add(detail.getCourseCurrentPrice()));
 			setting.setTotalOriginalPrice(setting.getTotalOriginalPrice().add(detail.getCourseOriginalPrice()));
@@ -43,7 +43,11 @@ public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseService
         musicGroupOrganizationCourseSettingsDao.insert(setting);
         for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
             detail.setMusicGroupOrganizationCourseSettingsId(setting.getId());
-            detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 8, BigDecimal.ROUND_HALF_UP));
+            if(detail.getCourseTotalMinuties() > 0){
+            	detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 8, BigDecimal.ROUND_HALF_UP));
+            } else {
+            	detail.setUnitPrice(BigDecimal.ZERO);
+            }
         }
         musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
         return setting;
@@ -69,8 +73,8 @@ public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseService
         musicGroupOrganizationCourseSettingsDetailDao.deleteBySettingId(setting.getId());
 
 		for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
-			if (detail.getCourseTotalMinuties() <= 0) {
-				throw new BizException(detail.getCourseType().getMsg() + "课程总时长必须大于0");
+			if (detail.getCourseTotalMinuties() < 0) {
+				throw new BizException(detail.getCourseType().getMsg() + "课程总时长不能为负数");
 			}
 			setting.setTotalCurrentPrice(setting.getTotalCurrentPrice().add(detail.getCourseCurrentPrice()));
 			setting.setTotalOriginalPrice(setting.getTotalOriginalPrice().add(detail.getCourseOriginalPrice()));
@@ -79,7 +83,11 @@ public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseService
         for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
             detail.setId(null);
             detail.setMusicGroupOrganizationCourseSettingsId(setting.getId());
-            detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 8, BigDecimal.ROUND_HALF_UP));
+            if(detail.getCourseTotalMinuties() > 0){
+            	detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 8, BigDecimal.ROUND_HALF_UP));
+            } else {
+            	detail.setUnitPrice(BigDecimal.ZERO);
+            }
         }
         musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
         return setting;

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

@@ -1122,7 +1122,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
 				//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
 				if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
-					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+					if(musicGroupPaymentCalender.getPaymentAmount().doubleValue() > 0){
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+					}else{
+						musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.PAID);
+					}
 				}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
 				}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {

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

@@ -15,6 +15,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.*;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -743,6 +744,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationService.update(studentRegistration);
 
         if ("205".equals(studentPaymentOrder.getPaymentAccountNo())) {
+            Integer teacherId = musicGroup.getEducationalTeacherId();
+            SysUser endTeacher = sysUserFeignService.queryUserById(teacherId);
+            Map<Integer, String> userPhoneMap = new HashMap<>();
+            userPhoneMap.put(endTeacher.getId(), endTeacher.getPhone());
+            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.NO_BUY_CLOUD_TEACHER_MSG,
+                    userPhoneMap, null, 0, null, null, musicGroup.getName(), studentRegistration.getName());
+
             Map<String, String> notifyMap = new HashMap<>();
             notifyMap.put("hasPaidZero", "205");
             notifyMap.put("orderNo", studentPaymentOrder.getOrderNo());
@@ -799,7 +807,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         StudentPaymentOrder ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.ING);
         if (ApplyOrder == null) {
-            throw new BizException("没有支付中的订单,请勿非法请求");
+            throw new BizException("没有支付中订单,请在我的订单中查看订单状态");
         }
         //手动关闭订单
         ApplyOrder.setStatus(DealStatusEnum.FAILED);
@@ -924,6 +932,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationService.update(studentRegistration);
 
         if ("205".equals(studentPaymentOrder.getPaymentAccountNo())) {
+            Integer teacherId = musicGroup.getEducationalTeacherId();
+            SysUser endTeacher = sysUserFeignService.queryUserById(teacherId);
+            Map<Integer, String> userPhoneMap = new HashMap<>();
+            userPhoneMap.put(endTeacher.getId(), endTeacher.getPhone());
+            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.NO_BUY_CLOUD_TEACHER_MSG,
+                    userPhoneMap, null, 0, null, null, musicGroup.getName(), studentRegistration.getName());
+
+
             Map<String, String> notifyMap = new HashMap<>();
             notifyMap.put("hasPaidZero", "205");
             notifyMap.put("orderNo", studentPaymentOrder.getOrderNo());
@@ -2668,7 +2684,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             updateTeamTeacher(group, musicGroup);
         }
         //修改了维修技师
-        if(musicGroup.getRepairUserId() != null && !musicGroup.getRepairUserId().equals(group.getRepairUserId())){
+        if (musicGroup.getRepairUserId() != null && !musicGroup.getRepairUserId().equals(group.getRepairUserId())) {
             refresh = true;
         }
         //不是导入的乐团

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

@@ -196,7 +196,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         List<String> orderNoList = new ArrayList<String>();
 
         for (StudentPaymentOrder payingOrder : payingOrders) {
-            if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo()) && DateUtil.isSameDay(payingOrder.getCreateTime(), new Date())) {
+            //if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo()) && DateUtil.isSameDay(payingOrder.getCreateTime(), new Date())) {
+            if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo())) {
                 continue;
             }
             if (payingOrder.getTransNo() == null) {

+ 79 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -6,16 +6,7 @@ import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-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 javax.annotation.Resource;
 
@@ -24,6 +15,7 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
+import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -516,7 +508,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS) && !buyCloudTeacherPlus)
         ) {
             paidZeroFlag = true;
-            if (paidZeroNum <= 0) {
+            if (studentRegistration.getNoneNeedCloudTeacher().equals(1)) {
                 musicOneSubjectClassPlan.setPaidZeroNum(paidZeroNum + 1);
                 musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
                 firstPaidZeroFlag = true;
@@ -533,7 +525,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         if (paidZeroFlag) {
             studentPaymentOrder.setVersion(0);
-            String code = firstPaidZeroFlag ? "200" : "205";
+            String code = studentRegistration.getNoneNeedCloudTeacher().equals(1) ? "200" : "205";
             studentPaymentOrder.setPaymentAccountNo(code);
             studentPaymentOrderService.update(studentPaymentOrder);
         }
@@ -1831,4 +1823,79 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public List<Map<String, Integer>> countNormalNum(List<String> musicGroupIds) {
         return studentRegistrationDao.countNormalNum(StringUtils.join(musicGroupIds, ","));
     }
+
+    @Override
+    public PageInfoReg<RegisterDto> getRegisterOrPreList(RegistrationOrPreQueryInfo queryInfo) {
+        PageInfoReg<RegisterDto> pageInfo = new PageInfoReg<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<RegisterDto> dataList = new ArrayList<>();
+        int count = studentRegistrationDao.getRegisterOrPreCount(params);
+        if (queryInfo.getIsExport() && count > 50000) {
+            throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
+        }
+        int registerNum = studentRegistrationDao.getRegisterNum(queryInfo.getMusicGroupId());
+        pageInfo.setRegNum(registerNum);
+        RegisterDto registerOrPreMinTime = studentRegistrationDao.getRegisterOrPreMinTime(queryInfo.getMusicGroupId());
+        if(registerOrPreMinTime.getMinPayTime() != null){
+            Date startTime = DateUtil.trunc(registerOrPreMinTime.getMinPayTime());
+            Date endTime = DateUtil.getLastTimeWithDay(startTime);
+            int firstPayNum = studentRegistrationDao.getFirstPayNum(queryInfo.getMusicGroupId(), startTime, endTime);
+            int totalPayNum = studentRegistrationDao.getFirstPayNum(queryInfo.getMusicGroupId(), startTime,null);
+            pageInfo.setFirstDayPayNum(firstPayNum);
+            pageInfo.setPayNum(totalPayNum);
+            pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum),2,BigDecimal.ROUND_HALF_UP));
+        }
+
+        pageInfo.setTotal(count);
+        params.put("offset", pageInfo.getOffset());
+        if (queryInfo.getPage() <= pageInfo.getTotalPage()) {
+            Date firstPreTime = registerOrPreMinTime.getMinPerRegisterTime();
+            Date firstPayTime = registerOrPreMinTime.getMinPayTime();
+            dataList = studentRegistrationDao.getRegisterOrPreList(params);
+            for (RegisterDto registerDto : dataList) {
+                if (DateUtil.dateToString(registerDto.getPerRegisterTime()).equals("2099-12-31") ||
+                        DateUtil.dateToString(registerDto.getPerRegisterTime()).equals("1990-12-31")
+                ) {
+                    registerDto.setPerRegisterTime(null);
+                }
+
+                if (DateUtil.dateToString(registerDto.getPayTime()).equals("2099-12-31") ||
+                        DateUtil.dateToString(registerDto.getPayTime()).equals("1990-12-31")
+                ) {
+                    registerDto.setPayTime(null);
+                }
+                if (registerDto.getPerRegisterTime() != null) {
+                    int perRegInterval = DateUtil.secondsBetween(firstPreTime, registerDto.getPerRegisterTime());
+                    registerDto.setPerRegInterval(perRegInterval);
+                    registerDto.setPerRegIntervalStr(DateUtil.secondsFormat(perRegInterval));
+                }
+
+                if (registerDto.getPayTime() != null) {
+                    int payTimeInterval = DateUtil.secondsBetween(firstPayTime, registerDto.getPayTime());
+                    registerDto.setPayInterval(payTimeInterval);
+                    registerDto.setPayIntervalStr(DateUtil.secondsFormat(payTimeInterval));
+                }
+            }
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
+
+    @Override
+    public Boolean setNoneCloudTeacher(Long id) {
+        StudentRegistration studentRegistration = studentRegistrationDao.get(id);
+        if (!studentRegistration.getPayingStatus().equals(2)) {
+            throw new BizException("该学生不在预约中");
+        }
+        if (studentRegistration.getNoneNeedCloudTeacher().equals(1)) {
+            throw new BizException("该学生已设置");
+        }
+        studentRegistration.setNoneNeedCloudTeacher(1);
+        if (studentRegistrationDao.update(studentRegistration) <= 0) {
+            throw new BizException("设置失败,请重试");
+        }
+        return true;
+    }
 }

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

@@ -221,7 +221,7 @@ public class TenantPaymentOrderServiceImpl extends BaseServiceImpl<Long, TenantP
         return true;
     }
 
-    private Boolean confirmOrder(TenantPaymentOrder order) {
+    public Boolean confirmOrder(TenantPaymentOrder order) {
         List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
         for (StudentPaymentRouteOrder routeOrder : routeOrders) {
             Map<String, Object> divMember = new HashMap<>();
@@ -423,4 +423,4 @@ public class TenantPaymentOrderServiceImpl extends BaseServiceImpl<Long, TenantP
         pageInfo.setRows(dataList);
         return pageInfo;
     }
-}
+}

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

@@ -26,6 +26,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.util.date.DateConvertor;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.string.MessageFormatter;
 
@@ -43,18 +44,23 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.util.CollectionUtils;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.MessageFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
+import static com.ym.mec.biz.dal.enums.GroupType.VIP;
+
 @Service
 public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> implements VipGroupService {
 
@@ -157,6 +163,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
 	@Autowired
 	private VipGroupStudentCoursePriceDao vipGroupStudentCoursePriceDao;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(VipGroup.class);
@@ -471,6 +479,592 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public HttpResponseResult createActivityVipGroup(VipGroupApplyDto vipGroup) {
+		if (Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getUserId())){
+			throw new BizException("请选择指导老师");
+		}
+
+		if(vipGroup.getCourseSchedules().size()!=(vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()+vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum())){
+			throw new BizException("建课失败,当前课程存在未排课课程,请调整相关设置");
+		}
+
+		Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroup;
+		try {
+			courseScheduleGroup = vipGroup.getCourseSchedules().stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
+		} catch (Exception e) {
+			throw new BizException("教学模式错误");
+		}
+
+		if(StringUtils.isBlank(vipGroup.getVipGroupApplyBaseInfo().getSubjectIdList())){
+			throw new BizException("请选择声部");
+		}
+
+		if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+			List<VipGroupCategory> vipGroupCategories = vipGroupCategoryDao.findAllByOrgan(vipGroup.getVipGroupApplyBaseInfo().getOrganId().toString());
+			VipGroupCategory vipGroupCategory = vipGroupCategories.stream().filter(v -> v.getName().equals("1v2")).findFirst().get();
+			vipGroup.getVipGroupApplyBaseInfo().setVipGroupCategoryId(vipGroupCategory.getId());
+		}
+
+		if((Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()!=0)
+				||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&(courseScheduleGroup.get(TeachModeEnum.OFFLINE).size()<vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()))){
+			throw new BizException("线下课课时数量安排有误");
+		}
+
+		if((Objects.isNull(courseScheduleGroup.get(TeachModeEnum.ONLINE))&&vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum()!=0)
+				||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.ONLINE))&&(courseScheduleGroup.get(TeachModeEnum.ONLINE).size()<vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum()))){
+			throw new BizException("线上课课时数量安排有误");
+		}
+
+		if(vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()>0
+				&&Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getTeacherSchoolId())){
+			throw new BizException("请设置教学点");
+		}
+
+		String studentIds=vipGroup.getVipGroupApplyBaseInfo().getStudentIdList();
+		if(StringUtils.isBlank(studentIds)){
+			throw new BizException("请选择学员");
+		}
+		List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
+
+		List<Student> studentDetail = studentDao.lockStudents(studentIdList);
+		List<SimpleUserDto> studentSimpleInfos = teacherDao.getUsersSimpleInfo(studentIdList);
+		if(studentDetail.size()!=studentSimpleInfos.size()){
+			throw new BizException("学员信息错误");
+		}
+		Map<Integer, SimpleUserDto> idUserInfoMap = studentSimpleInfos.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, s -> s, (s1, s2) -> s1));
+		Map<Integer, BigDecimal> studentTheoryPriceMap = new HashMap<>();
+		for (Student student : studentDetail) {
+			if(StringUtils.isEmpty(student.getActivityCourseDetail())){
+				SimpleUserDto studentInfo = idUserInfoMap.get(student.getUserId());
+				throw new BizException("{}暂无排课资格", studentInfo.getNickName());
+			}
+			JSONObject courseDetail = JSON.parseObject(student.getActivityCourseDetail());
+			Integer surplusTimes = courseDetail.getInteger(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType().getCode());
+			if(surplusTimes<=0){
+				SimpleUserDto studentInfo = idUserInfoMap.get(student.getUserId());
+				throw new BizException("{}暂无排课资格", studentInfo.getNickName());
+			}
+			courseDetail.fluentPut(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType().getCode(), surplusTimes-1);
+			student.setActivityCourseDetail(courseDetail.toJSONString());
+			if(ActivityCourseType.MUSIC_THEORY.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+				studentTheoryPriceMap.put(student.getUserId(), courseDetail.getBigDecimal("music_theory_price"));
+			}
+		}
+		studentDao.batchUpdate(studentDetail);
+
+		Date now=new Date();
+
+		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
+
+		if(Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
+				&&Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())){
+			throw new BizException("请设置课程单价");
+		}
+
+		if(StringUtils.isBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
+			throw new BizException("请选择学员");
+		}
+
+		Integer totalClassTimes=vipGroupApplyBaseInfoDto.getOnlineClassesNum()+vipGroupApplyBaseInfoDto.getOfflineClassesNum();
+		//获取第一节课
+		CourseSchedule firstCourseSchedule = vipGroup.getCourseSchedules().stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get();
+		//获取最后一节课
+		CourseSchedule latestCourseSchedule = vipGroup.getCourseSchedules().stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
+
+		if(firstCourseSchedule.getStartClassTime().before(now)){
+			throw new BizException("开课时间不能小于当前时间");
+		}
+
+		vipGroupApplyBaseInfoDto.setRegistrationStartTime(now);
+		vipGroupApplyBaseInfoDto.setPaymentExpireDate(now);
+
+		if(vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())){
+			throw new BizException("报名开始时间必须在报名截至时间之前");
+		}
+
+		List<Integer> canBuyStudentIds = Arrays.stream(vipGroupApplyBaseInfoDto.getStudentIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		List<VipGroupStudentCoursePrice> vscps = vipGroup.getVipGroupApplyBaseInfo().getVipGroupStudentCoursePrices();
+
+		//获取活动信息
+		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId());
+//		if(!vipGroup.getAllowOverstepActivityStudentNum()&&Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes())&&vipGroupActivity.getStudentMaxUsedTimes()!=-1&&StringUtils.isNotBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
+//			List<String> tempStudentIds = Arrays.asList(vipGroupApplyBaseInfoDto.getStudentIdList().split(","));
+//			List<Integer> errStudentIds = new ArrayList<>();
+//			for (String studentIdStr : tempStudentIds) {
+//				int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId(), Integer.valueOf(studentIdStr));
+//				if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
+//					errStudentIds.add(Integer.valueOf(studentIdStr));
+//				}
+//			}
+//			if(errStudentIds.size()>0){
+//				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+//				String studentNames = StringUtils.join(studentSimpleInfos.stream().map(SimpleUserDto::getNickName).collect(Collectors.toList()), "、");
+//				return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"该活动"+studentNames+"学员创建及成课之和已达上限,是否继续创建该课程?");
+//			}
+//		}
+		//判断课程安排是否超出范围
+		if(Objects.nonNull(vipGroupActivity)&&(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime()))){
+			if(latestCourseSchedule.getEndClassTime().after(vipGroupActivity.getCoursesEndTime())
+					||firstCourseSchedule.getStartClassTime().before(vipGroupActivity.getCoursesStartTime())){
+				throw new BizException("课时安排时间超出范围!");
+			}
+		}else{
+			VipGroupDefaultClassesCycle vipGroupDefaultClassesCycle = vipGroupDefaultClassesCycleDao.findByOrganAndClassTimes(totalClassTimes);
+
+			if (vipGroupDefaultClassesCycle != null) {
+				int month = DateUtil.monthsBetween(firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
+				if (month > vipGroupDefaultClassesCycle.getMonth()) {
+					throw new BizException("课时安排时间超出范围!");
+				}
+			}
+		}
+
+		if(Objects.nonNull(vipGroupActivity)&&Objects.nonNull(vipGroupActivity.getMinCourseNum())&&vipGroupActivity.getMinCourseNum()!=-1&&Objects.nonNull(vipGroupActivity.getMaxCourseNum())&&vipGroupActivity.getMaxCourseNum()!=-1){
+			Integer requestCourseNum = vipGroupApplyBaseInfoDto.getOnlineClassesNum() + vipGroupApplyBaseInfoDto.getOfflineClassesNum();
+			if(requestCourseNum.compareTo(vipGroupActivity.getMinCourseNum())<0||requestCourseNum.compareTo(vipGroupActivity.getMaxCourseNum())>0){
+				throw new BizException("该活动课时数为{}节~{}节", vipGroupActivity.getMinCourseNum(), vipGroupActivity.getMaxCourseNum());
+			}
+		}
+
+		int repeatVipGroups = vipGroupDao.countUserRepeatVipGroupInCourseStartEndTime(vipGroupApplyBaseInfoDto.getUserId(), firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
+		if(repeatVipGroups>0){
+			SysUser sysUser = sysUserFeignService.queryUserById(vipGroupApplyBaseInfoDto.getUserId());
+			throw new BizException("{}课程时间冲突({}-{})", sysUser.getRealName(), DateUtil.dateToString(firstCourseSchedule.getStartClassTime(), "yyyy-MM-dd HH:mm:ss"), DateUtil.dateToString(latestCourseSchedule.getEndClassTime(), "HH:mm:ss"));
+		}
+
+		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroupApplyBaseInfoDto.getVipGroupCategoryId());
+		if(Objects.isNull(vipGroupCategory)){
+			throw new BizException("课程形式不存在");
+		}
+		List<String> studentNames = studentDao.getStudentNames(canBuyStudentIds);
+
+		//生成vip课信息
+		List<String> bySubIds = subjectDao.findBySubIds(vipGroupApplyBaseInfoDto.getSubjectIdList());
+		StringBuffer className=new StringBuffer();
+		if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+			className.append("考前辅导课•");
+		}else if(Objects.isNull(vipGroupCategory.getMusicTheory())||!vipGroupCategory.getMusicTheory()){
+			className.append(StringUtils.join(bySubIds,","));
+			className.append(vipGroupCategory.getName());
+		}else{
+			className.append("乐理课•");
+		}
+		className.append(StringUtils.join(studentNames, ","));
+		vipGroupApplyBaseInfoDto.setName(className.toString());
+
+
+		if(!ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+			//计算课程相关费用信息
+			Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
+					vipGroupApplyBaseInfoDto.getUserId(), null);
+			vipGroupApplyBaseInfoDto.setOnlineTeacherSalary(costInfo.get("onlineTeacherSalary"));
+			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(costInfo.get("offlineTeacherSalary"));
+			vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
+		}else{
+			vipGroupApplyBaseInfoDto.setOnlineTeacherSalary(BigDecimal.ZERO);
+			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(BigDecimal.ZERO);
+			vipGroupApplyBaseInfoDto.setTotalPrice(BigDecimal.ZERO);
+		}
+
+		vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
+		vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.PROGRESS);
+
+		if(CollectionUtils.isEmpty(vscps)){
+			vscps = new ArrayList<>();
+			for (Integer canBuyStudentId : canBuyStudentIds) {
+				vscps.add(new VipGroupStudentCoursePrice(canBuyStudentId, vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getTotalPrice()));
+			}
+		}
+		Teacher teacher = teacherService.get(vipGroupApplyBaseInfoDto.getUserId());
+		if(Objects.isNull(teacher)){
+			throw new BizException("教师不存在");
+		}
+
+		//开课时间为排课的第一节课的开始时间
+		vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
+		//课程结束时间为排课的最后一节课的结束时间
+		vipGroupApplyBaseInfoDto.setCoursesExpireDate(latestCourseSchedule.getEndClassTime());
+
+		vipGroupApplyBaseInfoDto.setPaymentExpireDate(DateUtil.getLastSecondWithDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate()));
+
+		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
+
+		vscps.forEach(e->e.setVipGroupId(vipGroupApplyBaseInfoDto.getId()));
+		vipGroupStudentCoursePriceDao.batchInsert(vscps);
+
+		vipGroup.getVipGroupApplyBaseInfo().setId(vipGroupApplyBaseInfoDto.getId());
+
+		//创建班级信息
+		ClassGroup classGroup=new ClassGroup();
+		classGroup.setSubjectIdList(vipGroupApplyBaseInfoDto.getSubjectIdList());
+		classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
+		classGroup.setStudentNum(studentIdList.size());
+		classGroup.setName(vipGroupApplyBaseInfoDto.getName());
+		classGroup.setTotalClassTimes(totalClassTimes);
+		classGroup.setType(ClassGroupTypeEnum.VIP);
+		classGroup.setDelFlag(0);
+		classGroup.setGroupType(GroupType.VIP);
+		classGroup.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
+		classGroup.setCreateTime(now);
+		classGroup.setUpdateTime(now);
+		classGroupDao.insert(classGroup);
+
+		//创建班级老师关联记录
+		ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
+		classGroupTeacherMapper.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
+		classGroupTeacherMapper.setClassGroupId(classGroup.getId());
+		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
+		classGroupTeacherMapper.setUserId(vipGroupApplyBaseInfoDto.getUserId());
+		classGroupTeacherMapper.setGroupType(GroupType.VIP);
+		classGroupTeacherMapper.setCreateTime(now);
+		classGroupTeacherMapper.setUpdateTime(now);
+		classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
+
+		//创建班级与老师课酬记录
+		ClassGroupTeacherSalary classGroupTeacherSalary=new ClassGroupTeacherSalary();
+		classGroupTeacherSalary.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
+		classGroupTeacherSalary.setClassGroupId(classGroup.getId());
+		classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
+		classGroupTeacherSalary.setUserId(vipGroupApplyBaseInfoDto.getUserId());
+		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary());
+		classGroupTeacherSalary.setOnlineClassesSalary(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary());
+		classGroupTeacherSalary.setGroupType(GroupType.VIP);
+		classGroupTeacherSalary.setCreateTime(now);
+		classGroupTeacherSalary.setUpdateTime(now);
+		classGroupTeacherSalaryDao.insert(classGroupTeacherSalary);
+
+		//班级学员关联记录
+		List<ClassGroupStudentMapper> classGroupStudentMapperList = new ArrayList<>();
+		for (Integer studentId : studentIdList) {
+			ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+			classGroupStudentMapper.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
+			classGroupStudentMapper.setClassGroupId(classGroup.getId());
+			classGroupStudentMapper.setUserId(studentId);
+			classGroupStudentMapper.setCreateTime(now);
+			classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+			classGroupStudentMapper.setGroupType(GroupType.VIP);
+			classGroupStudentMapperList.add(classGroupStudentMapper);
+		}
+		classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMapperList);
+
+		//课程信息调整
+		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
+			courseSchedule.setGroupType(GroupType.VIP);
+			courseSchedule.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
+			if(courseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
+				courseSchedule.setSchoolId(vipGroup.getVipGroupApplyBaseInfo().getTeacherSchoolId());
+			}
+			courseSchedule.setTeacherId(vipGroupApplyBaseInfoDto.getUserId());
+			courseSchedule.setActualTeacherId(vipGroupApplyBaseInfoDto.getUserId());
+			courseSchedule.setStatus(CourseStatusEnum.NOT_START);
+			courseSchedule.setType(CourseSchedule.CourseScheduleType.VIP);
+			courseSchedule.setClassGroupId(classGroup.getId());
+			courseSchedule.setName(vipGroupApplyBaseInfoDto.getName());
+			courseSchedule.setOrganId(vipGroupApplyBaseInfoDto.getOrganId());
+		});
+
+		vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(vipGroup.getCourseSchedules()));
+		vipGroupDao.update(vipGroupApplyBaseInfoDto);
+
+		//创建课程
+		List<CourseSchedule> courseSchedules = vipGroup.getCourseSchedules();
+		courseScheduleService.batchAddCourseSchedule(courseSchedules);
+		//创建老师单节课课酬信息
+		if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+			List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
+			BigDecimal teacherDefaultSalary = new BigDecimal("16.67");
+			SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
+			if(Objects.nonNull(practiceCourseSalaryConfig)&&StringUtils.isNotBlank(practiceCourseSalaryConfig.getParanValue())){
+				teacherDefaultSalary = new BigDecimal(practiceCourseSalaryConfig.getParanValue());
+			}
+			for (CourseSchedule courseSchedule : courseSchedules) {
+				CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+				courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+				courseScheduleTeacherSalary.setGroupType(GroupType.VIP);
+				courseScheduleTeacherSalary.setMusicGroupId(classGroup.getMusicGroupId());
+				courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+				courseScheduleTeacherSalary.setUserId(vipGroupApplyBaseInfoDto.getTeacherId().intValue());
+				courseScheduleTeacherSalary.setExpectSalary(teacherDefaultSalary);
+				courseScheduleTeacherSalary.setCreateTime(now);
+				courseScheduleTeacherSalary.setUpdateTime(now);
+				courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+				courseScheduleTeacherSalary.setEnableChangeSalary(false);
+				courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
+			}
+			List<TeacherAttendance> teacherAttendances = new ArrayList<>();
+			for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
+				TeacherAttendance teacherAttendance = new TeacherAttendance();
+				teacherAttendance.setGroupType(courseScheduleTeacherSalary.getGroupType());
+				teacherAttendance.setClassGroupId(courseScheduleTeacherSalary.getClassGroupId());
+				teacherAttendance.setMusicGroupId(courseScheduleTeacherSalary.getMusicGroupId());
+				teacherAttendance.setTeacherId(courseScheduleTeacherSalary.getUserId());
+				teacherAttendance.setCourseScheduleId(courseScheduleTeacherSalary.getCourseScheduleId());
+				teacherAttendances.add(teacherAttendance);
+			}
+			courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
+			if (!CollectionUtils.isEmpty(teacherAttendances)) {
+				teacherAttendanceDao.batchInsert(teacherAttendances);
+			}
+		}else{
+			courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroupApplyBaseInfoDto,
+					courseSchedules,
+					classGroupTeacherSalary.getOnlineClassesSalary(),
+					classGroupTeacherSalary.getSalary());
+			courseScheduleTeacherSalaryDao.updateEnableChangeSalaryByClassGroup(classGroup.getId().longValue(), false);
+		}
+
+		SysUser sysUser = sysUserFeignService.queryUserById(vipGroupApplyBaseInfoDto.getUserId());
+
+		List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentMapperDao.findByClassGroup(classGroup.getId());
+
+		Map<Integer,String> userRoleMap = new HashMap<>();
+		if(Objects.nonNull(vipGroupApplyBaseInfoDto.getEducationalTeacherId())){
+			userRoleMap.put(vipGroupApplyBaseInfoDto.getEducationalTeacherId(),"乐团主管");
+		}
+		userRoleMap.put(vipGroupApplyBaseInfoDto.getUserId(),"指导老师");
+		//生成学生单课缴费信息
+		for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
+			if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())
+				||ActivityCourseType.MUSIC_THEORY.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+				List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
+				BigDecimal price = studentTheoryPriceMap.get(classGroupStudent.getUserId());
+				BigDecimal coursePrice = BigDecimal.ZERO;
+				if(Objects.nonNull(price)){
+					coursePrice = price.divide(new BigDecimal(courseSchedules.size()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+				}
+				for (CourseSchedule courseSchedule : courseSchedules) {
+					CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+					courseScheduleStudentPayment.setUserId(classGroupStudent.getUserId());
+					courseScheduleStudentPayment.setGroupType(courseSchedule.getGroupType());
+					courseScheduleStudentPayment.setMusicGroupId(courseSchedule.getMusicGroupId());
+					courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+					courseScheduleStudentPayment.setClassGroupId(courseSchedule.getClassGroupId());
+					if(ActivityCourseType.MUSIC_THEORY.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
+						courseScheduleStudentPayment.setExpectPrice(coursePrice);
+						courseScheduleStudentPayment.setOriginalPrice(coursePrice);
+					}else{
+						courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
+						courseScheduleStudentPayment.setOriginalPrice(BigDecimal.ZERO);
+					}
+					courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
+					courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+				}
+				courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+			}else{
+				courseScheduleStudentPaymentService.createCourseScheduleStudentPaymentForVipGroup(vipGroupApplyBaseInfoDto.getId(),classGroupStudent.getUserId());
+			}
+			userRoleMap.put(classGroupStudent.getUserId(),null);
+			studentDao.updateStudentServiceTag(classGroupStudent.getUserId(), null, YesOrNoEnum.YES.getCode());
+		}
+
+		courseScheduleService.checkNewCourseSchedules(courseSchedules, false,false);
+
+		try {
+			imGroupService.create(classGroup.getId().longValue(), null, classGroup.getName(), classGroup.getName(), vipGroupApplyBaseInfoDto.getName(), null, null, GroupType.VIP.getCode());
+			imGroupMemberService.join(classGroup.getId().longValue(), userRoleMap);
+			imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(),classGroup.getGroupType());
+			//发送推送
+			Map<Integer,String> map = new HashMap<>(1);
+			map.put(vipGroupApplyBaseInfoDto.getUserId(),sysUser.getPhone());
+			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.CHILDREN_DAY_VIP_COURSE_TEACHER_PUSH,
+					map,null,0,"","TEACHER", StringUtils.join(studentNames, ","),vipGroupApplyBaseInfoDto.getName());
+
+			Map<Integer,String> studentIdStrMap = new HashMap<>(1);
+			studentIdList.forEach(id->studentIdStrMap.put(id, id.toString()));
+			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.CHILDREN_DAY_VIP_COURSE_STUDENT_PUSH, studentIdStrMap, null, 0, "","STUDENT",
+					vipGroupApplyBaseInfoDto.getName());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public HttpResponseResult importActivityVipGroup(String data) {
+		if(StringUtils.isBlank(data)){
+			return BaseController.succeed();
+		}
+		List<JSONObject> datas = JSON.parseArray(data, JSONObject.class);
+		Date date = new Date();
+		for (JSONObject courseData : datas) {
+			boolean skipHoliday = "是".equals(courseData.getString("skip_holiday"))?true:false;
+			String vipGroupActivityName = courseData.getString("vip_group_activity");
+			String vipGroupCategoryStr = courseData.getString("vip_group_category");
+			boolean freeCourse = "考前辅导课".equals(vipGroupCategoryStr);
+			int courseMinute = freeCourse?25:45;
+			String vipGroupCategoryName = "1v1".equals(vipGroupCategoryStr)?"1v1":"1v2";
+			Integer schoolId = courseData.getInteger("school_id");
+			int onlineCourseNum = StringUtils.isBlank(courseData.getString("online_course_num"))?0:courseData.getIntValue("online_course_num");
+			int onlineWeekNum = 0;
+			if(onlineCourseNum>0){
+				onlineWeekNum = courseData.getIntValue("online_course_week_num");
+			}
+			String onlineCourseStartTime = courseData.getString("online_course_start_time");
+			int offlineCourseNum = StringUtils.isBlank(courseData.getString("offline_course_num"))?0:courseData.getIntValue("offline_course_num");
+			int offlineWeekNum = 0;
+			if(offlineCourseNum>0){
+				offlineWeekNum = courseData.getIntValue("offline_course_week_num");
+			}
+			String offlineCourseStartTime = courseData.getString("offline_course_start_time");
+			int totalCourseNum = onlineCourseNum + offlineCourseNum;
+			Integer teacherId = courseData.getInteger("teacher_id");
+			Integer eduTeacherId = StringUtils.isBlank(courseData.getString("edu_teacher_id"))?null:courseData.getInteger("edu_teacher_id");
+			String studentIdsStr= courseData.getString("student_ids");
+			if(StringUtils.isBlank(studentIdsStr)){
+				throw new BizException("请选择学员");
+			}
+			List<Integer> studentIds = Arrays.stream(studentIdsStr.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
+			SysUser student = studentDao.getUser(studentIds.get(0));
+			Student stu = studentDao.get(studentIds.get(0));
+			if(Objects.isNull(student)){
+				throw new BizException("学员信息异常");
+			}
+
+			List<VipGroupCategory> vipGroupCategories = vipGroupCategoryDao.findAllByOrgan(student.getOrganId().toString());
+			VipGroupCategory vipGroupCategory = vipGroupCategories.stream().filter(v -> v.getName().equals(vipGroupCategoryName)).findFirst().get();
+
+			List<VipGroupActivity> vipGroupActivities = vipGroupActivityDao.findByName(vipGroupActivityName);
+			VipGroupActivity vipGroupActivity = null;
+			if(!CollectionUtils.isEmpty(vipGroupActivities)){
+				vipGroupActivity = vipGroupActivities.get(0);
+			}
+
+			LocalDate courseStartDay = null;
+			LocalDate onlineCourseStartDay = null;
+			LocalDate offlineCourseStartDay = null;
+
+			if(onlineCourseNum>0){
+				onlineCourseStartDay = LocalDate.parse(courseData.getString("online_course_start_day").replace(" 00:00:00", ""), DateUtil.dateFormatter);
+				courseStartDay = onlineCourseStartDay;
+			}
+
+			if(offlineCourseNum>0){
+				offlineCourseStartDay = LocalDate.parse(courseData.getString("offline_course_start_day").replace(" 00:00:00", ""), DateUtil.dateFormatter);
+				if(Objects.isNull(courseStartDay)||onlineCourseStartDay.compareTo(offlineCourseStartDay)>0){
+					courseStartDay = offlineCourseStartDay;
+				}
+			}
+
+			Set<String> holidayDays = new HashSet<>();
+
+			if (skipHoliday) {
+				SysConfig holidaySetting = sysConfigService.findByParamName(SysConfigService.HOLIDAY_SETTING);
+				if(Objects.nonNull(holidaySetting)&&StringUtils.isNotBlank(holidaySetting.getParanValue())){
+					holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
+				}
+			}
+
+			List<CourseSchedule> courseSchedules = new ArrayList<>();
+			int onlineCourseNumCreated = 0;
+			int offlineCourseNumCreated = 0;
+
+			while (true) {
+				if (skipHoliday && holidayDays.contains(courseStartDay.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))) {
+					courseStartDay = courseStartDay.plusDays(1);
+					continue;
+				}
+				int dayOfWeek = courseStartDay.getDayOfWeek().getValue();//当前星期
+
+				if (onlineCourseNumCreated<onlineCourseNum&&(onlineWeekNum < 1 || onlineWeekNum > 7)) {
+					throw new BizException("排课循环周期错误,请核查");
+				}
+				if(onlineCourseNumCreated<onlineCourseNum&&courseStartDay.compareTo(onlineCourseStartDay)>=0&&dayOfWeek==onlineWeekNum){
+					Date classDate = DateConvertor.toDate(courseStartDay);
+					String startClassTime = DateUtil.getDate(classDate) + " " + onlineCourseStartTime;
+					String endClassTime = DateUtil.dateToString(DateUtil.addMinutes(DateUtil.stringToDate(startClassTime, "yyyy-MM-dd HH:mm:ss"), courseMinute), "yyyy-MM-dd HH:mm:ss");
+
+					CourseSchedule courseSchedule = new CourseSchedule();
+					courseSchedule.setStatus(CourseStatusEnum.NOT_START);
+					courseSchedule.setClassDate(classDate);
+					courseSchedule.setStartClassTime(DateUtil.stringToDate(startClassTime));
+					courseSchedule.setEndClassTime(DateUtil.stringToDate(endClassTime));
+					courseSchedule.setCreateTime(date);
+					courseSchedule.setUpdateTime(date);
+					courseSchedule.setTeachMode(TeachModeEnum.ONLINE);
+					courseSchedule.setType(CourseSchedule.CourseScheduleType.VIP);
+					courseSchedule.setGroupType(VIP);
+					courseSchedule.setOrganId(student.getOrganId());
+					courseSchedule.setTeacherId(teacherId);
+					courseSchedule.setActualTeacherId(teacherId);
+					courseSchedules.add(courseSchedule);
+
+					onlineCourseNumCreated++;
+				}
+
+				if (offlineCourseNumCreated<offlineCourseNum&&(offlineWeekNum < 1 || offlineWeekNum > 7)) {
+					throw new BizException("排课循环周期错误,请核查");
+				}
+				if(offlineCourseNumCreated<offlineCourseNum&&courseStartDay.compareTo(offlineCourseStartDay)>=0&&dayOfWeek==offlineWeekNum){
+					Date classDate = DateConvertor.toDate(courseStartDay);
+					String startClassTime = DateUtil.getDate(classDate) + " " + offlineCourseStartTime;
+					String endClassTime = DateUtil.dateToString(DateUtil.addMinutes(DateUtil.stringToDate(startClassTime, "yyyy-MM-dd HH:mm:ss"), courseMinute), "yyyy-MM-dd HH:mm:ss");
+
+					CourseSchedule courseSchedule = new CourseSchedule();
+					courseSchedule.setStatus(CourseStatusEnum.NOT_START);
+					courseSchedule.setClassDate(classDate);
+					courseSchedule.setStartClassTime(DateUtil.stringToDate(startClassTime));
+					courseSchedule.setEndClassTime(DateUtil.stringToDate(endClassTime));
+					courseSchedule.setCreateTime(date);
+					courseSchedule.setUpdateTime(date);
+					courseSchedule.setSchoolId(schoolId);
+					courseSchedule.setTeachMode(TeachModeEnum.OFFLINE);
+					courseSchedule.setType(CourseSchedule.CourseScheduleType.VIP);
+					courseSchedule.setGroupType(VIP);
+					courseSchedule.setOrganId(student.getOrganId());
+					courseSchedule.setTeacherId(teacherId);
+					courseSchedule.setActualTeacherId(teacherId);
+					courseSchedules.add(courseSchedule);
+
+					offlineCourseNumCreated++;
+				}
+
+				if (courseSchedules.size()>=totalCourseNum) {
+					break;
+				}
+
+				courseStartDay = courseStartDay.plusDays(1);
+			}
+
+			VipGroupApplyDto vipGroupApplyDto = new VipGroupApplyDto();
+			VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto = new VipGroupApplyBaseInfoDto();
+			vipGroupApplyBaseInfoDto.setStudentIdList(studentIdsStr);
+			
+			vipGroupApplyBaseInfoDto.setAllCourseNum(totalCourseNum);
+			vipGroupApplyBaseInfoDto.setTeacherId(teacherId.longValue());
+			vipGroupApplyBaseInfoDto.setEducationalTeacherId(eduTeacherId);
+			vipGroupApplyBaseInfoDto.setSubjectIdList(stu.getSubjectIdList());
+			vipGroupApplyBaseInfoDto.setFirstStudentId(studentIds.get(0));
+			vipGroupApplyBaseInfoDto.setUserId(teacherId);
+			vipGroupApplyBaseInfoDto.setSingleClassMinutes(courseMinute);
+			vipGroupApplyBaseInfoDto.setRegistrationStartTime(date);
+			vipGroupApplyBaseInfoDto.setPaymentExpireDate(date);
+			vipGroupApplyBaseInfoDto.setCourseStartDate(courseSchedules.get(0).getStartClassTime());
+			vipGroupApplyBaseInfoDto.setCoursesExpireDate(courseSchedules.get(courseSchedules.size()-1).getEndClassTime());
+			vipGroupApplyBaseInfoDto.setTeacherSchoolId(schoolId);
+			vipGroupApplyBaseInfoDto.setOnlineClassesNum(onlineCourseNum);
+			vipGroupApplyBaseInfoDto.setOfflineClassesNum(offlineCourseNum);
+			vipGroupApplyBaseInfoDto.setVipGroupCategoryId(vipGroupCategory.getId());
+			if(freeCourse){
+				vipGroupApplyBaseInfoDto.setActivityCourseType(ActivityCourseType.FREE_VIP);
+			}
+			if(Objects.nonNull(vipGroupActivity)){
+				vipGroupApplyBaseInfoDto.setVipGroupActivityId(vipGroupActivity.getId());
+			}
+			vipGroupApplyBaseInfoDto.setOrganId(student.getOrganId());
+			vipGroupApplyBaseInfoDto.setOnlineClassesUnitPrice(vipGroupCategory.getOnlineClassesUnitPrice());
+			vipGroupApplyBaseInfoDto.setOfflineClassesUnitPrice(vipGroupCategory.getOfflineClassesUnitPrice());
+			vipGroupApplyDto.setVipGroupApplyBaseInfo(vipGroupApplyBaseInfoDto);
+
+			vipGroupApplyDto.setCourseSchedules(courseSchedules);
+			createActivityVipGroup(vipGroupApplyDto);
+		}
+
+		return BaseController.succeed();
+	}
+
+	@Override
 	public List<Organization> getPublicOrgans(Integer eduTeacherId, Integer teacherId) {
 		if(Objects.isNull(eduTeacherId)){
 			throw new BizException("教务老师不存在");
@@ -1872,6 +2466,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
 			throw new BizException("不能对已停止的课程进行此操作");
 		}
+		if(vipGroup.getName().startsWith("考前辅导课")){
+			throw new BizException("当前课程类型不支持退学");
+		}
 
 		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
 

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

@@ -1519,6 +1519,6 @@
         WHERE pg.educational_teacher_id_ = #{userId} AND cg.group_type_ = 'PRACTICE' AND cg.del_flag_ = 0
     </select>
     <select id="countCourseNum" resultType="int">
-        SELECT COUNT(id_) FROM course_schedule WHERE class_group_id_ = #{teachMode} AND teach_mode_ = #{teachMode}
+        SELECT COUNT(id_) FROM course_schedule WHERE class_group_id_ = #{classGroupId} AND teach_mode_ = #{teachMode}
     </select>
 </mapper>

+ 5 - 2
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -12,6 +12,7 @@
         <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
+        <result column="student_avatar_" property="studentAvatar"/>
         <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
         <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
         <result column="is_pushed_" jdbcType="INTEGER" property="isPushed"/>
@@ -218,8 +219,10 @@
 
     <select id="getNeedPostReports" resultMap="CourseScheduleEvaluate">
         SELECT cse.id_,cse.class_group_id_,DATE_FORMAT(cse.create_time_,'%Y年%m月') month_,pg.name_
-        group_name_,cse.teacher_id_ FROM course_schedule_evaluate cse
-        LEFT JOIN practice_group pg on cse.music_group_id_ = pg.id_ WHERE status_= 0
+        group_name_,cse.teacher_id_,pg.student_id_,su.avatar_ student_avatar_ FROM course_schedule_evaluate cse
+        LEFT JOIN practice_group pg on cse.music_group_id_ = pg.id_
+        LEFT JOIN sys_user su ON pg.student_id_=su.id_
+        WHERE status_= 0
         <if test="teacherId != null">
             AND cse.teacher_id_ = #{teacherId}
         </if>

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleReviewMapper.xml

@@ -133,6 +133,7 @@
     </update>
     <resultMap id="CourseReviewDto" type="com.ym.mec.biz.dal.dto.CourseReviewDto">
         <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
         <result column="subject_name_" jdbcType="INTEGER" property="subjectName"/>
         <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
@@ -391,7 +392,7 @@
     </select>
 
     <select id="getOnlineCourseReviewList" resultMap="CourseReviewDto">
-        SELECT cs.id_,cs.class_date_,cs.name_ course_name_,csr.id_ review_id_,
+        SELECT cs.id_,cs.group_type_,cs.class_date_,cs.name_ course_name_,csr.id_ review_id_,
         csr.hand_homework_,csr.course_review_,csr.teaching_material_,csr.pronunciation_,csr.tempo_,
         csr.music_theory_,csr.song_,csr.memo_,csr.create_time_,csr.has_liaison_,csr.update_time_,
         sa.id_ attendance_id_

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -532,6 +532,10 @@
 		</foreach>
 	</update>
 
+    <update id="updateEnableChangeSalaryByClassGroup">
+		UPDATE course_schedule_teacher_salary SET enable_change_salary_ = #{enableChangeSalary} WHERE class_group_id_=#{classGroupId}
+	</update>
+
     <select id="findCourseScheduleTeacherSalaryByMusicGroupId" resultMap="CourseScheduleTeacherSalary">
 		SELECT * FROM course_schedule_teacher_salary WHERE music_group_id_=#{musicGroupId} AND group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	</select>

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

@@ -753,7 +753,7 @@
         SELECT * FROM music_group WHERE cooperation_organ_id_ = #{cooperationOrganId} AND status_ IN ('PROGRESS','PAUSE','PREPARE')
     </select>
     <select id="findByCooperationId" resultMap="MusicGroup">
-        SELECT * FROM music_group WHERE cooperation_organ_id_ = #{cooperationId}
+        SELECT * FROM music_group WHERE cooperation_organ_id_ = #{cooperationId} AND del_flag_ = 0
     </select>
 
     <select id="getStudentLastMusicGroup" resultMap="MusicGroup">

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

@@ -143,7 +143,7 @@
         select * from school where del_flag_ != 1 and user_id_ = #{userId}
     </select>
     <select id="findVipSchoolByUserId" resultMap="School">
-        SELECT * FROM school WHERE del_flag_ != 1
+        SELECT * FROM school WHERE del_flag_ = 0
         <if test="organId != null">
         AND ((FIND_IN_SET(organ_id_,#{organId}) and user_id_ is NULL) or user_id_ = #{userId})
         </if>

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -216,6 +216,12 @@
             <if test="comeOnPackage != null">
                 AND s.come_on_package_ = #{comeOnPackage}
             </if>
+            <if test="subjectId!=null">
+                AND FIND_IN_SET( #{subjectId}, s.subject_id_list_ )
+            </if>
+            <if test="activityCourseType!=null and activityCourseType!=''">
+                AND JSON_EXTRACT(activity_course_detail_, CONCAT('$.', #{activityCourseType}))>0
+            </if>
         </where>
     </sql>
 

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -22,6 +22,7 @@
         <result column="current_grade_num_" property="currentGradeNum"/>
         <result column="current_class_" property="currentClass"/>
         <result column="cooperation_organ_id_" property="cooperationOrganId"/>
+        <result column="activity_course_detail_" property="activityCourseDetail"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -120,6 +121,9 @@
             <if test="currentClass != null">
                 current_class_=#{currentClass},
             </if>
+            <if test="activityCourseDetail != null">
+                activity_course_detail_=#{activityCourseDetail},
+            </if>
                 cooperation_organ_id_=#{cooperationOrganId},
                 update_time_ = NOW()
         </set>
@@ -199,6 +203,9 @@
                 <if test="item.cooperationOrganId != null">
                     cooperation_organ_id_=#{item.cooperationOrganId},
                 </if>
+                <if test="item.activityCourseDetail != null">
+                    activity_course_detail_=#{item.activityCourseDetail},
+                </if>
                 update_time_ = NOW()
             </set>
             WHERE user_id_ = #{item.userId}
@@ -642,6 +649,15 @@
             #{studentId}
         </foreach>
     </select>
+
+    <select id="lockStudents" resultMap="Student">
+        SELECT * FROM student WHERE user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
+        FOR UPDATE
+    </select>
+
     <select id="queryCloseServiceTagIds" resultType="java.lang.Integer">
         SELECT s.user_id_ FROM student s
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 450 - 185
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml


+ 5 - 2
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -939,9 +939,12 @@
         <include refid="queryPageNameSql"/>
     </select>
     <sql id="queryPageNameSql">
-        <if test="organId != null">
+        <if test="organId != null and includeFlowOrgan==null">
             AND FIND_IN_SET(t.organ_id_,#{organId})
         </if>
+        <if test="organId != null and includeFlowOrgan!=null and includeFlowOrgan">
+            AND (CONCAT(',',t.organ_id_,',',IFNULL(t.flow_organ_range_,''),',') REGEXP CONCAT(',(',replace(#{organId},',','|'),'),'))
+        </if>
         <if test="subjectIds != null">
             AND INTE_ARRAY(t.subject_id_,#{subjectIds})
         </if>
@@ -956,7 +959,7 @@
         </if>
     </sql>
     <select id="queryPageName" resultMap="Teacher">
-        SELECT su.id_,su.real_name_,su.avatar_,GROUP_CONCAT(s.name_) subject_name_ FROM teacher t
+        SELECT su.id_,su.real_name_,su.avatar_,t.subject_id_,t.organ_id_,GROUP_CONCAT(s.name_) subject_name_ FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
         LEFT JOIN subject s ON FIND_IN_SET(s.id_, t.subject_id_)
         WHERE su.del_flag_ != 1 AND su.lock_flag_!=1

+ 13 - 2
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -35,6 +35,7 @@
 		<result property="maxCourseNum" column="max_course_num_"/>
 		<result property="studentMaxUsedTimes" column="student_max_used_times_"/>
 		<result property="applyToStudentType" column="apply_to_student_type_"/>
+		<result property="allowOnlineToOffline" column="allow_online_to_offline_"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -57,10 +58,10 @@
 		INSERT INTO vip_group_activity (id_,name_,description_,vip_group_category_id_list_,start_time_,end_time_,organ_id_,courses_start_time_,courses_end_time_,type_,
 		                                attribute1_,attribute2_,attribute3_,salary_readonly_flag_,give_class_pay_salary_flag_,create_time_,update_time_,salary_settlement_json_,del_flag_,
 		                                payment_readonly_flag_,online_class_join_gradient_rewards_,offline_class_join_gradient_rewards_,min_course_num_,max_course_num_,
-										student_max_used_times_, apply_to_student_type_)
+										student_max_used_times_, apply_to_student_type_,allow_online_to_offline_)
 		VALUES(#{id},#{name},#{description},#{vipGroupCategoryIdList},#{startTime},#{endTime},#{organId},#{coursesStartTime},#{coursesEndTime},#{type},#{attribute1},#{attribute2},#{attribute3},
 		       #{salaryReadonlyFlag},#{giveClassPaySalaryFlag},now(),now(),#{salarySettlementJson},#{delFlag},#{paymentReadonlyFlag},#{onlineClassJoinGradientRewards},
-		       #{offlineClassJoinGradientRewards},#{minCourseNum},#{maxCourseNum},#{studentMaxUsedTimes},#{applyToStudentType})
+		       #{offlineClassJoinGradientRewards},#{minCourseNum},#{maxCourseNum},#{studentMaxUsedTimes},#{applyToStudentType},#{allowOnlineToOffline})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -142,6 +143,9 @@
 			<if test="applyToStudentType!=null">
 				apply_to_student_type_=#{applyToStudentType},
 			</if>
+			<if test="allowOnlineToOffline!=null">
+				allow_online_to_offline_=#{allowOnlineToOffline},
+			</if>
 			update_time_ = NOW(),
 		</set>WHERE id_ = #{id}
 	</update>
@@ -169,6 +173,9 @@
 			<if test="applyToStudentType!=null">
 				AND apply_to_student_type_=#{applyToStudentType}
 			</if>
+			<if test="allowOnlineToOffline!=null">
+				AND allow_online_to_offline_=#{allowOnlineToOffline}
+			</if>
 		</where>
 	</sql>
 
@@ -262,4 +269,8 @@
 		</where>
 		GROUP BY vga.`id_`
 	</select>
+
+    <select id="findByName" resultMap="VipGroupActivity">
+		SELECT * FROM vip_group_activity vga WHERE vga.name_ = #{name}
+	</select>
 </mapper>

+ 16 - 0
mec-im/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=im
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 8 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayController.java

@@ -48,6 +48,9 @@ public class ChildrenDayController extends BaseController {
         if (Objects.isNull(user)) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
+        if (user.getOrganId().equals(43)) {
+            return failed("您不可参与该活动,请联系乐团主管");
+        }
         return succeed(childrenDayReserveService.addReserve(user, YesOrNoEnum.YES));
     }
 
@@ -79,6 +82,11 @@ public class ChildrenDayController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败,请重新登陆");
         }
+        if (sysUser.getOrganId().equals(43) &&
+                (degreePayDto.getVip1v1() || degreePayDto.getVip1v2() || degreePayDto.getTheoryCourse())
+        ) {
+            return failed("您不可参与该活动,请联系乐团主管");
+        }
         Date nowTime = new Date();
         String endTimeStr = sysConfigDao.findConfigValue("children_day_end_time");
         Date endTime = DateUtil.stringToDate(endTimeStr);

+ 7 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -799,5 +799,12 @@ public class StudentOrderController extends BaseController {
         return succeed(musicGroupRegCalender);
     }
 
+    @GetMapping("confirmTeacherOrder")
+    public Object confirmOrder(String orderNo){
+        TenantPaymentOrder tenantPaymentOrder = tenantPaymentOrderService.queryByOrderNo(orderNo);
+        tenantPaymentOrderService.confirmOrder(tenantPaymentOrder);
+        return succeed();
+    }
+
 
 }

+ 16 - 0
mec-student/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=student
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/config/ResourceServerConfig.java

@@ -32,7 +32,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 				.and()
 				.authorizeRequests()
 				.antMatchers("/v2/api-docs", "/code/*", "/teacher/queryStudentApply", "/teacher/querySubByMusicGroupId", "/studentRegistration/updateSubject",
-						"/studyReport/createEvaluate", "/teacherOrder/*").permitAll().anyRequest().authenticated().and().httpBasic();
+						"/studyReport/createEvaluate", "/teacherOrder/*","/teacher/getRegisterOrPreList").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 28 - 4
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -1,7 +1,13 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.dto.PageInfoReg;
+import com.ym.mec.biz.dal.dto.RegisterDto;
+import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -9,9 +15,13 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
 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.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,10 +30,6 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
-import com.ym.mec.biz.dal.page.TeacherMusicClassQueryInfo;
-import com.ym.mec.biz.dal.page.VipClassQueryInfo;
-import com.ym.mec.biz.dal.page.queryMusicGroupStudentQueryInfo;
 import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("teacher")
@@ -45,6 +51,10 @@ public class TeacherController extends BaseController {
 	private SubjectDao subjectDao;
 	@Autowired
     private EmployeeService employeeService;
+	@Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
+	@Autowired
+    private StudentRegistrationService studentRegistrationService;
 
     @ApiOperation(value = "修改教师个人中心信息")
     @PostMapping("/update")
@@ -195,4 +205,18 @@ public class TeacherController extends BaseController {
         }
         return succeed(employeeService.findByRole("4,5",organIds));
     }
+
+
+    @ApiOperation(value = "获取报名/预报名列表")
+    @GetMapping("/getRegisterOrPreList")
+    public HttpResponseResult<PageInfoReg<RegisterDto>> queryStudentApplyDetail(RegistrationOrPreQueryInfo queryInfo) {
+        if (StringUtils.isNotBlank(queryInfo.getSearch())) {
+            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
+            List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
+            if (userIds.size() > 0) {
+                queryInfo.setUserIds(userIds);
+            }
+        }
+        return succeed(studentRegistrationService.getRegisterOrPreList(queryInfo));
+    }
 }

+ 16 - 0
mec-teacher/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=teacher
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 63 - 40
mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java

@@ -197,7 +197,7 @@ public class DateUtil {
 
 	/**
 	 * 设置系统默认的<code>java.util.TimeZone</code>
-	 * 
+	 *
 	 * @param timeZone <code>java.util.TimeZone</code>
 	 */
 	public static void setTimeZone(TimeZone timeZone) {
@@ -256,7 +256,7 @@ public class DateUtil {
 
 	/**
 	 * 将<code>java.util.Date</code>按照给定的模式转换成日期字符串。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param formatter 给定的模式
 	 * @return 转换后的日期字符串
@@ -272,7 +272,7 @@ public class DateUtil {
 
 	/**
 	 * 将<code>java.util.Date</code>按照给定的模式转换成日期字符串。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param formatter 给定的模式
 	 * @return 转换后的日期字符串
@@ -303,10 +303,10 @@ public class DateUtil {
 
 	/**
 	 * 确定给定的年份是否为闰年。
-	 * 
+	 *
 	 * <pre>
 	 * </pre>
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @return True 如果是闰年
 	 */
@@ -342,7 +342,7 @@ public class DateUtil {
 
 	/**
 	 * 根据日历的规则,为给定的日历字段添加或减去指定的时间量。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param field 给定的日历字段
 	 * @param amount 数量
@@ -361,7 +361,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的年份。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -372,7 +372,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的月份。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -383,7 +383,7 @@ public class DateUtil {
 
 	/**
 	 * 修改周,时间按周的量增加或减少。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -394,7 +394,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的日数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -405,7 +405,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的小时数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -416,7 +416,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的分钟数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -427,7 +427,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的秒钟数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -438,7 +438,7 @@ public class DateUtil {
 
 	/**
 	 * 增加或减少指定数量的毫秒数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param amount 数量
 	 * @return 运算后的 <code>java.util.Date</code>
@@ -449,7 +449,7 @@ public class DateUtil {
 
 	/**
 	 * 在给定的日历字段上添加或减去(上/下)单个时间单元,不更改更大的字段。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param field 给定的日历字段
 	 * @param up 添加或减去(上/下)
@@ -465,7 +465,7 @@ public class DateUtil {
 
 	/**
 	 * 向指定日历字段添加指定(有符号的)时间量,不更改更大的字段。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param field 给定的日历字段
 	 * @param amount 数量
@@ -481,7 +481,7 @@ public class DateUtil {
 
 	/**
 	 * 将毫秒时间戳转换成格里高利历的日数。日数是只从格里高利历第1年1月1日算起的日数。
-	 * 
+	 *
 	 * @param millis 给定的毫秒时间戳
 	 * @return 格里高利历的日数
 	 */
@@ -491,7 +491,7 @@ public class DateUtil {
 
 	/**
 	 * 将<code>java.util.Date</code>转换成格里高利历的日数。 日数是只从格里高利历第1年1月1日算起的日数。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @return 格里高利历的日数
 	 */
@@ -501,7 +501,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的秒钟数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的秒钟数
@@ -512,7 +512,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的分钟数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的分钟数
@@ -528,7 +528,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的小时数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的小时数
@@ -539,7 +539,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的天数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的天数
@@ -554,7 +554,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的月数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的月数
@@ -569,7 +569,7 @@ public class DateUtil {
 
 	/**
 	 * 计算两个日期之间相差的年数。如果第一个日期在第二个日期之前,则返回正,反之返回负。
-	 * 
+	 *
 	 * @param early 第一个日期
 	 * @param late 第二个日期
 	 * @return 两个日期之间相差的年数
@@ -584,7 +584,7 @@ public class DateUtil {
 
 	/**
 	 * 将格里高利历日数转换成 <code>java.sql.Date</code>
-	 * 
+	 *
 	 * @param julian 格里高利历日数
 	 * @return <code>java.sql.Date</code>
 	 */
@@ -594,7 +594,7 @@ public class DateUtil {
 
 	/**
 	 * 将格里高利历日数转换成 <code>java.util.Date</code>
-	 * 
+	 *
 	 * @param julian 格里高利历日数
 	 * @return <code>java.util.Date</code>
 	 */
@@ -604,7 +604,7 @@ public class DateUtil {
 
 	/**
 	 * 将格里高利历日数转换成毫秒时间戳。
-	 * 
+	 *
 	 * @param julian 格里高利历日数
 	 * @return 毫秒时间戳
 	 */
@@ -615,7 +615,7 @@ public class DateUtil {
 	/**
 	 * 将日历转换成儒略历日期。算法参见: <a href="http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html">Julian Day Calculations
 	 * (Gregorian Calendar)</a>, 由 Bill Jeffrys 提供。
-	 * 
+	 *
 	 * @param c 日历实例
 	 * @return 儒略历日期
 	 */
@@ -636,7 +636,7 @@ public class DateUtil {
 	/**
 	 * 将日期转换成儒略历日期。算法参见: <a href="http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html">Julian Day Calculations
 	 * (Gregorian Calendar)</a>, 由 Bill Jeffrys 提供。
-	 * 
+	 *
 	 * @param date 日期
 	 * @return 儒略历日期
 	 */
@@ -655,7 +655,7 @@ public class DateUtil {
 
 	/**
 	 * 给定此 <code>java.util.Date</code> 的时间值,返回指定日历字段可能拥有的最大值。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param field 日历字段
 	 * @return 对于此 <code>java.util.Date</code> 的时间值而言,给定日历字段的最大值
@@ -670,7 +670,7 @@ public class DateUtil {
 
 	/**
 	 * 给定此 <code>java.util.Date</code> 的时间值,返回指定日历字段可能拥有的最小值。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @param field 日历字段
 	 * @return 对于此 <code>java.util.Date</code> 的时间值而言,给定日历字段的最小值
@@ -685,7 +685,7 @@ public class DateUtil {
 
 	/**
 	 * 截取日期,只保留年、月、日部分。
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @return 截取后的<code>java.util.Date</code>
 	 */
@@ -705,7 +705,7 @@ public class DateUtil {
 
 	/**
 	 * 返回当天的最后一秒
-	 * 
+	 *
 	 * @param date <code>java.util.Date</code>
 	 * @return 截取后的<code>java.util.Date</code>
 	 */
@@ -726,7 +726,7 @@ public class DateUtil {
 
 	/**
 	 * 判断两个日期是否是同一天,精确到天。
-	 * 
+	 *
 	 * @param date1 <code>java.util.Date</code>
 	 * @param date2 <code>java.util.Date</code>
 	 * @return true 如果两个日期是同一天
@@ -744,7 +744,7 @@ public class DateUtil {
 
 	/**
 	 * 判断两个日期是否是同一天,精确到天。
-	 * 
+	 *
 	 * @param cal1 <code>java.util.Calendar</code>
 	 * @param cal2 <code>java.util.Calendar</code>
 	 * @return true 如果两个日期是同一天
@@ -759,7 +759,7 @@ public class DateUtil {
 
 	/**
 	 * 判断两个时间是否完全相等,精确到毫秒。
-	 * 
+	 *
 	 * @param date1 <code>java.util.Date</code>
 	 * @param date2 <code>java.util.Date</code>
 	 * @return true 如果两个时间完全相等
@@ -777,7 +777,7 @@ public class DateUtil {
 
 	/**
 	 * 判断两个时间是否完全相等,精确到毫秒。
-	 * 
+	 *
 	 * @param cal1 <code>java.util.Calendar</code>
 	 * @param cal2 <code>java.util.Calendar</code>
 	 * @return true 如果两个时间完全相等
@@ -848,7 +848,7 @@ public class DateUtil {
 
 	/**
 	 * 解析毫秒时间格式
-	 * 
+	 *
 	 * @param millis
 	 * @return
 	 */
@@ -860,7 +860,7 @@ public class DateUtil {
 
 	/**
 	 * 返回date所在月的第一天
-	 * 
+	 *
 	 * @return
 	 */
 	public static Date getFirstDayOfMonth(Date date) {
@@ -912,7 +912,7 @@ public class DateUtil {
 
 	/**
 	 * 将字符串转换为指定格式的日期
-	 * 
+	 *
 	 * @param dateStr
 	 * @param pattern
 	 * @return
@@ -1239,6 +1239,29 @@ public class DateUtil {
 		return sdf.format(new Date(Long.valueOf(seconds+"000")));
 	}
 
+    public static String secondsFormat(int seconds) {
+        String formatStr = "";
+        if (seconds < 60) {
+            return seconds + "秒";
+        } else if (seconds < 3600) {
+            return seconds / 60 + "分钟";
+        } else if (seconds < 86400) {
+            int hour = seconds / 3600;
+            formatStr += hour + "小时";
+            int second = (seconds - (3600 * hour)) / 60;
+            formatStr += second + "分钟";
+            return formatStr;
+        } else {
+            int days = seconds / 86400;
+            formatStr += days + "天";
+            int hour = (seconds - (86400 * days)) / 3600;
+            formatStr += hour + "小时";
+            int second = (seconds - (86400 * days) - (3600 * hour)) / 60;
+            formatStr += second + "分钟";
+            return formatStr;
+        }
+    }
+
 	public static void main(String[] args) throws ParseException {
 		// DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
 		DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

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

@@ -2969,6 +2969,8 @@ public class ExportController extends BaseController {
                 throw new BizException("非法请求");
             }
         }
+        queryInfo.setPage(1);
+        queryInfo.setRows(49999);
         List<IndexErrorDataExportDto> result = indexErrDataRecordService.queryRecord(queryInfo).getRows();
         if (CollectionUtils.isEmpty(result)) {
             response.setStatus(200);

+ 91 - 13
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -2,11 +2,14 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
-import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
+import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.EmployeeService;
 
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -14,11 +17,8 @@ import io.swagger.annotations.ApiOperation;
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -36,13 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dto.DelRegisterDto;
-import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
-import com.ym.mec.biz.dal.dto.StudentAddDto;
-import com.ym.mec.biz.dal.dto.StudentPreRegistrationDto;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
-import com.ym.mec.biz.dal.page.StudentPreRegistrationQueryInfo;
-import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
 import com.ym.mec.biz.service.StudentPreRegistrationService;
 import com.ym.mec.biz.service.StudentRegistrationService;
@@ -74,6 +68,8 @@ public class StudentRegistrationController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private EmployeeService employeeService;
+    @Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
 
     @ApiOperation(value = "乐团预报名列表分页查询")
     @GetMapping("/queryPreApplyList")
@@ -271,7 +267,7 @@ public class StudentRegistrationController extends BaseController {
         PageInfo<StudentPreRegistrationDto> studentPreRegistration = studentPreRegistrationService.queryListForPage(queryInfo);
         if (studentPreRegistration.getTotal() <= 0) {
             response.setStatus(200);
-            response.setContentType("Content-Type: application/json;charset=UTF-8");
+            response.setContentType("Content-Type:application/json;charset=UTF-8");
             response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
             response.flushBuffer();
             return;
@@ -349,4 +345,86 @@ public class StudentRegistrationController extends BaseController {
         }
         return succeed(studentRegistrationService.queryNoClassMusicStudentInfo(queryInfo));
     }
+
+    @ApiOperation(value = "获取报名/预报名列表")
+    @GetMapping("/getRegisterOrPreList")
+    @PreAuthorize("@pcs.hasPermissions('studentRegistration/getRegisterOrPreList')")
+    public HttpResponseResult<PageInfoReg<RegisterDto>> queryStudentApplyDetail(RegistrationOrPreQueryInfo queryInfo) {
+        if (StringUtils.isNotBlank(queryInfo.getSearch())) {
+            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
+            List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
+            if (userIds.size() > 0) {
+                queryInfo.setUserIds(userIds);
+            }
+        }
+        return succeed(studentRegistrationService.getRegisterOrPreList(queryInfo));
+    }
+
+    @ApiOperation(value = "获取报名/预报名列表导出")
+    @GetMapping("/registerOrPreListExport")
+    @PreAuthorize("@pcs.hasPermissions('studentRegistration/registerOrPreListExport')")
+    public void registerOrPreListExport(RegistrationOrPreQueryInfo queryInfo, HttpServletResponse response) throws Exception {
+        if (StringUtils.isNotBlank(queryInfo.getSearch())) {
+            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
+            List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
+            if (userIds.size() > 0) {
+                queryInfo.setUserIds(userIds);
+            }
+        }
+        queryInfo.setPage(1);
+        queryInfo.setRows(49999);
+
+        PageInfo<RegisterDto> registerOrPreList = studentRegistrationService.getRegisterOrPreList(queryInfo);
+        if (registerOrPreList.getTotal() <= 0) {
+            throw new BizException("没有可导出的记录");
+        }
+
+        List<RegisterDto> hasSoredPreRegs = registerOrPreList.getRows().stream().filter(e -> e.getPerRegisterTime() != null).sorted(Comparator.comparing(RegisterDto::getPerRegisterTime)).collect(Collectors.toList());
+        int i = 1;
+        for (RegisterDto hasSoredPreReg : hasSoredPreRegs) {
+            hasSoredPreReg.setPerRegSort(i);
+            i++;
+        }
+
+        i = 1;
+        List<RegisterDto> pays = registerOrPreList.getRows().stream().filter(e -> e.getPayTime() != null).sorted(Comparator.comparing(RegisterDto::getPayTime)).collect(Collectors.toList());
+        for (RegisterDto pay : pays) {
+            pay.setPaySort(i);
+            i++;
+        }
+
+        OutputStream outputStream = response.getOutputStream();
+        HSSFWorkbook workbook = null;
+        try {
+            String[] header = {"学员编号", "学员姓名", "声部", "预报名时间", "预报名时间差","预报名排名", "缴费时间", "缴费时间差","缴费排名"};
+            String[] body = {"userId", "studentName", "actualSubjectName", "perRegisterTime", "perRegIntervalStr","perRegSort", "payTime", "payIntervalStr","paySort"};
+            workbook = POIUtil.exportExcel(header, body, registerOrPreList.getRows());
+            response.setContentType("application/octet-stream");
+            response.setHeader("Content-Disposition", "attachment;filename=registerOrPer-" + DateUtil.getDate(new Date()) + ".xls");
+            response.flushBuffer();
+            outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+            workbook.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (outputStream != null) {
+                try {
+                    workbook.close();
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+
+    @ApiOperation(value = "设置不需要云教练")
+    @GetMapping("/setNoneCloudTeacher")
+    @PreAuthorize("@pcs.hasPermissions('studentRegistration/setNoneCloudTeacher')")
+    public HttpResponseResult<Boolean> setNoneCloudTeacher(Long id) {
+        return succeed(studentRegistrationService.setNoneCloudTeacher(id));
+    }
 }

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

@@ -155,17 +155,17 @@ public class TeacherController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            return failed("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                return failed("非法请求");
             }
+        }
         return succeed(teacherService.queryPageName(queryInfo));
     }
 

+ 52 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduSchoolController.java

@@ -0,0 +1,52 @@
+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.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.page.SchoolQueryInfo;
+import com.ym.mec.biz.service.SchoolService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+@RequestMapping("eduSchool")
+@Api(tags = "学校(教学点)服务")
+@RestController
+public class EduSchoolController extends BaseController {
+
+    @Autowired
+    private SchoolService schoolService;
+    @Autowired
+    private TeacherDao teacherDao;
+
+    @ApiOperation(value = "获取教师vip课教学点")
+    @GetMapping("/findVipSchoolByTeacher")
+    public Object findVipSchoolByTeacher(@ApiParam(value = "教师编号", required = true) Integer userId){
+        Teacher teacher = teacherDao.get(userId);
+        if (teacher == null) {
+            return failed("用户信息获取失败");
+        }
+        String organId = new String();
+        if(Objects.nonNull(teacher.getTeacherOrganId())){
+            organId = teacher.getTeacherOrganId().toString();
+        }
+        if(StringUtils.isEmpty(teacher.getFlowOrganRange())){
+            organId += "," + teacher.getFlowOrganRange();
+        }
+        return succeed(schoolService.findVipSchoolByTeacher(userId,organId,null));
+    }
+}

+ 58 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentStudentController.java

@@ -1,11 +1,22 @@
 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.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.biz.service.StudentManageService;
+import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiOperation;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -15,6 +26,12 @@ import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
 /**
  * @Author Joburgess
  * @Date 2020.09.14
@@ -28,6 +45,12 @@ public class EduStudentStudentController extends BaseController {
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     private StudentManageService studentManageService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
+    @Autowired
+    private TeacherService teacherService;
 
     @ApiOperation(value = "获取某节课学生签到列表")
     @GetMapping("eduStudentAttendance/findStudentAttendance")
@@ -53,4 +76,39 @@ public class EduStudentStudentController extends BaseController {
         return succeed(studentManageService.queryStudentNoStartCourse(queryInfo));
     }
 
+    @ApiOperation(value = "获取学生列表")
+    @GetMapping("eduStudentManage/queryStudentList")
+    public Object queryStudentList(StudentManageQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(Objects.nonNull(queryInfo.getTeacherIdForOrgan())){
+            Teacher teacher = teacherService.get(queryInfo.getTeacherIdForOrgan());
+            if(Objects.isNull(teacher)){
+                return failed("教师信息不存在");
+            }
+            if(Objects.nonNull(teacher.getTeacherOrganId())){
+                queryInfo.setOrganId(teacher.getTeacherOrganId().toString());
+            }
+            if(StringUtils.isNotBlank(teacher.getFlowOrganRange())){
+                queryInfo.setOrganId(queryInfo.getOrganId()+","+teacher.getFlowOrganRange());
+            }
+        }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())||StringUtils.isBlank(employee.getOrganIdList())) {
+            return failed("用户所在分部异常");
+        }
+        Set<String> employeeOrganList = Arrays.stream(employee.getOrganIdList().split(",")).collect(Collectors.toSet());
+        Set<String> teacherOrganList = Arrays.stream(queryInfo.getOrganId().split(",")).collect(Collectors.toSet());
+        List<String> organIdList = teacherOrganList.stream().filter(id -> employeeOrganList.contains(id)).collect(Collectors.toList());
+        if(CollectionUtils.isEmpty(organIdList)){
+            return failed("用户所在分部异常");
+        }
+        queryInfo.setOrganId(StringUtils.join(organIdList, ","));
+
+        queryInfo.setIsExport(false);
+        return succeed(studentManageService.findStudentsByOrganId(queryInfo));
+    }
+
 }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java

@@ -3,8 +3,11 @@ package com.ym.mec.web.controller.education;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -24,4 +27,10 @@ public class EduSubjectController extends BaseController {
     public Object findSubSubjects(Integer tenantId){
         return succeed(subjectService.findSubSubjects(tenantId));
     }
+
+    @ApiOperation(value = "根据科目编号查询科目")
+    @GetMapping("/findBySubjectByIdList")
+    public Object get(String subjectIdList){
+        return succeed(subjectService.findBySubjectByIdList(subjectIdList));
+    }
 }

+ 93 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupActivityController.java

@@ -0,0 +1,93 @@
+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.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.Student;
+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 com.ym.mec.common.exception.BizException;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/1
+ */
+
+@Api(tags = "vip课活动")
+@RequestMapping("eduVipGroupActivity")
+@RestController
+public class EduVipGroupActivityController extends BaseController {
+
+    @Autowired
+    private VipGroupActivityService vipGroupActivityService;
+	@Autowired
+    private TeacherDao teacherDao;
+	@Autowired
+    private StudentDao studentDao;
+	@Autowired
+    private SysConfigService sysConfigService;
+
+    @ApiOperation(value = "根据课程类型获取对应课程活动方案")
+    @GetMapping("/findByVipGroupCategory")
+    @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/findByVipGroupCategory')")
+    public Object findByVipGroupCategory(Long categoryId, String studentIds, Integer teacherId){
+        if(StringUtils.isBlank(studentIds)){
+            return failed("请选择学员");
+        }
+
+        SysConfig activityIdConfig = sysConfigService.findByParamName(SysConfigService.CHILDREN_DAY_VIP_ACTIVITY_IDS);
+        if(Objects.isNull(activityIdConfig)||StringUtils.isBlank(activityIdConfig.getParanValue())){
+            return succeed();
+        }
+
+        Set<Integer> activityIds = Arrays.stream(activityIdConfig.getParanValue().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toSet());
+
+        List<Integer> userIds = Arrays.stream(studentIds.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
+        List<Student> students = studentDao.findByStudentIds(userIds);
+        if(CollectionUtils.isEmpty(students)||students.size()!=userIds.size()){
+            return failed("学员信息不存在");
+        }
+        long newStudentNum = students.stream().filter(s -> s.getIsNewUser()).count();
+
+        Integer applyToStudentType = -1;
+        if(newStudentNum==0){
+            applyToStudentType = 0;
+        }else if(newStudentNum==userIds.size()){
+            applyToStudentType = 1;
+        }
+
+        SysUser student = teacherDao.getUser(userIds.get(0));
+        if(Objects.isNull(student)){
+            return failed("学员信息不存在");
+        }
+        String organIds = student.getOrganId().toString();
+        List<VipGroupActivity> vipGroupActivities = vipGroupActivityService.findByVipGroupCategory(categoryId, organIds, teacherId, applyToStudentType);
+        Iterator<VipGroupActivity> iterator = vipGroupActivities.iterator();
+        while (iterator.hasNext()){
+            VipGroupActivity vipGroupActivity = iterator.next();
+            if(!activityIds.contains(vipGroupActivity.getId())){
+                iterator.remove();
+            }
+        }
+        return succeed(vipGroupActivities);
+    }
+
+}

+ 58 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupCategoryController.java

@@ -0,0 +1,58 @@
+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.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.entity.VipGroupCategory;
+import com.ym.mec.biz.service.VipGroupCategoryService;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+@Api(tags = "vip课类别")
+@RequestMapping("eduVipGroupCategory")
+@RestController
+public class EduVipGroupCategoryController extends BaseController {
+
+	@Autowired
+	private VipGroupCategoryService vipGroupCategoryService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private EmployeeDao employeeDao;
+
+	@ApiOperation("全查询")
+	@GetMapping(value = "/queryAll")
+	public Object queryAll(String organId) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		Employee employee = employeeDao.get(sysUser.getId());
+		if (StringUtils.isEmpty(organId)) {
+			organId = employee.getOrganIdList();
+		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
+			return failed("用户所在分部异常");
+		}else {
+			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+			if(!list.containsAll(Arrays.asList(organId.split(",")))){
+				return failed("非法请求");
+			}
+		}
+		return succeed(vipGroupCategoryService.findAllByOrgan(organId));
+	}
+}

+ 72 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduVipGroupManageController.java

@@ -0,0 +1,72 @@
+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.dao.TeacherDao;
+import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.Teacher;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/21
+ */
+@Api(tags = "vip课")
+@RequestMapping("eduVipGroupManage")
+@RestController
+public class EduVipGroupManageController extends BaseController {
+
+    @Autowired
+    private VipGroupService vipGroupService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private TeacherDao teacherDao;
+
+    @ApiOperation(value = "创建六一活动vip课")
+    @PostMapping("/createActivityVipGroup")
+    public Object createActivityVipGroup(@RequestBody VipGroupApplyDto vipGroupApplyDto){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        Integer userId = vipGroupApplyDto.getVipGroupApplyBaseInfo().getUserId();
+        Teacher teacher = teacherDao.get(userId);
+        if(Objects.isNull(teacher)){
+            return failed("请指定指导老师!");
+        }
+        if(Objects.isNull(vipGroupApplyDto.getVipGroupApplyBaseInfo().getOrganId())){
+            Integer firstStudentId = vipGroupApplyDto.getVipGroupApplyBaseInfo().getFirstStudentId();
+            SysUser student = teacherDao.getUser(firstStudentId);
+            if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
+                return failed("学员信息异常");
+            }
+            vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganId(student.getOrganId());
+        }
+        for (CourseSchedule courseSchedule : vipGroupApplyDto.getCourseSchedules()) {
+            courseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(), vipGroupApplyDto.getVipGroupApplyBaseInfo().getSingleClassMinutes()));
+        }
+        vipGroupApplyDto.getVipGroupApplyBaseInfo().setEducationalTeacherId(sysUser.getId());
+        return vipGroupService.createActivityVipGroup(vipGroupApplyDto);
+    }
+
+    @PostMapping("/exportActivityVipGroup")
+    public HttpResponseResult importActivityVipGroup(String data){
+        vipGroupService.importActivityVipGroup(data);
+        return succeed();
+    }
+
+}

+ 143 - 0
mec-web/src/main/resources/application.yml

@@ -0,0 +1,143 @@
+server:
+  port: 8005
+  connection-timeout: 60000
+  tomcat:
+    min-spare-threads: 50
+    max-threads: 500
+    accesslog:
+      enabled: true
+      buffered: true
+      directory: /var/logs
+      file-date-format: -yyyy-MM-dd
+      pattern: common
+      prefix: tomcat-web
+      rename-on-rotate: false
+      request-attributes-enabled: false
+      rotate: true
+      suffix: .log
+
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance:
+      lease-renewal-interval-in-seconds: 5
+      prefer-ip-address: true
+
+spring:
+  servlet:
+    multipart:
+      max-file-size: 150MB
+      max-request-size: 150MB
+  application:
+    name: web-server
+
+  data:
+    mongodb:
+      uri: mongodb://root:dayayuemeng2019@47.114.1.200:27017/mec_dev
+
+  datasource:
+    name: test
+    url: jdbc:mysql://rm-bp13774a2o87ti8c7mo.mysql.rds.aliyuncs.com:3306/mec_pro?useUnicode=true&characterEncoding=UTF8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: mec_pro
+    password: mec@Pro9
+    # 使用druid数据源
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      connection-init-sqls: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    filters: stat
+    maxActive: 50
+    initialSize: 10
+    maxWait: 60000
+    minIdle: 1
+    timeBetweenEvictionRunsMillis: 60000
+    minEvictableIdleTimeMillis: 300000
+    validationQuery: select 'x'
+    testWhileIdle: true
+    testOnBorrow: false
+    testOnReturn: false
+    poolPreparedStatements: true
+    maxOpenPreparedStatements: 20
+
+  redis:
+    host: 47.114.1.200
+    port: 6379
+    password: dyym
+    database: 1
+    #连接超时时间(毫秒)
+    timeout: 10000
+    jedis:
+      pool:
+        #连接池最大连接数(使用负值表示没有限制)
+        max-active: 20
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 10000
+        #连接池中的最大空闲连接
+        max-idle: 10
+        #连接池中的最小空闲连接
+        min-idle: 5
+
+mybatis:
+  mapperLocations: classpath:config/mybatis/*.xml
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+swagger:
+  base-package: com.ym.mec.web.controller
+
+##认证
+security:
+  oauth2:
+    client:
+      client-id: app
+      client-secret: app
+    resource:
+      token-info-uri: http://localhost:8001/oauth/check_token
+
+#spring boot admin 相关配置
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: ALWAYS
+
+
+ribbon:
+  ReadTimeout: 600000
+  ConnectTimeout: 60000
+
+logging:
+  level:
+    com.ym.mec.auth.api.client.SysUserFeignService: INFO
+
+message:
+  debugMode: true
+
+##支付流水隐藏
+payment:
+  hiddenMode: false
+  #隐藏的支付方式
+  channel: YQPAY
+
+eseal:
+  tsign:
+    projectid: 4438776254
+    projectSecret: a94cf63d6361084d232f345d71321691
+    apisUrl: http://smlitsm.tsign.cn:8080/tgmonitor/rest/app!getAPIInfo2
+
+push:
+  jiguang:
+    reqURL: https://api.jpush.cn/v3/push
+    appKey:
+      student: 0e7422e1d6e73637e678716a
+      teacher: 7e0282ca92c12c8c45a93bb3
+      system: 496fc1007dea59b1b4252d2b
+    masterSecret:
+      student: c2361016604eab56ab2db2ac
+      teacher: d47430e2f4755ef5dc050ac5
+      system: a5e51e9cdb25417463afbf7a
+    apns_production: false

+ 16 - 0
mec-web/src/main/resources/bootstrap-dev_server.properties

@@ -0,0 +1,16 @@
+#\u6307\u5b9a\u5f00\u53d1\u73af\u5883
+#spring.profiles.active=dev
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=fd352683-69df-439a-802f-c44f0c21329c
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=web
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů