|
@@ -12,7 +12,6 @@ import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
-import java.sql.SQLException;
|
|
|
import java.sql.Types;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -28,7 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|
|
public class OutInRecordUtil {
|
|
|
private static final Logger log = LoggerFactory.getLogger(OutInRecordUtil.class);
|
|
|
|
|
|
- private void teacherInsertRecord(Long userId, String recordTime, String facePhoto, int status, String eventId, String attendanceStatus) throws SQLException {
|
|
|
+ private void teacherInsertRecord(Long userId, String recordTime, String facePhoto, int status, String eventId, String attendanceStatus){
|
|
|
String photoValue = (facePhoto != null && !facePhoto.equals("null")) ? facePhoto : "";
|
|
|
|
|
|
String sql = "INSERT INTO teacher_out_in_record(create_date, user_id, record_time, face_photo, eventId, status,delete_mark,enabled_mark, attendance_status) " +
|
|
@@ -37,7 +36,7 @@ public class OutInRecordUtil {
|
|
|
SqlRunnerAdapter.db().insert(sql);
|
|
|
}
|
|
|
|
|
|
- private void studentInsertRecord(Long userId, Long teacherId, Long classId, String facePhoto, String recordTime, int status, String eventId, String attendanceStatus) throws SQLException {
|
|
|
+ private void studentInsertRecord(Long userId, Long teacherId, Long classId, String facePhoto, String recordTime, int status, String eventId, String attendanceStatus){
|
|
|
String photoValue = (facePhoto != null && !facePhoto.equals("null")) ? facePhoto : "";
|
|
|
|
|
|
String sql = "INSERT INTO student_out_in_record(create_date, user_id, teacher_id, class_id, face_photo, record_time , eventId,status,delete_mark,enabled_mark, attendance_status) " +
|
|
@@ -47,7 +46,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void visitInsertRecord(Long reservation_school_people_id, String recordTime,String facePhoto, String status, String eventId) throws SQLException {
|
|
|
+ public void visitInsertRecord(Long reservation_school_people_id, String recordTime,String facePhoto, String status, String eventId){
|
|
|
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)";
|
|
@@ -55,7 +54,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
private void vehicleInsertRecord(Long carMessageApplyId, String recordTime, int releaseReason, int category, String facePhoto, int status, String planNo, String crossRecordSyscode,
|
|
|
- int releaseResult, int releaseWay, int vehicleType, String phone, String name) throws SQLException {
|
|
|
+ int releaseResult, int releaseWay, int vehicleType, String phone, String name){
|
|
|
String phoneValue = (phone != null && !phone.equals("null")) ? phone : "";
|
|
|
String nameValue = (name != null && !name.equals("null")) ? name : "";
|
|
|
String photoValue = (facePhoto != null && !facePhoto.equals("null")) ? facePhoto : "";
|
|
@@ -83,7 +82,7 @@ public class OutInRecordUtil {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void GetTeacherAndStudentRecords(FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
+ public void GetTeacherAndStudentRecords(FaceImportMapper faceImportMapper) throws ParseException {
|
|
|
JsonArray responseBuilder = new JsonArray();
|
|
|
|
|
|
AtomicInteger pageNo = new AtomicInteger(1);
|
|
@@ -108,7 +107,7 @@ public class OutInRecordUtil {
|
|
|
InsertTeacherStudentRecords(responseBuilder, faceImportMapper);
|
|
|
}
|
|
|
|
|
|
- private void InsertTeacherStudentRecords(JsonArray doorEventsResponse, FaceImportMapper faceImportMapper) throws SQLException, 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");
|
|
@@ -159,7 +158,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String discernTeacherStatus(LocalDateTime recordTime, int status, Long userId) throws SQLException {
|
|
|
+ String discernTeacherStatus(LocalDateTime recordTime, int status, Long userId){
|
|
|
String attendanceStatus = "";
|
|
|
String dayOfWeek = recordTime.getDayOfWeek().name();
|
|
|
String sql = "SELECT t2.* FROM attendance_rule_category t1" +
|
|
@@ -214,7 +213,7 @@ public class OutInRecordUtil {
|
|
|
return attendanceStatus;
|
|
|
}
|
|
|
|
|
|
- String discernStudentStatus(LocalDateTime recordTime, int status, Long studentUserId) throws SQLException {
|
|
|
+ String discernStudentStatus(LocalDateTime recordTime, int status, Long studentUserId){
|
|
|
String attendanceStatus = "";
|
|
|
String dayOfWeek = recordTime.getDayOfWeek().name();
|
|
|
String sql = "SELECT t2.* FROM attendance_rule_category t1" +
|
|
@@ -288,7 +287,7 @@ public class OutInRecordUtil {
|
|
|
return attendanceStatus;
|
|
|
}
|
|
|
|
|
|
- public void GetVisitRecord(FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
+ public void GetVisitRecord(FaceImportMapper faceImportMapper) throws ParseException {
|
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
|
|
|
|
AtomicInteger pageNo = new AtomicInteger(1);
|
|
@@ -329,7 +328,7 @@ public class OutInRecordUtil {
|
|
|
InsertVisitRecords(responseBuilder,responseDoorBuilder,faceImportMapper);
|
|
|
}
|
|
|
|
|
|
- private void InsertVisitRecords(JsonArray eventsResponse, JsonArray doorEventsResponse,FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
+ private void InsertVisitRecords(JsonArray eventsResponse, JsonArray doorEventsResponse,FaceImportMapper faceImportMapper) throws ParseException {
|
|
|
|
|
|
for (JsonElement element : eventsResponse) {
|
|
|
List<String> visit_id_list = faceImportMapper.GetReservationSchoolIdList();
|
|
@@ -358,7 +357,7 @@ public class OutInRecordUtil {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void GetVehicleRecord(FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
+ public void GetVehicleRecord(FaceImportMapper faceImportMapper) throws ParseException {
|
|
|
ApiUtil apiUtil = new ApiUtil();
|
|
|
|
|
|
AtomicInteger pageNo = new AtomicInteger(1);
|
|
@@ -389,7 +388,7 @@ public class OutInRecordUtil {
|
|
|
InsertVehicleRecords(responseBuilder,faceImportMapper);
|
|
|
}
|
|
|
|
|
|
- private void InsertVehicleRecords(JsonArray doorEventsResponse, FaceImportMapper faceImportMapper) throws SQLException, ParseException {
|
|
|
+ private void InsertVehicleRecords(JsonArray doorEventsResponse, FaceImportMapper faceImportMapper) throws ParseException {
|
|
|
List<String> vehicle_id_list = faceImportMapper.GetVehicleIdList();
|
|
|
|
|
|
for (JsonElement element : doorEventsResponse) {
|
|
@@ -479,7 +478,7 @@ public class OutInRecordUtil {
|
|
|
return mysqlFormat.format(date);
|
|
|
}
|
|
|
|
|
|
- public void GetTeacherAndStudentRecordsTest(FaceImportMapper faceImportMapper, JsonObject data) throws SQLException, ParseException {
|
|
|
+ public void GetTeacherAndStudentRecordsTest(FaceImportMapper faceImportMapper, JsonObject data) throws ParseException {
|
|
|
try {
|
|
|
List<String> teacherEventIdList = faceImportMapper.GetTeacherUrlList();
|
|
|
List<String> studentEventIdList = faceImportMapper.GetStudentUrlList();
|
|
@@ -541,7 +540,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void GetVehicleRecordTest(FaceImportMapper faceImportMapper, String data) throws SQLException, ParseException {
|
|
|
+ public void GetVehicleRecordTest(FaceImportMapper faceImportMapper, String data) throws ParseException {
|
|
|
if (data != null) {
|
|
|
List<String> vehicle_id_list = faceImportMapper.GetVehicleIdList();
|
|
|
try {
|
|
@@ -613,7 +612,7 @@ public class OutInRecordUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void GetVisitRecordsTest(FaceImportMapper faceImportMapper, String data) throws SQLException, ParseException {
|
|
|
+ public void GetVisitRecordsTest(FaceImportMapper faceImportMapper, String data) throws ParseException {
|
|
|
if (data != null) {
|
|
|
List<String> visit_id_list = faceImportMapper.GetVisitIdList();
|
|
|
|