|
@@ -12,7 +12,6 @@ import com.xjrsoft.module.attendance.entity.AttendanceRuleDetails;
|
|
import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
|
|
import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.sql.Types;
|
|
import java.sql.Types;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
@@ -20,7 +19,10 @@ import java.text.SimpleDateFormat;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.time.ZoneOffset;
|
|
import java.time.ZoneOffset;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
@@ -178,8 +180,6 @@ public class OutInRecordUtil {
|
|
}
|
|
}
|
|
|
|
|
|
private void InsertTeacherStudentRecords(JsonArray doorEventsResponse, FaceImportMapper faceImportMapper) throws ParseException {
|
|
private void InsertTeacherStudentRecords(JsonArray doorEventsResponse, FaceImportMapper faceImportMapper) throws ParseException {
|
|
- List<String> teacherEventIdList = faceImportMapper.GetTeacherUrlList();
|
|
|
|
- List<String> studentEventIdList = faceImportMapper.GetStudentUrlList();
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
List<Long> teacherUserIds = faceImportMapper.getTeacherUserIds();
|
|
List<Long> teacherUserIds = faceImportMapper.getTeacherUserIds();
|
|
for (JsonElement element : doorEventsResponse) {
|
|
for (JsonElement element : doorEventsResponse) {
|
|
@@ -210,17 +210,11 @@ public class OutInRecordUtil {
|
|
String recordTimeStr = ChangeTime(recordTime);
|
|
String recordTimeStr = ChangeTime(recordTime);
|
|
if (teacherUserIds.contains(personId)) {
|
|
if (teacherUserIds.contains(personId)) {
|
|
// 老师记录
|
|
// 老师记录
|
|
- if (teacherEventIdList.contains(eventId)) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
String attendanceStatus = discernTeacherStatus(recordTimeDate, status, personId);
|
|
String attendanceStatus = discernTeacherStatus(recordTimeDate, status, personId);
|
|
teacherInsertRecord(personId, recordTimeStr, ApiUtil.GetRedirectURL(uri),status,eventId, attendanceStatus);
|
|
teacherInsertRecord(personId, recordTimeStr, ApiUtil.GetRedirectURL(uri),status,eventId, attendanceStatus);
|
|
} else {
|
|
} else {
|
|
// 学生记录
|
|
// 学生记录
|
|
- if (studentEventIdList.contains(eventId)){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
String attendanceStatus = discernStudentStatus(recordTimeDate, status, personId);
|
|
String attendanceStatus = discernStudentStatus(recordTimeDate, status, personId);
|
|
studentInsertRecord(personId, faceImportMapper.GetTeacherIdByPersonId(personId),
|
|
studentInsertRecord(personId, faceImportMapper.GetTeacherIdByPersonId(personId),
|
|
@@ -579,8 +573,6 @@ public class OutInRecordUtil {
|
|
|
|
|
|
public void GetTeacherAndStudentRecordsTest(FaceImportMapper faceImportMapper, JsonObject data) throws ParseException {
|
|
public void GetTeacherAndStudentRecordsTest(FaceImportMapper faceImportMapper, JsonObject data) throws ParseException {
|
|
try {
|
|
try {
|
|
- List<String> teacherEventIdList = faceImportMapper.GetTeacherUrlList();
|
|
|
|
- List<String> studentEventIdList = faceImportMapper.GetStudentUrlList();
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
JsonObject paramsObject = data.getAsJsonObject("params");
|
|
JsonObject paramsObject = data.getAsJsonObject("params");
|
|
@@ -616,17 +608,11 @@ public class OutInRecordUtil {
|
|
|
|
|
|
if (!Objects.equals(faceImportMapper.IsStudentTypeByPersonId(Long.valueOf(idNum)), "学生")) {
|
|
if (!Objects.equals(faceImportMapper.IsStudentTypeByPersonId(Long.valueOf(idNum)), "学生")) {
|
|
// 老师记录
|
|
// 老师记录
|
|
- if (teacherEventIdList.contains(eventId)) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
String attendanceStatus = discernTeacherStatus(recordTimeDate, status, Long.valueOf(idNum));
|
|
String attendanceStatus = discernTeacherStatus(recordTimeDate, status, Long.valueOf(idNum));
|
|
teacherInsertRecord(Long.valueOf(idNum), recordTimeStr, ApiUtil.GetRedirectURL(extEventPictureURL), status, eventId, attendanceStatus);
|
|
teacherInsertRecord(Long.valueOf(idNum), recordTimeStr, ApiUtil.GetRedirectURL(extEventPictureURL), status, eventId, attendanceStatus);
|
|
} else {
|
|
} else {
|
|
// 学生记录
|
|
// 学生记录
|
|
- if (studentEventIdList.contains(eventId)){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
|
|
String attendanceStatus = discernStudentStatus(recordTimeDate, status, Long.valueOf(idNum));
|
|
String attendanceStatus = discernStudentStatus(recordTimeDate, status, Long.valueOf(idNum));
|
|
studentInsertRecord(Long.valueOf(idNum), faceImportMapper.GetTeacherIdByPersonId(Long.valueOf(idNum)),
|
|
studentInsertRecord(Long.valueOf(idNum), faceImportMapper.GetTeacherIdByPersonId(Long.valueOf(idNum)),
|