ソースを参照

海康出入数据同步调整,解决学生出入记录跑到教师表中的问题

dzx 4 週間 前
コミット
0895226753

+ 2 - 2
src/main/java/com/xjrsoft/module/hikvision/util/OutInRecordUtil.java

@@ -22,7 +22,6 @@ import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
 
 
@@ -578,6 +577,7 @@ public class OutInRecordUtil {
             JsonObject paramsObject = data.getAsJsonObject("params");
             JsonArray eventsArray = paramsObject.getAsJsonArray("events");
 
+            List<Long> teacherUserIds = faceImportMapper.getTeacherUserIds();
             for (JsonElement eventElement : eventsArray) {
                 JsonObject eventObject = eventElement.getAsJsonObject();
                 JsonObject dataObject = eventObject.getAsJsonObject("data");
@@ -606,7 +606,7 @@ public class OutInRecordUtil {
 
                 if (idNum == null) continue;
 
-                if (!Objects.equals(faceImportMapper.IsStudentTypeByPersonId(Long.valueOf(idNum)), "学生")) {
+                if (teacherUserIds.contains(Long.valueOf(idNum))) {
                     // 老师记录
                     LocalDateTime recordTimeDate = LocalDateTime.parse(recordTimeStr, formatter);
                     String attendanceStatus = discernTeacherStatus(recordTimeDate, status, Long.valueOf(idNum));