Browse Source

feat:六一活动排课

Joburgess 4 years ago
parent
commit
9a29ed4c43

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -496,6 +496,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("教学模式错误");
 		}
 
+		if(StringUtils.isBlank(vipGroup.getVipGroupApplyBaseInfo().getSubjectIdList())){
+			throw new BizException("请选择声部");
+		}
+
 		if(ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())){
 			List<VipGroupCategory> vipGroupCategories = vipGroupCategoryDao.findAllByOrgan(vipGroup.getVipGroupApplyBaseInfo().getOrganId().toString());
 			VipGroupCategory vipGroupCategory = vipGroupCategories.stream().filter(v -> v.getName().equals("1v2")).findFirst().get();
@@ -625,7 +629,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		int repeatVipGroups = vipGroupDao.countUserRepeatVipGroupInCourseStartEndTime(vipGroupApplyBaseInfoDto.getUserId(), firstCourseSchedule.getStartClassTime(), latestCourseSchedule.getEndClassTime());
 		if(repeatVipGroups>0){
-			throw new BizException("请勿重复提交");
+			SysUser sysUser = sysUserFeignService.queryUserById(vipGroupApplyBaseInfoDto.getUserId());
+			throw new BizException("{}课程时间冲突({}-{})", sysUser.getRealName(), DateUtil.dateToString(firstCourseSchedule.getStartClassTime(), "yyyy-MM-dd HH:mm:ss"), DateUtil.dateToString(latestCourseSchedule.getEndClassTime(), "HH:mm:ss"));
 		}
 
 		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroupApplyBaseInfoDto.getVipGroupCategoryId());
@@ -693,9 +698,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		//创建班级信息
 		ClassGroup classGroup=new ClassGroup();
 		classGroup.setSubjectIdList(vipGroupApplyBaseInfoDto.getSubjectIdList());
-		if(StringUtils.isBlank(classGroup.getSubjectIdList())){
-			classGroup.setSubjectIdList(studentDetail.get(0).getSubjectIdList());
-		}
 		classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
 		classGroup.setStudentNum(studentIdList.size());
 		classGroup.setName(vipGroupApplyBaseInfoDto.getName());