|
@@ -111,13 +111,58 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/moblieInfo")
|
|
|
+ @ApiOperation(value="根据id查询学生班级巡查考核信息")
|
|
|
+ @SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
+ public RT<List<BaseStudentAssessmentInspectionPageVo>> moblieInfo(@RequestParam Long id){
|
|
|
+ BaseStudentAssessmentInspection baseStudentAssessmentInspection = baseStudentAssessmentInspectionService.getById(id);
|
|
|
+ if (baseStudentAssessmentInspection == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ List<BaseStudentAssessmentInspectionPageVo> list = baseStudentAssessmentInspectionService.selectJoinList(BaseStudentAssessmentInspectionPageVo.class,
|
|
|
+ MPJWrappers.<BaseStudentAssessmentInspection>lambdaJoin()
|
|
|
+ .eq(ObjectUtil.isNotNull(id), BaseStudentAssessmentInspection::getId, id)
|
|
|
+ .eq(BaseStudentAssessmentInspection::getStatus, 1)
|
|
|
+ .selectAs(BaseClass::getName, BaseStudentAssessmentInspectionPageVo::getClassName)
|
|
|
+ .select("u.name as class_teacher")
|
|
|
+ .select("d.name as dept_name")
|
|
|
+ .select("(SELECT COUNT(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id = t.id) as student_count")
|
|
|
+ .select("(SELECT name FROM xjr_user WHERE id = t.assessment_user_id) as assessment_user_name")
|
|
|
+ .select(BaseStudentAssessmentInspection::getScore)
|
|
|
+ .select(BaseStudentAssessmentInspection::getSortCode)
|
|
|
+ .select(BaseStudentAssessmentInspection::getReason)
|
|
|
+ .select(BaseStudentAssessmentInspection::getId)
|
|
|
+ .select(BaseStudentAssessmentInspection::getFileId)
|
|
|
+ .selectAs(BaseStudentAssessmentCategory::getName, BaseStudentAssessmentInspectionPageVo::getAssessmentCategoryName)
|
|
|
+ .selectAs(BaseStudentAssessmentProject::getName, BaseStudentAssessmentInspectionPageVo::getAssessmentProjectName)
|
|
|
+ .innerJoin(BaseStudentAssessmentCategory.class, BaseStudentAssessmentCategory::getId, BaseStudentAssessmentInspection::getBaseStudentAssessmentCategoryId)
|
|
|
+ .innerJoin(BaseStudentAssessmentProject.class, BaseStudentAssessmentProject::getId, BaseStudentAssessmentInspection::getBaseStudentAssessmentProjectId)
|
|
|
+ .leftJoin(XjrUser.class, XjrUser::getId, BaseStudentAssessmentInspection::getAssessmentUserId)
|
|
|
+ .innerJoin(BaseStudentAssessmentClassRelation.class, BaseStudentAssessmentClassRelation::getBaseStudentAssessmentInspectionId, BaseStudentAssessmentInspection::getId)
|
|
|
+ .innerJoin(BaseClass.class, BaseClass::getId, BaseStudentAssessmentClassRelation::getClassId)
|
|
|
+ .innerJoin("xjr_user u on t5.teacher_id = u.id")
|
|
|
+ .innerJoin("xjr_department d on t5.org_id = d.id")
|
|
|
+ );
|
|
|
+ for (BaseStudentAssessmentInspectionPageVo inspectionPageVo : list) {
|
|
|
+ //查询学生
|
|
|
+ LambdaQueryWrapper<BaseStudentAssessmentStudentRelation> studentQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ studentQueryWrapper
|
|
|
+ .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, inspectionPageVo.getId())
|
|
|
+ .select(BaseStudentAssessmentStudentRelation.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentStudentRelationVo.class).contains(x.getProperty()));
|
|
|
+ List<BaseStudentAssessmentStudentRelation> studentList = baseStudentAssessmentStudentRelationService.list(studentQueryWrapper);
|
|
|
+ inspectionPageVo.setStudentList(BeanUtil.copyToList(studentList, BaseStudentAssessmentStudentRelationVo.class));
|
|
|
+ inspectionPageVo.setStudentCount(studentList.size());
|
|
|
+ }
|
|
|
+ return RT.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping(value = "/info")
|
|
|
@ApiOperation(value="根据id查询学生班级巡查考核信息")
|
|
|
@SaCheckPermission("basestudentassessmentinspection:detail")
|
|
|
public RT<BaseStudentAssessmentInspectionVo> info(@RequestParam Long id){
|
|
|
BaseStudentAssessmentInspection baseStudentAssessmentInspection = baseStudentAssessmentInspectionService.getById(id);
|
|
|
if (baseStudentAssessmentInspection == null) {
|
|
|
- return RT.error("找不到此数据!");
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
}
|
|
|
BaseStudentAssessmentInspectionVo baseStudentAssessmentInspectionVo = BeanUtil.toBean(baseStudentAssessmentInspection, BaseStudentAssessmentInspectionVo.class);
|
|
|
//查询班级
|