Bladeren bron

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

dzx 4 weken geleden
bovenliggende
commit
0895226753
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      src/main/java/com/xjrsoft/module/hikvision/util/OutInRecordUtil.java

+ 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));