Browse Source

活动排课

zouxuan 4 years ago
parent
commit
8606f1f631
19 changed files with 483 additions and 138 deletions
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ActivityUserMapperDao.java
  2. 0 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupSellPriceDao.java
  3. 114 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ActivityUserMapper.java
  4. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ActivityUserMapperService.java
  5. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java
  6. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  7. 15 15
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  8. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  9. 26 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  10. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  12. 185 98
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  13. 78 0
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  14. 1 1
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  15. 4 2
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  16. 1 2
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  17. 11 0
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  18. 0 3
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java
  19. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

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

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.biz.dal.entity.ActivityUserMapper;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface ActivityUserMapperDao extends BaseDAO<Integer, ActivityUserMapper> {
+
+	
+}

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

@@ -9,6 +9,4 @@ import com.ym.mec.common.dal.BaseDAO;
  */
 public interface PracticeGroupSellPriceDao extends BaseDAO<Integer, PracticeGroupSellPrice> {
 
-
-
 }

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

@@ -0,0 +1,114 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(activity_user_mapper):
+ */
+public class ActivityUserMapper {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer activityId;
+	
+	/**  */
+	private Integer userId;
+	
+	/** vip课排课标记0没有排课资格1未排课2已排课 */
+	private Integer vipFlag = 0;
+	
+	/**  */
+	private Integer giveVipFlag = 0;
+	
+	/**  */
+	private Integer practiceFlag = 0;
+	
+	/**  */
+	private Integer givePracticeFlag = 0;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setActivityId(Integer activityId){
+		this.activityId = activityId;
+	}
+	
+	public Integer getActivityId(){
+		return this.activityId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setVipFlag(Integer vipFlag){
+		this.vipFlag = vipFlag;
+	}
+	
+	public Integer getVipFlag(){
+		return this.vipFlag;
+	}
+			
+	public void setGiveVipFlag(Integer giveVipFlag){
+		this.giveVipFlag = giveVipFlag;
+	}
+	
+	public Integer getGiveVipFlag(){
+		return this.giveVipFlag;
+	}
+			
+	public void setPracticeFlag(Integer practiceFlag){
+		this.practiceFlag = practiceFlag;
+	}
+	
+	public Integer getPracticeFlag(){
+		return this.practiceFlag;
+	}
+			
+	public void setGivePracticeFlag(Integer givePracticeFlag){
+		this.givePracticeFlag = givePracticeFlag;
+	}
+	
+	public Integer getGivePracticeFlag(){
+		return this.givePracticeFlag;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.ActivityUserMapper;
+import com.ym.mec.common.service.BaseService;
+
+public interface ActivityUserMapperService extends BaseService<Integer, ActivityUserMapper> {
+
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.ActivityUserMapperDao;
+import com.ym.mec.biz.dal.entity.ActivityUserMapper;
+import com.ym.mec.biz.service.ActivityUserMapperService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, ActivityUserMapper>  implements ActivityUserMapperService {
+	
+	@Autowired
+	private ActivityUserMapperDao activityUserMapperDao;
+
+	@Override
+	public BaseDAO<Integer, ActivityUserMapper> getDAO() {
+		return activityUserMapperDao;
+	}
+	
+}

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

@@ -3755,7 +3755,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 						if (newCourseSchedule.getGroupType() == GroupType.MUSIC) {
 							courseScheduleTeacherSalaryService.createMusicGroupCourseTeacherSalary(null, newCourseSchedule, ts);
 						} else if (newCourseSchedule.getGroupType() == GroupType.VIP) {
-							Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, teacherId, ts.getCourseScheduleId());
+							Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, teacherId, ts.getCourseScheduleId());
 
 							BigDecimal teacherSalary=null;
 
@@ -3971,7 +3971,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
                     BigDecimal onlineTeacherSalary = new BigDecimal(0), offlineTeacherSalary = new BigDecimal(0);
 
-					Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(byCourseSchedule, newCourseSchedule.getActualTeacherId(), newCourseSchedule.getId());
+					Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(byCourseSchedule, newCourseSchedule.getActualTeacherId(), newCourseSchedule.getId());
 
                     List<CourseSchedule> courseSchedules = new ArrayList<>();
                     courseSchedules.add(newCourseSchedule);

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

@@ -84,9 +84,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 
 	@Override
 	public int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId, Integer userId) {
-		VipGroup vipGroupApplyBaseInfoDto=vipGroupDao.get(vipGroupId);
+		VipGroup vipGroup=vipGroupDao.get(vipGroupId);
 
-		if(Objects.isNull(vipGroupApplyBaseInfoDto)){
+		if(Objects.isNull(vipGroup)){
 			throw new BizException("未找到相关vip课程");
 		}
 
@@ -96,7 +96,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		}
 
 		//获取活动信息
-		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroupApplyBaseInfoDto.getVipGroupActivityId().intValue());
+		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
 
 		List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findGroupCourseSchedules(vipGroupId.toString(),GroupType.VIP.getCode());
 
@@ -105,11 +105,11 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		}
 
 		int giveClassTimes=0;
-        if(vipGroupApplyBaseInfoDto.getStatus().equals(VipGroupStatusEnum.APPLYING)
+        if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)
                 &&Objects.nonNull(vipGroupActivity)
                 &&vipGroupActivity.getType().equals(VipGroupActivityTypeEnum.GIVE_CLASS)
-                &&vipGroupCourseSchedules.size()>=Integer.parseInt(vipGroupActivity.getAttribute1())){
-            giveClassTimes=Integer.parseInt(vipGroupActivity.getAttribute2());
+                &&vipGroupCourseSchedules.size() >= Integer.parseInt(vipGroupActivity.getAttribute1())){
+            giveClassTimes = Integer.parseInt(vipGroupActivity.getAttribute2());
         }
 
 		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDaop.findByStudentVipGroup(vipGroupId, userId, DealStatusEnum.SUCCESS.getCode());
