|
|
@@ -9,8 +9,6 @@ import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
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.StudentStatisticsPageVo;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
@@ -60,7 +58,6 @@ public class StudentStatisticsController {
|
|
|
|
|
|
private final IUserService xjrUserService;
|
|
|
private final IStudentOutInRecordService studentOutInRecordService;
|
|
|
- private final IAttendanceRuleCategoryService ruleCategoryService;
|
|
|
private final IStudentLeaveService studentLeaveService;
|
|
|
private final IBaseClassService classService;
|
|
|
|
|
|
@@ -100,11 +97,6 @@ public class StudentStatisticsController {
|
|
|
//查询各班的请假人数
|
|
|
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());
|
|
|
@@ -114,10 +106,7 @@ public class StudentStatisticsController {
|
|
|
if(outInRecord.getStatus() == 0){
|
|
|
continue;
|
|
|
}
|
|
|
- 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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|
|
|
@@ -125,10 +114,7 @@ public class StudentStatisticsController {
|
|
|
if(outInRecord.getStatus() == 0){
|
|
|
continue;
|
|
|
}
|
|
|
- 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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|
|
|
@@ -182,7 +168,6 @@ public class StudentStatisticsController {
|
|
|
LocalDateTime lastSundayStart = startTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
|
|
|
LocalDateTime lastSundayEnd = endTime.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).plusDays(-1);
|
|
|
|
|
|
- Map<Long, AttendanceRuleDetailsUserVo> allTodyRule = ruleCategoryService.getAllStudentTodyRule(queryDate.getDayOfWeek().name());
|
|
|
//查询当前时间段存在请假的学生
|
|
|
Map<Long, StudentLeave> leaveList = studentLeaveService.getLeaveList(startTime, endTime);
|
|
|
//查询进入记录
|
|
|
@@ -200,19 +185,8 @@ public class StudentStatisticsController {
|
|
|
if(studentLeave != null){
|
|
|
record.setStatus(studentLeave.getLeaveType());
|
|
|
}else{
|
|
|
- AttendanceRuleDetailsUserVo ruleUserVo = allTodyRule.get(record.getUserId());
|
|
|
StudentOutInRecord outInRecord = outInMap.get(record.getUserId());
|
|
|
- if(ruleUserVo.getIsAllowInOutSchool() != null && ruleUserVo.getIsAllowInOutSchool() == 0){
|
|
|
- record.setStatus("不考核");
|
|
|
- }else{
|
|
|
- if(dto.getTimePeriod() == 1 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleUserVo.getAmStartTime()) > 0){
|
|
|
- record.setStatus("迟到");
|
|
|
- }else if(dto.getTimePeriod() == 2 && outInRecord.getRecordTime().toLocalTime().compareTo(ruleUserVo.getPmStartTime()) > 0){
|
|
|
- record.setStatus("迟到");
|
|
|
- }else{
|
|
|
- record.setStatus("到校");
|
|
|
- }
|
|
|
- }
|
|
|
+ record.setStatus(outInRecord.getAttendanceStatus());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -250,11 +224,6 @@ public class StudentStatisticsController {
|
|
|
dayOfWeeks.add(startTime.plusDays(i).getDayOfWeek().name());
|
|
|
}
|
|
|
|
|
|
- //查询走读生的考勤规则
|
|
|
- Map<String, Map<Long, AttendanceRuleDetailsUserVo>> notStayTodyRule = ruleCategoryService.getAllStudentTodyRule(dayOfWeeks);
|
|
|
- //查询住校生生的考勤规则
|
|
|
- Map<String, Map<Long, AttendanceRuleDetailsUserVo>> staySundayRule = ruleCategoryService.getAllStudentTodyRule(dayOfWeeks);
|
|
|
-
|
|
|
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());
|
|
|
@@ -263,18 +232,12 @@ public class StudentStatisticsController {
|
|
|
Integer lateCount = 0;
|
|
|
for (String dayOfWeek : dayOfWeeks) {
|
|
|
for (StudentOutInRecordVo outInRecord : notStayMap.get(record.getId())) {
|
|
|
- AttendanceRuleDetailsUserVo ruleDetails = notStayTodyRule.get(dayOfWeek).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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|
|
|
for (StudentOutInRecordVo outInRecord : stayMap.get(record.getId())) {
|
|
|
- AttendanceRuleDetailsUserVo ruleDetails = staySundayRule.get(dayOfWeek).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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|
|
|
@@ -330,11 +293,6 @@ public class StudentStatisticsController {
|
|
|
//查询各班的请假人数
|
|
|
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());
|
|
|
@@ -344,10 +302,7 @@ public class StudentStatisticsController {
|
|
|
if(outInRecord.getStatus() == 1){
|
|
|
continue;
|
|
|
}
|
|
|
- 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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|
|
|
@@ -355,10 +310,7 @@ public class StudentStatisticsController {
|
|
|
if(outInRecord.getStatus() == 1){
|
|
|
continue;
|
|
|
}
|
|
|
- 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){
|
|
|
+ if("迟到".equals(outInRecord.getAttendanceStatus())){
|
|
|
lateCount ++;
|
|
|
}
|
|
|
}
|