Browse Source

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

zouxuan 4 years ago
parent
commit
0d79c278ab

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

@@ -20,9 +20,6 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	 */
 	int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId, Integer userId);
 
-	int createCourseScheduleStudentPaymentForPracticeGroup(Long practiceGroupId, Integer userId);
-
-
 	/**
 	 * 删除学生对应的课程
 	 * @param userId

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

@@ -779,6 +779,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 	}
 
 	@Override
+	@Async
 	public boolean transferPracticeCoursesContract(Integer userId, int courseSectionNum, Date startDate, Date endDate, BigDecimal fee) {
 		if(true){
 			 transferProduceContract(userId, null, null);

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

@@ -158,80 +158,6 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		return courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 	}
 
-	@Override
-	public int createCourseScheduleStudentPaymentForPracticeGroup(Long vipGroupId, Integer userId) {
-		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
-
-		if(Objects.isNull(vipGroup)){
-			throw new BizException("未找到相关vip课程");
-		}
-
-		VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroup(vipGroupId);
-		if(Objects.isNull(vipGroupDefaultClassesUnitPrice)){
-			throw new BizException("课程单价设置错误");
-		}
-
-		//获取活动信息
-		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
-
-		List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findGroupCourseSchedules(vipGroupId.toString(),GroupType.VIP.getCode());
-
-		if(CollectionUtils.isEmpty(vipGroupCourseSchedules)){
-			throw new BizException("未获取到排课信息");
-		}
-
-		int giveClassTimes=0;
-//        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());
-//        }
-
-		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDaop.findByStudentVipGroup(vipGroupId, userId, DealStatusEnum.SUCCESS.getCode());
-		BigDecimal couponFee = new BigDecimal(0);
-		if(Objects.nonNull(studentPaymentOrder)){
-			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(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(
-							vipGroup.getOfflineClassesUnitPrice().multiply(vipGroupActivity.getDiscount())
-									.divide(new BigDecimal(100), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP)
-									.subtract(couponFee)
-					);
-				}
-                courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(teachModeEnum)?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
-				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
-				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
-			}
-		}
-		return courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
-	}
-
     @Override
     public int deleteStudentCourseSchedule(Integer userId, List<CourseSchedule> courseScheduleList) {
 		if(courseScheduleList.size() == 0){

+ 96 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -47,6 +47,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.SignInStatusEnum.*;
+import static java.math.BigDecimal.ROUND_DOWN;
 
 @Service
 public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGroup> implements PracticeGroupService {
@@ -143,6 +144,12 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     private StudentService studentService;
     @Autowired
     private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
+    @Autowired
+    private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
+    @Autowired
+    private ImGroupService imGroupService;
+    @Autowired
+    private ImGroupMemberService imGroupMemberService;
 
     private static Map<Integer, Map<Integer, List<Integer>>> schoolSubjectTeachersMap;
 
@@ -3058,11 +3065,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(teacherDefaultSalary == null){
         	throw new BizException("请设置教师课酬");
         }
-        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
         BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
@@ -3506,11 +3513,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(teacherDefaultSalary == null){
             throw new BizException("请设置教师课酬");
         }
-        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
         BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
@@ -3696,6 +3703,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             return;
         }
         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(),
@@ -3703,7 +3711,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                     null,
                     practiceGroup.getId(),order.getActivityBuyNum());
             practiceGroup.setActivityUserMapperId(activityUserMapperId);
-            courseScheduleDao.updateGroupCourseLock(order.getMusicGroupId(), GroupType.PRACTICE, 0);
+            if(classGroup.getDelFlag() == 1){
+                updatePracticeGroupStudentNumAndStatus(practiceGroup, classGroup,order);
+            }else {
+                courseScheduleDao.updateGroupCourseLock(order.getMusicGroupId(), GroupType.PRACTICE, 0);
+            }
         } else {
             if (Objects.nonNull(order.getBalancePaymentAmount()) && order.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
                 sysUserCashAccountService.updateBalance(order.getUserId(), order.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "网管课支付失败,退还余额");
@@ -3760,7 +3772,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             sysCouponCodeService.quit(order.getCouponCodeId());
             return;
         }
-        ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(order.getMusicGroupId(), GroupType.PRACTICE.getCode());
 
         practiceGroup.setGroupStatus(GroupStatusEnum.NORMAL);
         practiceGroupDao.update(practiceGroup);
@@ -3776,7 +3787,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         } catch (Exception e) {
             LOGGER.error(MessageFormatter.arrayFormat("网管课[{}]购买协议错误:{}", order.getMusicGroupId(), e.getMessage()), e);
         }
-
         try {
             teacherCourseRewardService.addConvertReward(practiceGroup.getStudentId(), practiceGroup.getUserId());
         } catch (Exception e) {
@@ -3842,6 +3852,67 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         imUserFriendService.refreshGroupImUserFriend(practiceGroup.getId().toString(),GroupType.PRACTICE);
     }
 
+    private void updatePracticeGroupStudentNumAndStatus(PracticeGroup practiceGroup, ClassGroup classGroup,StudentPaymentOrder order) {
+        classGroup.setStudentNum(1);
+        classGroup.setDelFlag(0);
+        classGroupDao.update(classGroup);
+
+        List<CourseSchedule> courseSchedules = JSON.parseArray(practiceGroup.getCourseScheduleJson(),CourseSchedule.class);
+        int courseNum = courseScheduleDao.countVipGroupCourses(practiceGroup.getId().intValue(),"PRACTICE");
+        if(courseNum == 0){
+            courseScheduleService.batchAddCourseSchedule(courseSchedules);
+        }
+
+        ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+        classGroupStudentMapper.setClassGroupId(classGroup.getId());
+        classGroupStudentMapper.setGroupType(GroupType.PRACTICE);
+        classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+        classGroupStudentMapper.setMusicGroupId(practiceGroup.getId().toString());
+        classGroupStudentMapper.setUserId(practiceGroup.getStudentId());
+        classGroupStudentMapperDao.insert(classGroupStudentMapper);
+
+        List<TeacherAttendance> teacherAttendances = new ArrayList<>();
+        List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+
+        PracticeGroupSellPrice practiceGroupSellPrice = practiceGroupSellPriceDao.get(practiceGroup.getOrganId());
+        BigDecimal singleClassMinutesPrice = practiceGroupSellPrice.getSingleClassMinutesPrice();
+        //实际支付金额,去除优惠券
+        BigDecimal actualPrice = order.getExpectAmount().subtract(order.getCouponRemitFee());
+        BigDecimal divide = actualPrice.divide(new BigDecimal(courseSchedules.size()), ROUND_DOWN);
+        BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(courseSchedules.size()))).add(divide);
+
+        for (int i = 0; i < courseSchedules.size(); i++) {
+            CourseSchedule courseSchedule = courseSchedules.get(i);
+            //学生缴费记录
+            CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+            courseScheduleStudentPayment.setGroupType(GroupType.PRACTICE);
+            courseScheduleStudentPayment.setMusicGroupId(practiceGroup.getId().toString());
+            courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+            courseScheduleStudentPayment.setUserId(practiceGroup.getStudentId());
+            if(i == 0){
+                courseScheduleStudentPayment.setExpectPrice(firstAmount);
+                courseScheduleStudentPayment.setActualPrice(firstAmount);
+            }else {
+                courseScheduleStudentPayment.setExpectPrice(divide);
+                courseScheduleStudentPayment.setActualPrice(divide);
+            }
+            courseScheduleStudentPayment.setOriginalPrice(singleClassMinutesPrice);
+            courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
+            courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+
+            //教师签到记录
+            TeacherAttendance teacherAttendance = new TeacherAttendance();
+            teacherAttendance.setMusicGroupId(practiceGroup.getId().toString());
+            teacherAttendance.setTeacherId(practiceGroup.getStudentId());
+            teacherAttendance.setClassGroupId(classGroup.getId());
+            teacherAttendance.setGroupType(GroupType.PRACTICE);
+            teacherAttendance.setCourseScheduleId(courseSchedule.getId());
+            teacherAttendances.add(teacherAttendance);
+        }
+        courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+        teacherAttendanceDao.batchInsert(teacherAttendances);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public void activityOrderCallback(StudentPaymentOrder studentPaymentOrder) {
@@ -4120,18 +4191,21 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(Objects.nonNull(practiceGroup.getType())&&(PracticeGroupType.CARE_PACKAGE.equals(practiceGroup.getType())||PracticeGroupType.COME_ON_PACKAGE.equals(practiceGroup.getType()))){
             practiceCourseMinutes = 50;
         }
-        JSONArray coursesArry = new JSONArray();
-        JSONObject courseJson = JSON.parseObject(practiceGroup.getDrillTimesJson());
-        for (String weekNumStr : courseJson.keySet()) {
-            JSONObject newCourseJson = new JSONObject();
-            newCourseJson.put("weekName", DateUtil.weekNumNormalWeekNameMap.get(Integer.parseInt(weekNumStr)));
-            LocalTime courseStartTime = LocalTime.parse(courseJson.getString(weekNumStr), DateUtil.timeFormatter);
-            LocalTime courseEndTime = courseStartTime.plusMinutes(practiceCourseMinutes);
-            newCourseJson.put("startTime", courseStartTime.format(DateUtil.timeFormatter));
-            newCourseJson.put("endTime", courseEndTime.format(DateUtil.timeFormatter));
-            coursesArry.add(newCourseJson);
-        }
-        practiceBuyResult.setDrillTimesJson(coursesArry.toJSONString());
+
+        if(StringUtils.isNotEmpty(practiceGroup.getDrillTimesJson())){
+            JSONArray coursesArry = new JSONArray();
+            JSONObject courseJson = JSON.parseObject(practiceGroup.getDrillTimesJson());
+            for (String weekNumStr : courseJson.keySet()) {
+                JSONObject newCourseJson = new JSONObject();
+                newCourseJson.put("weekName", DateUtil.weekNumNormalWeekNameMap.get(Integer.parseInt(weekNumStr)));
+                LocalTime courseStartTime = LocalTime.parse(courseJson.getString(weekNumStr), DateUtil.timeFormatter);
+                LocalTime courseEndTime = courseStartTime.plusMinutes(practiceCourseMinutes);
+                newCourseJson.put("startTime", courseStartTime.format(DateUtil.timeFormatter));
+                newCourseJson.put("endTime", courseEndTime.format(DateUtil.timeFormatter));
+                coursesArry.add(newCourseJson);
+            }
+            practiceBuyResult.setDrillTimesJson(coursesArry.toJSONString());
+        }
         practiceBuyResult.setCourseStartTime(practiceGroup.getCoursesStartDate());
         practiceBuyResult.setCourseEndTime(practiceGroup.getCoursesExpireDate());
         Teacher teacher = teacherDao.get(practiceGroup.getUserId());
@@ -4530,7 +4604,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 throw new BizException("课酬结算方案错误");
             }
             salarySettlement = vipGroupSalarySettlementDto.getPracticeSalarySettlement();
-            totalPrice = totalPrice.multiply(vipGroupActivity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+            totalPrice = totalPrice.multiply(vipGroupActivity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
         }
         //教师课酬线上单课酬计算
         teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
@@ -4685,7 +4759,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         classGroupDao.insert(classGroup);
 
         //创建班级老师关联记录
-        ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
+        ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
         classGroupTeacherMapper.setMusicGroupId(applyBaseInfoDto.getId().toString());
         classGroupTeacherMapper.setClassGroupId(classGroup.getId());
         classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
@@ -5224,7 +5298,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 default:
                     throw new BizException("错误的会员周期");
             }
-            activityFee = activityFee.multiply(activity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+            activityFee = activityFee.multiply(activity.getDiscount()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
         }
         //计算订单金额
         StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(), activityFee, true);

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

@@ -786,18 +786,23 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                 switch (periodEnum){
                     case DAY:
                         cloudTeacherOrder.setEndTime(DateUtil.addDays(startDate, activity.getGiveMemberTime()));
+                        cloudTeacherOrder.setTime(activity.getGiveMemberTime());
                         break;
                     case MONTH:
                         cloudTeacherOrder.setEndTime(DateUtil.addMonths(startDate, activity.getGiveMemberTime()));
+                        cloudTeacherOrder.setTime(activity.getGiveMemberTime());
                         break;
                     case QUARTERLY:
                         cloudTeacherOrder.setEndTime(DateUtil.addMonths(startDate, activity.getGiveMemberTime() * 3));
+                        cloudTeacherOrder.setTime(activity.getGiveMemberTime() * 3);
                         break;
                     case YEAR_HALF:
                         cloudTeacherOrder.setEndTime(DateUtil.addMonths(startDate, activity.getGiveMemberTime() * 6));
+                        cloudTeacherOrder.setTime(activity.getGiveMemberTime() * 6);
                         break;
                     case YEAR:
                         cloudTeacherOrder.setEndTime(DateUtil.addYears(startDate, activity.getGiveMemberTime()));
+                        cloudTeacherOrder.setTime(activity.getGiveMemberTime());
                         break;
                     default:
                         throw new BizException("不支持的周期类型");

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

@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
 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;
 
@@ -87,26 +88,25 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 	private ActivityApplyStudentType getApplyToStudentType(String applyToStudentType){
 		ActivityApplyStudentType activityApplyStudentType = new ActivityApplyStudentType();
 		if(StringUtils.isNotEmpty(applyToStudentType)){
+			List<Integer> collect = Arrays.stream(applyToStudentType.split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
 			//0:老用户;1:新用户,2会员,3非会员
-			if(applyToStudentType.contains("0") && applyToStudentType.contains("1")){
-				applyToStudentType.replace("0","");
-				applyToStudentType.replace("1","");
-			}
-			if(applyToStudentType.contains("3") && applyToStudentType.contains("2")){
-				applyToStudentType.replace("2","");
-				applyToStudentType.replace("3","");
-			}
-			if(StringUtils.isNotEmpty(applyToStudentType)){
-				if(applyToStudentType.contains("0")){
+			if(collect.contains(0) && collect.contains(1)){
+				activityApplyStudentType.setNewStudent(-1);
+			}else {
+				if(collect.contains(0)){
 					activityApplyStudentType.setNewStudent(0);
 				}
-				if(applyToStudentType.contains("1")){
+				if(collect.contains(1)){
 					activityApplyStudentType.setNewStudent(1);
 				}
-				if(applyToStudentType.contains("2")){
+			}
+			if(collect.contains(2) && collect.contains(3)){
+				activityApplyStudentType.setMemberFlag(-1);
+			}else {
+				if(collect.contains(2)){
 					activityApplyStudentType.setMemberFlag(1);
 				}
-				if(applyToStudentType.contains("3")){
+				if(collect.contains(3)){
 					activityApplyStudentType.setMemberFlag(0);
 				}
 			}