brealinxx 9 місяців тому
батько
коміт
8c140e83b1

+ 48 - 5
src/main/java/com/xjrsoft/module/hikvision/util/Out_In_RecordUtil.java

@@ -47,11 +47,13 @@ public class Out_In_RecordUtil {
         db.execute(sql);
     }
 
-    private void vehicleInsertRecord(Db db, Long carMessageApplyId, String recordTime, int releaseReason, int category, String facePhoto, int status, String planNo, String crossRecordSyscode, int releaseResult, int releaseWay) throws SQLException {
-        String sql = "INSERT INTO car_out_in_record(create_date, car_message_apply_id, record_time, face_photo, status,release_reason, plan_no, cross_record_syscode, release_result, release_way, category,delete_mark,enabled_mark) " +
+    private void vehicleInsertRecord(Db db, 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 {
+        String sql = "INSERT INTO car_out_in_record(create_date, car_message_apply_id, record_time, face_photo, status,release_reason, plan_no, " +
+                "cross_record_syscode, release_result, release_way, vehicle_type, phone, name, category,delete_mark,enabled_mark) " +
                 "VALUES(now(), '"  + carMessageApplyId + "', '" +
                 recordTime + "', '" + facePhoto + "', '" + status + "', '" + releaseReason + "', '" + planNo + "', '" +
-                crossRecordSyscode + "', '" + releaseResult + "', '" + releaseWay + "', '" + category  +  "',0,1)";
+                crossRecordSyscode + "', '" + releaseResult + "', '" + releaseWay + "', '" + vehicleType + "', '" + phone + "', '" + name + "', '" + category  +  "',0,1)";
         db.execute(sql);
     }
 
@@ -385,11 +387,21 @@ public class Out_In_RecordUtil {
                 releaseReasonInt = item.get("releaseReason").isJsonNull() ? null : item.get("releaseReason").getAsInt();
             }
 
+            int vehicleType = item.get("vehicleType").isJsonNull() ? null : item.get("vehicleType").getAsInt();
             String crossRecordSyscode = item.get("crossRecordSyscode").isJsonNull() ? null : item.get("crossRecordSyscode").getAsString();
             String plateNo = item.get("plateNo").isJsonNull() ? null : item.get("plateNo").getAsString();
             String eventTime = item.get("crossTime").isJsonNull() ? null : ChangeTime(item.get("crossTime").getAsString());
 
             int status = item.get("vehicleOut").isJsonNull() ? null : item.get("vehicleOut").getAsInt();
+            int statusInt = 0;
+            switch (status){
+                case 0:
+                    statusInt = 1;
+                    break;
+                case 1:
+                    statusInt = 0;
+                    break;
+            }
 
             JsonElement facePicUriElement = item.get("facePicUri");
             String facePicUri;
@@ -400,9 +412,20 @@ public class Out_In_RecordUtil {
             }
             System.out.println(facePicUri + "haha");
 
+            String phone = faceImportMapper.GetPhoneNumberByPlanNum(plateNo);
+            if (phone == null){
+                phone = faceImportMapper.GetPhoneNumberByPlanNumView(plateNo);
+            }
+
+            String name = faceImportMapper.GetNameByPlanNum(plateNo);
+            if (name == null){
+                name = faceImportMapper.GetNameByPlanNumView(plateNo);
+            }
+
             if(vehicle_id_list.contains(crossRecordSyscode)) continue;
 
-            vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, categoryInt, facePicUri, status, plateNo, crossRecordSyscode, releaseResultInt, releaseWayInt);
+            vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, categoryInt, facePicUri, statusInt, plateNo,
+                    crossRecordSyscode, releaseResultInt, releaseWayInt, vehicleType, phone, name);
         }
     }
 
@@ -498,6 +521,7 @@ public class Out_In_RecordUtil {
                     }
 
                     String carAttributeName = dataObject.get("carAttributeName").getAsString().trim();
+                    int vehicleType = dataObject.get("vehicleType").getAsInt();
                     int category = -1;
                     switch (carAttributeName){
                         case "临时车":
@@ -515,10 +539,29 @@ public class Out_In_RecordUtil {
                     }
 
                     int status = eventObject.get("status").getAsInt();
+                    int statusInt = 0;
+                    switch (status){
+                        case 0:
+                            statusInt = 1;
+                            break;
+                        case 1:
+                            statusInt = 0;
+                            break;
+                    }
+
+                    String phone = faceImportMapper.GetPhoneNumberByPlanNum(carNum);
+                    if (phone == null){
+                        phone = faceImportMapper.GetPhoneNumberByPlanNumView(carNum);
+                    }
+
+                    String name = faceImportMapper.GetNameByPlanNum(carNum);
+                    if (name == null){
+                        name = faceImportMapper.GetNameByPlanNumView(carNum);
+                    }
 
                     if (vehicle_id_list.contains(eventIndex)) continue;
 
-                    vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, category, ApiUtil.GetRedirectURL(facePicUri), status, carNum, eventIndex, releaseResultInt, releaseWayInt);
+                    vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, category, ApiUtil.GetRedirectURL(facePicUri), statusInt, carNum, eventIndex, releaseResultInt, releaseWayInt,vehicleType,phone,name);
                 }
             } catch (Exception e) {
                 log.info(String.valueOf(e));

+ 12 - 0
src/main/java/com/xjrsoft/module/outint/entity/CarOutInRecord.java

@@ -110,4 +110,16 @@ public class CarOutInRecord implements Serializable {
 
     @ApiModelProperty("放行方式")
     private Integer releaseWay;
+
+    @ApiModelProperty("车辆id(car_message_apply),固定车辆使用")
+    private Long carMessageApplyId;
+
+    @ApiModelProperty("车辆类型")
+    private Integer vehicleType;
+
+    @ApiModelProperty("手机号")
+    private String phone;
+
+    @ApiModelProperty("姓名")
+    private String name;
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/teacher/mapper/FaceImportMapper.java

@@ -28,5 +28,11 @@ public interface FaceImportMapper {
 
     String GetCarMessageApplyIdByCarNumber(@Param("id") String id);
     List<String> GetVehicleIdList();
+
+    String GetPhoneNumberByPlanNum(@Param("id") String id);
+    String GetNameByPlanNum(@Param("id") String id);
+
+    String GetPhoneNumberByPlanNumView(@Param("id") String id);
+    String GetNameByPlanNumView(@Param("id") String id);
 }
 

+ 32 - 0
src/main/resources/mapper/teacher/TeacherFaceImportMapper.xml

@@ -106,4 +106,36 @@
         SELECT cross_record_syscode
         FROM car_out_in_record
     </select>
+
+    <select id="GetPhoneNumberByPlanNum" resultType="java.lang.String">
+        SELECT c_phone
+        FROM base_car_management
+        <if test="id != null">
+            WHERE car_no = #{id}
+        </if>
+    </select>
+
+    <select id="GetNameByPlanNum" resultType="java.lang.String">
+        SELECT c_name
+        FROM base_car_management
+        <if test="id != null">
+            WHERE car_no = #{id}
+        </if>
+    </select>
+
+    <select id="GetPhoneNumberByPlanNumView" resultType="java.lang.String">
+        SELECT phone
+        FROM reservation_school_people
+        <if test="id != null">
+            WHERE plate_number = #{id}
+        </if>
+    </select>
+
+    <select id="GetNameByPlanNumView" resultType="java.lang.String">
+        SELECT name
+        FROM reservation_school_people
+        <if test="id != null">
+            WHERE plate_number = #{id}
+        </if>
+    </select>
 </mapper>