|  | @@ -18,6 +18,7 @@ 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;
 | 
	
	
		
			
				|  | @@ -112,6 +113,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |      private TeacherService teacherService;
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private StudentPauseInfoDao studentPauseInfoDao;
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private IdGeneratorService idGeneratorService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	private static final Logger LOGGER = LoggerFactory
 | 
	
		
			
				|  |  |  			.getLogger(VipGroup.class);
 | 
	
	
		
			
				|  | @@ -1034,7 +1037,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		StudentPaymentOrder studentPaymentOrder=new StudentPaymentOrder();
 | 
	
		
			
				|  |  |  		studentPaymentOrder.setUserId(user.getId());
 | 
	
		
			
				|  |  |          studentPaymentOrder.setGroupType(GroupType.VIP);
 | 
	
		
			
				|  |  | -		String orderNo=StringUtils.join(new String[]{user.getId().toString(),String.valueOf(System.currentTimeMillis())});
 | 
	
		
			
				|  |  | +		String orderNo=idGeneratorService.generatorId("payment") + "";
 | 
	
		
			
				|  |  |  		studentPaymentOrder.setOrderNo(orderNo);
 | 
	
		
			
				|  |  |  		studentPaymentOrder.setStatus(DealStatusEnum.ING);
 | 
	
		
			
				|  |  |  		studentPaymentOrder.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
 | 
	
	
		
			
				|  | @@ -1387,6 +1390,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		studentPauseInfo.setMusicGroupId(vipGroup.getId().intValue());
 | 
	
		
			
				|  |  |  		studentPauseInfo.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  |          studentPauseInfo.setCoursesJson(JSON.toJSONString(pauseInfos));
 | 
	
		
			
				|  |  | +        studentPauseInfo.setSurplusCourseNum(userSurplusCourseInfoByGroup.size());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          studentPauseInfoDao.insert(studentPauseInfo);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1462,7 +1466,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		Collections.reverse(coursePrices);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		if(vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)){
 | 
	
		
			
				|  |  | -			studentRecoverInfo.setCourseCount(teachModeSequence.length);
 | 
	
		
			
				|  |  | +			List<StudentPauseInfo> studentPauseInfos=studentPauseInfoDao.findByGroup(GroupType.VIP, vipGroup.getId().toString());
 | 
	
		
			
				|  |  | +			StudentPauseInfo studentPauseInfo1 = studentPauseInfos.stream().min(Comparator.comparing(StudentPauseInfo::getSurplusCourseNum)).get();
 | 
	
		
			
				|  |  | +			Map<String, Object> courseInfo1 = JSON.parseObject(studentPauseInfo1.getCoursesJson(), Map.class);
 | 
	
		
			
				|  |  | +			Integer[] teachModeSequence1=JSON.parseArray(courseInfo1.get("teaChModeSequence").toString(), Integer.class).stream().toArray(Integer[]::new);
 | 
	
		
			
				|  |  | +			studentRecoverInfo.setCourseCount(teachModeSequence1.length);
 | 
	
		
			
				|  |  |  			List<CourseSchedule> newCourseSchedules = courseScheduleService.createCourses(studentRecoverInfo);
 | 
	
		
			
				|  |  |  			for(int i=0;i<newCourseSchedules.size();i++){
 | 
	
		
			
				|  |  |  				newCourseSchedules.get(i).setGroupType(GroupType.VIP);
 | 
	
	
		
			
				|  | @@ -1473,7 +1481,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  				newCourseSchedules.get(i).setActualTeacherId(vipGroup.getUserId());
 | 
	
		
			
				|  |  |  				newCourseSchedules.get(i).setTeacherId(vipGroup.getUserId());
 | 
	
		
			
				|  |  |  				newCourseSchedules.get(i).setType(CourseSchedule.CourseScheduleType.VIP);
 | 
	
		
			
				|  |  | -				newCourseSchedules.get(i).setTeachMode(teachModeSequence[i]==0?TeachModeEnum.OFFLINE:TeachModeEnum.ONLINE);
 | 
	
		
			
				|  |  | +				newCourseSchedules.get(i).setTeachMode(teachModeSequence1[i]==0?TeachModeEnum.OFFLINE:TeachModeEnum.ONLINE);
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
 | 
	
		
			
				|  |  |  
 |