|
@@ -11,6 +11,9 @@ import com.xjrsoft.common.enums.EvaluateTypeEnum;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
+import com.xjrsoft.module.courseTable.dto.ClassTeacherDto;
|
|
|
+import com.xjrsoft.module.courseTable.mapper.CourseTableMapper;
|
|
|
+import com.xjrsoft.module.courseTable.vo.ClassTeacherVo;
|
|
|
import com.xjrsoft.module.evaluate.dto.AddEvaluateExecuterDto;
|
|
|
import com.xjrsoft.module.evaluate.dto.AddEvaluateObjectDto;
|
|
|
import com.xjrsoft.module.evaluate.dto.EvaluateObjectGradeListDto;
|
|
@@ -29,6 +32,9 @@ import com.xjrsoft.module.evaluate.vo.EvaluateExecuterVo;
|
|
|
import com.xjrsoft.module.evaluate.vo.EvaluateManageVo;
|
|
|
import com.xjrsoft.module.evaluate.vo.EvaluateObjectGradeListVo;
|
|
|
import com.xjrsoft.module.evaluate.vo.EvaluateObjectListVo;
|
|
|
+import com.xjrsoft.module.organization.entity.User;
|
|
|
+import com.xjrsoft.module.organization.service.IUserService;
|
|
|
+import com.xjrsoft.module.teacher.entity.BaseTeacher;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -55,6 +61,8 @@ public class EvaluateObjectServiceImpl extends MPJBaseServiceImpl<EvaluateObject
|
|
|
|
|
|
private final EvaluateObjectMapper evaluateObjectMapper;
|
|
|
private final EvaluateExecuterMapper evaluateExecuterMapper;
|
|
|
+ private final CourseTableMapper courseTableMapper;
|
|
|
+ private final IUserService userService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -240,21 +248,38 @@ public class EvaluateObjectServiceImpl extends MPJBaseServiceImpl<EvaluateObject
|
|
|
}
|
|
|
}else if(dto.getEvaluateType() != null && dto.getEvaluateType().equals(EvaluateTypeEnum.TEACHER_EVALUATE_CLASS.getCode())) {//任课教师对班级评价
|
|
|
EvaluateManage manage = evaluateManageMapper.selectById(dto.getEvaluateManageId());
|
|
|
-
|
|
|
newObjectList = evaluateObjectMapper.getNewObjectList(dto);
|
|
|
- List<Long> classIds = newObjectList.stream().map(x -> Long.parseLong(x.getObjectId())).collect(Collectors.toList());
|
|
|
- dto.setClassIds(classIds);
|
|
|
- dto.setStartDate(manage.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
- dto.setEndDate(manage.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
|
|
|
- List<EvaluateExecuterVo> newExecuterList = evaluateObjectMapper.getNewExecuterList(dto);
|
|
|
+ List<ClassTeacherVo> classTeacher = courseTableMapper.getClassTeacherIds(
|
|
|
+ new ClassTeacherDto() {{
|
|
|
+ setStartDate(manage.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
+ setGradeId(dto.getGradeId());
|
|
|
+ setEndDate(manage.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
+ }}
|
|
|
+ );
|
|
|
+
|
|
|
+ List<User> userList = userService.list(
|
|
|
+ new MPJLambdaWrapper<User>()
|
|
|
+ .select(User::getId)
|
|
|
+ .select(User.class, x -> VoToColumnUtil.fieldsToColumns(User.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(BaseTeacher.class, BaseTeacher::getUserId, User::getId)
|
|
|
+ );
|
|
|
+ Map<Long, String> userMap = userList.stream().collect(Collectors.toMap(User::getId, User::getName));
|
|
|
for (EvaluateObjectListVo objectListVo : newObjectList) {
|
|
|
List<EvaluateExecuterVo> currentExecuterList = new ArrayList<>();
|
|
|
- for (EvaluateExecuterVo executerVo : newExecuterList) {
|
|
|
- if(!objectListVo.getObjectId().equals(executerVo.getClassId())){
|
|
|
+ for (ClassTeacherVo executerVo : classTeacher) {
|
|
|
+ if(!objectListVo.getObjectId().equals(executerVo.getClassId().toString())){
|
|
|
continue;
|
|
|
}
|
|
|
- currentExecuterList.add(executerVo);
|
|
|
+
|
|
|
+ String[] teacherIds = executerVo.getTeacherId().split(",");
|
|
|
+ for (String teacherId : teacherIds) {
|
|
|
+ EvaluateExecuterVo evaluateExecuterVo = new EvaluateExecuterVo();
|
|
|
+ evaluateExecuterVo.setEvaluateObjectId(teacherId);
|
|
|
+ evaluateExecuterVo.setExecuterName(userMap.get(Long.parseLong(teacherId)));
|
|
|
+ evaluateExecuterVo.setEvaluateManageId(dto.getEvaluateManageId().toString());
|
|
|
+ currentExecuterList.add(evaluateExecuterVo);
|
|
|
+ }
|
|
|
}
|
|
|
objectListVo.setExecuterCount(currentExecuterList.size());
|
|
|
objectListVo.setExecuterList(currentExecuterList);
|