Переглянути джерело

Merge branch 'dev' of https://git.yingcaibx.com/tl/api into dev

brealin 1 рік тому
батько
коміт
1e4a4d0134
39 змінених файлів з 796 додано та 39 видалено
  1. 35 9
      src/main/java/com/xjrsoft/module/attendance/controller/StatisticsController.java
  2. 218 0
      src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java
  3. 2 1
      src/main/java/com/xjrsoft/module/attendance/dto/AttendanceStatisticDto.java
  4. 3 0
      src/main/java/com/xjrsoft/module/attendance/mapper/AttendanceRuleDetailsMapper.java
  5. 2 0
      src/main/java/com/xjrsoft/module/attendance/service/IAttendanceRuleCategoryService.java
  6. 11 0
      src/main/java/com/xjrsoft/module/attendance/service/impl/AttendanceRuleCategoryServiceImpl.java
  7. 48 0
      src/main/java/com/xjrsoft/module/attendance/vo/ClassStatisticsVo.java
  8. 44 0
      src/main/java/com/xjrsoft/module/attendance/vo/VisitorInfoVo.java
  9. 5 0
      src/main/java/com/xjrsoft/module/base/mapper/BaseClassMapper.java
  10. 4 0
      src/main/java/com/xjrsoft/module/base/service/IBaseClassService.java
  11. 7 0
      src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java
  12. 14 0
      src/main/java/com/xjrsoft/module/hikvision/mapper/HikvisionDataMapper.java
  13. 9 8
      src/main/java/com/xjrsoft/module/hikvision/util/FaceImportUtil.java
  14. 13 2
      src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java
  15. 12 1
      src/main/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNode.java
  16. 11 0
      src/main/java/com/xjrsoft/module/organization/controller/UserController.java
  17. 4 0
      src/main/java/com/xjrsoft/module/organization/dto/UserPageDto.java
  18. 2 0
      src/main/java/com/xjrsoft/module/organization/vo/UserPageVo.java
  19. 3 1
      src/main/java/com/xjrsoft/module/outint/entity/StudentOutInRecord.java
  20. 13 0
      src/main/java/com/xjrsoft/module/outint/mapper/StudentOutInRecordMapper.java
  21. 28 0
      src/main/java/com/xjrsoft/module/outint/service/IStudentOutInRecordService.java
  22. 65 0
      src/main/java/com/xjrsoft/module/outint/service/impl/StudentOutInRecordServiceImpl.java
  23. 22 0
      src/main/java/com/xjrsoft/module/outint/vo/IdCountVo.java
  24. 3 1
      src/main/java/com/xjrsoft/module/outint/vo/StudentOutInRecordVo.java
  25. 5 0
      src/main/java/com/xjrsoft/module/personnel/mapper/ReservationSchoolMapper.java
  26. 5 0
      src/main/java/com/xjrsoft/module/personnel/service/IReservationSchoolService.java
  27. 6 0
      src/main/java/com/xjrsoft/module/personnel/service/impl/ReservationSchoolServiceImpl.java
  28. 11 2
      src/main/java/com/xjrsoft/module/student/mapper/StudentLeaveMapper.java
  29. 7 0
      src/main/java/com/xjrsoft/module/student/service/IStudentLeaveService.java
  30. 18 0
      src/main/java/com/xjrsoft/module/student/service/impl/StudentLeaveServiceImpl.java
  31. 7 4
      src/main/resources/mapper/attendance/AttendanceRuleDetailsMapper.xml
  32. 17 1
      src/main/resources/mapper/base/BaseClass.xml
  33. 13 0
      src/main/resources/mapper/hikvision/HikvisionDataMapper.xml
  34. 37 0
      src/main/resources/mapper/outin/StudentOutInRecordMapper.xml
  35. 15 0
      src/main/resources/mapper/personnel/ReservationSchoolMapper.xml
  36. 28 0
      src/main/resources/mapper/student/StudentLeaveMapper.xml
  37. 1 7
      src/main/resources/mapper/teacher/TeacherFaceImportMapper.xml
  38. 2 2
      src/main/resources/mapper/teacher/WfTeacherleaveMapper.xml
  39. 46 0
      src/test/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNodeTest.java

+ 35 - 9
src/main/java/com/xjrsoft/module/attendance/controller/StatisticsController.java

@@ -9,10 +9,17 @@ import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
 import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
 import com.xjrsoft.module.attendance.vo.AttendanceRuleDetailsUserVo;
 import com.xjrsoft.module.attendance.vo.TeacherStatisticsVo;
+import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
 import com.xjrsoft.module.concat.service.IXjrUserService;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
+import com.xjrsoft.module.outint.entity.StudentOutInRecord;
 import com.xjrsoft.module.outint.entity.TeacherOutInRecord;
+import com.xjrsoft.module.outint.service.IStudentOutInRecordService;
 import com.xjrsoft.module.outint.service.ITeacherOutInRecordService;
+import com.xjrsoft.module.personnel.service.IReservationSchoolService;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.entity.StudentLeave;
+import com.xjrsoft.module.student.service.IStudentLeaveService;
 import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
