|
@@ -23,19 +23,27 @@ import com.xjrsoft.common.utils.TreeUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
+import com.xjrsoft.module.base.entity.BaseMajorSet;
|
|
|
import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.concat.service.IXjrUserService;
|
|
|
import com.xjrsoft.module.hikvision.util.DataUtil;
|
|
|
+import com.xjrsoft.module.organization.entity.Department;
|
|
|
import com.xjrsoft.module.organization.entity.UserDeptRelation;
|
|
|
+import com.xjrsoft.module.organization.service.IDepartmentService;
|
|
|
import com.xjrsoft.module.organization.service.IUserDeptRelationService;
|
|
|
import com.xjrsoft.module.room.service.IRoomBedService;
|
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
|
|
|
+import com.xjrsoft.module.student.entity.BaseClassMajorSet;
|
|
|
+import com.xjrsoft.module.student.entity.BaseMajor;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
+import com.xjrsoft.module.student.service.IBaseMajorService;
|
|
|
import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
+import com.xjrsoft.module.student.vo.BaseClassMajorSetVo;
|
|
|
+import com.xjrsoft.module.student.vo.BaseDepMajorGradeClassStudenTreeVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentSchoolRollVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentTreeVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
@@ -81,6 +89,8 @@ public class StudentManagerController {
|
|
|
|
|
|
private final IStudentManagerService studentManagerService;
|
|
|
private final IBaseGradeService baseGradeService;
|
|
|
+ private final IDepartmentService baseDeparmentService;
|
|
|
+ private final IBaseMajorService baseMajorService;
|
|
|
private final IBaseClassService baseClassService;
|
|
|
private final IXjrUserService xjrUserService;
|
|
|
private final IRoomBedService roomBedService;
|
|
@@ -192,6 +202,79 @@ public class StudentManagerController {
|
|
|
return R.ok(userVo);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/majro-grade-class-tree")
|
|
|
+ @ApiOperation(value = "学生部门专业年级班级树")
|
|
|
+ @SaCheckPermission("studentmanager:detail")
|
|
|
+ public RT<List<BaseDepMajorGradeClassStudenTreeVo>> tree2() {
|
|
|
+ List<BaseDepMajorGradeClassStudenTreeVo> voList = new ArrayList<>();
|
|
|
+ MPJLambdaWrapper<BaseClass> baseClassMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
+// MPJLambdaWrapper<BaseMajorSet> majorSetWrapper = new MPJLambdaWrapper<>();
|
|
|
+// majorSetWrapper
|
|
|
+// .select(BaseClass::getId)
|
|
|
+// .select("t.major_id")
|
|
|
+// .select("t3.name as className")
|
|
|
+// .select("t3.id as classId")
|
|
|
+// .select("t3.grade_id")
|
|
|
+// .leftJoin("base_class_major_set t2 on t2.major_set_id = t.id")
|
|
|
+// .leftJoin("base_class t3 on t3.id = t2.class_id")
|
|
|
+// .eq(BaseMajorSet::getDeleteMark, DeleteMark.NODELETE.getCode());
|
|
|
+ baseClassMPJLambdaWrapper
|
|
|
+ .selectAs(BaseClass::getId, BaseClassMajorSetVo::getClassId)
|
|
|
+ .selectAs(BaseMajorSet::getMajorId, BaseClassMajorSetVo::getMajorId)
|
|
|
+ .selectAs(BaseClass::getName, BaseClassMajorSetVo::getClassName)
|
|
|
+ .selectAs(BaseClass::getGradeId, BaseClassMajorSetVo::getGradeId)
|
|
|
+ .leftJoin(BaseClassMajorSet.class, BaseClassMajorSet::getClassId, BaseClass::getId)
|
|
|
+ .leftJoin(BaseMajorSet.class, BaseMajorSet::getId, BaseClassMajorSet::getMajorSetId)
|
|
|
+ ;
|
|
|
+
|
|
|
+ List<BaseClassMajorSetVo> majorSetList = baseClassService.selectJoinList(BaseClassMajorSetVo.class, baseClassMPJLambdaWrapper);
|
|
|
+
|
|
|
+
|
|
|
+ List<BaseGrade> gradeList = baseGradeService.list(
|
|
|
+ new QueryWrapper<BaseGrade>().lambda().eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ List<BaseMajor> majorList = baseMajorService.list(
|
|
|
+ new QueryWrapper<BaseMajor>().lambda().eq(BaseMajor::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ List<Department> departmentList =baseDeparmentService.list(
|
|
|
+ new QueryWrapper<Department>().lambda().eq(Department::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(Department::getParentId,"1684107782861680008")
|
|
|
+ );
|
|
|
+ departmentList.forEach((node) -> {
|
|
|
+ voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
|
|
|
+ setId(node.getId().toString());
|
|
|
+ setName(node.getName());
|
|
|
+ setParentId("0");
|
|
|
+ }});
|
|
|
+ });
|
|
|
+ majorList.forEach((node)->{
|
|
|
+ voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
|
|
|
+ setId(node.getId().toString());
|
|
|
+ setName(node.getName());
|
|
|
+ setParentId(node.getDepartmentId().toString());
|
|
|
+ }});
|
|
|
+ gradeList.forEach((DDD)->{
|
|
|
+ voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
|
|
|
+ setId(node.getId().toString()+"_"+DDD.getId().toString());
|
|
|
+ setName(DDD.getName());
|
|
|
+ setParentId(node.getId().toString());
|
|
|
+ }});
|
|
|
+ });
|
|
|
+ });
|
|
|
+ majorSetList.forEach((node)->{
|
|
|
+ voList.add(new BaseDepMajorGradeClassStudenTreeVo(){{
|
|
|
+ setId(node.getClassId().toString());
|
|
|
+ setName(node.getClassName());
|
|
|
+ setParentId(node.getMajorId().toString()+"_"+node.getGradeId());
|
|
|
+ }});
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ List<BaseDepMajorGradeClassStudenTreeVo> treeVoList = TreeUtil.build(voList);
|
|
|
+
|
|
|
+ return RT.ok(treeVoList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@PostMapping
|
|
|
@ApiOperation(value = "新增学生")
|