|
|
|
@ -2,6 +2,7 @@ package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
@ -11,6 +12,7 @@ import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.StudentDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeSchoolClassDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeStudentDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
@ -53,6 +55,9 @@ public class TeacherOpenCourseMergeSchoolClassService extends CoreBaseService<Te
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentService studentService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentDao studentDao;
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseMergeSchoolClass>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = teacherOpenCourseMergeSchoolClassDao.queryByCondition(query);
|
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
@ -282,8 +287,19 @@ public class TeacherOpenCourseMergeSchoolClassService extends CoreBaseService<Te
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseMergeStudent> collect = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent : studentDelList) {
|
|
|
|
|
Student student = studentDao.getById(teacherOpenCourseMergeStudent.getStudentId());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(student)) {
|
|
|
|
|
if (classIds.contains(student.getClassId().toString())) {
|
|
|
|
|
collect.add(teacherOpenCourseMergeStudent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取关联表要删除的主键Ids
|
|
|
|
|
String idsDelAdString = CollectionUtil.emptyIfNull(studentDelList).stream().map(
|
|
|
|
|
String idsDelAdString = CollectionUtil.emptyIfNull(collect).stream().map(
|
|
|
|
|
o -> o.getTeacherOpenCourseSchoolClassMergeStudentId().toString()).collect(joining(","));
|
|
|
|
|
// 删除 班级方式加入的学生
|
|
|
|
|
teacherOpenCourseMergeStudentDao.deleteByIds(idsDelAdString);
|
|
|
|
|