Ver código fonte

考勤模块调整

dzx 5 meses atrás
pai
commit
b86d8ab106

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

@@ -99,10 +99,10 @@ public class StatisticsController {
                             .orderByAsc(TeacherOutInRecord::getRecordTime)
             );
 
-            List<Long> collect = outInRecords.stream().map(TeacherOutInRecord::getUserId).collect(Collectors.toList());
+            Set<Long> collect = outInRecords.stream().map(TeacherOutInRecord::getUserId).collect(Collectors.toSet());
             Set<Long> userIds = new HashSet<>(collect);
             //实到人数
-            statisticsVo.setActualCount(Long.valueOf(userIds.size()));
+            statisticsVo.setActualCount(Long.valueOf(collect.size()));
 
             //查询教师请假人数
             Long leaveCount = wfTeacherleaveService.getLeaveCount(startTime, endTime);
@@ -176,7 +176,7 @@ public class StatisticsController {
                             .eq(StudentOutInRecord::getStatus, 1)
             );
             //实到人数
-            List<Long> collect = outInRecords.stream().map(StudentOutInRecord::getUserId).collect(Collectors.toList());
+            Set<Long> collect = outInRecords.stream().map(StudentOutInRecord::getUserId).collect(Collectors.toSet());
             statisticsVo.setActualCount(Long.valueOf(collect.size()));
 
             //查询教师请假人数

+ 5 - 1
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -51,6 +51,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
 * @title: 考勤消息设置
@@ -279,7 +281,9 @@ public class StudentStatisticsController {
 
             for (ClassStatisticsVo record: attendancePage.getRecords()) {
                 record.setLeaveCount(classLeaveCount.get(record.getId()) == null ? 0:classLeaveCount.get(record.getId()));
-                record.setActualCount(notStayMap.get(record.getId()).size() + stayMap.get(record.getId()).size());
+                Set<Long> collect = notStayMap.get(record.getId()).stream().map(StudentOutInRecordVo::getUserId).collect(Collectors.toSet());
+
+                record.setActualCount(collect.size());
                 record.setStudentCount(record.getStudentCount() * dayOfWeeks.size() * 3);
 
                 Integer lateCount = 0;

+ 0 - 2
src/main/java/com/xjrsoft/module/attendance/controller/TeacherStatisticsController.java

@@ -11,9 +11,7 @@ import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.attendance.dto.TeacherDetailsDto;
-import com.xjrsoft.module.attendance.entity.AttendanceMessageSet;
 import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
-import com.xjrsoft.module.attendance.vo.AttendanceMessageSetPageVo;
 import com.xjrsoft.module.attendance.vo.AttendanceRuleDetailsUserVo;
 import com.xjrsoft.module.attendance.vo.TeacherStatisticsPageVo;
 import com.xjrsoft.module.holiday.entity.HolidayDate;

+ 6 - 3
src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java

@@ -253,16 +253,19 @@ public class AttenDanceWarnNoticeTask {
                     && ruleDetail.getIsAttendance() != null && ruleDetail.getIsAttendance() == 1){
                 if(ruleDetail.getAmStartTime() != null){
                     LocalDateTime amStartTime = now.with(ruleDetail.getAmStartTime().toLocalTime());
-                    result.add(amStartTime);
+                    result.add(amStartTime.plusDays(- ruleDetail.getAgoMinutes()));
+                    result.add(amStartTime.plusDays(ruleDetail.getOverMinutes()));
                 }
                 if(ruleDetail.getPmStartTime() != null){
                     LocalDateTime pmStartTime = now.with(ruleDetail.getPmStartTime().toLocalTime());
-                    result.add(pmStartTime);
+                    result.add(pmStartTime.plusDays(- ruleDetail.getAgoMinutes()));
+                    result.add(pmStartTime.plusDays(ruleDetail.getOverMinutes()));
                 }
 
                 if(ruleDetail.getEveningStartTime() != null){
                     LocalDateTime eveningStartTime = now.with(ruleDetail.getEveningStartTime().toLocalTime());
-                    result.add(eveningStartTime);
+                    result.add(eveningStartTime.plusDays(- ruleDetail.getAgoMinutes()));
+                    result.add(eveningStartTime.plusDays(ruleDetail.getOverMinutes()));
                 }
             }
         }