瀏覽代碼

Merge branch 'active_course_2021-09-26~29' of http://git.dayaedu.com/yonge/mec into 2021-double-eleven

zouxuan 3 年之前
父節點
當前提交
4f7a0587cb
共有 35 個文件被更改,包括 653 次插入655 次删除
  1. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  2. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java
  3. 2 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java
  4. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupBuyParamsDto.java
  5. 4 20
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupSalarySettlementDto.java
  6. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ActivityUserMapper.java
  7. 1 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalary.java
  8. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java
  9. 1 6
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  10. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupActivityService.java
  11. 12 17
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  12. 2 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  13. 31 52
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  14. 4 31
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  15. 13 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  16. 10 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  17. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultPracticeGroupSalaryServiceImpl.java
  18. 5 15
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  19. 2 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java
  20. 378 382
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  21. 8 2
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  22. 1 1
      mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml
  23. 2 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  24. 5 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  25. 4 8
      mec-biz/src/main/resources/config/mybatis/TeacherDefaultVipGroupSalaryMapper.xml
  26. 18 5
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  27. 1 1
      mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml
  28. 0 1
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  29. 2 15
      mec-education/src/main/java/com/ym/mec/education/entity/TeacherDefaultVipGroupSalary.java
  30. 5 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java
  31. 3 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipGroupController.java
  32. 1 1
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupActivityController.java
  33. 0 6
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java
  34. 1 11
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  35. 113 12
      mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

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

@@ -456,4 +456,13 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @return
      */
     Integer getOrderIdByMusical(@Param("musicGroupId") String musicGroupId, @Param("studentId") Integer studentId);
+
+    /**
+    * @description: 根据课程组编号获取学员的订单列表
+     * @param vipGroupId
+    * @return java.util.Map<java.lang.Integer,java.math.BigDecimal>
+    * @author zx
+    * @date 2021/10/20 18:56
+    */
+    List<Map<Integer, BigDecimal>> queryStudentCourseAmountMap(Long vipGroupId);
 }

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

@@ -45,7 +45,7 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
 	* @author zx
 	* @date 2021/10/11 11:17
 	*/
