|
|
@@ -40,10 +40,10 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void visitInsertRecord(Db db, Long reservation_school_people_id, String recordTime,String facePhoto, int status) throws SQLException {
|
|
|
- String sql = "INSERT INTO visitor_out_in_record(create_date, reservation_school_people_id, record_time, face_photo, status,delete_mark,enabled_mark) " +
|
|
|
+ public void visitInsertRecord(Db db, Long reservation_school_people_id, String recordTime,String facePhoto, int status, String eventId) throws SQLException {
|
|
|
+ String sql = "INSERT INTO visitor_out_in_record(create_date, reservation_school_people_id, record_time, face_photo, event_id, status,delete_mark,enabled_mark) " +
|
|
|
"VALUES(now(), '" + reservation_school_people_id + "', '" +
|
|
|
- recordTime + "', '" + facePhoto + "', '" + status + "',0,1)";
|
|
|
+ recordTime + "', '" + facePhoto + "', '" + eventId + "', '" + status + "',0,1)";
|
|
|
db.execute(sql);
|
|
|
}
|
|
|
|
|
|
@@ -295,16 +295,16 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
private void InsertVisitRecords(Db use, JsonArray eventsResponse, JsonArray doorEventsResponse,FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
- List<Long> visit_id_list = faceImportMapper.GetReservationSchoolIdList();
|
|
|
|
|
|
for (JsonElement element : eventsResponse) {
|
|
|
+ List<String> visit_id_list = faceImportMapper.GetReservationSchoolIdList();
|
|
|
JsonObject item = element.getAsJsonObject();
|
|
|
|
|
|
- String picUri = item.get("visitorPhotoUri").isJsonNull() ? null : ApiUtil.GetRedirectURL(item.get("visitorPhotoUri").getAsString());
|
|
|
+ String picUri = item.get("visitorPhotoUri").isJsonNull() ? "" : ApiUtil.GetRedirectURL(item.get("visitorPhotoUri").getAsString());
|
|
|
String orderId = item.get("orderId").isJsonNull() ? null : item.get("orderId").getAsString();
|
|
|
String eventTime = item.get("eventTime").isJsonNull() ? null : ChangeTime(item.get("eventTime").getAsString());
|
|
|
- //todo: reservationSchoolId
|
|
|
-// Long reservationSchoolId = faceImportMapper.GetReservationSchoolId(orderId) == null ? 1 : faceImportMapper.GetReservationSchoolId(orderId);
|
|
|
+ String reservationSchoolId = faceImportMapper.GetReservationSchoolId(orderId) == null ? "0" : String.valueOf(faceImportMapper.GetReservationSchoolId(orderId));
|
|
|
+ String eventId = item.get("eventId").isJsonNull() ? null : item.get("eventId").getAsString();
|
|
|
|
|
|
int status = -1;
|
|
|
for (JsonElement e : doorEventsResponse){
|
|
|
@@ -315,8 +315,9 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (visit_id_list.contains(1)) continue;
|
|
|
- visitInsertRecord(use, Long.parseLong("123"), eventTime, picUri, status);
|
|
|
+ if (visit_id_list.contains(eventId)) continue;
|
|
|
+
|
|
|
+ visitInsertRecord(use, Long.parseLong(reservationSchoolId), eventTime, picUri, status, eventId);
|
|
|
}
|
|
|
|
|
|
}
|