|
@@ -47,10 +47,11 @@ public class Out_In_RecordUtil {
|
|
|
db.execute(sql);
|
|
|
}
|
|
|
|
|
|
- private void vehicleInsertRecord(Db db, Long carMessageApplyId, String recordTime, String releaseReason, int category, String facePhoto, int status, String planNo, String crossRecordSyscode) throws SQLException {
|
|
|
- String sql = "INSERT INTO car_out_in_record(create_date, car_message_apply_id, record_time, face_photo, status,releaseReason, planNo,crossRecordSyscode,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) 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) " +
|
|
|
"VALUES(now(), '" + carMessageApplyId + "', '" +
|
|
|
- recordTime + "', '" + facePhoto + "', '" + status + "', '" + releaseReason + "', '" + planNo + "', '" + crossRecordSyscode + "', '" + category + "',0,1)";
|
|
|
+ recordTime + "', '" + facePhoto + "', '" + status + "', '" + releaseReason + "', '" + planNo + "', '" +
|
|
|
+ crossRecordSyscode + "', '" + releaseResult + "', '" + releaseWay + "', '" + category + "',0,1)";
|
|
|
db.execute(sql);
|
|
|
}
|
|
|
|
|
@@ -355,29 +356,40 @@ public class Out_In_RecordUtil {
|
|
|
|
|
|
String carMessageApplyIdStr = faceImportMapper.GetCarMessageApplyIdByCarNumber(item.get("plateNo").getAsString().trim());
|
|
|
Long carId = (carMessageApplyIdStr == null || carMessageApplyIdStr.isEmpty()) ? 0 : Long.parseLong(carMessageApplyIdStr);
|
|
|
- int releaseMode = item.get("releaseMode").isJsonNull() ? null : item.get("releaseMode").getAsInt();
|
|
|
+ String category = null;
|
|
|
+ int categoryInt = 0;
|
|
|
+ if (item.has("carCategory")){
|
|
|
+ category = item.get("carCategory").isJsonNull() ? null : item.get("carCategory").getAsString();
|
|
|
+ switch (category){
|
|
|
+ case "10":
|
|
|
+ categoryInt = 0;
|
|
|
+ break;
|
|
|
+ case "11":
|
|
|
+ categoryInt = 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int releaseResultInt = 0;
|
|
|
+ if (item.has("releaseResult")){
|
|
|
+ releaseResultInt = item.get("releaseResult").isJsonNull() ? null : item.get("releaseResult").getAsInt();
|
|
|
+ }
|
|
|
+
|
|
|
+ int releaseWayInt = 0;
|
|
|
+ if (item.has("releaseWay")){
|
|
|
+ releaseWayInt = item.get("releaseWay").isJsonNull() ? null : item.get("releaseWay").getAsInt();
|
|
|
+ }
|
|
|
+
|
|
|
+ int releaseReasonInt = 0;
|
|
|
+ if (item.has("releaseReason")){
|
|
|
+ releaseReasonInt = item.get("releaseReason").isJsonNull() ? null : item.get("releaseReason").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 releaseReasonInt = item.get("releaseReason").isJsonNull() ? null : item.get("releaseReason").getAsInt();
|
|
|
- String releaseReason = null;
|
|
|
- switch (releaseReasonInt){
|
|
|
- case 100:
|
|
|
- releaseReason = "固定车自动放行";
|
|
|
- break;
|
|
|
- case 101:
|
|
|
- releaseReason = "临时车自动放行";
|
|
|
- break;
|
|
|
- case 102:
|
|
|
- releaseReason = "预约车自动放行";
|
|
|
- break;
|
|
|
- case 103:
|
|
|
- releaseReason = "一户多车自动放行";
|
|
|
- break;
|
|
|
- }
|
|
|
- int status = item.get("vehicleOut").isJsonNull() ? null : item.get("vehicleOut").getAsInt();
|
|
|
|
|
|
- if(vehicle_id_list.contains(crossRecordSyscode)) continue;
|
|
|
+ int status = item.get("vehicleOut").isJsonNull() ? null : item.get("vehicleOut").getAsInt();
|
|
|
|
|
|
JsonElement facePicUriElement = item.get("facePicUri");
|
|
|
String facePicUri;
|
|
@@ -386,8 +398,11 @@ public class Out_In_RecordUtil {
|
|
|
} else {
|
|
|
facePicUri = ApiUtil.GetRedirectURL(facePicUriElement.getAsString());
|
|
|
}
|
|
|
-// System.out.println(GetReserveOrderNo(crossRecordSyscode) + "haha");
|
|
|
- vehicleInsertRecord(use, carId, eventTime, releaseReason, releaseMode, facePicUri, status, plateNo, crossRecordSyscode);
|
|
|
+ System.out.println(facePicUri + "haha");
|
|
|
+
|
|
|
+ if(vehicle_id_list.contains(crossRecordSyscode)) continue;
|
|
|
+
|
|
|
+ vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, categoryInt, facePicUri, status, plateNo, crossRecordSyscode, releaseResultInt, releaseWayInt);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -401,21 +416,6 @@ public class Out_In_RecordUtil {
|
|
|
return apiUtil.doPost(apiPath, String.valueOf(paramJson), null);
|
|
|
}
|
|
|
|
|
|
- private String GetReserveOrderNo(String parkSyscode){
|
|
|
- ApiUtil apiUtil = new ApiUtil();
|
|
|
- String apiPath = "/api/pms/v2/reserveRecord/page";
|
|
|
- JsonObject paramJson = new JsonObject();
|
|
|
- paramJson.addProperty("pageNo", 1);
|
|
|
- paramJson.addProperty("pageSize", 50);
|
|
|
-
|
|
|
- String response = apiUtil.doPost(apiPath, String.valueOf(paramJson), null);
|
|
|
- System.out.println(response + "xixi");
|
|
|
-// JsonElement responseElement = new Gson().fromJson(response, JsonElement.class);
|
|
|
-// JsonElement dataList = responseElement.getAsJsonObject().getAsJsonObject("data").getAsJsonArray("list");
|
|
|
-
|
|
|
- return "123";//dataList.getAsJsonObject().get("reserveOrderNo").getAsString()
|
|
|
- }
|
|
|
-
|
|
|
private String ChangeTime(String recordTime) throws ParseException {
|
|
|
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
|
SimpleDateFormat mysqlFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -468,6 +468,7 @@ public class Out_In_RecordUtil {
|
|
|
|
|
|
public void GetVehicleRecordTest(Db use, FaceImportMapper faceImportMapper, String data) throws SQLException, ParseException {
|
|
|
if (data != null) {
|
|
|
+ List<String> vehicle_id_list = faceImportMapper.GetVehicleIdList();
|
|
|
try {
|
|
|
JsonObject jsonObject = new Gson().fromJson(data, JsonObject.class);
|
|
|
JsonObject paramsObject = jsonObject.getAsJsonObject("params");
|
|
@@ -483,30 +484,27 @@ public class Out_In_RecordUtil {
|
|
|
Long carId = (carMessageApplyIdStr == null || carMessageApplyIdStr.isEmpty()) ? 0 : Long.parseLong(carMessageApplyIdStr);
|
|
|
String eventTime = ChangeTime(dataObject.get("time").getAsString());
|
|
|
|
|
|
- int releaseMode = 0;
|
|
|
+ int releaseWayInt = 0;
|
|
|
int releaseReasonInt = 0;
|
|
|
+ int releaseResultInt = 0;
|
|
|
JsonObject inResultObject = dataObject.getAsJsonObject("inResult");
|
|
|
if (inResultObject != null) {
|
|
|
JsonObject rlsResultObject = inResultObject.getAsJsonObject("rlsResult");
|
|
|
- if (rlsResultObject != null && rlsResultObject.has("releaseWay")) {
|
|
|
- releaseMode = rlsResultObject.get("releaseWay").getAsInt();
|
|
|
+ if (rlsResultObject != null && rlsResultObject.has("releaseWay") && rlsResultObject.has("releaseReason") && rlsResultObject.has("releaseResult")) {
|
|
|
+ releaseWayInt = rlsResultObject.get("releaseWay").getAsInt();
|
|
|
releaseReasonInt = rlsResultObject.get("releaseReason").getAsInt();
|
|
|
+ releaseResultInt = rlsResultObject.get("releaseResult").getAsInt();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String releaseReason = null;
|
|
|
- switch (releaseReasonInt){
|
|
|
- case 100:
|
|
|
- releaseReason = "固定车自动放行";
|
|
|
+ String carAttributeName = dataObject.get("carAttributeName").getAsString().trim();
|
|
|
+ int category = -1;
|
|
|
+ switch (carAttributeName){
|
|
|
+ case "临时车":
|
|
|
+ category = 1;
|
|
|
break;
|
|
|
- case 101:
|
|
|
- releaseReason = "临时车自动放行";
|
|
|
- break;
|
|
|
- case 102:
|
|
|
- releaseReason = "预约车自动放行";
|
|
|
- break;
|
|
|
- case 103:
|
|
|
- releaseReason = "一户多车自动放行";
|
|
|
+ case "固定车":
|
|
|
+ category = 0;
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -518,7 +516,9 @@ public class Out_In_RecordUtil {
|
|
|
|
|
|
int status = eventObject.get("status").getAsInt();
|
|
|
|
|
|
- vehicleInsertRecord(use, carId, eventTime, releaseReason, releaseMode, ApiUtil.GetRedirectURL(facePicUri), status,carNum,eventIndex);
|
|
|
+ if (vehicle_id_list.contains(eventIndex)) continue;
|
|
|
+
|
|
|
+ vehicleInsertRecord(use, carId, eventTime, releaseReasonInt, category, ApiUtil.GetRedirectURL(facePicUri), status, carNum, eventIndex, releaseResultInt, releaseWayInt);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.info(String.valueOf(e));
|