@@ -118,7 +118,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			couponFee = studentPaymentOrder.getCouponRemitFee().divide(new BigDecimal(vipGroupCourseSchedules.size()-giveClassTimes), CommonConstants.DECIMAL_PLACE);
 		}
 
-		List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
+		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)
@@ -137,22 +137,22 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 					//学生线上单节课应缴费计算
 					switch (vipGroupActivity.getType()) {
 						case BASE_ACTIVITY:
-							courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().subtract(couponFee));
+							courseScheduleStudentPayment.setExpectPrice(vipGroup.getOnlineClassesUnitPrice().subtract(couponFee));
 							break;
 						case DISCOUNT:
 							courseScheduleStudentPayment.setExpectPrice(
-									vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().multiply(
+									vipGroup.getOnlineClassesUnitPrice().multiply(
 											new BigDecimal(vipGroupActivity.getAttribute1()))
 											.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP)
 											.subtract(couponFee)
 							);
 							break;
 						case GIVE_CLASS:
-							if (vipGroupApplyBaseInfoDto.getGiveTeachMode() == teachModeEnum
+							if (vipGroup.getGiveTeachMode() == teachModeEnum
 									&& i >= (courseSchedules.size()-giveClassTimes)) {
 								courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
 							} else {
-								courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().subtract(couponFee));
+								courseScheduleStudentPayment.setExpectPrice(vipGroup.getOnlineClassesUnitPrice().subtract(couponFee));
 							}
 							break;
 						default:
@@ -162,22 +162,22 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 					//学生线下单节课应缴费计算
 					switch (vipGroupActivity.getType()) {
 						case BASE_ACTIVITY:
-							courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().subtract(couponFee));
+							courseScheduleStudentPayment.setExpectPrice(vipGroup.getOfflineClassesUnitPrice().subtract(couponFee));
 							break;
 						case DISCOUNT:
 							courseScheduleStudentPayment.setExpectPrice(
-									vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().multiply(
+									vipGroup.getOfflineClassesUnitPrice().multiply(
 											new BigDecimal(vipGroupActivity.getAttribute1()))
 											.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP)
 											.subtract(couponFee)
 							);
 							break;
 						case GIVE_CLASS:
-							if (vipGroupApplyBaseInfoDto.getGiveTeachMode() == teachModeEnum
+							if (vipGroup.getGiveTeachMode() == teachModeEnum
                                     && i >= (courseSchedules.size()-giveClassTimes)) {
 								courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
 							} else {
-								courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().subtract(couponFee));
+								courseScheduleStudentPayment.setExpectPrice(vipGroup.getOfflineClassesUnitPrice().subtract(couponFee));
 							}
 							break;
 						default:

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

@@ -930,7 +930,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 }
                 String courseType = coureTeachModeMap.get(courseScheduleTeacherSalaries.get(i).getCourseScheduleId());
 
-                Map<String, BigDecimal> salary = vipGroupService.countVipGroupPredictFee(vipGroup, vipGroup.getUserId(), 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");
@@ -1410,7 +1410,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     private void createVipGroupCourseTeacherSalaries(CourseSchedule courseSchedule, List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries){
         VipGroup vipGroup = vipGroupService.get(Long.valueOf(courseSchedule.getMusicGroupId()));
         for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
-            Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, courseSchedule.getActualTeacherId(), courseSchedule.getId());
+            Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, courseSchedule.getActualTeacherId(), courseSchedule.getId());
             courseScheduleTeacherSalary.setExpectSalary(courseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary"));
         }
     }

+ 26 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -18,19 +18,15 @@ import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.entity.ImGroupMember;
-import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 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.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.string.MessageFormatter;
-
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,6 +46,7 @@ import java.time.temporal.WeekFields;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum.FIXED_SALARY;
 import static com.ym.mec.biz.dal.enums.SignInStatusEnum.*;
 
 @Service
@@ -96,8 +93,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     @Autowired
     private MusicGroupDao musicGroupDao;
     @Autowired
-    private ImFeignService imFeignService;
-    @Autowired
     private ImUserFriendService imUserFriendService;
     @Autowired
     private TeacherFreeTimeDao teacherFreeTimeDao;
@@ -126,8 +121,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     @Autowired
     private ContractService contractService;
     @Autowired
-    private PracticeLessonApplyDao practiceLessonApplyDao;
-    @Autowired
     private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
     @Autowired
     private StudentRegistrationDao studentRegistrationDao;
