|
@@ -70,13 +70,11 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
@Autowired
|
|
|
private SysUserCashAccountDetailService sysUserCashAccountDetailService;
|
|
|
@Autowired
|
|
|
- private ContractService contractService;
|
|
|
- @Autowired
|
|
|
- private TeacherService teacherService;
|
|
|
- @Autowired
|
|
|
private ImFeignService imFeignService;
|
|
|
@Autowired
|
|
|
private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
+ @Autowired
|
|
|
+ private SysTenantAccountService sysTenantAccountService;
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory
|
|
|
.getLogger(PracticeGroupService.class);
|
|
@@ -112,6 +110,10 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
|
|
|
//总课程时长
|
|
|
Integer totalCourseTime=courseCycleInfo.getCourseCount()*courseCycleInfo.getSingleClassMinutes();
|
|
|
+ SysTenantAccount sysTenantAccount = sysTenantAccountService.get(courseGroup.getTeacherId());
|
|
|
+ if(Objects.isNull(sysTenantAccount)||(sysTenantAccount.getAvailableMinutes()-totalCourseTime)<0){
|
|
|
+ throw new BizException("您的可用课程时长不足");
|
|
|
+ }
|
|
|
|
|
|
Date now=new Date();
|
|
|
courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
|
|
@@ -123,7 +125,7 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
newCourse.setType(CourseSchedule.CourseScheduleType.COMM);
|
|
|
newCourse.setTeacherId(courseGroup.getTeacherId());
|
|
|
newCourse.setActualTeacherId(courseGroup.getTeacherId());
|
|
|
- newCourse.setIsLock(1);
|
|
|
+ newCourse.setIsLock(0);
|
|
|
newCourse.setStatus(CourseStatusEnum.NOT_START);
|
|
|
newCourse.setName(courseGroup.getName());
|
|
|
}
|
|
@@ -145,8 +147,7 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
//创建班级信息
|
|
|
ClassGroup classGroup = new ClassGroup();
|
|
|
classGroup.setSubjectIdList(courseGroup.getSubjectId().toString());
|
|
|
- classGroup.setExpectStudentNum(1);
|
|
|
- classGroup.setStudentNum(1);
|
|
|
+ classGroup.setExpectStudentNum(courseGroup.getMaxStudentNum());
|
|
|
classGroup.setName(courseGroup.getName());
|
|
|
classGroup.setTotalClassTimes(courseCycleInfo.getCourseCount());
|
|
|
classGroup.setType(ClassGroupTypeEnum.COMM);
|
|
@@ -514,6 +515,12 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
classGroupStudentMapper.setGroupType(GroupType.COMM);
|
|
|
classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentMapperDao.findByClassGroup(classGroup.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(classGroupStudents)&&classGroupStudents.size()==classGroup.getExpectStudentNum()){
|
|
|
+ coursesGroup.setStatus(GroupStatusEnum.NORMAL);
|
|
|
+ coursesGroupDao.update(coursesGroup);
|
|
|
+ }
|
|
|
+
|
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
|
|
|
List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(order.getMusicGroupId(), GroupType.COMM);
|
|
|
if(CollectionUtils.isEmpty(groupNotStartCourses)){
|