@@ -47,8 +54,11 @@ public class StatisticsController {
 
     private final IXjrUserService xjrUserService;
     private final ITeacherOutInRecordService teacherOutInRecordService;
+    private final IStudentOutInRecordService studentOutInRecordService;
     private final IAttendanceRuleCategoryService ruleCategoryService;
     private final IWfTeacherleaveService wfTeacherleaveService;
+    private final IStudentLeaveService studentLeaveService;
+    private final IReservationSchoolService reservationSchoolService;
 
     @GetMapping(value = "/teacher-statistics")
     @ApiOperation(value="教职工考勤统计")
@@ -80,12 +90,16 @@ public class StatisticsController {
             List<TeacherOutInRecord> outInRecords = teacherOutInRecordService.list(
                     new QueryWrapper<TeacherOutInRecord>().lambda()
                             .between(TeacherOutInRecord::getRecordTime, startTime, endTime)
+                            .eq(TeacherOutInRecord::getStatus, 0)
             );
             //实到人数
             statisticsVo.setActualCount(Long.valueOf(outInRecords.size()));
 
             //查询教师请假人数
             Long leaveCount = wfTeacherleaveService.getLeaveCount(startTime, endTime);
+            if(leaveCount == null){
+                leaveCount = 0L;
+            }
             statisticsVo.setLeaveCount(leaveCount);
 
             //查询每个人当天的考勤规则
@@ -118,15 +132,14 @@ public class StatisticsController {
 
 
     @GetMapping(value = "/student-statistics")
-    @ApiOperation(value="教职工考勤统计")
+    @ApiOperation(value="学生考勤统计")
     @SaCheckPermission("statistics:detail")
     public RT<TeacherStatisticsVo> studentStatistics(@Valid AttendanceStatisticDto dto){
         TeacherStatisticsVo statisticsVo = new TeacherStatisticsVo();
         //查询总人数
         MPJLambdaWrapper<XjrUser> queryWrapper = MPJWrappers.<XjrUser>lambdaJoin()
                 .disableSubLogicDel()
-                .innerJoin(BaseTeacher.class,BaseTeacher::getUserId,XjrUser::getId)
-                .innerJoin(UserDeptRelation.class, UserDeptRelation::getUserId, XjrUser::getId);
+                .innerJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId);
         long allCount = xjrUserService.count(queryWrapper);
         statisticsVo.setAllCount(allCount);
         if(dto.getDate() != null && !"".equals(dto.getDate())){
@@ -144,22 +157,26 @@ public class StatisticsController {
                 endTime = queryDate.atTime(23, 59, 59);
             }
 
-            List<TeacherOutInRecord> outInRecords = teacherOutInRecordService.list(
-                    new QueryWrapper<TeacherOutInRecord>().lambda()
-                            .between(TeacherOutInRecord::getRecordTime, startTime, endTime)
+            List<StudentOutInRecord> outInRecords = studentOutInRecordService.list(
+                    new QueryWrapper<StudentOutInRecord>().lambda()
+                            .between(StudentOutInRecord::getRecordTime, startTime, endTime)
+                            .eq(StudentOutInRecord::getStatus, 0)
             );
             //实到人数
             statisticsVo.setActualCount(Long.valueOf(outInRecords.size()));
 
             //查询教师请假人数
-            Long leaveCount = wfTeacherleaveService.getLeaveCount(startTime, endTime);
+            Long leaveCount = studentLeaveService.getLeaveCount(startTime, endTime);
+            if(leaveCount == null){
+                leaveCount = 0L;
+            }
             statisticsVo.setLeaveCount(leaveCount);
 
             //查询每个人当天的考勤规则
-            Map<Long, AttendanceRuleDetailsUserVo> allTeacherTodyRule = ruleCategoryService.getAllTeacherTodyRule(queryDate.getDayOfWeek().name());
+            Map<Long, AttendanceRuleDetailsUserVo> allTeacherTodyRule = ruleCategoryService.getAllStudentTodyRule(queryDate.getDayOfWeek().name());
             //通过考勤规则和实到人数信息,计算迟到的
             Long lateCount = 0L;
-            for (TeacherOutInRecord outInRecord : outInRecords) {
+            for (StudentOutInRecord outInRecord : outInRecords) {
                 AttendanceRuleDetailsUserVo ruleDetails = allTeacherTodyRule.get(outInRecord.getUserId());
                 if(dto.getTimePeriod() == 1 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getAmStartTime()) > 0){
                     lateCount ++;
@@ -180,4 +197,13 @@ public class StatisticsController {
         return RT.ok(statisticsVo);
     }
 
+
+    @GetMapping(value = "/visitor-list")
+    @ApiOperation(value="访客列表")
+    @SaCheckPermission("statistics:detail")
+    public RT<List<VisitorInfoVo>> visitorList(@Valid AttendanceStatisticDto dto){
+        List<VisitorInfoVo> visionList = reservationSchoolService.getVisionList(dto.getDate());
+        return RT.ok(visionList);
+    }
+
 }

+ 218 - 0
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -0,0 +1,218 @@
+package com.xjrsoft.module.attendance.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.toolkit.MPJWrappers;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
+import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
+import com.xjrsoft.module.attendance.vo.AttendanceRuleDetailsUserVo;
+import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
+import com.xjrsoft.module.attendance.vo.TeacherStatisticsVo;
+import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
+import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.outint.entity.StudentOutInRecord;
+import com.xjrsoft.module.outint.service.IStudentOutInRecordService;
+import com.xjrsoft.module.outint.service.ITeacherOutInRecordService;
+import com.xjrsoft.module.outint.vo.StudentOutInRecordVo;
+import com.xjrsoft.module.personnel.service.IReservationSchoolService;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.service.IStudentLeaveService;
+import com.xjrsoft.module.teacher.entity.XjrUser;
+import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+* @title: 考勤消息设置
+* @Author dzx
+* @Date: 2024-05-21
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/studentStatistics")
+@Api(value = "/studentStatistics" ,tags = "学生考勤统计")
+@AllArgsConstructor
+public class StudentStatisticsController {
+
+
+    private final IXjrUserService xjrUserService;
+    private final ITeacherOutInRecordService teacherOutInRecordService;
+    private final IStudentOutInRecordService studentOutInRecordService;
+    private final IAttendanceRuleCategoryService ruleCategoryService;
+    private final IWfTeacherleaveService wfTeacherleaveService;
+    private final IStudentLeaveService studentLeaveService;
+    private final IReservationSchoolService reservationSchoolService;
+    private final IBaseClassService classService;
+
+    @GetMapping(value = "/class-statistics")
+    @ApiOperation(value="班级考勤统计")
+    @SaCheckPermission("statistics:detail")
+    public RT<Page<ClassStatisticsVo>> teacherStatistics(@Valid AttendanceStatisticDto dto){
+        Page<ClassStatisticsVo> attendancePage = classService.getAttendancePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        List<Long> classIds = new ArrayList<>();
+        for (ClassStatisticsVo record : attendancePage.getRecords()) {
+            classIds.add(record.getId());
+        }
+        if(dto.getDate() != null && !"".equals(dto.getDate())){
+            DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
+            LocalDate queryDate = LocalDate.parse(dto.getDate(), formatter);
+            LocalDateTime startTime, endTime;
+
+
+            if(dto.getTimePeriod() == 1){
+                startTime = queryDate.atTime(9, 0, 0);
+                endTime = queryDate.atTime(12, 0, 0);
+            }else if(dto.getTimePeriod() == 2){
+                startTime = queryDate.atTime(12, 0, 0);
+                endTime = queryDate.atTime(18, 0, 0);
+            }else{
+                startTime = queryDate.atTime(0, 0, 0);
+                endTime = queryDate.atTime(23, 59, 59);
+            }
+            LocalDateTime lastSundayStart = startTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
+            LocalDateTime lastSundayEnd = endTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
+
+            //查询每个班的走读生实到人数
+            Map<Long, List<StudentOutInRecordVo>> notStayMap = studentOutInRecordService.getNotStayList(startTime, endTime, classIds);
+            //查询住校生的实到情况
+            Map<Long, List<StudentOutInRecordVo>> stayMap = studentOutInRecordService.getStayList(lastSundayStart, lastSundayEnd, classIds);
+
+            //查询各班的请假人数
+            Map<Long, Integer> classLeaveCount = studentLeaveService.getClassLeaveCount(startTime, endTime);
+
+            //查询走读生的考勤规则
+            Map<Long, AttendanceRuleDetailsUserVo> notStayTodyRule = ruleCategoryService.getAllStudentTodyRule(queryDate.getDayOfWeek().name());
+            //查询住校生生的考勤规则
+            Map<Long, AttendanceRuleDetailsUserVo> staySundayRule = ruleCategoryService.getAllStudentTodyRule(lastSundayStart.getDayOfWeek().name());
+
+            for (ClassStatisticsVo record: attendancePage.getRecords()) {
+                record.setLeaveCount(classLeaveCount.get(record.getId()));
+                record.setActualCount(notStayMap.get(record.getId()).size() + stayMap.get(record.getId()).size());
+
+                Integer lateCount = 0;
+                for (StudentOutInRecordVo outInRecord : notStayMap.get(record.getId())) {
+                    AttendanceRuleDetailsUserVo ruleDetails = notStayTodyRule.get(outInRecord.getUserId());
+                    if(dto.getTimePeriod() == 1 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getAmStartTime()) > 0){
+                        lateCount ++;
+                    }else if(dto.getTimePeriod() == 2 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getPmStartTime()) > 0){
+                        lateCount ++;
+                    }
+                }
+                for (StudentOutInRecordVo outInRecord : stayMap.get(record.getId())) {
+                    AttendanceRuleDetailsUserVo ruleDetails = staySundayRule.get(outInRecord.getUserId());
+                    if(dto.getTimePeriod() == 1 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getAmStartTime()) > 0){
+                        lateCount ++;
+                    }else if(dto.getTimePeriod() == 2 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getPmStartTime()) > 0){
+                        lateCount ++;
+                    }
+                }
+                record.setLateCount(lateCount);
+
+                //最后通过总人数-实到人数-请假人数计算出缺勤人数
+                record.setAbsenteeismCount(record.getStudentCount() - record.getLeaveCount() - record.getActualCount());
+
+                //计算出勤率
+                BigDecimal divide = BigDecimal.valueOf(record.getActualCount()).divide(BigDecimal.valueOf(record.getStudentCount()), 2, RoundingMode.HALF_UP);
+                record.setAttendanceRate(divide.doubleValue());
+            }
+        }
+
+        return RT.ok(attendancePage);
+    }
+
+
+    @GetMapping(value = "/student-statistics")
+    @ApiOperation(value="学生考勤统计")
+    @SaCheckPermission("statistics:detail")
+    public RT<TeacherStatisticsVo> studentStatistics(@Valid AttendanceStatisticDto dto){
+        TeacherStatisticsVo statisticsVo = new TeacherStatisticsVo();
+        //查询总人数
+        MPJLambdaWrapper<XjrUser> queryWrapper = MPJWrappers.<XjrUser>lambdaJoin()
+                .disableSubLogicDel()
+                .innerJoin(BaseStudent.class, BaseStudent::getUserId, XjrUser::getId);
+        long allCount = xjrUserService.count(queryWrapper);
+        statisticsVo.setAllCount(allCount);
+        if(dto.getDate() != null && !"".equals(dto.getDate())){
+            DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
+            LocalDate queryDate = LocalDate.parse(dto.getDate(), formatter);
+            LocalDateTime startTime, endTime;
+            if(dto.getTimePeriod() == 1){
+                startTime = queryDate.atTime(9, 0, 0);
+                endTime = queryDate.atTime(12, 0, 0);
+            }else if(dto.getTimePeriod() == 2){
+                startTime = queryDate.atTime(12, 0, 0);
+                endTime = queryDate.atTime(18, 0, 0);
+            }else{
+                startTime = queryDate.atTime(0, 0, 0);
+                endTime = queryDate.atTime(23, 59, 59);
+            }
+
+            List<StudentOutInRecord> outInRecords = studentOutInRecordService.list(
+                    new QueryWrapper<StudentOutInRecord>().lambda()
+                            .between(StudentOutInRecord::getRecordTime, startTime, endTime)
+            );
+            //实到人数
+            statisticsVo.setActualCount(Long.valueOf(outInRecords.size()));
+
+            //查询教师请假人数
+            Long leaveCount = studentLeaveService.getLeaveCount(startTime, endTime);
+            if(leaveCount == null){
+                leaveCount = 0L;
+            }
+            statisticsVo.setLeaveCount(leaveCount);
+
+            //查询每个人当天的考勤规则
+            Map<Long, AttendanceRuleDetailsUserVo> allTeacherTodyRule = ruleCategoryService.getAllStudentTodyRule(queryDate.getDayOfWeek().name());
+            //通过考勤规则和实到人数信息,计算迟到的
+            Long lateCount = 0L;
+            for (StudentOutInRecord outInRecord : outInRecords) {
+                AttendanceRuleDetailsUserVo ruleDetails = allTeacherTodyRule.get(outInRecord.getUserId());
+                if(dto.getTimePeriod() == 1 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getAmStartTime()) > 0){
+                    lateCount ++;
+                }else if(dto.getTimePeriod() == 2 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleDetails.getPmStartTime()) > 0){
+                    lateCount ++;
+                }
+            }
+            statisticsVo.setLateCount(lateCount);
+
+            //最后通过总人数-实到人数-请假人数计算出缺勤人数
+            statisticsVo.setAbsenteeismCount(statisticsVo.getAllCount() - statisticsVo.getLeaveCount() - statisticsVo.getActualCount());
+
+            //计算出勤率
+            BigDecimal divide = BigDecimal.valueOf(statisticsVo.getActualCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 2, RoundingMode.HALF_UP);
+            statisticsVo.setAttendanceRate(divide.doubleValue());
+        }
+
+        return RT.ok(statisticsVo);
+    }
+
+
+    @GetMapping(value = "/visitor-list")
+    @ApiOperation(value="访客列表")
+    @SaCheckPermission("statistics:detail")
+    public RT<List<VisitorInfoVo>> visitorList(@Valid AttendanceStatisticDto dto){
+        List<VisitorInfoVo> visionList = reservationSchoolService.getVisionList(dto.getDate());
+        return RT.ok(visionList);
+    }
+
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/attendance/dto/AttendanceStatisticDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.attendance.dto;
 
+import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -8,7 +9,7 @@ import java.time.LocalDate;
 
 @Data
 @EqualsAndHashCode(callSuper = false)
-public class AttendanceStatisticDto {
+public class AttendanceStatisticDto extends PageInput {
 
     @ApiModelProperty("时间段(1:上午 2:下午)")
     private Integer timePeriod;

+ 3 - 0
src/main/java/com/xjrsoft/module/attendance/mapper/AttendanceRuleDetailsMapper.java

@@ -19,4 +19,7 @@ public interface AttendanceRuleDetailsMapper extends MPJBaseMapper<AttendanceRul
     List<AttendanceRuleDetails> getTodayRules(@Param("dayOfWeek") String dayOfWeek);
 
     List<AttendanceRuleDetailsUserVo> getAllTeacherTodyRule(@Param("dayOfWeek") String dayOfWeek);
+
+    List<AttendanceRuleDetailsUserVo> getAllStudentTodyRule(@Param("dayOfWeek") String dayOfWeek);
+
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/attendance/service/IAttendanceRuleCategoryService.java

@@ -47,4 +47,6 @@ public interface IAttendanceRuleCategoryService extends MPJBaseService<Attendanc
     AttendanceRuleDetails getTodayRulesByParam(String dayOfWeek);
 
     Map<Long, AttendanceRuleDetailsUserVo> getAllTeacherTodyRule(String dayOfWeek);
+
+    Map<Long, AttendanceRuleDetailsUserVo> getAllStudentTodyRule(String dayOfWeek);
 }

+ 11 - 0
src/main/java/com/xjrsoft/module/attendance/service/impl/AttendanceRuleCategoryServiceImpl.java

@@ -434,4 +434,15 @@ public class AttendanceRuleCategoryServiceImpl extends MPJBaseServiceImpl<Attend
 
         return result;
     }
+
+    @Override
+    public Map<Long, AttendanceRuleDetailsUserVo> getAllStudentTodyRule(String dayOfWeek) {
+        List<AttendanceRuleDetailsUserVo> teacherTodyRule = detailsMapper.getAllStudentTodyRule(dayOfWeek);
+        Map<Long, AttendanceRuleDetailsUserVo> result = new HashMap<>();
+        for (AttendanceRuleDetailsUserVo userVo : teacherTodyRule) {
+            result.put(userVo.getUserId(), userVo);
+        }
+
+        return result;
+    }
 }