@@ -4283,19 +4276,43 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     public Map countPracticeGroupPredictFee(PracticeGroupApplyBaseInfoDto practice, Integer teacherId, Long courseId) {
+        if(Objects.isNull(teacherId)){
+            throw new BizException("请指定教师");
+        }
+        SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
+        Integer practiceCourseMinutes = practiceCourseMinutesConfig.getParanValue(Integer.class);
+        TeacherDefaultPracticeGroupSalary teacherDefaultPracticeGroupSalary = teacherDefaultPracticeGroupSalaryDao.findByTeacherAndCourseMinutes(teacherId,practiceCourseMinutes);
+
+        BigDecimal teacherDefaultSalary=null;
+        if(Objects.nonNull(teacherDefaultPracticeGroupSalary)){
+            teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
+        }
+        if(teacherDefaultSalary == null){
+            throw new BizException("请设置老师课酬");
+        }
         PracticeGroupSellPrice practiceGroupSellPrice = practiceGroupSellPriceDao.get(practice.getOrganId());
         if (Objects.isNull(practiceGroupSellPrice)) {
             throw new BizException("所在城市暂不参与此活动");
         }
         Map<String,BigDecimal> results = new HashMap<>(1);
+
         BigDecimal onlineClassNum = new BigDecimal(practice.getAllCourseNum());
         BigDecimal totalPrice = practiceGroupSellPrice.getSingleClassMinutesPrice().multiply(onlineClassNum);
         //课程购买费用计算
         if(practice.getVipGroupActivityId() != null){
             VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(practice.getVipGroupActivityId());
+            VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
+            if(Objects.isNull(vipGroupSalarySettlementDto)){
+                throw new BizException("课酬结算方案错误");
+            }
+            VipGroupSalarySettlementTypeDto salarySettlement = vipGroupSalarySettlementDto.getPracticeSalarySettlement();
+            if(salarySettlement.getSalarySettlementType() != null && salarySettlement.getSalarySettlementType() == FIXED_SALARY){
+                teacherDefaultSalary = salarySettlement.getSettlementValue();
+            }
             totalPrice = totalPrice.multiply(vipGroupActivity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         }
-        results.put("onlineTeacherSalary",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
+        results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
+        results.put("onlineTeacherSalary",teacherDefaultSalary);
         return results;
     }
 

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

@@ -306,6 +306,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
                 student.setMembershipEndTime(DateUtil.addDays(nowDate, cloudTeacherOrder.getTime()));
     			break;
     		case MONTH:
+    		case QUARTERLY:
     		case YEAR_HALF:
                 student.setMembershipEndTime(DateUtil.addMonths(nowDate, cloudTeacherOrder.getTime()));
     			break;

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

@@ -169,7 +169,7 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 							if (tdms != null && origTdms != null) {
 								Map<String, BigDecimal> teachModeSalaryMap = new HashMap<>();
 //								if(vipGroupCategory.getMusicTheory()){
-									teachModeSalaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
+									teachModeSalaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
 //								}else{
 //									teachModeSalaryMap = vipGroupService.countVipGroupCoursePredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
 //								}

+ 185 - 98
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -88,8 +88,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     @Autowired
     private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
     @Autowired
-    private TeacherDefaultPracticeGroupSalaryDao teacherDefaultPracticeGroupSalaryDao;
-    @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
 	private StudentApplyRefundsDao studentApplyRefundsDao;
@@ -169,6 +167,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private SysConfigService sysConfigService;
 	@Autowired
 	private SysCouponCodeService sysCouponCodeService;
+	@Autowired
+	private CloudTeacherOrderService cloudTeacherOrderService;
+	@Autowired
+	private StudentService studentService;
 
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(VipGroup.class);
@@ -182,12 +184,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	@Override
 	public HttpResponseResult createVipGroup(VipGroupApplyDto vipGroup) {
 
-		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfo = vipGroup.getVipGroupApplyBaseInfo();
-		if (Objects.isNull(vipGroupApplyBaseInfo.getUserId())){
+		if (Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getUserId())){
 			throw new BizException("请选择指导老师");
 		}
 
-	    if(vipGroup.getCourseSchedules().size()!=(vipGroupApplyBaseInfo.getOfflineClassesNum() + vipGroupApplyBaseInfo.getOnlineClassesNum())){
+	    if(vipGroup.getCourseSchedules().size()!=(vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()+vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum())){
 	        throw new BizException("建课失败,当前课程存在未排课课程,请调整相关设置");
         }
 
@@ -198,18 +199,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("教学模式错误");
 		}
 
-		if((Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE)) && vipGroupApplyBaseInfo.getOfflineClassesNum()!=0)
-				||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.OFFLINE))&&(courseScheduleGroup.get(TeachModeEnum.OFFLINE).size()<vipGroupApplyBaseInfo.getOfflineClassesNum()))){
+		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)) && vipGroupApplyBaseInfo.getOnlineClassesNum()!=0)
-				||(!Objects.isNull(courseScheduleGroup.get(TeachModeEnum.ONLINE))&&(courseScheduleGroup.get(TeachModeEnum.ONLINE).size() < vipGroupApplyBaseInfo.getOnlineClassesNum()))){
+        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(vipGroupApplyBaseInfo.getOfflineClassesNum()>0
-			&&Objects.isNull(vipGroupApplyBaseInfo.getTeacherSchoolId())){
+		if(vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum()>0
+			&&Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getTeacherSchoolId())){
 			throw new BizException("请设置教学点");
 		}
 
@@ -221,20 +222,22 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         Date now=new Date();
 
-        if(Objects.isNull(vipGroupApplyBaseInfo.getOfflineClassesUnitPrice())
-            &&Objects.isNull(vipGroupApplyBaseInfo.getOnlineClassesUnitPrice())){
+		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
+
+        if(Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
+            &&Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())){
             throw new BizException("请设置课程单价");
         }
 
-		if(StringUtils.isBlank(vipGroupApplyBaseInfo.getStudentIdList())){
+		if(StringUtils.isBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
 			throw new BizException("请选择学员");
 		}
 
-        if(Objects.isNull(vipGroupApplyBaseInfo.getOnlineTeacherSalary())||Objects.isNull(vipGroupApplyBaseInfo.getOfflineTeacherSalary())){
+        if(Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary()) || Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())){
 			throw new BizException("请设置教师课酬");
 		}
 
-		Integer totalClassTimes=vipGroupApplyBaseInfo.getOnlineClassesNum()+vipGroupApplyBaseInfo.getOfflineClassesNum();
+		Integer totalClassTimes=vipGroupApplyBaseInfoDto.getOnlineClassesNum()+vipGroupApplyBaseInfoDto.getOfflineClassesNum();
 		//获取第一节课
 		CourseSchedule firstCourseSchedule = vipGroup.getCourseSchedules().stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get();
 		//获取最后一节课
@@ -244,29 +247,25 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("开课时间不能小于当前时间");
 		}
 
-		if(vipGroupApplyBaseInfo.getRegistrationStartTime().after(vipGroupApplyBaseInfo.getPaymentExpireDate())){
+		if(vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())){
 		    throw new BizException("报名开始时间必须在报名截至时间之前");
         }
 
-		if(vipGroupApplyBaseInfo.getPaymentExpireDate().after(firstCourseSchedule.getStartClassTime())
-            ||DateUtil.isSameDay(vipGroupApplyBaseInfo.getPaymentExpireDate(),firstCourseSchedule.getEndClassTime())){
+		if(vipGroupApplyBaseInfoDto.getPaymentExpireDate().after(firstCourseSchedule.getStartClassTime())
+            ||DateUtil.isSameDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate(),firstCourseSchedule.getEndClassTime())){
 		    throw new BizException("创建失败,报名截止时间必须在开课时间前一天");
         }
 
