|
@@ -17,8 +17,10 @@ import com.qmth.distributed.print.business.service.TeachCourseService;
|
|
|
import com.qmth.distributed.print.business.service.TeachStudentService;
|
|
|
import com.qmth.teachcloud.common.base.BaseEntity;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -40,6 +42,8 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
|
private TeachStudentService teachStudentService;
|
|
|
@Resource
|
|
|
private TeachCourseService teachCourseService;
|
|
|
+ @Resource
|
|
|
+ private BasicCourseService basicCourseService;
|
|
|
|
|
|
@Override
|
|
|
public IPage<TeachClazzResult> teachClazzPage(Long teachCourseId, String teachClazzName, int pageNumber, int pageSize) {
|
|
@@ -87,17 +91,15 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
|
.eq(TeachClazz::getTeachCourseId, teachCourseId));
|
|
|
|
|
|
if (Objects.nonNull(check)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("教学课程【" + check.getTeachCourseName() + "】中已存在班级名称为【" + check.getTeachClazzName() + "】的班级");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("教学课程【" + basicCourseService.getById(teachCourseService.getById(check.getTeachCourseId()).getBasicCourseId()).getName()
|
|
|
+ + "】中已存在班级名称为【" + check.getTeachClazzName() + "】的班级");
|
|
|
}
|
|
|
|
|
|
TeachClazz teachClazz = new TeachClazz();
|
|
|
teachClazz.setSchoolId(schoolId);
|
|
|
teachClazz.setTeachClazzName(teachClazzName);
|
|
|
teachClazz.setUserId(teachCourse.getUserId());
|
|
|
- teachClazz.setUserName(teachCourse.getUserName());
|
|
|
teachClazz.setTeachCourseId(teachCourseId);
|
|
|
- teachClazz.setTeachCourseCode(teachCourse.getBasicCourseCode());
|
|
|
- teachClazz.setTeachCourseName(teachCourse.getBasicCourseName());
|
|
|
teachClazz.insertInfo(requestUser.getId());
|
|
|
result = this.save(teachClazz);
|
|
|
}
|
|
@@ -122,10 +124,11 @@ public class TeachClazzServiceImpl extends ServiceImpl<TeachClazzMapper,TeachCla
|
|
|
.eq(TeachCourse::getSchoolId, schoolId)
|
|
|
.orderByDesc(TeachCourse::getCreateTime));
|
|
|
return teachCourseList.stream().flatMap(e -> {
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(e.getBasicCourseId());
|
|
|
DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setCode(e.getBasicCourseCode());
|
|
|
- dictionaryResult.setName(e.getBasicCourseName());
|
|
|
+ dictionaryResult.setCode(basicCourse.getCode());
|
|
|
+ dictionaryResult.setName(basicCourse.getName());
|
|
|
return Stream.of(dictionaryResult);
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|