|
|
@@ -40,7 +40,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void visitInsertRecord(Db db, Long reservation_school_people_id, String recordTime,String facePhoto, int status, String eventId) throws SQLException {
|
|
|
+ public void visitInsertRecord(Db db, Long reservation_school_people_id, String recordTime,String facePhoto, String 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 + "', '" + eventId + "', '" + status + "',0,1)";
|
|
|
@@ -305,6 +305,7 @@ public class OutInRecordUtil {
|
|
|
String eventTime = item.get("eventTime").isJsonNull() ? null : ChangeTime(item.get("eventTime").getAsString());
|
|
|
String reservationSchoolId = faceImportMapper.GetReservationSchoolId(orderId) == null ? "0" : String.valueOf(faceImportMapper.GetReservationSchoolId(orderId));
|
|
|
String eventId = item.get("eventId").isJsonNull() ? null : item.get("eventId").getAsString();
|
|
|
+ String deviceDesc = item.get("deviceDesc").isJsonNull() ? null : item.get("deviceDesc").getAsString();
|
|
|
|
|
|
int status = -1;
|
|
|
for (JsonElement e : doorEventsResponse){
|
|
|
@@ -317,7 +318,7 @@ public class OutInRecordUtil {
|
|
|
|
|
|
if (visit_id_list.contains(eventId)) continue;
|
|
|
|
|
|
- visitInsertRecord(use, Long.parseLong(reservationSchoolId), eventTime, picUri, status, eventId);
|
|
|
+ visitInsertRecord(use, Long.parseLong(reservationSchoolId), eventTime, picUri, deviceDesc, eventId);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -583,5 +584,33 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void GetVisitRecordsTest(Db use, FaceImportMapper faceImportMapper, String data) throws SQLException, ParseException {
|
|
|
+ if (data != null) {
|
|
|
+ List<String> visit_id_list = faceImportMapper.GetVisitIdList();
|
|
|
+
|
|
|
+ try {
|
|
|
+ JsonObject jsonObject = new Gson().fromJson(data, JsonObject.class);
|
|
|
+ JsonObject paramsObject = jsonObject.getAsJsonObject("params");
|
|
|
+ JsonArray eventsArray = paramsObject.getAsJsonArray("events");
|
|
|
+
|
|
|
+ for (JsonElement eventElement : eventsArray) {
|
|
|
+ JsonObject eventObject = eventElement.getAsJsonObject();
|
|
|
+ JsonObject dataObject = eventObject.getAsJsonObject("data");
|
|
|
+
|
|
|
+ String orderId = dataObject.get("visitorId").getAsString().trim();
|
|
|
+ String eventTime = ChangeTime(eventObject.get("happenTime").getAsString());
|
|
|
+ String picUri = dataObject.get("photoUrl").getAsString().trim();
|
|
|
+ String srcParentIndex = eventObject.get("srcParentIndex").getAsString().trim();
|
|
|
+ String eventId = eventObject.get("eventId").getAsString().trim();
|
|
|
+ String reservationSchoolId = faceImportMapper.GetReservationSchoolId(orderId) == null ? "0" : String.valueOf(faceImportMapper.GetReservationSchoolId(orderId));
|
|
|
+
|
|
|
+ if (visit_id_list.contains(eventId)) continue;
|
|
|
|
|
|
+ visitInsertRecord(use, Long.parseLong(reservationSchoolId), eventTime, ApiUtil.GetRedirectURL(picUri), srcParentIndex, eventId);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info(String.valueOf(e));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|