-		List<Integer> canBuyStudentIds = Arrays.stream(vipGroupApplyBaseInfo.getStudentIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
-		List<VipGroupStudentCoursePrice> vscps = vipGroupApplyBaseInfo.getVipGroupStudentCoursePrices();
+		List<Integer> canBuyStudentIds = Arrays.stream(vipGroupApplyBaseInfoDto.getStudentIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		List<VipGroupStudentCoursePrice> vscps = vipGroup.getVipGroupApplyBaseInfo().getVipGroupStudentCoursePrices();
 
 		//获取活动信息
-		VipGroupActivity vipGroupActivity = null;
-		if(vipGroupApplyBaseInfo.getVipGroupActivityId() != null){
-			vipGroupActivity = vipGroupActivityDao.get(vipGroupApplyBaseInfo.getVipGroupActivityId());
-		}
-
-		if(vipGroupActivity != null && !vipGroup.getAllowOverstepActivityStudentNum() && Objects.nonNull(vipGroupActivity.getStudentMaxUsedTimes()) && vipGroupActivity.getStudentMaxUsedTimes()!=-1&&StringUtils.isNotBlank(vipGroupApplyBaseInfo.getStudentIdList())){
-			List<String> tempStudentIds = Arrays.asList(vipGroupApplyBaseInfo.getStudentIdList().split(","));
+		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(vipGroupApplyBaseInfo.getVipGroupActivityId(), Integer.valueOf(studentIdStr));
+				int useNum = vipGroupDao.countStudentUserActivityNum(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId(), Integer.valueOf(studentIdStr));
 				if(useNum>=vipGroupActivity.getStudentMaxUsedTimes()){
 					errStudentIds.add(Integer.valueOf(studentIdStr));
 				}
@@ -279,7 +278,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			}
 		}
 		//判断课程安排是否超出范围
-		if(Objects.nonNull(vipGroupActivity) && (Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime()))){
+		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("课时安排时间超出范围!");
@@ -295,26 +294,26 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			}
 		}
 
-		if(Objects.nonNull(vipGroupActivity) && Objects.nonNull(vipGroupActivity.getMinCourseNum())&&vipGroupActivity.getMinCourseNum()!=-1&&Objects.nonNull(vipGroupActivity.getMaxCourseNum())&&vipGroupActivity.getMaxCourseNum()!=-1){
-			Integer requestCourseNum = vipGroupApplyBaseInfo.getOnlineClassesNum() + vipGroupApplyBaseInfo.getOfflineClassesNum();
+		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(vipGroupApplyBaseInfo.getUserId(), firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
+		int repeatVipGroups = vipGroupDao.countUserRepeatVipGroupInCourseStartEndTime(vipGroupApplyBaseInfoDto.getUserId(), firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
 		if(repeatVipGroups>0){
 			throw new BizException("请勿重复提交");
 		}
 
-		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroupApplyBaseInfo.getVipGroupCategoryId());
+		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(vipGroupApplyBaseInfo.getSubjectIdList());
+		List<String> bySubIds = subjectDao.findBySubIds(vipGroupApplyBaseInfoDto.getSubjectIdList());
 		StringBuffer className=new StringBuffer();
 		if(Objects.isNull(vipGroupCategory.getMusicTheory())||!vipGroupCategory.getMusicTheory()){
 			className.append(StringUtils.join(bySubIds,","));
@@ -323,34 +322,34 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			className.append("乐理课•");
 		}
 		className.append(StringUtils.join(studentNames, ","));
-		vipGroupApplyBaseInfo.setName(className.toString());
+		vipGroupApplyBaseInfoDto.setName(className.toString());
 
 		//计算课程相关费用信息
-		Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfo,
-				vipGroupApplyBaseInfo.getUserId(), null);
+		Map<String, BigDecimal> costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto,
+				vipGroupApplyBaseInfoDto.getUserId(), null);
 
-		vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.PASS);
+        vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 
 		//如果默认课酬与实际课酬不匹配则需要审批
-		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfo.getOfflineTeacherSalary())<0||
-			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfo.getOnlineTeacherSalary())<0
+		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())<0||
+			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())<0
 			&&StringUtils.isBlank(studentIds)){
-			vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.ING);
+			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 		}
 
-		vipGroupApplyBaseInfo.setTotalPrice(costInfo.get("totalPrice"));
+		vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
 		if(StringUtils.isNotBlank(studentIds)){
-			vipGroupApplyBaseInfo.setStatus(VipGroupStatusEnum.PROGRESS);
+			vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.PROGRESS);
 		}else{
-			vipGroupApplyBaseInfo.setStatus(VipGroupStatusEnum.APPLYING);
+			vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
 		}
 		if(CollectionUtils.isEmpty(vscps)){
 			vscps = new ArrayList<>();
 			for (Integer canBuyStudentId : canBuyStudentIds) {
-				vscps.add(new VipGroupStudentCoursePrice(canBuyStudentId, vipGroupApplyBaseInfo.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfo.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfo.getTotalPrice()));
+				vscps.add(new VipGroupStudentCoursePrice(canBuyStudentId, vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice(), vipGroupApplyBaseInfoDto.getTotalPrice()));
 			}
 		}
-        Teacher teacher = teacherService.get(vipGroupApplyBaseInfo.getUserId());
+        Teacher teacher = teacherService.get(vipGroupApplyBaseInfoDto.getUserId());
 		if(Objects.isNull(teacher)){
 		    throw new BizException("教师不存在");
         }
@@ -359,66 +358,66 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
 //        vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(teacher.getOrganId()));
 		//开课时间为排课的第一节课的开始时间