+ 48 - 0
src/main/java/com/xjrsoft/module/attendance/vo/ClassStatisticsVo.java

@@ -0,0 +1,48 @@
+package com.xjrsoft.module.attendance.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 教职工统计
+* @Author dzx
+* @Date: 2024年5月24日
+* @Version 1.0
+*/
+@Data
+public class ClassStatisticsVo {
+
+    @ApiModelProperty("班级id")
+    private Long id;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("班主任姓名")
+    private String teacherName;
+
+    @ApiModelProperty("学生总人数")
+    private Integer studentCount;
+
+    @ApiModelProperty("住校人数")
+    private Integer stayCount;
+
+    @ApiModelProperty("走读人数")
+    private Integer notStayCount;
+
+    @ApiModelProperty("请假人数")
+    private Integer leaveCount;
+
+    @ApiModelProperty("迟到人数")
+    private Integer lateCount;
+
+    @ApiModelProperty("实到人数")
+    private Integer actualCount;
+
+    @ApiModelProperty("缺勤人数")
+    private Integer absenteeismCount;
+
+    @ApiModelProperty("出勤率")
+    private Double attendanceRate;
+
+}

+ 44 - 0
src/main/java/com/xjrsoft/module/attendance/vo/VisitorInfoVo.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.attendance.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+* @title: 访客信息
+* @Author dzx
+* @Date: 2024年5月27日
+* @Version 1.0
+*/
+@Data
+public class VisitorInfoVo {
+
+    @ApiModelProperty("访客姓名")
+    private String name;
+
+    @ApiModelProperty("访客身份证")
+    private String identityCard;
+
+    @ApiModelProperty("电话")
+    private String phone;
+
+    @ApiModelProperty("被访人")
+    private String respondentUserName;
+
+    @ApiModelProperty("被访部门")
+    private String deptName;
+
+    @ApiModelProperty("到访结束时间")
+    private LocalDateTime endTime;
+
+    @ApiModelProperty("到访开始时间")
+    private LocalDateTime startTime;
+
+    @ApiModelProperty("申请时间")
+    private LocalDateTime createDate;
+
+    @ApiModelProperty("进校事由")
+    private String reason;
+
+}

