Sfoglia il codice sorgente

1、数据看板-全校师生预览
2、活动信息查询调整

dzx 7 mesi fa
parent
commit
ee38dd704a

+ 55 - 1
src/main/java/com/xjrsoft/module/databoard/controller/DataboardController.java

@@ -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);
     }
 

+ 15 - 0
src/main/java/com/xjrsoft/module/databoard/vo/PersonStatisticsVo.java

@@ -22,6 +22,21 @@ public class PersonStatisticsVo {
     @ApiModelProperty("女教师总人数")
     private Integer teacherFemaleCount;
 
+    @ApiModelProperty("正式聘用教师数")
+    private Integer teacherCount1;
+
+    @ApiModelProperty("外聘/临聘教师数")
+    private Integer teacherCount2;
+
+    @ApiModelProperty("兼职教师数")
+    private Integer teacherCount3;
+
+    @ApiModelProperty("合作办学教师数")
+    private Integer teacherCount4;
+
+    @ApiModelProperty("其他人员")
+    private Integer teacherCount5;
+
 
     @ApiModelProperty("学生总人数")
     private Integer studentCount;

+ 18 - 4
src/main/resources/mapper/activity/ActivityInfoMapper.xml

@@ -58,7 +58,8 @@
         a1.activity_location AS place,a1.start_time AS start_date
         ,a1.end_time AS end_date, NULL AS cover_file_id,3 AS category,NULL AS org_name
         ,NULL AS enroll_end_time, 1 AS STATUS,NULL AS TYPE,a1.activity_type as type_cn
-        FROM club_activities a1 WHERE a1.delete_mark = 0 AND a1.student_id = #{dto.loginUserId}
+        FROM club_activities a1 WHERE a1.delete_mark = 0 AND a1.student_id IN
+        (SELECT credential_number FROM xjr_user WHERE id = #{dto.loginUserId})
         UNION
         SELECT a2.id, a2.moral_event_name AS NAME, 1 AS enroll_status,
         a2.event_content AS content,
@@ -66,8 +67,21 @@
         ,a2.event_end_time AS end_date, NULL AS cover_file_id,4 AS category,NULL AS org_name
         ,NULL AS enroll_end_time, 1 AS STATUS,NULL AS TYPE,a2.event_type as type_cn
         FROM moral_event a2 WHERE a2.delete_mark = 0 AND
-        (a2.attend_teacher = #{dto.loginUserId} OR a2.attend_class IN (
-        SELECT class_id FROM base_student_school_roll WHERE user_id =  #{dto.loginUserId}
-        ))
+        (a2.attend_teacher = #{dto.loginUserId} OR FIND_IN_SET((
+        SELECT class_id FROM base_student_school_roll WHERE user_id = #{dto.loginUserId}
+        ),a2.attend_class) > 0
+        )
+        UNION
+        SELECT a3.id,a3.training_name AS NAME,1 AS enroll_status, a3.training_topic AS content,a3.training_address AS place,
+        a3.start_time AS start_date, a3.end_time AS end_date,NULL AS cover_file_id, 5 AS category, NULL AS org_name,NULL AS enroll_end_time,
+        STATUS, NULL AS TYPE, NULL AS type_cn FROM wf_teacher_training a3
+        INNER JOIN wf_teacher_training_participant a4 ON a3.id = a4.wf_teacher_training_id
+        WHERE a3.delete_mark = 0 AND a4.participant_id = #{dto.loginUserId}
+        UNION
+        SELECT id,party_tissue_name AS NAME, event_content AS content,event_address AS place,event_start_time AS start_date, event_end_time AS end_date, event_type AS TYPE,
+        1 AS enroll_status,NULL AS cover_file_id, 6 AS category, NULL AS org_name,NULL AS enroll_end_time,1 AS STATUS,NULL AS type_cn FROM party_build_event
+        WHERE delete_mark = 0 AND (
+        participant_teacher_name LIKE CONCAT('%',#{dto.loginUserId},'%') OR participant_student_name LIKE CONCAT('%',#{dto.loginUserId},'%')
+        )
     </select>
 </mapper>