|
|
@@ -8,6 +8,7 @@ import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
|
import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
|
import com.xjrsoft.module.organization.entity.Department;
|
|
|
import com.xjrsoft.module.personnel.entity.CarMessageApply;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
@@ -464,7 +465,7 @@ public class DataUtil {
|
|
|
}
|
|
|
|
|
|
/*同步车辆数据*/
|
|
|
- public Map<Long, String> insertCar(String tableName, Map<String, String> tableData, FaceImportMapper faceImportMapper) {
|
|
|
+ public Map<Long, String> insertCar(String tableName, Map<String, String> tableData, HikvisionDataMapper hikvisionDataMapper) {
|
|
|
String sql = "SELECT * FROM " + tableName + " WHERE delete_mark = 0 and status = 1";
|
|
|
List<Map<String, Object>> dataList = SqlRunnerAdapter.db().selectList(sql, CarMessageApply.class);
|
|
|
String apiPath = "/api/resource/v1/vehicle/batch/add";
|
|
|
@@ -483,19 +484,18 @@ public class DataUtil {
|
|
|
JsonArray dataArray = new JsonArray();
|
|
|
String result = null;
|
|
|
int clientId = 1;
|
|
|
- for (Map<String, Object> carMessageApplyMap : dataList) {
|
|
|
- CarMessageApply carMessageApply = SqlRunnerAdapterUtil.convertMapToEntity(carMessageApplyMap, CarMessageApply.class);
|
|
|
- if(existingPlates.contains(carMessageApply.getId() + "")){
|
|
|
+ for (Map<String, Object> carMap : dataList) {
|
|
|
+ if(existingPlates.contains(carMap.get("id") + "")){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
JsonObject paramJson = new JsonObject();
|
|
|
paramJson.addProperty("clientId", clientId);
|
|
|
- paramJson.addProperty("plateNo", carMessageApply.getCarNumber().trim());
|
|
|
- paramJson.addProperty("personId", faceImportMapper.GetHikvisonPersonId(carMessageApply.getId().toString()));
|
|
|
+ paramJson.addProperty("plateNo", carMap.get("car_number").toString());
|
|
|
+ paramJson.addProperty("personId", hikvisionDataMapper.getTeacherHikvisionId(Long.parseLong(carMap.get("user_id").toString())));
|
|
|
|
|
|
int vehicleTypeNum;
|
|
|
- switch (carMessageApply.getVehicleType()) {
|
|
|
+ switch (carMap.get("vehicle_type").toString()) {
|
|
|
case "小型车":
|
|
|
vehicleTypeNum = 1;
|
|
|
break;
|
|
|
@@ -510,19 +510,18 @@ public class DataUtil {
|
|
|
break;
|
|
|
}
|
|
|
paramJson.addProperty("vehicleType", vehicleTypeNum);
|
|
|
- clientMap.put(clientId, carMessageApply.getId());
|
|
|
+ clientMap.put(clientId, Long.parseLong(carMap.get("id").toString()));
|
|
|
dataArray.add(paramJson);
|
|
|
clientId++;
|
|
|
}
|
|
|
result = apiUtil.doPost(apiPath, dataArray.toString(), tagMap, null);
|
|
|
|
|
|
- for (Map<String, Object> carMessageApplyMap : dataList) {
|
|
|
- CarMessageApply carMessageApply = SqlRunnerAdapterUtil.convertMapToEntity(carMessageApplyMap, CarMessageApply.class);
|
|
|
+ for (Map<String, Object> carMap : dataList) {
|
|
|
JsonObject paramJsonTime = new JsonObject();
|
|
|
paramJsonTime.addProperty("parkSyscode", "c69f2a7c48a74216bcab7d65f24d4a09");
|
|
|
- paramJsonTime.addProperty("plateNo", carMessageApply.getCarNumber().trim());
|
|
|
- paramJsonTime.addProperty("startTime", String.valueOf(carMessageApply.getStartTime()));
|
|
|
- paramJsonTime.addProperty("endTime", String.valueOf(carMessageApply.getEndTime()));
|
|
|
+ paramJsonTime.addProperty("plateNo", carMap.get("car_number").toString());
|
|
|
+ paramJsonTime.addProperty("startTime", carMap.get("start_time").toString());
|
|
|
+ paramJsonTime.addProperty("endTime", carMap.get("end_time").toString());
|
|
|
apiUtil.doPost(apiPathTime, String.valueOf(paramJsonTime), tagMap, null);
|
|
|
}
|
|
|
|