+ 5 - 0
src/main/java/com/xjrsoft/module/base/mapper/BaseClassMapper.java

@@ -2,6 +2,8 @@ package com.xjrsoft.module.base.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
+import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
 import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.vo.BaseClassPageVo;
@@ -24,4 +26,7 @@ public interface BaseClassMapper extends MPJBaseMapper<BaseClass> {
     Page<BaseClassPageVo> getPage(Page<BaseClassPageVo> page, BaseClassPageDto dto);
 
     List<StudentClassVo> getStudentClass();
+
+
+    Page<ClassStatisticsVo> getAttendanceClass(Page<ClassStatisticsVo> page, AttendanceStatisticDto dto);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/base/service/IBaseClassService.java

@@ -2,6 +2,8 @@ package com.xjrsoft.module.base.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
+import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
 import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.vo.BaseClassPageVo;
@@ -17,4 +19,6 @@ public interface IBaseClassService extends MPJBaseService<BaseClass> {
     Page<BaseClassPageVo> getPage(Page<BaseClassPageVo> page, BaseClassPageDto dto);
 
     List<StudentClassVo> getStudentClass();
+
+    Page<ClassStatisticsVo> getAttendancePage(Page<ClassStatisticsVo> page, AttendanceStatisticDto dto);
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.module.attendance.dto.AttendanceStatisticDto;
+import com.xjrsoft.module.attendance.vo.ClassStatisticsVo;
 import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
@@ -87,4 +89,9 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
     public List<StudentClassVo> getStudentClass() {
         return baseClassMapper.getStudentClass();
     }
+
+    @Override
+    public Page<ClassStatisticsVo> getAttendancePage(Page<ClassStatisticsVo> page, AttendanceStatisticDto dto){
+        return baseClassMapper.getAttendanceClass(page, dto);
+    };
 }

+ 14 - 0
src/main/java/com/xjrsoft/module/hikvision/mapper/HikvisionDataMapper.java

@@ -13,4 +13,18 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface HikvisionDataMapper extends MPJBaseMapper<HikvisionData> {
 
+    /**
+     * 查询教师在海康中的id
+     * @param sourceId
+     * @return
+     */
+    String getTeacherHikvisionId(Long sourceId);
+
+
+    /**
+     * 查询学生在海康中的id
+     * @param sourceId
+     * @return
+     */
+    String getStudentHikvisionId(Long sourceId);
 }

+ 9 - 8
src/main/java/com/xjrsoft/module/hikvision/util/FaceImportUtil.java

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.hikvision.util;
 
 import com.google.gson.JsonObject;
+import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 
 import java.io.ByteArrayOutputStream;
@@ -13,13 +14,13 @@ import java.util.Map;
 
 
 public class FaceImportUtil {
-    private static FaceImportMapper faceImportMapper;
-    private static ApiUtil apiUtil;
 
-    public static String ImportTeacherFace(Long id) {
+    private static ApiUtil apiUtil = new ApiUtil();
+
+    public static String ImportTeacherFace(String personId, String fileUrl) {
         JsonObject paramJson = new JsonObject();
-        paramJson.addProperty("personId", faceImportMapper.GetTeacherUserIdById(id));
-        paramJson.addProperty("faceData", ImageToBase64(faceImportMapper.GetTeacherHikvisionImgById(id)));
+        paramJson.addProperty("personId", personId);
+        paramJson.addProperty("faceData", ImageToBase64(fileUrl));
 
         Map<String, String> querys = new HashMap<>();
         querys.put("tagId", "frs");
@@ -30,10 +31,10 @@ public class FaceImportUtil {
         return response;
     }
 
-    public static String ImportStudentFace(Long id) {
+    public static String ImportStudentFace(String personId, String fileUrl) {
         JsonObject paramJson = new JsonObject();
-        paramJson.addProperty("personId", faceImportMapper.GetStudentUserIdById(id));
-        paramJson.addProperty("faceData", ImageToBase64(faceImportMapper.GetStudentHikvisionImgById(id)));
+        paramJson.addProperty("personId", personId);
+        paramJson.addProperty("faceData", ImageToBase64(fileUrl));
 
         Map<String, String> querys = new HashMap<>();
         querys.put("tagId", "frs");

+ 13 - 2
src/main/java/com/xjrsoft/module/liteflow/node/ImportStudentFaceNode.java

@@ -1,9 +1,11 @@
 package com.xjrsoft.module.liteflow.node;
 
 import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.FaceImportUtil;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
+import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -17,6 +19,13 @@ import java.util.Map;
 public class ImportStudentFaceNode extends NodeComponent {
     @Autowired
     private IStundentFaceProcessService stundentFaceProcessService;
+
+    @Autowired
+    private HikvisionDataMapper hikvisionDataMapper;
+
+    @Autowired
+    private FaceImportMapper faceImportMapper;
+
     @Override
     public void process() throws Exception {
         // 获取表单中数据编号
@@ -24,14 +33,16 @@ public class ImportStudentFaceNode extends NodeComponent {
         Object value = util.getFormDatKey(params,"id");
         Long formId = Convert.toLong(value);
         if (formId != null) {
+            String fileUrl = faceImportMapper.GetStudentHikvisionImgById(formId);
             // 数据处理
             StundentFaceProcess dataObj = stundentFaceProcessService.getById(formId);
             dataObj.setStatus(1);
             dataObj.setExamStatus(1);
-
+            String result = FaceImportUtil.ImportStudentFace(hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId()), fileUrl);
+            dataObj.setHikvisionResult(result);
             stundentFaceProcessService.updateById(dataObj);
 
-            FaceImportUtil.ImportStudentFace(formId);
+
         }
     }
 }

+ 12 - 1
src/main/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNode.java

@@ -1,8 +1,10 @@
 package com.xjrsoft.module.liteflow.node;
 
 import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 import com.xjrsoft.module.personnel.service.ITeacherFaceProcessService;
+import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import com.yomahub.liteflow.core.NodeComponent;
 import com.xjrsoft.module.hikvision.util.FaceImportUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +21,12 @@ public class ImportTeacherFaceNode extends NodeComponent {
     @Autowired
     private ITeacherFaceProcessService teacherFaceProcessService;
 
+    @Autowired
+    private HikvisionDataMapper hikvisionDataMapper;
+
+    @Autowired
+    private FaceImportMapper faceImportMapper;
+
     @Override
     public void process() throws Exception {
         // 获取表单中数据编号
@@ -26,11 +34,14 @@ public class ImportTeacherFaceNode extends NodeComponent {
         Object value = util.getFormDatKey(params,"id");
         Long formId = Convert.toLong(value);
         if (formId != null) {
+
+            String fileUrl = faceImportMapper.GetTeacherHikvisionImgById(formId);
+
             // 数据处理
             TeacherFaceProcess dataObj = teacherFaceProcessService.getById(formId);
             dataObj.setStatus(1);
             dataObj.setExamStatus(1);
-            String reslut = FaceImportUtil.ImportTeacherFace(formId);
+            String reslut = FaceImportUtil.ImportTeacherFace(hikvisionDataMapper.getTeacherHikvisionId(dataObj.getUserId()), fileUrl);
             dataObj.setHikvisionResult(reslut);
             teacherFaceProcessService.updateById(dataObj);
         }

+ 11 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -67,6 +67,7 @@ import com.xjrsoft.module.oss.factory.OssFactory;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.system.entity.File;
 import com.xjrsoft.module.system.service.IFileService;
+import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.workflow.constant.WorkflowConstant;
 import com.xjrsoft.module.workflow.entity.WorkflowExtra;
 import com.xjrsoft.module.workflow.mapper.WorkflowExtraMapper;
@@ -189,11 +190,16 @@ public class UserController {
                     .eq((ObjectUtil.isNotNull(dto.getTreeType()) && dto.getTreeType() == 3), BaseStudentSchoolRoll::getGradeId, dto.getTreeId())
                     .eq((ObjectUtil.isNotNull(dto.getTreeType()) && dto.getTreeType() == 4), BaseStudentSchoolRoll::getClassId, dto.getTreeId())
                     .eq(ObjectUtil.isNotNull(dto.getUserType()), Role::getId, dto.getUserType())
+                    .eq(ObjectUtil.isNotNull(dto.getEmployType()), BaseTeacher::getEmployType, dto.getEmployType())
+                    .eq(ObjectUtil.isNotNull(dto.getEmployWay()), BaseTeacher::getEmployWay, dto.getEmployWay())
                     .orderByDesc(User::getId)
                     .select(User::getId)
+                    .selectAs(BaseTeacher::getEmployWay, UserPageVo::getEmployWay)
+                    .selectAs(BaseTeacher::getEmployType, UserPageVo::getEmployType)
                     .select(User.class, x -> VoToColumnUtil.fieldsToColumns(UserPageVo.class).contains(x.getProperty()))
                     .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId, User::getId)
                     .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, User::getId)
+                    .leftJoin(BaseTeacher.class, BaseTeacher::getUserId, User::getId)
                     .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, User::getId)
                     .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId);
             IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class, queryUser);
@@ -232,12 +238,17 @@ public class UserController {
                             .eq((ObjectUtil.isNotNull(dto.getTreeType()) && dto.getTreeType() == 2), UserDeptRelation::getDeptId, dto.getTreeId())
                             .eq((ObjectUtil.isNotNull(dto.getTreeType()) && dto.getTreeType() == 3), BaseStudentSchoolRoll::getGradeId, dto.getTreeId())
                             .eq((ObjectUtil.isNotNull(dto.getTreeType()) && dto.getTreeType() == 4), BaseStudentSchoolRoll::getClassId, dto.getTreeId())
+                            .eq(ObjectUtil.isNotNull(dto.getEmployType()), BaseTeacher::getEmployType, dto.getEmployType())
+                            .eq(ObjectUtil.isNotNull(dto.getEmployWay()), BaseTeacher::getEmployWay, dto.getEmployWay())
                             .orderByDesc(User::getId)
                             .select(User::getId)
+                            .selectAs(BaseTeacher::getEmployWay, UserPageVo::getEmployWay)
+                            .selectAs(BaseTeacher::getEmployType, UserPageVo::getEmployType)
                             .select(User.class, x -> VoToColumnUtil.fieldsToColumns(UserPageVo.class).contains(x.getProperty()))
                             .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, User::getId)
                             .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, User::getId)
                             .leftJoin(UserDeptRelation.class, UserDeptRelation::getUserId, User::getId)
+                            .leftJoin(BaseTeacher.class, BaseTeacher::getUserId, User::getId)
                             .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId);
             IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class,queryUser);
             for (UserPageVo record : page.getRecords()) {

+ 4 - 0
src/main/java/com/xjrsoft/module/organization/dto/UserPageDto.java

@@ -39,4 +39,8 @@ public class UserPageDto extends PageInput {
 
     @ApiModelProperty("树id")
     private Long treeId;
+
+    private String employType;
+
+    private String employWay;
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/organization/vo/UserPageVo.java

@@ -99,5 +99,7 @@ public class UserPageVo implements Serializable {
 
     private LocalDateTime modifyDate;
 
+    private String employType;
 
+    private String employWay;
 }

+ 3 - 1
src/main/java/com/xjrsoft/module/outint/entity/StudentOutInRecord.java

@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 import java.util.Date;
 
 
@@ -88,7 +89,8 @@ public class StudentOutInRecord implements Serializable {
     * 记录时间
     */
     @ApiModelProperty("记录时间")
-    private String recordTime;
+    private LocalDateTime recordTime;
+
     /**
     * 人脸照片
     */

+ 13 - 0
src/main/java/com/xjrsoft/module/outint/mapper/StudentOutInRecordMapper.java

@@ -2,7 +2,13 @@ package com.xjrsoft.module.outint.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.outint.entity.StudentOutInRecord;
+import com.xjrsoft.module.outint.vo.IdCountVo;
+import com.xjrsoft.module.outint.vo.StudentOutInRecordVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.time.LocalDateTime;
+import java.util.List;
 
 /**
 * @title: 学生出入记录
@@ -13,4 +19,11 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface StudentOutInRecordMapper extends MPJBaseMapper<StudentOutInRecord> {
 
+    List<IdCountVo> getNotStayClassCount(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);
+
+    List<IdCountVo> getStayClassCount(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);
+
+    List<StudentOutInRecordVo> getNotStayList(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);
+
+    List<StudentOutInRecordVo> getStayList(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);
 }

+ 28 - 0
src/main/java/com/xjrsoft/module/outint/service/IStudentOutInRecordService.java

@@ -2,6 +2,12 @@ package com.xjrsoft.module.outint.service;
 
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.outint.entity.StudentOutInRecord;
+import com.xjrsoft.module.outint.vo.StudentOutInRecordVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
 
 /**
 * @title: 学生出入记录
@@ -11,4 +17,26 @@ import com.xjrsoft.module.outint.entity.StudentOutInRecord;
 */
 
 public interface IStudentOutInRecordService extends MPJBaseService<StudentOutInRecord> {
+
+    Map<Long, Integer> getNotStayClassCount(LocalDateTime startTime, LocalDateTime endTime);
+
+    Map<Long, Integer> getStayClassCount(LocalDateTime startTime, LocalDateTime endTime);
+
+    /**
+     * 查询每个班级指定时间段内走读生到校人数
+     * @param startTime
+     * @param endTime
+     * @param classIds
+     * @return
+     */
+    Map<Long, List<StudentOutInRecordVo>> getNotStayList(LocalDateTime startTime, LocalDateTime endTime, List<Long> classIds);
+
+    /**
+     * 查询每个班级指定时间段内住校生到校人数
+     * @param startTime
+     * @param endTime
+     * @param classIds
+     * @return
+     */
+    Map<Long, List<StudentOutInRecordVo>> getStayList(LocalDateTime startTime, LocalDateTime endTime, List<Long> classIds);
 }

+ 65 - 0
src/main/java/com/xjrsoft/module/outint/service/impl/StudentOutInRecordServiceImpl.java

@@ -4,9 +4,17 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.module.outint.entity.StudentOutInRecord;
 import com.xjrsoft.module.outint.mapper.StudentOutInRecordMapper;
 import com.xjrsoft.module.outint.service.IStudentOutInRecordService;
+import com.xjrsoft.module.outint.vo.IdCountVo;
+import com.xjrsoft.module.outint.vo.StudentOutInRecordVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
 * @title: 学生出入记录
 * @Author dzx
@@ -16,4 +24,61 @@ import org.springframework.stereotype.Service;
 @Service
 @AllArgsConstructor
 public class StudentOutInRecordServiceImpl extends MPJBaseServiceImpl<StudentOutInRecordMapper, StudentOutInRecord> implements IStudentOutInRecordService {
+    @Override
+    public Map<Long, Integer> getNotStayClassCount(LocalDateTime startTime, LocalDateTime endTime) {
+        List<IdCountVo> classCount = this.baseMapper.getNotStayClassCount(startTime, endTime);
+        Map<Long, Integer> result = new HashMap<>();
+        for (IdCountVo idCountVo : classCount) {
+            result.put(idCountVo.getId(), idCountVo.getCount());
+        }
+
+        return result;
+    }
+
+    @Override
+    public Map<Long, Integer> getStayClassCount(LocalDateTime startTime, LocalDateTime endTime) {
+        List<IdCountVo> classCount = this.baseMapper.getStayClassCount(startTime, endTime);
+        Map<Long, Integer> result = new HashMap<>();
+        for (IdCountVo idCountVo : classCount) {
+            result.put(idCountVo.getId(), idCountVo.getCount());
+        }
+
+        return result;
+    }
+
+    @Override
+    public Map<Long, List<StudentOutInRecordVo>> getNotStayList(LocalDateTime startTime, LocalDateTime endTime, List<Long> classIds) {
+        List<StudentOutInRecordVo> notStayList = this.baseMapper.getNotStayList(startTime, endTime);
+        Map<Long, List<StudentOutInRecordVo>> result = new HashMap<>();
+        for (Long classId : classIds) {
+            List<StudentOutInRecordVo> dataList = new ArrayList<>();
+            for (StudentOutInRecordVo recordVo : notStayList) {
+                if(!classId.equals(recordVo.getClassId())){
+                    continue;
+                }
+                dataList.add(recordVo);
+            }
+            result.put(classId, dataList);
+        }
+
+        return result;
+    }
+
+    @Override
+    public Map<Long, List<StudentOutInRecordVo>> getStayList(LocalDateTime startTime, LocalDateTime endTime, List<Long> classIds) {
+        List<StudentOutInRecordVo> notStayList = this.baseMapper.getStayList(startTime, endTime);
+        Map<Long, List<StudentOutInRecordVo>> result = new HashMap<>();
+        for (Long classId : classIds) {
+            List<StudentOutInRecordVo> dataList = new ArrayList<>();
+            for (StudentOutInRecordVo recordVo : notStayList) {
+                if(!classId.equals(recordVo.getClassId())){
+                    continue;
+                }
+                dataList.add(recordVo);
+            }
+            result.put(classId, dataList);
+        }
+
+        return result;
+    }
 }

+ 22 - 0
src/main/java/com/xjrsoft/module/outint/vo/IdCountVo.java

@@ -0,0 +1,22 @@
+package com.xjrsoft.module.outint.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: id数量
+* @Author dzx
+* @Date: 2024年5月28日
+* @Version 1.0
+*/
+@Data
+public class IdCountVo {
+
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("数量")
+    private Integer count;
+
+}

+ 3 - 1
src/main/java/com/xjrsoft/module/outint/vo/StudentOutInRecordVo.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.outint.vo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.time.LocalDateTime;
+
 /**
 * @title: 学生出入记录表单出参
 * @Author dzx
@@ -36,7 +38,7 @@ public class StudentOutInRecordVo {
     * 记录时间
     */
     @ApiModelProperty("记录时间")
-    private String recordTime;
+    private LocalDateTime recordTime;
     /**
     * 人脸照片
     */

+ 5 - 0
src/main/java/com/xjrsoft/module/personnel/mapper/ReservationSchoolMapper.java

@@ -2,8 +2,12 @@ package com.xjrsoft.module.personnel.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
 import com.xjrsoft.module.personnel.entity.ReservationSchool;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
 * @title: 预约进校
@@ -14,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface ReservationSchoolMapper extends MPJBaseMapper<ReservationSchool> {
 
+    List<VisitorInfoVo> getVisionList(@Param("date") String date);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/personnel/service/IReservationSchoolService.java

@@ -2,8 +2,11 @@ package com.xjrsoft.module.personnel.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
 import com.xjrsoft.module.personnel.entity.ReservationSchool;
 import lombok.Data;
+import org.apache.ibatis.annotations.Param;
+
 import java.util.List;
 
 /**
@@ -44,4 +47,6 @@ public interface IReservationSchoolService extends MPJBaseService<ReservationSch
      * @return
      */
     Boolean registration(ReservationSchool dataObj);
+
+    List<VisitorInfoVo> getVisionList(String date);
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/ReservationSchoolServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.google.gson.JsonObject;
 import com.xjrsoft.common.enums.GenderIntEnum;
+import com.xjrsoft.module.attendance.vo.VisitorInfoVo;
 import com.xjrsoft.module.hikvision.entity.HikvisionData;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.ApiUtil;
@@ -142,4 +143,9 @@ public class ReservationSchoolServiceImpl extends MPJBaseServiceImpl<Reservation
 
         return true;
     }
+
+    @Override
+    public List<VisitorInfoVo> getVisionList(String date) {
+        return reservationSchoolMapper.getVisionList(date);
+    }
 }

+ 11 - 2
src/main/java/com/xjrsoft/module/student/mapper/StudentLeaveMapper.java

@@ -1,16 +1,25 @@
 package com.xjrsoft.module.student.mapper;
 
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.entity.StudentDropOut;
 import com.xjrsoft.module.student.entity.StudentLeave;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.time.LocalDateTime;
+import java.util.List;
 
 /**
-* @title: 退学申请
+* @title: 学生请假
 * @Author dzx
-* @Date: 2024年4月17日
+* @Date: 2024年5月27日
 * @Version 1.0
 */
 @Mapper
 public interface StudentLeaveMapper extends MPJBaseMapper<StudentLeave> {
+
+    Long getLeaveCount(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
+
+    List<IdCountVo> getClassLeaveCount(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentLeaveService.java

@@ -3,6 +3,9 @@ package com.xjrsoft.module.student.service;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.student.entity.StudentLeave;
 
+import java.time.LocalDateTime;
+import java.util.Map;
+
 /**
 * @title: 学生荣誉
 * @Author dzx
@@ -13,4 +16,8 @@ import com.xjrsoft.module.student.entity.StudentLeave;
 public interface IStudentLeaveService extends MPJBaseService<StudentLeave> {
 
     Boolean hikvisionLeave(Long id);
+
+    Long getLeaveCount(LocalDateTime startTime, LocalDateTime endTime);
+
+    Map<Long, Integer> getClassLeaveCount(LocalDateTime startTime, LocalDateTime endTime);
 }

+ 18 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentLeaveServiceImpl.java

@@ -9,14 +9,17 @@ import com.google.gson.JsonParser;
 import com.xjrsoft.module.hikvision.entity.HikvisionData;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.ApiUtil;
+import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.entity.StudentLeave;
 import com.xjrsoft.module.student.mapper.StudentLeaveMapper;
 import com.xjrsoft.module.student.service.IStudentLeaveService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -75,6 +78,21 @@ public class StudentLeaveServiceImpl extends MPJBaseServiceImpl<StudentLeaveMapp
         return true;
     }
 
+    @Override
+    public Long getLeaveCount(LocalDateTime startTime, LocalDateTime endTime) {
+        return this.baseMapper.getLeaveCount(startTime, endTime);
+    }
+
+    @Override
+    public Map<Long, Integer> getClassLeaveCount(LocalDateTime startTime, LocalDateTime endTime) {
+        List<IdCountVo> classLeaveCount = this.baseMapper.getClassLeaveCount(startTime, endTime);
+        Map<Long, Integer> result = new HashMap<>();
+        for (IdCountVo idCountVo : classLeaveCount) {
+            result.put(idCountVo.getId(), idCountVo.getCount());
+        }
+        return result;
+    }
+
     JsonArray selectResource(ApiUtil apiUtil){
         String apiPath = "/api/irds/v2/resource/resourcesByParams";
         JsonObject jsonObject = new JsonObject();

+ 7 - 4
src/main/resources/mapper/attendance/AttendanceRuleDetailsMapper.xml

@@ -18,10 +18,13 @@
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0 AND NOW() BETWEEN start_date AND end_date
         AND t2.date_type = #{dayOfWeek}
     </select>
-    <select id="getAllStudentTodyRule" resultType="com.xjrsoft.module.attendance.entity.AttendanceRuleDetails">
-        SELECT t2.* FROM attendance_rule_category t1
-                             INNER JOIN attendance_rule_details t2 ON t1.id = t2.attendance_rule_category_id
+    <select id="getAllStudentTodyRule" resultType="com.xjrsoft.module.attendance.vo.AttendanceRuleDetailsUserVo">
+        SELECT t2.*,t5.user_id FROM attendance_rule_category t1
+        INNER JOIN attendance_rule_details t2 ON t1.id = t2.attendance_rule_category_id
+        INNER JOIN attendance_user_relation t3 ON t1.id = t3.attendance_rule_category_id
+        INNER JOIN xjr_user t4 ON t3.user_id = t4.id
+        INNER JOIN base_student t5 ON t4.id = t5.user_id
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0 AND NOW() BETWEEN start_date AND end_date
-          AND t2.date_type = #{dayOfWeek}
+        AND t2.date_type = #{dayOfWeek}
     </select>
 </mapper>

+ 17 - 1
src/main/resources/mapper/base/BaseClass.xml

@@ -76,5 +76,21 @@
         INNER JOIN base_student_school_roll t2 ON t1.id = t2.class_id
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
     </select>
-
+    <select id="getAttendanceClass" resultType="com.xjrsoft.module.attendance.vo.ClassStatisticsVo">
+        SELECT t1.id,t1.name AS class_name,t2.name AS teacher_name,
+        (SELECT COUNT(*) FROM base_student_school_roll c1
+        INNER JOIN xjr_user c2 ON c1.user_id = c2.id
+        WHERE c1.delete_mark = 0 AND c1.delete_mark = 0
+        AND c1.class_id = t1.id AND c1.archives_status = 'FB2901') AS student_count,
+        (SELECT COUNT(*) FROM base_student_school_roll c1
+        INNER JOIN xjr_user c2 ON c1.user_id = c2.id
+        WHERE c1.delete_mark = 0 AND c1.delete_mark = 0
+        AND c1.class_id = t1.id AND c1.archives_status = 'FB2901' AND c1.stduy_status = 'FB3001') AS stay_count,
+        (SELECT COUNT(*) FROM base_student_school_roll c1
+        INNER JOIN xjr_user c2 ON c1.user_id = c2.id
+        WHERE c1.delete_mark = 0 AND c1.delete_mark = 0
+        AND c1.class_id = t1.id AND c1.archives_status = 'FB2901' AND c1.stduy_status = 'FB3002') AS not_stay_count FROM base_class t1
+        LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
+        WHERE t1.delete_mark = 0
+    </select>
 </mapper>

+ 13 - 0
src/main/resources/mapper/hikvision/HikvisionDataMapper.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper">
+    <select id="getTeacherHikvisionId" parameterType="long" resultType="java.lang.String">
+        SELECT hikvision_id FROM hikvision_data WHERE source_id = #{id} AND table_name = 'base_teacher'
+    </select>
+    <select id="getStudentHikvisionId" parameterType="long" resultType="java.lang.String">
+        SELECT hikvision_id FROM hikvision_data WHERE source_id = #{id} AND table_name = 'base_student'
+    </select>
+
+</mapper>

+ 37 - 0
src/main/resources/mapper/outin/StudentOutInRecordMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.outint.mapper.StudentOutInRecordMapper">
+    <select id="getNotStayClassCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
+        SELECT t1.class_id AS id,COUNT(t1.user_id) FROM student_out_in_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        WHERE t1.delete_mark = 0 AND t1.status = 0 AND t2.delete_mark = 0
+        AND t1.stduy_status = 'FB3002'
+        AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+        GROUP BY t1.class_id
+    </select>
+    <select id="getStayClassCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
+        SELECT t1.class_id AS id,COUNT(t1.user_id) FROM student_out_in_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        WHERE t1.delete_mark = 0 AND t1.status = 0 AND t2.delete_mark = 0
+        AND t1.stduy_status = 'FB3001'
+        AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+        GROUP BY t1.class_id
+    </select>
+
+    <select id="getNotStayList" resultType="com.xjrsoft.module.outint.vo.StudentOutInRecordVo">
+        SELECT t1.* FROM student_out_in_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        WHERE t1.delete_mark = 0 AND t1.status = 0 AND t2.delete_mark = 0
+        AND t1.stduy_status = 'FB3002'
+        AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+    </select>
+    <select id="getStayList" resultType="com.xjrsoft.module.outint.vo.StudentOutInRecordVo">
+        SELECT t1.* FROM student_out_in_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        WHERE t1.delete_mark = 0 AND t1.status = 0 AND t2.delete_mark = 0
+        AND t1.stduy_status = 'FB3001'
+        AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+    </select>
+</mapper>

+ 15 - 0
src/main/resources/mapper/personnel/ReservationSchoolMapper.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.personnel.mapper.ReservationSchoolMapper">
+    <select id="getVisionList" resultType="com.xjrsoft.module.attendance.vo.VisitorInfoVo">
+        SELECT t1.name,t1.identity_card,t1.phone,t3.name AS respondent_user_name,t2.reason,t4.name AS dept_name,t2.start_time,t2.end_time,t2.create_date FROM reservation_school_people t1
+        INNER JOIN reservation_school t2 ON t1.reservation_schoo_id = t2.id
+        LEFT JOIN xjr_user t3 ON t2.respondent_user_id = t3.id
+        LEFT JOIN xjr_department t4 ON t2.dept_id = t4.id
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0 AND t2.status = 1
+        AND #{date} between start_time and end_time
+    </select>
+
+</mapper>

+ 28 - 0
src/main/resources/mapper/student/StudentLeaveMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.student.mapper.StudentLeaveMapper">
+    <select id="getLeaveCount" resultType="java.lang.Long">
+        SELECT COUNT(*) FROM student_leave t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        WHERE t1.status = 1 AND t2.delete_mark = 0
+        AND (
+        (start_date BETWEEN #{startTime} and #{endTime})
+        OR (end_date BETWEEN #{startTime} and #{endTime})
+        OR (start_date > #{startTime} and #{endTime} > end_date)
+        OR (#{startTime} > start_date and end_date > #{endTime})
+        )
+    </select>
+    <select id="getClassLeaveCount" resultType="com.xjrsoft.module.outint.vo.IdCountVo">
+        SELECT t1.class_id as id, COUNT(*) FROM student_leave t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        WHERE t1.status = 1 AND t2.delete_mark = 0
+        AND (
+        (start_date BETWEEN #{startTime} and #{endTime})
+        OR (end_date BETWEEN #{startTime} and #{endTime})
+        OR (start_date > #{startTime} and #{endTime} > end_date)
+        OR (#{startTime} > start_date and end_date > #{endTime})
+        ) group by t1.class_id
+    </select>
+</mapper>

+ 1 - 7
src/main/resources/mapper/teacher/TeacherFaceImportMapper.xml

@@ -4,12 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.teacher.mapper.FaceImportMapper">
     <select id="GetTeacherUserIdById" parameterType="long" resultType="java.lang.String">
-        select t.user_id
-        from teacher_face_process t
-        <if test="id != null">
-            where t.id = #{id}
-        </if>
-        and t.status = 1
+        select t.user_id from teacher_face_process t where t.id = #{id}
     </select>
 
     <select id="GetTeacherHikvisionImgById" parameterType="long" resultType="java.lang.String">
@@ -19,7 +14,6 @@
         <if test="id != null">
             where t.id = #{id}
         </if>
-        and t.status = 1
     </select>
 
     <select id="GetStudentUserIdById" parameterType="long" resultType="java.lang.String">

+ 2 - 2
src/main/resources/mapper/teacher/WfTeacherleaveMapper.xml

@@ -10,8 +10,8 @@
         AND (
         (leave_start_time BETWEEN #{startTime} and #{endTime})
         OR (leave_end_time BETWEEN #{startTime} and #{endTime})
-        OR (leave_end_time > #{startTime} and #{endTime} > leave_end_time)
-        OR (#{startTime} > leave_end_time and leave_end_time > #{endTime})
+        OR (leave_start_time > #{startTime} and #{endTime} > leave_end_time)
+        OR (#{startTime} > leave_start_time and leave_end_time > #{endTime})
         )
     </select>
 </mapper>

+ 46 - 0
src/test/java/com/xjrsoft/module/liteflow/node/ImportTeacherFaceNodeTest.java

@@ -0,0 +1,46 @@
+package com.xjrsoft.module.liteflow.node;
+
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
+import com.xjrsoft.module.hikvision.util.FaceImportUtil;
+import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
+import com.xjrsoft.module.personnel.service.ITeacherFaceProcessService;
+import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author dzx
+ * @date 2024/5/27
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class ImportTeacherFaceNodeTest {
+
+
+    @Autowired
+    private ITeacherFaceProcessService teacherFaceProcessService;
+    @Autowired
+    private FaceImportMapper faceImportMapper;
+
+    @Autowired
+    private HikvisionDataMapper hikvisionDataMapper;
+    @Test
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Long formId = 1793948095216664576L;
+        if (formId != null) {
+            String fileUrl = faceImportMapper.GetTeacherHikvisionImgById(formId);
+            // 数据处理
+            TeacherFaceProcess dataObj = teacherFaceProcessService.getById(formId);
+            dataObj.setStatus(1);
+            dataObj.setExamStatus(1);
+            String reslut = FaceImportUtil.ImportTeacherFace(hikvisionDataMapper.getTeacherHikvisionId(dataObj.getUserId()), fileUrl);
+            dataObj.setHikvisionResult(reslut);
+            teacherFaceProcessService.updateById(dataObj);
+        }
+    }
+}