-		vipGroupApplyBaseInfo.setCourseStartDate(firstCourseSchedule.getStartClassTime());
+		vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
 		//课程结束时间为排课的最后一节课的结束时间
-		vipGroupApplyBaseInfo.setCoursesExpireDate(latestCourseSchedule.getEndClassTime());
+		vipGroupApplyBaseInfoDto.setCoursesExpireDate(latestCourseSchedule.getEndClassTime());
 
-		vipGroupApplyBaseInfo.setPaymentExpireDate(DateUtil.getLastSecondWithDay(vipGroupApplyBaseInfo.getPaymentExpireDate()));
+		vipGroupApplyBaseInfoDto.setPaymentExpireDate(DateUtil.getLastSecondWithDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate()));
 
-        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroupApplyBaseInfo.getVipGroupCategoryId(), vipGroupApplyBaseInfo.getOrganId());
+        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId(), vipGroup.getVipGroupApplyBaseInfo().getOrganId());
 
         if(Objects.isNull(vipGroupDefaultClassesUnitPrice)){
-			vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.ING);
+            vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
         }else{
-			if(Objects.nonNull(vipGroupApplyBaseInfo.getOfflineClassesUnitPrice())
-					&&vipGroupApplyBaseInfo.getOfflineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice())!=0){
-				vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.ING);
+			if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
+					&&vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice())!=0){
+				vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 			}
-			if(Objects.nonNull(vipGroupApplyBaseInfo.getOnlineClassesUnitPrice())
-					&&vipGroupApplyBaseInfo.getOnlineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice())!=0){
-				vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.ING);
+			if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())
+					&&vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice())!=0){
+				vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 			}
         }
 
-        if(StringUtils.isBlank(vipGroupApplyBaseInfo.getStudentIdList())){
-			vipGroupApplyBaseInfo.setStudentIdList(StringUtils.join(vscps.stream().map(VipGroupStudentCoursePrice::getStudentId).collect(Collectors.toList()), ","));
+        if(StringUtils.isBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
+			vipGroupApplyBaseInfoDto.setStudentIdList(StringUtils.join(vscps.stream().map(VipGroupStudentCoursePrice::getStudentId).collect(Collectors.toList()), ","));
 		}
 
         if(vipGroup.getOnlyProgress()){
-			vipGroupApplyBaseInfo.setAuditStatus(AuditStatusEnum.PASS);
+			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 		}
 
-		vipGroupDao.insert(vipGroupApplyBaseInfo);
+		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
 
-		vscps.forEach(e->e.setVipGroupId(vipGroupApplyBaseInfo.getId()));
+		vscps.forEach(e->e.setVipGroupId(vipGroupApplyBaseInfoDto.getId()));
 		vipGroupStudentCoursePriceDao.batchInsert(vscps);
 
-        vipGroup.getVipGroupApplyBaseInfo().setId(vipGroupApplyBaseInfo.getId());
+        vipGroup.getVipGroupApplyBaseInfo().setId(vipGroupApplyBaseInfoDto.getId());
 
 		//创建班级信息
 		ClassGroup classGroup=new ClassGroup();
-		classGroup.setSubjectIdList(vipGroupApplyBaseInfo.getSubjectIdList());
+		classGroup.setSubjectIdList(vipGroupApplyBaseInfoDto.getSubjectIdList());
 		classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
 		if(StringUtils.isNotBlank(studentIds)){
 			classGroup.setStudentNum(studentIdList.size());
 		}
-		classGroup.setName(vipGroupApplyBaseInfo.getName());
-		classGroup.setExpectStudentNum(vipGroupApplyBaseInfo.getStudentNum());
+		classGroup.setName(vipGroupApplyBaseInfoDto.getName());
+		classGroup.setExpectStudentNum(vipGroupApplyBaseInfoDto.getStudentNum());
 		classGroup.setTotalClassTimes(totalClassTimes);
 		classGroup.setType(ClassGroupTypeEnum.VIP);
 		classGroup.setDelFlag(1);
 		classGroup.setGroupType(GroupType.VIP);
-		classGroup.setMusicGroupId(vipGroupApplyBaseInfo.getId().toString());
+		classGroup.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
 		classGroup.setCreateTime(now);
 		classGroup.setUpdateTime(now);
 		classGroupDao.insert(classGroup);
 
 		//创建班级老师关联记录
 		ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
-		classGroupTeacherMapper.setMusicGroupId(vipGroupApplyBaseInfo.getId().toString());
+		classGroupTeacherMapper.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
 		classGroupTeacherMapper.setClassGroupId(classGroup.getId());
 		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
-		classGroupTeacherMapper.setUserId(vipGroupApplyBaseInfo.getUserId());
+		classGroupTeacherMapper.setUserId(vipGroupApplyBaseInfoDto.getUserId());
 		classGroupTeacherMapper.setGroupType(GroupType.VIP);
 		classGroupTeacherMapper.setCreateTime(now);
 		classGroupTeacherMapper.setUpdateTime(now);
@@ -426,12 +425,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		//创建班级与老师课酬记录
 		ClassGroupTeacherSalary classGroupTeacherSalary=new ClassGroupTeacherSalary();
-		classGroupTeacherSalary.setMusicGroupId(vipGroupApplyBaseInfo.getId().toString());
+		classGroupTeacherSalary.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
 		classGroupTeacherSalary.setClassGroupId(classGroup.getId());
 		classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
-		classGroupTeacherSalary.setUserId(vipGroupApplyBaseInfo.getUserId());
-		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfo.getOfflineTeacherSalary());
-		classGroupTeacherSalary.setOnlineClassesSalary(vipGroupApplyBaseInfo.getOnlineTeacherSalary());
+		classGroupTeacherSalary.setUserId(vipGroupApplyBaseInfoDto.getUserId());
+		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary());
+		classGroupTeacherSalary.setOnlineClassesSalary(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary());
 		classGroupTeacherSalary.setGroupType(GroupType.VIP);
 		classGroupTeacherSalary.setCreateTime(now);
 		classGroupTeacherSalary.setUpdateTime(now);
