|
@@ -2,12 +2,15 @@ package com.xjrsoft.module.databoard.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.common.enums.WorkflowIsRecycleType;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.courseTable.entity.CourseTable;
|
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
@@ -21,6 +24,11 @@ import com.xjrsoft.module.outint.service.IVisitorOutInRecordService;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.teacher.entity.BaseTeacher;
|
|
|
+import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
+import com.xjrsoft.module.teacher.service.ITeacherbaseManagerService;
|
|
|
+import com.xjrsoft.module.teacher.vo.XjrUserPageVo;
|
|
|
import com.xjrsoft.module.workflow.constant.WorkflowConstant;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -54,6 +62,7 @@ public class DataboardController {
|
|
|
private final ICourseTableService courseTableService;
|
|
|
private final IVisitorOutInRecordService visitorService;
|
|
|
private final IBaseStudentService studentService;
|
|
|
+ private final ITeacherbaseManagerService teacherService;
|
|
|
|
|
|
@GetMapping(value = "/process-statistics")
|
|
|
@ApiOperation(value="流程统计")
|
|
@@ -143,7 +152,7 @@ public class DataboardController {
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/person-statistics")
|
|
|
- @ApiOperation(value="访客统计")
|
|
|
+ @ApiOperation(value="全校师生数据概览")
|
|
|
@SaCheckPermission("databoard:detail")
|
|
|
public RT<PersonStatisticsVo> personStatistics(@Valid StatisticsDto dto){
|
|
|
|
|
@@ -202,6 +211,51 @@ public class DataboardController {
|
|
|
.map(BaseStudentUserPageVo::getId).collect(Collectors.toSet());
|
|
|
result.setStudentNotStayFemaleCount(studentNotStayFemaleSet.size());
|
|
|
|
|
|
+ MPJLambdaWrapper<XjrUser> queryWrapper = MPJWrappers.<XjrUser>lambdaJoin()
|
|
|
+ .disableSubLogicDel()
|
|
|
+ .orderByDesc(XjrUser::getId)
|
|
|
+ .select(XjrUser::getId)
|
|
|
+ .select(XjrUser.class,x -> VoToColumnUtil.fieldsToColumns(XjrUserPageVo.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(BaseTeacher.class,BaseTeacher::getUserId,XjrUser::getId)
|
|
|
+ .leftJoin(DictionaryDetail.class,DictionaryDetail::getCode,BaseTeacher::getJobState, ext->ext.selectAs(DictionaryDetail::getName, XjrUserPageVo::getJobState))
|
|
|
+ .leftJoin(DictionaryDetail.class,DictionaryDetail::getCode,XjrUser::getCredentialType,ext->ext.selectAs(DictionaryDetail::getName, XjrUserPageVo::getCredentialType))
|
|
|
+ .leftJoin(DictionaryDetail.class,DictionaryDetail::getCode,BaseTeacher::getEmployWay,ext->ext.selectAs(DictionaryDetail::getName, XjrUserPageVo::getEmployWay))
|
|
|
+
|
|
|
+ .selectAsClass(BaseTeacher.class, XjrUserPageVo.class);
|
|
|
+
|
|
|
+ List<XjrUserPageVo> teacherList = teacherService.selectJoinList(XjrUserPageVo.class, queryWrapper);
|
|
|
+ result.setTeacherCount(teacherList.size());
|
|
|
+
|
|
|
+ Set<String> teacherMaleSet = teacherList.stream()
|
|
|
+ .filter(x -> (x.getGender() != null && x.getGender().equals(GenderDictionaryEnum.MALE.getCode())))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherMaleCount(teacherMaleSet.size());
|
|
|
+
|
|
|
+ Set<String> teacherFemaleSet = teacherList.stream()
|
|
|
+ .filter(x -> (x.getGender() != null && x.getGender().equals(GenderDictionaryEnum.FEMALE.getCode())))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherFemaleCount(teacherFemaleSet.size());
|
|
|
+
|
|
|
+ Set<String> teacherSet1 = teacherList.stream()
|
|
|
+ .filter(x -> (x.getEmployWay() != null && x.getEmployWay().equals("FB1601")))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherCount1(teacherSet1.size());
|
|
|
+ Set<String> teacherSet2 = teacherList.stream()
|
|
|
+ .filter(x -> (x.getEmployWay() != null && x.getEmployWay().equals("FB1602")))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherCount2(teacherSet2.size());
|
|
|
+ Set<String> teacherSet3 = teacherList.stream()
|
|
|
+ .filter(x -> (x.getEmployWay() != null && x.getEmployWay().equals("FB1606")))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherCount3(teacherSet3.size());
|
|
|
+ Set<String> teacherSet4 = teacherList.stream()
|
|
|
+ .filter(x -> (x.getEmployWay() != null && x.getEmployWay().equals("FB1609")))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherCount4(teacherSet4.size());
|
|
|
+ Set<String> teacherSet5 = teacherList.stream()
|
|
|
+ .filter(x -> (x.getEmployWay() != null && x.getEmployWay().equals("FB1608")))
|
|
|
+ .map(XjrUserPageVo::getId).collect(Collectors.toSet());
|
|
|
+ result.setTeacherCount5(teacherSet5.size());
|
|
|
return RT.ok(result);
|
|
|
}
|
|
|
|