|
|
@@ -38,6 +38,7 @@ import com.xjrsoft.module.student.vo.StudentReportPlanVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
@@ -85,12 +86,13 @@ public class StudentReportPlanController {
|
|
|
}
|
|
|
StudentReportPlanVo planVo = BeanUtil.toBean(studentReportPlan, StudentReportPlanVo.class);
|
|
|
List<Long> classIds = studentReportPlan.getStudentReportPlanClassRelationList().stream().map(StudentReportPlanClassRelation::getClassId).collect(Collectors.toList());
|
|
|
-
|
|
|
- List<BaseClass> classList = classService.listByIds(classIds);
|
|
|
- Map<Long, String> classMaps = classList.stream().collect(Collectors.toMap(BaseClass::getId, BaseClass::getName));
|
|
|
- List<StudentReportPlanClassRelationVo> classRelationList = planVo.getStudentReportPlanClassRelationList();
|
|
|
- for (StudentReportPlanClassRelationVo baseClass : classRelationList) {
|
|
|
- baseClass.setClassName(classMaps.get(baseClass.getClassId()));
|
|
|
+ if(CollectionUtils.isNotEmpty(classIds)){
|
|
|
+ List<BaseClass> classList = classService.listByIds(classIds);
|
|
|
+ Map<Long, String> classMaps = classList.stream().collect(Collectors.toMap(BaseClass::getId, BaseClass::getName));
|
|
|
+ List<StudentReportPlanClassRelationVo> classRelationList = planVo.getStudentReportPlanClassRelationList();
|
|
|
+ for (StudentReportPlanClassRelationVo baseClass : classRelationList) {
|
|
|
+ baseClass.setClassName(classMaps.get(baseClass.getClassId()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return RT.ok(planVo);
|