@@ -440,32 +439,32 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		//课程信息调整
 		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
 			courseSchedule.setGroupType(GroupType.VIP);
-			courseSchedule.setMusicGroupId(vipGroupApplyBaseInfo.getId().toString());
+			courseSchedule.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
 		    if(courseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
 				courseSchedule.setSchoolId(vipGroup.getVipGroupApplyBaseInfo().getTeacherSchoolId());
 			}
-		    courseSchedule.setTeacherId(vipGroupApplyBaseInfo.getUserId());
-			courseSchedule.setActualTeacherId(vipGroupApplyBaseInfo.getUserId());
+		    courseSchedule.setTeacherId(vipGroupApplyBaseInfoDto.getUserId());
+			courseSchedule.setActualTeacherId(vipGroupApplyBaseInfoDto.getUserId());
 			courseSchedule.setStatus(CourseStatusEnum.NOT_START);
 		    courseSchedule.setType(CourseSchedule.CourseScheduleType.VIP);
 			courseSchedule.setClassGroupId(classGroup.getId());
-			courseSchedule.setName(vipGroupApplyBaseInfo.getName());
-			courseSchedule.setOrganId(vipGroupApplyBaseInfo.getOrganId());
+			courseSchedule.setName(vipGroupApplyBaseInfoDto.getName());
+			courseSchedule.setOrganId(vipGroupApplyBaseInfoDto.getOrganId());
 		});
 		courseScheduleService.checkNewCourseSchedules(vipGroup.getCourseSchedules(),false,false);
-		vipGroupApplyBaseInfo.setCourseSchedulesJson(JSON.toJSONString(vipGroup.getCourseSchedules()));
-		vipGroupDao.update(vipGroupApplyBaseInfo);
+		vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(vipGroup.getCourseSchedules()));
+		vipGroupDao.update(vipGroupApplyBaseInfoDto);
 
 		if(StringUtils.isNotBlank(studentIds)){
 			List<Integer> collect = studentIdList.stream().mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
-			classGroupService.addStudentIntoClassGroup(vipGroupApplyBaseInfo.getId().toString(),classGroup.getId(),collect);
-			createVipGroupCourseScheInfo(vipGroupApplyBaseInfo.getId(),classGroup);
+			classGroupService.addStudentIntoClassGroup(vipGroupApplyBaseInfoDto.getId().toString(),classGroup.getId(),collect);
+			createVipGroupCourseScheInfo(vipGroupApplyBaseInfoDto.getId(),classGroup);
 		}
 
 		Set<Integer> roleIds = new HashSet<>(1);
 		roleIds.add(SysUserRole.SECTION_MANAGER);
 		Map<String,Long> memo = new HashMap<>(1);
-		memo.put("vipGroupId",vipGroupApplyBaseInfo.getId());
+		memo.put("vipGroupId",vipGroupApplyBaseInfoDto.getId());
 //		SysUser sysUser = sysUserFeignService.queryUserById(vipGroup.getVipGroupApplyBaseInfo().getUserId());
 		if(Objects.isNull(teacher)){
 			throw new BizException("该用户不存在");
@@ -474,15 +473,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(CollectionUtils.isEmpty(userIds)){
 			throw new BizException("当前分部没有运营主管,无法创建,请联系总部工作人员!");
 		}
-		if(vipGroupApplyBaseInfo.getEducationalTeacherId() != null){
-			userIds.add(vipGroupApplyBaseInfo.getEducationalTeacherId());
+		if(vipGroupApplyBaseInfoDto.getEducationalTeacherId() != null){
+			userIds.add(vipGroupApplyBaseInfoDto.getEducationalTeacherId());
 		}
 //		if (vipGroup.getVipGroupApplyBaseInfo().getUserId() != null){
 //			sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_VIP_COURSE_APPLY, JSONObject.toJSONString(memo),sysUser.getUsername(),sysUser.getUsername());
 //		}else {
 		sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_TEACHER_APPLY_VIP, JSONObject.toJSONString(memo),teacher.getRealName());
 //		}
-		return BaseController.succeed(vipGroupApplyBaseInfo.getAuditStatus().getCode());
+		return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
 	}
 
 	@Override
@@ -719,7 +718,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		if(!ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
 			//计算课程相关费用信息
-			Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
+			Map<String, BigDecimal> costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto,
 					vipGroupApplyBaseInfoDto.getUserId(), null);
 			vipGroupApplyBaseInfoDto.setOnlineTeacherSalary(costInfo.get("onlineTeacherSalary"));
 			vipGroupApplyBaseInfoDto.setOfflineTeacherSalary(costInfo.get("offlineTeacherSalary"));
@@ -1862,7 +1861,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				throw new BizException("课程单价异常");
 			}
 			BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
-			BigDecimal totalClassNum=offlineClassNum.add(onlineClassNum);
+			BigDecimal totalClassNum = offlineClassNum.add(onlineClassNum);
 			BigDecimal teacherOnlineSalary=null,teacherOfflineSalary=null;
 
 			//课程购买费用计算
@@ -2469,7 +2468,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		studentPaymentOrderDao.update(order);
 
-		ClassGroup classGroup=classGroupDao.get(order.getClassGroupId());
+		ClassGroup classGroup = classGroupDao.get(order.getClassGroupId());
 
 		//将学生加入到班级,更新班级报名状态及人数信息
 		if(!isOk){
@@ -2484,8 +2483,98 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			sysCouponCodeService.quit(order.getCouponCodeId());
 			return;
 		}
