|
@@ -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,12 @@ 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("您的可用课程时长不足");
|
|
|
+ }
|
|
|
+ sysTenantAccount.setAvailableMinutes(sysTenantAccount.getAvailableMinutes()-totalCourseTime);
|
|
|
+ sysTenantAccountService.update(sysTenantAccount);
|
|
|
|
|
|
Date now=new Date();
|
|
|
courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
|
|
@@ -123,7 +127,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());
|
|
|
}
|