-    List<WaitCourseActivityDto> queryWaitCourseActivity(Integer teacherId);
+    List<WaitCourseActivityDto> queryWaitCourseActivity(@Param("teacherId") Integer teacherId, @Param("organId") String organId);
 
     /**
     * @description: 获取活动待排课学员数量

+ 2 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java

@@ -29,8 +29,8 @@ public class VipGroupApplyBaseInfoDto extends VipGroup {
     @ApiModelProperty(value = "预计招生人数",hidden = true)
     private Integer expectStudentNum;
 
-    @ApiModelProperty(value = "教师线上课课酬")
-    private BigDecimal onlineTeacherSalary;
+//    @ApiModelProperty(value = "教师线上课课酬")
+//    private BigDecimal onlineTeacherSalary;
 
     @ApiModelProperty(value = "教师线下课课酬")
     private BigDecimal offlineTeacherSalary;
@@ -76,14 +76,6 @@ public class VipGroupApplyBaseInfoDto extends VipGroup {
         this.subjectIdList = subjectIdList;
     }
 
-    public BigDecimal getOnlineTeacherSalary() {
-        return onlineTeacherSalary;
-    }
-
-    public void setOnlineTeacherSalary(BigDecimal onlineTeacherSalary) {
-        this.onlineTeacherSalary = onlineTeacherSalary;
-    }
-
     public BigDecimal getOfflineTeacherSalary() {
         return offlineTeacherSalary;
     }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupBuyParamsDto.java

@@ -23,7 +23,7 @@ public class VipGroupBuyParamsDto {
     private boolean isUseBalancePayment;
 
     @ApiModelProperty(value = "是否重新支付")
-    private boolean isRepeatPay;
+    private boolean isRepeatPay = false;
 
     @ApiModelProperty(value = "优惠券列表", required = false)
     private List<Integer> couponIdList;

+ 4 - 20
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupSalarySettlementDto.java

@@ -10,14 +10,14 @@ import java.io.Serializable;
  */
 public class VipGroupSalarySettlementDto implements Serializable {
 
-    @ApiModelProperty("收费VIP线上课收费标准")
-    private VipGroupSalarySettlementTypeDto vipOnlineSalarySettlement;
+//    @ApiModelProperty("收费VIP线上课收费标准")
+//    private VipGroupSalarySettlementTypeDto vipOnlineSalarySettlement;
 
     @ApiModelProperty("收费VIP线下课收费标准")
     private VipGroupSalarySettlementTypeDto vipOfflineSalarySettlement;
 
-    @ApiModelProperty("赠送VIP线上课收费标准")
-    private VipGroupSalarySettlementTypeDto giveVipOnlineSalarySettlement;
+//    @ApiModelProperty("赠送VIP线上课收费标准")
+//    private VipGroupSalarySettlementTypeDto giveVipOnlineSalarySettlement;
 
     @ApiModelProperty("赠送VIP线下课收费标准")
     private VipGroupSalarySettlementTypeDto giveVipOfflineSalarySettlement;
@@ -28,14 +28,6 @@ public class VipGroupSalarySettlementDto implements Serializable {
     @ApiModelProperty("赠送网管课收费标准")
     private VipGroupSalarySettlementTypeDto givePracticeSalarySettlement;
 
-    public VipGroupSalarySettlementTypeDto getVipOnlineSalarySettlement() {
-        return vipOnlineSalarySettlement;
-    }
-
-    public void setVipOnlineSalarySettlement(VipGroupSalarySettlementTypeDto vipOnlineSalarySettlement) {
-        this.vipOnlineSalarySettlement = vipOnlineSalarySettlement;
-    }
-
     public VipGroupSalarySettlementTypeDto getVipOfflineSalarySettlement() {
         return vipOfflineSalarySettlement;
     }
@@ -44,14 +36,6 @@ public class VipGroupSalarySettlementDto implements Serializable {
         this.vipOfflineSalarySettlement = vipOfflineSalarySettlement;
     }
 
-    public VipGroupSalarySettlementTypeDto getGiveVipOnlineSalarySettlement() {
-        return giveVipOnlineSalarySettlement;
-    }
-
-    public void setGiveVipOnlineSalarySettlement(VipGroupSalarySettlementTypeDto giveVipOnlineSalarySettlement) {
-        this.giveVipOnlineSalarySettlement = giveVipOnlineSalarySettlement;
-    }
-
     public VipGroupSalarySettlementTypeDto getGiveVipOfflineSalarySettlement() {
         return giveVipOfflineSalarySettlement;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ActivityUserMapper.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(activity_user_mapper):
  */
@@ -52,6 +54,8 @@ public class ActivityUserMapper {
 	private Long givePracticeGroupId;
 
 	private Boolean returnFee = false;
+
+	private BigDecimal actualPrice = BigDecimal.ZERO;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -59,6 +63,14 @@ public class ActivityUserMapper {
 	/**  */
 	private java.util.Date updateTime;
 
+	public BigDecimal getActualPrice() {
+		return actualPrice;
+	}
+
+	public void setActualPrice(BigDecimal actualPrice) {
+		this.actualPrice = actualPrice;
+	}
+
 	public Integer getTeacherId() {
 		return teacherId;
 	}

+ 1 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalary.java

@@ -25,9 +25,7 @@ public class TeacherDefaultVipGroupSalary {
 
 	private Boolean musicTheory;
 	
-	/** 线上课薪酬 */
-	@ApiModelProperty(value = "线上课薪酬", required = false)
-	private java.math.BigDecimal onlineClassesSalary;
+//	private java.math.BigDecimal onlineClassesSalary;
 	
 	/** 线下课薪酬 */
 	@ApiModelProperty(value = "线下课薪酬", required = false)
@@ -71,14 +69,6 @@ public class TeacherDefaultVipGroupSalary {
 		return this.vipGroupCategoryId;
 	}
 			
-	public void setOnlineClassesSalary(java.math.BigDecimal onlineClassesSalary){
-		this.onlineClassesSalary = onlineClassesSalary;
-	}
-	
-	public java.math.BigDecimal getOnlineClassesSalary(){
-		return this.onlineClassesSalary;
-	}
-			
 	public void setOfflineClassesSalary(java.math.BigDecimal offlineClassesSalary){
 		this.offlineClassesSalary = offlineClassesSalary;
 	}

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java

@@ -31,7 +31,6 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      */
     void createCourseScheduleTeacherVipSalary(VipGroup vipGroup,
                                              List<CourseSchedule> vipCourseSchedules,
-                                             BigDecimal onlineTeacherSalary,
                                              BigDecimal offlineTeacherSalary);
 
     void createCourseScheduleTeacherPracticeSalary(List<CourseSchedule> courseSchedules,

+ 1 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -203,18 +203,13 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
     /**
      * @description: 活动赠送课程,或者会员
      * @param vipGroupActivityId
-     * @param userId
-     * @param paymentOrderId
      * @return void
      * @author zx
      * @date 2021/10/11 10:36
      */
     Integer activityGive(Integer vipGroupActivityId,
-                         Integer userId,
-                         Long paymentOrderId,
+                         StudentPaymentOrder studentPaymentOrder,
                          Long vipGroupId,
                          Long practiceGroupId,
-                         Integer buyNum,
-                         Integer organId,
                          Integer teacherId);
 }

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

@@ -44,7 +44,7 @@ public interface VipGroupActivityService extends BaseService<Integer, VipGroupAc
     * @author zx
     * @date 2021/10/11 11:12
     */
-    List<WaitCourseActivityDto> queryWaitCourseActivity(Integer teacherId);
+    List<WaitCourseActivityDto> queryWaitCourseActivity(Integer teacherId,String organId);
 
 
     /**

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

@@ -22,7 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
 public interface VipGroupService extends BaseService<Long, VipGroup> {
 
     /**
-     * @describe 创建vip
+     * @describe 申请VIP
      * @author Joburgess
      * @date 2019/10/30
      * @param vipGroup: VIP课申请信息
@@ -31,13 +31,13 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     HttpResponseResult createVipGroup(VipGroupApplyDto vipGroup);
 
     /**
-     * @describe 创建vip课
+     * @describe 创建vip课、并排课
      * @author Joburgess
      * @date 2019/10/30
      * @param vipGroup: VIP课申请信息
      * @return void
      */
-    HttpResponseResult createActivityVipGroup(VipGroupApplyDto vipGroup);
+    HttpResponseResult createVipGroup1(VipGroupApplyDto vipGroup);
 
     /**
      * @describe 创建vip课
@@ -46,6 +46,15 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
      * @param vipGroup: VIP课申请信息
      * @return void
      */
+    HttpResponseResult createActivityVipGroup(VipGroupApplyDto vipGroup);
+
+    /**
+    * @description: 教师端活动排课
+     * @param vipGroup
+    * @return com.ym.mec.common.entity.HttpResponseResult
+    * @author zx
+    * @date 2021/10/21 11:17
+    */
     HttpResponseResult createActivityVipGroup1(VipGroupApplyDto vipGroup);
 
     HttpResponseResult importActivityVipGroup(String data);
@@ -204,20 +213,6 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
                                                                          Integer teacherId);
 
     /**
-     * @describe 计算vip课程购买总价,及老师课酬-只是学生人数统计方式不同
-     * @author Joburgess
-     * @date 2019/10/23
-     * @param vipGroup: vip课程
-     * @param teacherId: 要计算课酬的老师的编号
-     * @return java.util.Map
-     */
-    @Deprecated
-//    <K extends VipGroup> Map<String, BigDecimal> countVipGroupCoursePredictFee(K vipGroup,
-//                                                                         Integer teacherId,
-//                                                                               Long courseId);
-
-
-    /**
      * @Author: Joburgess
      * @Date: 2019/10/3
      * @params [queryInfo]

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

@@ -3760,7 +3760,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							BigDecimal teacherSalary=null;
 
 							if(Objects.nonNull(salaryMap)){
-								teacherSalary=newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary");
+								teacherSalary = salaryMap.get("offlineTeacherSalary");
 							}
 
 							ts.setExpectSalary(teacherSalary);
@@ -3969,16 +3969,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 if (teacherIsChange) {
                     VipGroup byCourseSchedule = vipGroupDao.findByCourseSchedule(newCourseSchedule.getId());
 
-                    BigDecimal onlineTeacherSalary = new BigDecimal(0), offlineTeacherSalary = new BigDecimal(0);
-
 					Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(byCourseSchedule, newCourseSchedule.getActualTeacherId(), newCourseSchedule.getId());
 
                     List<CourseSchedule> courseSchedules = new ArrayList<>();
                     courseSchedules.add(newCourseSchedule);
-                    courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(byCourseSchedule,
-                            courseSchedules,
-							salaryMap.get("onlineTeacherSalary"),
-							salaryMap.get("offlineTeacherSalary"));
+                    courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(byCourseSchedule,courseSchedules,salaryMap.get("offlineTeacherSalary"));
                     if (Objects.nonNull(oldCourseSchedule.getActualTeacherId()) && teacherIsChange) {
                         beReplaceTeacherIds.add(oldCourseSchedule.getActualTeacherId().intValue());
                     }

+ 31 - 52
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -75,8 +75,6 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 	@Autowired
 	private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 	@Autowired
-	private SysConfigDao sysConfigDao;
-	@Autowired
 	private StudentPaymentOrderDao studentPaymentOrderDaop;
 
 	@Override
@@ -98,73 +96,54 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		}
 
 		//获取活动信息
-		BigDecimal discount = new BigDecimal(100);
 		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
-		if(vipGroupActivity != null){
-			discount = vipGroupActivity.getDiscount();
-		}
 
 		List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findGroupCourseSchedules(vipGroupId.toString(),GroupType.VIP.getCode());
 
 		if(CollectionUtils.isEmpty(vipGroupCourseSchedules)){
 			throw new BizException("未获取到排课信息");
 		}
-		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+
+		int giveClassTimes=0;
 
 		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDaop.findByStudentVipGroup(vipGroupId, userId, DealStatusEnum.SUCCESS.getCode());
+		BigDecimal couponFee = new BigDecimal(0);
 		if(Objects.nonNull(studentPaymentOrder)){
-			//实际支付金额,去除优惠券
-			BigDecimal actualPrice = studentPaymentOrder.getExpectAmount().subtract(studentPaymentOrder.getCouponRemitFee());
-			BigDecimal divide = actualPrice.divide(new BigDecimal(vipGroupCourseSchedules.size()), ROUND_DOWN);
-			BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(vipGroupCourseSchedules.size()))).add(divide);
-			for (int i = 0; i < vipGroupCourseSchedules.size(); i++) {
-				CourseSchedule courseSchedule = vipGroupCourseSchedules.get(i);
+			couponFee = studentPaymentOrder.getCouponRemitFee().divide(new BigDecimal(vipGroupCourseSchedules.size()-giveClassTimes), CommonConstants.DECIMAL_PLACE);
+		}
+
+		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+		Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroupByTeachMode = vipGroupCourseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
+		for(TeachModeEnum teachModeEnum:courseScheduleGroupByTeachMode.keySet()){
+			List<CourseSchedule> courseSchedules = courseScheduleGroupByTeachMode.get(teachModeEnum)
+					.stream()
+					.sorted(Comparator.comparing(CourseSchedule::getStartClassTime)).collect(Collectors.toList());
+			for(int i=0;i<courseSchedules.size();i++) {
+				//创建学生课程应缴费记录
 				CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
 				courseScheduleStudentPayment.setUserId(userId);
-				courseScheduleStudentPayment.setGroupType(courseSchedule.getGroupType());
-				courseScheduleStudentPayment.setMusicGroupId(courseSchedule.getMusicGroupId());
-				courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
-				courseScheduleStudentPayment.setClassGroupId(courseSchedule.getClassGroupId());
-				if (i == 0) {
-					courseScheduleStudentPayment.setExpectPrice(firstAmount);
+	            courseScheduleStudentPayment.setGroupType(courseSchedules.get(i).getGroupType());
+	            courseScheduleStudentPayment.setMusicGroupId(courseSchedules.get(i).getMusicGroupId());
+				courseScheduleStudentPayment.setCourseScheduleId(courseSchedules.get(i).getId());
+				courseScheduleStudentPayment.setClassGroupId(courseSchedules.get(i).getClassGroupId());
+
+				if (teachModeEnum == TeachModeEnum.ONLINE) {
+					//学生线上单节课应缴费计算
+					courseScheduleStudentPayment.setExpectPrice(
+							vipGroup.getOnlineClassesUnitPrice().multiply(vipGroupActivity.getDiscount())
+									.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP)
+									.subtract(couponFee));
 				}else{
-					courseScheduleStudentPayment.setExpectPrice(actualPrice);
+					//学生线下单节课应缴费计算
+					courseScheduleStudentPayment.setExpectPrice(
+							vipGroup.getOfflineClassesUnitPrice().multiply(vipGroupActivity.getDiscount())
+									.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP)
+									.subtract(couponFee));
 				}
-				courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(courseSchedule.getTeachMode())?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
+                courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(teachModeEnum)?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
 				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 			}
-		}else {
-			Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroupByTeachMode = vipGroupCourseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
-			for(TeachModeEnum teachModeEnum:courseScheduleGroupByTeachMode.keySet()){
-				List<CourseSchedule> courseSchedules = courseScheduleGroupByTeachMode.get(teachModeEnum)
-						.stream()
-						.sorted(Comparator.comparing(CourseSchedule::getStartClassTime)).collect(Collectors.toList());
-				for(int i=0;i<courseSchedules.size();i++) {
-					//创建学生课程应缴费记录
-					CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
-					courseScheduleStudentPayment.setUserId(userId);
-					courseScheduleStudentPayment.setGroupType(courseSchedules.get(i).getGroupType());
-					courseScheduleStudentPayment.setMusicGroupId(courseSchedules.get(i).getMusicGroupId());
-					courseScheduleStudentPayment.setCourseScheduleId(courseSchedules.get(i).getId());
-					courseScheduleStudentPayment.setClassGroupId(courseSchedules.get(i).getClassGroupId());
-
-					if (teachModeEnum == TeachModeEnum.ONLINE) {
-						//学生线上单节课应缴费计算
-						courseScheduleStudentPayment.setExpectPrice(
-								vipGroup.getOnlineClassesUnitPrice().multiply(discount)
-										.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
-					}else{
-						//学生线下单节课应缴费计算
-						courseScheduleStudentPayment.setExpectPrice(
-								vipGroup.getOfflineClassesUnitPrice().multiply(discount)
-										.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
-					}
-					courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(teachModeEnum)?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
-					courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
-					courseScheduleStudentPayments.add(courseScheduleStudentPayment);
-				}
-			}
 		}
 		return courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 	}

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

@@ -107,14 +107,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     @Override
     public void createCourseScheduleTeacherVipSalary(VipGroup vipGroup,
                                                      List<CourseSchedule> vipCourseSchedules,
-                                                     BigDecimal onlineTeacherSalary,
                                                      BigDecimal offlineTeacherSalary) {
-        //获取活动信息
-        VipGroupActivity vipGroupActivity = null;
-        if(vipGroup.getVipGroupActivityId() != null){
-            vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
-        }
-
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
         Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroupByTeachMode = vipCourseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
 
@@ -134,13 +127,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
                 courseScheduleTeacherSalary.setUserId(courseSchedules.get(i).getActualTeacherId().intValue());
                 courseScheduleTeacherSalary.setClassGroupId(courseSchedules.get(i).getClassGroupId());
-//                courseScheduleTeacherSalary.setSubsidy(subsidy);
-
-                if (teachModeEnum == TeachModeEnum.ONLINE) {
-                    courseScheduleTeacherSalary.setExpectSalary(onlineTeacherSalary);
-                } else {
-                    courseScheduleTeacherSalary.setExpectSalary(offlineTeacherSalary);
-                }
+                courseScheduleTeacherSalary.setExpectSalary(offlineTeacherSalary);
                 courseScheduleTeacherSalary.setActualSalary(null);
                 if (Objects.isNull(courseScheduleTeacherSalary.getId())) {
                     courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
@@ -936,33 +923,19 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public void updateVipGroupCourseTeacherSalary(Integer vipGroupId, Integer oldTeacherId) {
         VipGroup vipGroup = vipGroupService.get(vipGroupId.longValue());
-
-        BigDecimal onlineTeacherSalary=BigDecimal.ZERO,
-                offlineTeacherSalary=BigDecimal.ZERO;
+        BigDecimal offlineTeacherSalary=BigDecimal.ZERO;
 
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByGroupWithNotStart(vipGroupId.toString(), GroupType.VIP.getCode());
         if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)){
-            List<Long> courseIds = courseScheduleTeacherSalaries.stream().map(CourseScheduleTeacherSalary::getCourseScheduleId).collect(Collectors.toList());
-            List<Map<Integer, String>> teachModeById = courseScheduleDao.getTeachModeById(courseIds);
-            Map<Integer, String> coureTeachModeMap = MapUtil.convertIntegerMap(teachModeById);
             for(int i=0;i<courseScheduleTeacherSalaries.size();i++){
                 if(!courseScheduleTeacherSalaries.get(i).getEnableChangeSalary()){
                     continue;
                 }
-                String courseType = coureTeachModeMap.get(courseScheduleTeacherSalaries.get(i).getCourseScheduleId());
-
                 Map<String, BigDecimal> salary = vipGroupService.countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), courseScheduleTeacherSalaries.get(i).getCourseScheduleId());
-
                 if(Objects.nonNull(salary)){
-                    onlineTeacherSalary=salary.get("onlineTeacherSalary");
                     offlineTeacherSalary=salary.get("offlineTeacherSalary");
                 }
-
-                if(courseType.equals(TeachModeEnum.ONLINE.getCode())){
-                    courseScheduleTeacherSalaries.get(i).setExpectSalary(onlineTeacherSalary);
-                }else if(courseType.equals(TeachModeEnum.OFFLINE.getCode())){
-                    courseScheduleTeacherSalaries.get(i).setExpectSalary(offlineTeacherSalary);
-                }
+                courseScheduleTeacherSalaries.get(i).setExpectSalary(offlineTeacherSalary);
             }
             courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(courseScheduleTeacherSalaries);
         }
@@ -1432,7 +1405,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         VipGroup vipGroup = vipGroupService.get(Long.valueOf(courseSchedule.getMusicGroupId()));
         for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
             Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, courseSchedule.getActualTeacherId(), courseSchedule.getId());
-            courseScheduleTeacherSalary.setExpectSalary(courseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary"));
+            courseScheduleTeacherSalary.setExpectSalary(salaryMap.get("offlineTeacherSalary"));
         }
     }
 

+ 13 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -3704,11 +3704,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(order.getMusicGroupId()));
         ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(order.getMusicGroupId(), GroupType.PRACTICE.getCode());
         if (order.getStatus().equals(DealStatusEnum.SUCCESS)) {
-            Integer activityUserMapperId = studentPaymentOrderService.activityGive(practiceGroup.getVipGroupActivityId(),
-                    order.getUserId(),
-                    order.getId(),
+            Integer activityUserMapperId = studentPaymentOrderService.activityGive(practiceGroup.getVipGroupActivityId(),order,
                     null,
-                    practiceGroup.getId(),order.getActivityBuyNum(),order.getOrganId(),practiceGroup.getUserId());
+                    practiceGroup.getId(),practiceGroup.getUserId());
             practiceGroup.setActivityUserMapperId(activityUserMapperId);
             if(classGroup.getDelFlag() == 1){
                 updatePracticeGroupStudentNumAndStatus(practiceGroup, classGroup,order);
@@ -4738,6 +4736,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         TeacherDefaultPracticeGroupSalary teacherDefaultPracticeGroupSalary = teacherDefaultPracticeGroupSalaryDao.findByTeacherAndCourseMinutes(teacherId,practiceCourseMinutes);
 
         BigDecimal teacherDefaultSalary = BigDecimal.ZERO;
+        BigDecimal giveTeacherDefaultSalary = BigDecimal.ZERO;
         if(Objects.isNull(teacherDefaultPracticeGroupSalary)){
             throw new BizException("请设置老师课酬");
         }
@@ -4755,6 +4754,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
         //课程购买费用计算
         VipGroupSalarySettlementTypeDto salarySettlement = null;
+        VipGroupSalarySettlementTypeDto givePracticeSalarySettlement = null;
         if(practice.getVipGroupActivityId() != null){
             VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(practice.getVipGroupActivityId());
             VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
@@ -4762,18 +4762,26 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 throw new BizException("课酬结算方案错误");
             }
             salarySettlement = vipGroupSalarySettlementDto.getPracticeSalarySettlement();
+            givePracticeSalarySettlement = vipGroupSalarySettlementDto.getGivePracticeSalarySettlement();
             totalPrice = totalPrice.multiply(vipGroupActivity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
         }
         //教师课酬线上单课酬计算
         teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
+        giveTeacherDefaultSalary = teacherDefaultSalary;
         if(Objects.nonNull(salarySettlement)){
             if(salarySettlement.getSalarySettlementType() == SalarySettlementTypeEnum.FIXED_SALARY){
                 teacherDefaultSalary = salarySettlement.getSettlementValue();
             }
         }
+        if(Objects.nonNull(givePracticeSalarySettlement)){
+            if(givePracticeSalarySettlement.getSalarySettlementType() == SalarySettlementTypeEnum.FIXED_SALARY){
+                giveTeacherDefaultSalary = givePracticeSalarySettlement.getSettlementValue();
+            }
+        }
 
         results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
         results.put("onlineTeacherSalary",teacherDefaultSalary.setScale(2, BigDecimal.ROUND_HALF_UP));
+        results.put("giveTeacherDefaultSalary",giveTeacherDefaultSalary.setScale(2, BigDecimal.ROUND_HALF_UP));
         return results;
     }
 
@@ -5112,11 +5120,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         //计算课程相关费用信息
         Map<String, BigDecimal> costInfo = countPracticeGroupPredictFee(applyBaseInfo,applyBaseInfo.getUserId());
         if(practice.getGiveFlag()){
-            applyBaseInfo.setOnlineTeacherSalary(costInfo.get("giveOnlineTeacherSalary"));
+            applyBaseInfo.setOnlineTeacherSalary(costInfo.get("giveTeacherDefaultSalary"));
         }else {
             applyBaseInfo.setOnlineTeacherSalary(costInfo.get("onlineTeacherSalary"));
         }
-        practiceGroupDao.update(applyBaseInfo);
 
         //创建班级老师关联记录
         ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();

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

@@ -121,8 +121,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-	public Map createOrder(StudentPaymentOrder studentPaymentOrder, List<StudentPaymentOrderDetail> details, String payReceiver)
-			throws Exception {
+	public Map createOrder(StudentPaymentOrder studentPaymentOrder, List<StudentPaymentOrderDetail> details, String payReceiver) throws Exception {
 
     	BigDecimal cashAmount = studentPaymentOrder.getActualAmount();
     	BigDecimal expectAmount = studentPaymentOrder.getExpectAmount();
@@ -718,16 +717,17 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Integer activityGive(Integer vipGroupActivityId, Integer userId, Long paymentOrderId,Long vipGroupId,Long practiceGroupId,Integer buyNum,Integer organId,Integer teacherId) {
+    public Integer activityGive(Integer vipGroupActivityId, StudentPaymentOrder studentPaymentOrder, Long vipGroupId, Long practiceGroupId, Integer teacherId) {
         Integer activityUserMapperId = null;
         if(vipGroupActivityId != null){
             ActivityUserMapper activityUserMapper = new ActivityUserMapper();
             activityUserMapper.setVipGroupId(vipGroupId);
             activityUserMapper.setPracticeGroupId(practiceGroupId);
-            activityUserMapper.setPaymentOrderId(paymentOrderId);
-            activityUserMapper.setUserId(userId);
+            activityUserMapper.setPaymentOrderId(studentPaymentOrder.getId());
+            activityUserMapper.setUserId(studentPaymentOrder.getUserId());
             activityUserMapper.setActivityId(vipGroupActivityId);
             activityUserMapper.setTeacherId(teacherId);
+            activityUserMapper.setActualPrice(studentPaymentOrder.getExpectAmount().subtract(studentPaymentOrder.getCouponRemitFee()));
             if(vipGroupId != null){
                 activityUserMapper.setVipFlag(2);
             }else {
@@ -735,7 +735,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             }
             //是否达到满赠标准
             VipGroupActivity activity = vipGroupActivityDao.get(vipGroupActivityId);
-            if(activity.getFullMinusCourseTimes() == -1 || buyNum < activity.getFullMinusCourseTimes()){
+            if(activity.getFullMinusCourseTimes() == -1 || studentPaymentOrder.getActivityBuyNum() < activity.getFullMinusCourseTimes()){
                 activityUserMapperDao.insert(activityUserMapper);
                 return activityUserMapper.getId();
             }
@@ -755,12 +755,12 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                 cloudTeacherOrder.setStatus(2);
                 cloudTeacherOrder.setUpdateTime(now);
                 cloudTeacherOrder.setAmount(BigDecimal.ZERO);
-                cloudTeacherOrder.setOrderId(paymentOrderId);
+                cloudTeacherOrder.setOrderId(studentPaymentOrder.getId());
                 cloudTeacherOrder.setRemark("购买vip活动赠送会员");
                 cloudTeacherOrder.setLevel(activity.getGiveMemberRankId());
-                cloudTeacherOrder.setStudentId(userId);
+                cloudTeacherOrder.setStudentId(studentPaymentOrder.getUserId());
                 cloudTeacherOrder.setType(2);
-                cloudTeacherOrder.setOrganId(organId);
+                cloudTeacherOrder.setOrganId(studentPaymentOrder.getOrganId());
                 PeriodEnum periodEnum = activity.getGivePeriodEnum();
                 switch (periodEnum){
                     case DAY:
@@ -777,7 +777,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                     default:
                         throw new BizException("不支持的周期类型");
                 }
-                Student student = studentService.get(userId);
+                Student student = studentService.get(studentPaymentOrder.getUserId());
                 Date startDate = now;
                 if (student.getMemberRankSettingId() == null || now.after(student.getMembershipEndTime())) {
                     cloudTeacherOrder.setStartTime(now);

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

@@ -79,13 +79,6 @@ public class TeacherDefaultPracticeGroupSalaryServiceImpl extends BaseServiceImp
 				
 				if (updateTeacherSalaryList != null && updateTeacherSalaryList.size() > 0) {
 
-					Set<Long> groupIds = updateTeacherSalaryList.stream().map(c -> Long.valueOf(c.getMusicGroupId())).collect(Collectors.toSet());
-					List<PracticeGroup> practiceGroups = practiceGroupDao.getWithIds(new ArrayList<>(groupIds));
-					Map<Long, PracticeGroup> idGroupMap = new HashMap<>();
-					if(!CollectionUtils.isEmpty(practiceGroups)){
-						idGroupMap = practiceGroups.stream().collect(Collectors.toMap(PracticeGroup::getId, p->p, (p1, p2)->p1));
-					}
-
 					SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
 					BigDecimal freeTeacherSalary = new BigDecimal(practiceCourseSalaryConfig.getParanValue());
 

+ 5 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java

@@ -64,7 +64,6 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 		if (Objects.isNull(byTeacherAndCategory)) {
 			byTeacherAndCategory = new TeacherDefaultVipGroupSalary();
 			byTeacherAndCategory.setOfflineClassesSalary(new BigDecimal(0));
-			byTeacherAndCategory.setOnlineClassesSalary(new BigDecimal(0));
 		}
 		return byTeacherAndCategory;
 	}
@@ -102,9 +101,9 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 						|| oldMS.getOnlineClassesSalary() == null || oldMS.getOnlineClassesSalary().doubleValue() != ms.getOnlineClassesSalary().doubleValue()) {
 					salaryMap.put(ms.getVipGroupCategoryId(), ms);
 				}*/
-				if(teacher.getJobNature() == JobNatureEnum.FULL_TIME){
-					ms.setOnlineClassesSalary(new BigDecimal(0));
-				}
+//				if(teacher.getJobNature() == JobNatureEnum.FULL_TIME){
+//					ms.setOnlineClassesSalary(new BigDecimal(0));
+//				}
 				salaryMap.put(ms.getVipGroupCategoryId(), ms);
 			}
 
@@ -167,17 +166,8 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 							TeacherDefaultVipGroupSalary tdms = salaryMap.get(vipGroup.getVipGroupCategoryId());
 							TeacherDefaultVipGroupSalary origTdms = map.get(vipGroup.getVipGroupCategoryId());
 							if (tdms != null && origTdms != null) {
-								Map<String, BigDecimal> teachModeSalaryMap = new HashMap<>();
-//								if(vipGroupCategory.getMusicTheory()){
-									teachModeSalaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
-//								}else{
-//									teachModeSalaryMap = vipGroupService.countVipGroupCoursePredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
-//								}
-								if(TeachModeEnum.ONLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("onlineTeacherSalary")){
-									ts.setExpectSalary(teachModeSalaryMap.get("onlineTeacherSalary"));
-								}else if(TeachModeEnum.OFFLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("offlineTeacherSalary")){
-									ts.setExpectSalary(teachModeSalaryMap.get("offlineTeacherSalary"));
-								}
+								Map<String, BigDecimal> teachModeSalaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
+								ts.setExpectSalary(teachModeSalaryMap.get("offlineTeacherSalary"));
 								list.add(ts);
 							}
 						}

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

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.ActivityApplyStudentTypeDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.VipGroupActivityDao;
@@ -12,7 +11,6 @@ import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
-import com.ym.mec.biz.event.source.EntityChangeEventSource;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -26,8 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 import java.util.stream.Collectors;
 
-import static com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum.TEACHER_DEFAULT;
-
 @Service
 public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGroupActivity>  implements VipGroupActivityService {
 	
@@ -69,9 +65,7 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 		}
 		VipGroupSalarySettlementDto vipGroupSalarySettlement = vipGroupActivityAddDto.getVipGroupSalarySettlement();
 		if(vipGroupSalarySettlement != null){
-			checkSettlement(vipGroupSalarySettlement.getVipOnlineSalarySettlement());
 			checkSettlement(vipGroupSalarySettlement.getVipOfflineSalarySettlement());
-			checkSettlement(vipGroupSalarySettlement.getGiveVipOnlineSalarySettlement());
 			checkSettlement(vipGroupSalarySettlement.getGiveVipOfflineSalarySettlement());
 			checkSettlement(vipGroupSalarySettlement.getPracticeSalarySettlement());
 			checkSettlement(vipGroupSalarySettlement.getGivePracticeSalarySettlement());
@@ -132,9 +126,7 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 		}else {
 			VipGroupSalarySettlementDto vipGroupSalarySettlement = vipGroupActivityAddDto.getVipGroupSalarySettlement();
 			if(vipGroupSalarySettlement != null){
-				checkSettlement(vipGroupSalarySettlement.getVipOnlineSalarySettlement());
 				checkSettlement(vipGroupSalarySettlement.getVipOfflineSalarySettlement());
-				checkSettlement(vipGroupSalarySettlement.getGiveVipOnlineSalarySettlement());
 				checkSettlement(vipGroupSalarySettlement.getGiveVipOfflineSalarySettlement());
 				checkSettlement(vipGroupSalarySettlement.getPracticeSalarySettlement());
 				checkSettlement(vipGroupSalarySettlement.getGivePracticeSalarySettlement());
@@ -173,8 +165,8 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 	}
 
     @Override
-    public List<WaitCourseActivityDto> queryWaitCourseActivity(Integer teacherId) {
-		return vipGroupActivityDao.queryWaitCourseActivity(teacherId);
+    public List<WaitCourseActivityDto> queryWaitCourseActivity(Integer teacherId,String organId) {
+		return vipGroupActivityDao.queryWaitCourseActivity(teacherId,organId);
     }
 
     @Override

文件差異過大導致無法顯示
+ 378 - 382
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java


+ 8 - 2
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -25,6 +25,7 @@
 		<result column="practice_group_id_" property="practiceGroupId" />
 		<result column="give_practice_group_id_" property="givePracticeGroupId" />
 		<result column="return_fee_" property="returnFee" />
+		<result column="actual_price_" property="actualPrice" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -43,10 +44,12 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapper" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO activity_user_mapper (activity_id_,user_id_,vip_flag_,give_vip_flag_,
 		                                  practice_flag_,give_practice_flag_,member_flag_,give_member_flag_,create_time_,update_time_,payment_order_id_,
-										  vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_,return_fee_,member_order_id_,give_member_order_id_,teacher_id_)
+										  vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_,return_fee_,
+		                                  member_order_id_,give_member_order_id_,teacher_id_,actual_price_)
 		                                  VALUES(#{activityId},#{userId},#{vipFlag},#{giveVipFlag},#{practiceFlag},
 		                                         #{givePracticeFlag},#{memberFlag},#{giveMemberFlag},NOW(),NOW(),#{paymentOrderId},#{vipGroupId},
-		                                         #{giveVipGroupId},#{practiceGroupId},#{givePracticeGroupId},#{returnFee},#{memberOrderId},#{giveMemberOrderId},#{teacherId})
+		                                         #{giveVipGroupId},#{practiceGroupId},#{givePracticeGroupId},#{returnFee},
+		                                         #{memberOrderId},#{giveMemberOrderId},#{teacherId},#{actualPrice})
 	</insert>
     <insert id="batchInsert">
 		INSERT INTO activity_user_mapper (activity_id_,user_id_,vip_flag_,give_vip_flag_,
@@ -64,6 +67,9 @@
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapper">
 		UPDATE activity_user_mapper
 		<set>
+			<if test="actualPrice != null">
+				actual_price_ = #{actualPrice},
+			</if>
 			<if test="teacherId != null">
 				teacher_id_ = #{teacherId},
 			</if>

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

@@ -182,7 +182,7 @@
         FROM cloud_teacher_order
         WHERE student_id_ = #{studentId}
         <if test="musicGroupId != null and musicGroupId != ''">
-            music_group_id_ = #{musicGroupId}
+          AND music_group_id_ = #{musicGroupId}
         </if>
           AND status_ IN (1, 2)
     </select>

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

@@ -614,7 +614,8 @@
 		SELECT ts.*,cs.type_,cs.teach_mode_,cs.class_date_,cs.start_class_time_,cs.end_class_time_
 		FROM course_schedule_teacher_salary ts
 		LEFT JOIN course_schedule cs ON ts.course_schedule_id_ = cs.id_
-		WHERE FIND_IN_SET(cs.type_, #{typeList}) AND ts.user_id_ = #{userId} AND ts.settlement_time_ IS NULL AND cs.class_date_ &gt;= #{startClassDate} AND cs.pre_course_flag_ = 0
+		WHERE FIND_IN_SET(cs.type_, #{typeList}) AND ts.user_id_ = #{userId} AND ts.settlement_time_ IS NULL
+		AND cs.class_date_ &gt;= #{startClassDate} AND cs.pre_course_flag_ = 0
 	</select>
     <select id="findByTeacher" resultMap="CourseScheduleTeacherSalary">
 		SELECT

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

@@ -1029,4 +1029,9 @@
         WHERE spo.type_ = 'APPLY' AND spo.status_ = 'SUCCESS' AND spo.music_group_id_ = #{musicGroupId}
         AND spo.user_id_ = #{studentId} AND spod.type_ = 'MUSICAL'
     </select>
+    <select id="queryStudentCourseAmountMap" resultType="java.util.Map">
+        SELECT user_id_ 'key',expect_amount_ - coupon_remit_fee_ 'value' FROM student_payment_order
+        WHERE status_ = 'SUCCESS' AND music_group_id_ = #{vipGroupId}
+        GROUP BY user_id_
+    </select>
 </mapper>

+ 4 - 8
mec-biz/src/main/resources/config/mybatis/TeacherDefaultVipGroupSalaryMapper.xml

@@ -12,7 +12,6 @@
         <result column="vip_group_category_id_" property="vipGroupCategoryId"/>
         <result column="vip_group_category_name_" property="vipGroupCategoryName"/>
         <result column="music_theory_" property="musicTheory"/>
-        <result column="online_classes_salary_" property="onlineClassesSalary"/>
         <result column="offline_classes_salary_" property="offlineClassesSalary"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
@@ -32,14 +31,14 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO teacher_default_vip_group_salary
-        (user_id_,vip_group_category_id_,online_classes_salary_,offline_classes_salary_,create_time_,update_time_)
-        VALUES(#{userId},#{vipGroupCategoryId},#{onlineClassesSalary},#{offlineClassesSalary},now(),now())
+        (user_id_,vip_group_category_id_,offline_classes_salary_,create_time_,update_time_)
+        VALUES(#{userId},#{vipGroupCategoryId},#{offlineClassesSalary},now(),now())
     </insert>
     <insert id="batchAdd">
         INSERT INTO teacher_default_vip_group_salary
-        (user_id_,vip_group_category_id_,online_classes_salary_,offline_classes_salary_,create_time_,update_time_)VALUES
+        (user_id_,vip_group_category_id_,offline_classes_salary_,create_time_,update_time_)VALUES
         <foreach collection="vipGroupSalaries" item="item" separator=",">
-            (#{item.userId},#{item.vipGroupCategoryId},#{item.onlineClassesSalary},#{item.offlineClassesSalary},now(),now())
+            (#{item.userId},#{item.vipGroupCategoryId},#{item.offlineClassesSalary},now(),now())
         </foreach>
     </insert>
 
@@ -50,9 +49,6 @@
             <if test="userId != null">
                 user_id_ = #{userId},
             </if>
-            <if test="onlineClassesSalary != null">
-                online_classes_salary_ = #{onlineClassesSalary},
-            </if>
             <if test="updateTime != null">
                 update_time_ = NOW(),
             </if>

+ 18 - 5
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -280,8 +280,15 @@
 	<select id="queryWaitCourseActivity" resultMap="WaitCourseActivityDto">
 		SELECT aum.id_,aum.activity_id_,vga.name_ activity_name_,COUNT(DISTINCT aum.user_id_) student_num_ FROM activity_user_mapper aum
 		LEFT JOIN vip_group_activity vga ON aum.activity_id_ = vga.id_
-		WHERE aum.teacher_id_ = #{teacherId} AND (aum.vip_flag_ = 1 OR aum.practice_flag_ = 1 OR aum.give_vip_flag_ = 1 OR aum.give_practice_flag_ = 1)
-		GROUP BY aum.activity_id_,aum.user_id_
+		WHERE 1=1
+		<if test="teacherId != null">
+			AND aum.teacher_id_ = #{teacherId}
+		</if>
+		<if test="organId != null and organId != ''">
+			AND INTE_ARRAY(#{organId},vga.organ_id_)
+		</if>
+		AND (aum.vip_flag_ = 1 OR aum.practice_flag_ = 1 OR aum.give_vip_flag_ = 1 OR aum.give_practice_flag_ = 1)
+		GROUP BY aum.activity_id_
 	</select>
 	<resultMap id="ActivityWaitCourseStudentNumDto" type="com.ym.mec.biz.dal.dto.ActivityWaitCourseStudentNumDto">
 		<result property="vipNum" column="vip_num_"/>
@@ -303,8 +310,11 @@
 			  FROM activity_user_mapper
 			  WHERE activity_id_ = #{activityId}
 			  GROUP BY user_id_) aum
-		WHERE aum.activity_id_ = #{activityId} AND aum.teacher_id_ = #{userId}
-		GROUP BY aum.user_id_
+		WHERE aum.activity_id_ = #{activityId}
+		<if test="userId != null">
+			AND aum.teacher_id_ = #{userId}
+		</if>
+		GROUP BY aum.activity_id_
 	</select>
 	<select id="getActivityStudentCanCourseNum" resultMap="ActivityWaitCourseStudentNumDto">
 		SELECT COUNT(CASE WHEN aum.vip_flag_ = 1 THEN 1 ELSE NULL END) vip_num_,
@@ -314,7 +324,10 @@
 				su.username_,su.avatar_,aum.user_id_,su.phone_
 		FROM activity_user_mapper aum
 		LEFT JOIN sys_user su ON su.id_ = aum.user_id_
-		WHERE aum.activity_id_ = #{activityId} AND aum.teacher_id_ = #{userId}
+		WHERE aum.activity_id_ = #{activityId}
+		<if test="userId != null">
+			AND aum.teacher_id_ = #{userId}
+		</if>
 		GROUP BY aum.user_id_
 	</select>
 </mapper>

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

@@ -40,7 +40,7 @@
 	<select id="findTeacherDefaultSalary" resultMap="VipGroupCategory">
 		SELECT
 			vgc.*,
-			tdvgs.online_classes_salary_ online_classes_unit_price_,
+			tdvgs.offline_classes_salary_ online_classes_unit_price_,
 			tdvgs.offline_classes_salary_ offline_classes_unit_price_
 		FROM
 			vip_group_category vgc

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

@@ -358,7 +358,6 @@
             AND status_='SUCCESS') = 0
             AND IF(vg.student_id_list_ IS NULL, vg.organ_id_ = #{organId}, FIND_IN_SET(#{userId},
             vg.student_id_list_))
-            AND vgc.music_theory_ = 0
             <if test="subjectId!=null">
                 AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
             </if>

+ 2 - 15
mec-education/src/main/java/com/ym/mec/education/entity/TeacherDefaultVipGroupSalary.java

@@ -31,11 +31,8 @@ public class TeacherDefaultVipGroupSalary extends Model<TeacherDefaultVipGroupSa
      */
     @TableField("vip_group_category_id_")
     private String vipGroupCategoryId;
-    /**
-     * 线上课薪酬
-     */
-    @TableField("online_classes_salary_")
-    private BigDecimal onlineClassesSalary;
+//    @TableField("online_classes_salary_")
+//    private BigDecimal onlineClassesSalary;
     /**
      * 线下课薪酬
      */
@@ -74,15 +71,6 @@ public class TeacherDefaultVipGroupSalary extends Model<TeacherDefaultVipGroupSa
         return this;
     }
 
-    public BigDecimal getOnlineClassesSalary() {
-        return onlineClassesSalary;
-    }
-
-    public TeacherDefaultVipGroupSalary setOnlineClassesSalary(BigDecimal onlineClassesSalary) {
-        this.onlineClassesSalary = onlineClassesSalary;
-        return this;
-    }
-
     public BigDecimal getOfflineClassesSalary() {
         return offlineClassesSalary;
     }
@@ -121,7 +109,6 @@ public class TeacherDefaultVipGroupSalary extends Model<TeacherDefaultVipGroupSa
         ", id=" + id +
         ", userId=" + userId +
         ", vipGroupCategoryId=" + vipGroupCategoryId +
-        ", onlineClassesSalary=" + onlineClassesSalary +
         ", offlineClassesSalary=" + offlineClassesSalary +
         ", createTime=" + createTime +
         ", updateTime=" + updateTime +

+ 5 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -102,6 +102,11 @@ public class StudentVipGroupController extends BaseController {
     @PostMapping("/buyVipGroup")
     @AuditLogAnnotation(operateName = "vip课购买")
     public Object buyVipGroup(VipGroupBuyParamsDto vipGroupBuyParams) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (null == sysUser) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        vipGroupBuyParams.setUserId(sysUser.getId());
         return vipGroupService.buyVipGroup(vipGroupBuyParams);
     }
 

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

@@ -49,7 +49,7 @@ public class TeacherVipGroupController extends BaseController {
 	@Autowired
 	private VipGroupDefaultClassesUnitPriceDao vipGroupDefaultClassesUnitPriceDao;
 
-	@ApiOperation("vip课申请")
+	@ApiOperation("老师端vip课申请")
 	@PostMapping("/vipGroupApply")
 	@AuditLogAnnotation(operateName = "vip课申请")
 	public Object vipGroupApply(@RequestBody VipGroupApplyDto vipGroupApplyDto) {
@@ -72,7 +72,7 @@ public class TeacherVipGroupController extends BaseController {
 		return vipGroupService.createVipGroup(vipGroupApplyDto);
 	}
 
-	@ApiOperation("vip课申请-双11")
+	@ApiOperation("vip双11排课")
 	@PostMapping("/vipGroupApplyForDouble11")
 	@Transactional(rollbackFor = Exception.class)
 	public Object vipGroupApplyForDouble11(@RequestBody VipGroupApplyDto vipGroupApplyDto) {
@@ -131,7 +131,7 @@ public class TeacherVipGroupController extends BaseController {
 			}
 		}
 
-		HttpResponseResult result = vipGroupService.createVipGroup(vipGroupApplyDto);
+		HttpResponseResult result = vipGroupService.createVipGroup1(vipGroupApplyDto);
 		if(result.getCode()==200){
 			vipGroupService.addVipGroupStudents(vipGroupApplyDto.getVipGroupApplyBaseInfo().getId(), studentIds, new HashMap<>());
 		}

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

@@ -51,7 +51,7 @@ public class VipGroupActivityController extends BaseController {
         if(sysUser == null){
             return failed("用户信息获取失败");
         }
-        return succeed(vipGroupActivityService.queryWaitCourseActivity(sysUser.getId()));
+        return succeed(vipGroupActivityService.queryWaitCourseActivity(sysUser.getId(),null));
     }
 
     @ApiOperation(value = "获取活动待排课学员数量")

+ 0 - 6
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.biz.service.VipGroupCategoryService;
 import com.ym.mec.common.controller.BaseController;
@@ -23,10 +21,6 @@ public class VipGroupCategoryController extends BaseController {
 
 	@Autowired
 	private VipGroupCategoryService vipGroupCategoryService;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-	@Autowired
-	private EmployeeDao employeeDao;
 
 	@ApiOperation("单查询")
 	@GetMapping(value = "/query")

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

@@ -60,10 +60,8 @@ public class VipGroupManageController extends BaseController {
     private ImUserFriendService imUserFriendService;
     @Autowired
     private ImGroupService imGroupService;
-
     @Autowired
     private StudentApplyRefundsService studentApplyRefundsService;
-    
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
@@ -72,8 +70,6 @@ public class VipGroupManageController extends BaseController {
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     @Autowired
     private CourseScheduleDao courseScheduleDao;
-    @Autowired
-    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 
     @GetMapping("/teacherSalarySettlement")
     public Object teacherSalarySettlement(){
@@ -138,7 +134,7 @@ public class VipGroupManageController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "vip课申请")
+    @ApiOperation(value = "管理端vip课申请")
     @PostMapping("/vipGroupApply")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/vipGroupApply')")
     public Object vipGroupApply(@RequestBody VipGroupApplyDto vipGroupApplyDto){
@@ -152,12 +148,6 @@ public class VipGroupManageController extends BaseController {
             return failed("请指定指导老师!");
         }
         if(Objects.isNull(vipGroupApplyDto.getVipGroupApplyBaseInfo().getOrganId())){
-//            Employee employee = employeeDao.get(sysUser.getId());
-//            if(StringUtils.isEmpty(employee.getOrganIdList()) || employee.getOrganIdList().contains(",")){
-//                vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganId(teacher.getTeacherOrganId());
-//            }else {
-//                vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganId(Integer.parseInt(employee.getOrganIdList()));
-//            }
             Integer firstStudentId = vipGroupApplyDto.getVipGroupApplyBaseInfo().getFirstStudentId();
             SysUser student = teacherDao.getUser(firstStudentId);
             if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){

+ 113 - 12
mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

@@ -1,26 +1,22 @@
 package com.ym.mec.web.controller.education;
 
 
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dto.LuckStatisDto;
-import com.ym.mec.biz.dal.dto.OrderStatisDto;
-import com.ym.mec.biz.dal.dto.OrganMaxAmountDto;
-import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+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.page.CloudTeacherActiveQueryInfo;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -41,6 +37,111 @@ public class ActivityController extends BaseController {
     private OrganizationService organizationService;
     @Autowired
     private StudentService studentService;
+    @Autowired
+    private VipGroupActivityService vipGroupActivityService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
+    @Autowired
+    private TeacherDao teacherDao;
+    @Autowired
+    private VipGroupDefaultClassesUnitPriceDao vipGroupDefaultClassesUnitPriceDao;
+    @Autowired
+    private VipGroupService vipGroupService;
+    @Autowired
+    private PracticeGroupService practiceGroupService;
+
+    @ApiOperation(value = "获取待排课的活动方案列表")
+    @RequestMapping("/queryWaitCourseActivity")
+    public Object queryWaitCourseActivity(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        Employee employee = employeeDao.get(sysUser.getId());
+        return succeed(vipGroupActivityService.queryWaitCourseActivity(null,employee.getOrganIdList()));
+    }
+
+    @ApiOperation(value = "获取活动待排课学员数量")
+    @RequestMapping("/getActivityWaitCourseStudentNum")
+    public Object getActivityWaitCourseStudentNum(Integer activityId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            return failed("用户信息获取失败");
+        }
+        return succeed(vipGroupActivityService.getActivityWaitCourseStudentNum(null,activityId));
+    }
+
+    @ApiOperation(value = "获取活动学员课排课次数")
+    @RequestMapping("/getActivityStudentCanCourseNum")
+    public Object getActivityStudentCanCourseNum(Integer activityId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            return failed("用户信息获取失败");
+        }
+        return succeed(vipGroupActivityService.getActivityStudentCanCourseNum(null,activityId));
+    }
+
+
+    @ApiOperation(value = "管理端活动排课")
+    @PostMapping("/createVipGroup")
+    public Object createVipGroup(@RequestBody VipGroupApplyDto vipGroupApplyDto){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        VipGroupApplyBaseInfoDto applyBaseInfo = vipGroupApplyDto.getVipGroupApplyBaseInfo();
+        Integer userId = sysUser.getId();
+        applyBaseInfo.setUserId(userId);
+        Teacher teacher = teacherDao.get(userId);
+        if(Objects.isNull(teacher)){
+            return failed("请指定指导老师!");
+        }
+        Integer firstStudentId = applyBaseInfo.getFirstStudentId();
+        SysUser student = teacherDao.getUser(firstStudentId);
+        if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
+            return failed("学员信息异常");
+        }
+        applyBaseInfo.setOrganId(student.getOrganId());
+        for (CourseSchedule courseSchedule : vipGroupApplyDto.getCourseSchedules()) {
+            courseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(), applyBaseInfo.getSingleClassMinutes()));
+        }
+        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(applyBaseInfo.getVipGroupCategoryId(), applyBaseInfo.getOrganId());
+        if(Objects.nonNull(vipGroupDefaultClassesUnitPrice)){
+            applyBaseInfo.setOnlineClassesUnitPrice(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice());
+            applyBaseInfo.setOfflineClassesUnitPrice(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
+        }
+
+        applyBaseInfo.setEducationalTeacherId(sysUser.getId());
+        return vipGroupService.createActivityVipGroup1(vipGroupApplyDto);
+    }
+
+    @ApiOperation(value = "管理端网管课活动排课")
+    @PostMapping("/createPracticeGroup")
+    public Object createPracticeGroup(@RequestBody PracticeGroupApplyDto practiceGroupApplyDto){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        PracticeGroupApplyBaseInfoDto applyBaseInfo = practiceGroupApplyDto.getPracticeGroupApplyBaseInfoDto();
+        Integer userId = sysUser.getId();
+        applyBaseInfo.setUserId(userId);
+        Teacher teacher = teacherDao.get(userId);
+        if(Objects.isNull(teacher)){
+            return failed("请指定指导老师!");
+        }
+        SysUser student = teacherDao.getUser(applyBaseInfo.getStudentId());
+        if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
+            return failed("学员信息异常");
+        }
+        applyBaseInfo.setOrganId(student.getOrganId());
+        for (CourseSchedule courseSchedule : practiceGroupApplyDto.getCourseSchedules()) {
+            courseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(), applyBaseInfo.getSingleClassMinutes()));
+        }
+        applyBaseInfo.setEducationalTeacherId(sysUser.getId());
+        return practiceGroupService.createActivityPracticeGroup(practiceGroupApplyDto);
+    }
 
     @ApiOperation(value = "分部双11活动统计")
     @GetMapping("/doubleEleven2020Statis")

部分文件因文件數量過多而無法顯示