|
@@ -19,7 +19,9 @@ import com.ym.mec.common.page.QueryInfo;
|
|
import com.ym.mec.common.service.IdGeneratorService;
|
|
import com.ym.mec.common.service.IdGeneratorService;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.im.ImFeignService;
|
|
import com.ym.mec.im.ImFeignService;
|
|
|
|
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -80,6 +82,8 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
private SysTenantAccountService sysTenantAccountService;
|
|
private SysTenantAccountService sysTenantAccountService;
|
|
@Autowired
|
|
@Autowired
|
|
private StudentDao studentDao;
|
|
private StudentDao studentDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory
|
|
private static final Logger LOGGER = LoggerFactory
|
|
.getLogger(PracticeGroupService.class);
|
|
.getLogger(PracticeGroupService.class);
|
|
@@ -117,11 +121,11 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
|
|
|
|
//总课程时长
|
|
//总课程时长
|
|
Integer totalCourseTime=courseCycleInfo.getCourseCount()*courseCycleInfo.getSingleClassMinutes();
|
|
Integer totalCourseTime=courseCycleInfo.getCourseCount()*courseCycleInfo.getSingleClassMinutes();
|
|
-// sysTenantAccountService.update(courseGroup.getTeacherId(), -totalCourseTime, SysTenantAccountDetail.TransType.CONSUME, "",BigDecimal.ZERO,"课程组创建");
|
|
|
|
|
|
+ sysTenantAccountService.update(courseGroup.getTeacherId(), -totalCourseTime, "", SysTenantAccountDetail.TransType.CONSUME, "",BigDecimal.ZERO,"课程组创建");
|
|
|
|
|
|
Date now=new Date();
|
|
Date now=new Date();
|
|
courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
|
|
courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
|
|
- courseGroup.setStatus(GroupStatusEnum.APPLYING);
|
|
|
|
|
|
+ courseGroup.setStatus(GroupStatusEnum.NORMAL);
|
|
List<CourseSchedule> newCourses = courseScheduleService.createCourses(courseGroupCreateInfo.getCourseCycleInfo());
|
|
List<CourseSchedule> newCourses = courseScheduleService.createCourses(courseGroupCreateInfo.getCourseCycleInfo());
|
|
for (CourseSchedule newCourse : newCourses) {
|
|
for (CourseSchedule newCourse : newCourses) {
|
|
newCourse.setTeachMode(TeachModeEnum.ONLINE);
|
|
newCourse.setTeachMode(TeachModeEnum.ONLINE);
|
|
@@ -330,9 +334,7 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
throw new BizException("请指定课程组");
|
|
throw new BizException("请指定课程组");
|
|
}
|
|
}
|
|
|
|
|
|
- studentDao.lockUser(userId);
|
|
|
|
-
|
|
|
|
- CoursesGroup coursesGroup = coursesGroupDao.get(courseGroupId);
|
|
|
|
|
|
+ CoursesGroup coursesGroup = coursesGroupDao.lockGroup(courseGroupId);
|
|
if(Objects.isNull(coursesGroup)){
|
|
if(Objects.isNull(coursesGroup)){
|
|
throw new BizException("此课程组不存在");
|
|
throw new BizException("此课程组不存在");
|
|
}
|
|
}
|
|
@@ -589,4 +591,19 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
|
|
// 创建群组
|
|
// 创建群组
|
|
imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void noStudentsCourseGroupRemind() {
|
|
|
|
+ Date startDate = DateUtil.addDays(new Date(), -1);
|
|
|
|
+ List<CoursesGroup> noStudentsGroups = coursesGroupDao.findNoStudentsGroups(startDate);
|
|
|
|
+ if(CollectionUtils.isEmpty(noStudentsGroups)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (CoursesGroup noStudentsGroup : noStudentsGroups) {
|
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
|
+ userMap.put(noStudentsGroup.getTeacherId(), noStudentsGroup.getTeacherId().toString());
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.COMM_NO_STUDENTS_PUSH,
|
|
|
|
+ userMap, null, 0, null, "TEACHER", noStudentsGroup.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|