-
+		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
 		try {
+			Integer vipGroupActivityId = vipGroup.getVipGroupActivityId();
+			if(vipGroupActivityId != null){
+				ActivityUserMapper activityUserMapper = new ActivityUserMapper();
+				VipGroupActivity activity = vipGroupActivityDao.get(vipGroupActivityId);
+				//是否赠送课程
+				if(activity.getGiveCourseNum() > 0){
+					if(activity.getGiveCourseType().equals("VIP")){
+						activityUserMapper.setGiveVipFlag(1);
+					}else {
+						activityUserMapper.setGivePracticeFlag(1);
+					}
+				}
+				//是否赠送会员(会员立即生效)
+				if(activity.getMemberTime() > 0){
+					Date now = new Date();
+					// 查询会员订单信息
+					CloudTeacherOrder cloudTeacherOrder = new CloudTeacherOrder();
+					cloudTeacherOrder.setStatus(2);
+					cloudTeacherOrder.setUpdateTime(now);
+					cloudTeacherOrder.setAmount(BigDecimal.ZERO);
+					cloudTeacherOrder.setOrderId(studentPaymentOrder.getId());
+					cloudTeacherOrder.setRemark("购买vip活动赠送会员");
+					cloudTeacherOrder.setLevel(activity.getGiveMemberRankId());
+					cloudTeacherOrder.setStudentId(studentPaymentOrder.getUserId());
+					cloudTeacherOrder.setType(2);
+					PeriodEnum periodEnum = activity.getGivePeriodEnum();
+					switch (periodEnum){
+						case DAY:
+							cloudTeacherOrder.setType(1);
+							break;
+						case MONTH:
+						case QUARTERLY:
+						case YEAR_HALF:
+							cloudTeacherOrder.setType(2);
+							break;
+						case YEAR:
+							cloudTeacherOrder.setType(3);
+							break;
+						default:
+							throw new BizException("不支持的周期类型");
+					}
+					Student student = studentDao.get(userId);
+					if (student.getMemberRankSettingId() == null || now.after(student.getMembershipEndTime())) {
+						cloudTeacherOrder.setStartTime(now);
+						switch (periodEnum){
+							case DAY:
+								cloudTeacherOrder.setEndTime(DateUtil.addDays(now, activity.getGiveMemberTime()));
+								break;
+							case MONTH:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(now, activity.getGiveMemberTime()));
+								break;
+							case QUARTERLY:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(now, activity.getGiveMemberTime() * 3));
+								break;
+							case YEAR_HALF:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(now, activity.getGiveMemberTime() * 6));
+								break;
+							case YEAR:
+								cloudTeacherOrder.setEndTime(DateUtil.addYears(now, activity.getGiveMemberTime()));
+								break;
+							default:
+								throw new BizException("不支持的周期类型");
+						}
+					} else {
+						cloudTeacherOrder.setStartTime(DateUtil.addDays(student.getMembershipEndTime(), 1));
+						switch (periodEnum){
+							case DAY:
+								cloudTeacherOrder.setEndTime(DateUtil.addDays(student.getMembershipEndTime(), activity.getGiveMemberTime()));
+								break;
+							case MONTH:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(student.getMembershipEndTime(), activity.getGiveMemberTime()));
+								break;
+							case QUARTERLY:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(student.getMembershipEndTime(), activity.getGiveMemberTime() * 3));
+								break;
+							case YEAR_HALF:
+								cloudTeacherOrder.setEndTime(DateUtil.addMonths(student.getMembershipEndTime(), activity.getGiveMemberTime() * 6));
+								break;
+							case YEAR:
+								cloudTeacherOrder.setEndTime(DateUtil.addYears(student.getMembershipEndTime(), activity.getGiveMemberTime()));
+								break;
+							default:
+								throw new BizException("不支持的周期类型");
+						}
+					}
+					cloudTeacherOrderService.update(cloudTeacherOrder);
+					// 添加会员有效时长
+					studentService.updateMemberRank(cloudTeacherOrder, periodEnum);
+				}
+			}
 			if(classGroup.getDelFlag()==1){
 				updateVipGroupStudentNumAndStatus(vipGroupId, classGroup,0,true);
 			}
@@ -2495,11 +2584,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
 
-		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
-
 		//插入缴费明细
 		//收入
-		if(Objects.nonNull(order.getActualAmount())&&order.getActualAmount().compareTo(BigDecimal.ZERO)!=0){
+		if(Objects.nonNull(order.getActualAmount()) && order.getActualAmount().compareTo(BigDecimal.ZERO)!=0){
 			SysUserCashAccountDetail sysUserIncomeCashAccountDetail = new SysUserCashAccountDetail();
 			sysUserIncomeCashAccountDetail.setUserId(userId);
 			sysUserIncomeCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.RECHARGE);
@@ -2541,7 +2628,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		HashSet<Integer> hashSet = new HashSet<>(organIds);
 		String organIdsString = StringUtils.join(hashSet, ",");
 		vipGroup.setOrganIdList(organIdsString);
-		classGroup=classGroupDao.get(order.getClassGroupId());
+		classGroup = classGroupDao.get(order.getClassGroupId());
 		if(classGroup.getDelFlag()==0&&classGroup.getExpectStudentNum().equals(classGroup.getStudentNum())){
 			vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
 		}
@@ -2925,7 +3012,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
 			}
 
-			Map<String, BigDecimal> salaryMap = countVipGroupPredictFee(vipGroup, vipGroup.getUserId(), null);
+			Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 
 			//创建老师单节课课酬信息
 			courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroup,
@@ -3577,7 +3664,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		courseScheduleService.batchAddCourseSchedule(vipGroupApplyDto.getCourseSchedules());
 
-		Map<String, BigDecimal> map = countVipGroupPredictFee(vipGroup, vipGroup.getUserId(), null);
+		Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 
 		BigDecimal teacherSalary=BigDecimal.ZERO;
 
@@ -3727,7 +3814,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			if(courseNum==0){
 				courseScheduleService.batchAddCourseSchedule(courseSchedules);
 
-				Map<String, BigDecimal> salaryMap = countVipGroupPredictFee(vipGroup, vipGroup.getUserId(), null);
+				Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 
 				//创建老师单节课课酬信息
 				courseScheduleTeacherSalaryService.createCourseScheduleTeacherVipSalary(vipGroup,

+ 78 - 0
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.ActivityUserMapperDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.ActivityUserMapper" id="ActivityUserMapper">
+		<result column="id_" property="id" />
+		<result column="activity_id_" property="activityId" />
+		<result column="user_id_" property="userId" />
+		<result column="vip_flag_" property="vipFlag" />
+		<result column="give_vip_flag_" property="giveVipFlag" />
+		<result column="practice_flag_" property="practiceFlag" />
+		<result column="give_practice_flag_" property="givePracticeFlag" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ActivityUserMapper" >
+		SELECT * FROM activity_user_mapper WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ActivityUserMapper">
+		SELECT * FROM activity_user_mapper ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<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_,create_time_,update_time_)
+		                                  VALUES(#{activityId},#{userId},#{vipFlag},#{giveVipFlag},#{practiceFlag},
+		                                         #{givePracticeFlag},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapper">
+		UPDATE activity_user_mapper <set>
+		<if test="userId != null">
+		user_id_ = #{userId},
+		</if>
+		<if test="givePracticeFlag != null">
+		give_practice_flag_ = #{givePracticeFlag},
+		</if>
+		<if test="giveVipFlag != null">
+		give_vip_flag_ = #{giveVipFlag},
+		</if>
+		<if test="vipFlag != null">
+		vip_flag_ = #{vipFlag},
+		</if>
+		<if test="activityId != null">
+		activity_id_ = #{activityId},
+		</if>
+		<if test="practiceFlag != null">
+		practice_flag_ = #{practiceFlag},
+		</if>
+		update_time_ = NOW()
+	</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM activity_user_mapper WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ActivityUserMapper" parameterType="map">
+		SELECT * FROM activity_user_mapper ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM activity_user_mapper
+	</select>
+</mapper>

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

@@ -773,6 +773,6 @@
     <select id="countUserRepeatPracticeGroupInCourseStartEndTime" resultType="java.lang.Integer">
         SELECT COUNT(id_)
         FROM practice_group
-        WHERE student_id_ = #{userId} AND courses_start_date = #{courseStartDate} AND courses_expire_date_ = #{courseEndDate}
+        WHERE student_id_ = #{userId} AND courses_start_date_ = #{courseStartDate} AND courses_expire_date_ = #{courseEndDate}
     </select>
 </mapper>

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

@@ -275,8 +275,10 @@
 		SELECT vga.* FROM
 			vip_group_activity vga
 			LEFT JOIN activity_apply_student_type ast ON vga.id_ = ast.activity_id_
-		WHERE
-			FIND_IN_SET(#{activityQueryDto.categoryId}, vga.vip_group_category_id_list_ ) AND vga.status_ = 'PROGRESS'
+		WHERE vga.status_ = 'PROGRESS'
+		<if test="activityQueryDto.categoryId != null">
+		  AND FIND_IN_SET(#{activityQueryDto.categoryId}, vga.vip_group_category_id_list_ )
+		</if>
 		<if test="activityQueryDto.includeClosed == null">
 			AND (vga.end_time_ IS NULL OR NOW() BETWEEN vga.start_time_ AND vga.end_time_)
 		</if>

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

@@ -345,8 +345,7 @@
     <sql id="studentVipGroupQueryCondition">
         <where>
             vg.audit_status_='PASS'
-            AND vg.group_status_=1
-            AND vg.group_status_!=7
+            AND vg.group_status_ = 1
             AND vg.courses_expire_date_ &gt;= DATE_FORMAT(NOW(),'%Y%m%d')
             AND vg.registration_start_time_ &lt;= NOW()
             AND vg.courses_start_date &gt; NOW()

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -3,12 +3,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.EmployeeDao;
+import com.ym.mec.biz.dal.dao.PracticeGroupSellPriceDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.PracticeGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.dto.PracticeGroupApplyDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
@@ -52,6 +54,8 @@ public class PracticeGroupManageController extends BaseController {
     private CourseScheduleEvaluateService courseScheduleEvaluateService;
     @Autowired
     private TeacherDao teacherDao;
+    @Autowired
+    private PracticeGroupSellPriceDao practiceGroupSellPriceDao;
 
     @ApiOperation(value = "全查询")
     @GetMapping("/queryAll")
@@ -171,6 +175,13 @@ public class PracticeGroupManageController extends BaseController {
         return succeed(results);
     }
 
+    @ApiOperation("获取网管课分部价格")
+    @RequestMapping("/queryPracticeGroupSellPrice")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/queryPracticeGroupSellPrice')")
+    public Object queryPracticeGroupSellPrice(Integer organId){
+        return succeed(practiceGroupSellPriceDao.get(organId));
+    }
+
     @ApiOperation(value = "网管课申请")
     @PostMapping("/practiceGroupApply")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/practiceGroupApply')")

+ 0 - 3
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -112,9 +112,6 @@ public class VipGroupActivityController extends BaseController {
     @GetMapping("/findByVipGroupCategory")
     @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/findByVipGroupCategory')")
     public Object findByVipGroupCategory(ActivityQueryDto activityQueryDto){
-        if(activityQueryDto.getCategoryId() == null){
-            return failed("请选择课程形式");
-        }
         List<Integer> userIds = Arrays.stream(activityQueryDto.getStudentIds().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
         List<Student> students = studentDao.findByStudentIds(userIds);
         if(CollectionUtils.isEmpty(students)||students.size()!=userIds.size()){

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

@@ -372,7 +372,7 @@ public class VipGroupManageController extends BaseController {
     @PostMapping("/getVipGroupCostCount")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/getVipGroupCostCount')")
     public Object getVipGroupCostCount(@RequestBody VipGroupApplyBaseInfoDto vipGroup){
-        Map results = vipGroupService.countVipGroupPredictFee(vipGroup,vipGroup.getUserId(), null);
+        Map results = vipGroupService.countVipGroupPredictFee1(vipGroup,vipGroup.getUserId(), null);
         return succeed(results);
     }