移动方法
This commit is contained in:
parent
a32d4d5caf
commit
3caec4f5c2
@ -551,7 +551,7 @@ public class HikvisionCall {
|
|||||||
String rs = null;
|
String rs = null;
|
||||||
param.put("pageNo", param.getIntValue("pageNo") + 1);
|
param.put("pageNo", param.getIntValue("pageNo") + 1);
|
||||||
try {
|
try {
|
||||||
rs = getDoorEventsForHttp(project, param);
|
rs = HikvisionUtil.getDoorEventsForHttp(project, param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("err:", e);
|
log.error("err:", e);
|
||||||
return;
|
return;
|
||||||
@ -665,7 +665,7 @@ public class HikvisionCall {
|
|||||||
String rs = null;
|
String rs = null;
|
||||||
param.put(Cts.PAGE_NO, param.getIntValue(Cts.PAGE_NO) + 1);
|
param.put(Cts.PAGE_NO, param.getIntValue(Cts.PAGE_NO) + 1);
|
||||||
try {
|
try {
|
||||||
rs = getCrossRecordsForHttp(project, param);
|
rs = HikvisionUtil.getCrossRecordsForHttp(project, param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("err:", e);
|
log.error("err:", e);
|
||||||
return;
|
return;
|
||||||
@ -851,20 +851,11 @@ public class HikvisionCall {
|
|||||||
// deleteWorker.setId(wiJo.getLong("personId"));
|
// deleteWorker.setId(wiJo.getLong("personId"));
|
||||||
// deleteWorkerFromHttp(deleteWorker, project);
|
// deleteWorkerFromHttp(deleteWorker, project);
|
||||||
// }
|
// }
|
||||||
String rs = doAddWorkerFromHttp(workerInfo, project);
|
String rs = HikvisionUtil.doAddWorkerFromHttp(workerInfo, project);
|
||||||
sendNoticeAndSetStatusForWorker("添加人员到海康isc", rs, workerInfo, 1, 1);
|
sendNoticeAndSetStatusForWorker("添加人员到海康isc", rs, workerInfo, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String doAddWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
public static String getWorkerJson(WorkerInfo workerInfo) {
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v2/person/single/add";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
String body = getWorkerJson(workerInfo);
|
|
||||||
String rs = HikvisionUtil.doPost(host, path, body, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
return rs;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getWorkerJson(WorkerInfo workerInfo) {
|
|
||||||
JSONObject jsonBody = new JSONObject();
|
JSONObject jsonBody = new JSONObject();
|
||||||
jsonBody.put("personId", workerInfo.getId());
|
jsonBody.put("personId", workerInfo.getId());
|
||||||
jsonBody.put("personName", workerInfo.getWorkerName());
|
jsonBody.put("personName", workerInfo.getWorkerName());
|
||||||
@ -879,7 +870,7 @@ public class HikvisionCall {
|
|||||||
return jsonBody.toJSONString();
|
return jsonBody.toJSONString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getOrgIndexCode(WorkerInfo workerInfo) {
|
private static String getOrgIndexCode(WorkerInfo workerInfo) {
|
||||||
if (workerInfo == null) {
|
if (workerInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -920,18 +911,10 @@ public class HikvisionCall {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void editWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
public void editWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
||||||
String rs = doEditWorkerFromHttp(workerInfo, project);
|
String rs = HikvisionUtil.doEditWorkerFromHttp(workerInfo, project);
|
||||||
sendNoticeAndSetStatusForWorker("更新人员到海康isc", rs, workerInfo, 1, 2);
|
sendNoticeAndSetStatusForWorker("更新人员到海康isc", rs, workerInfo, 1, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String doEditWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/person/single/update";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
String body = getWorkerJson(workerInfo);
|
|
||||||
return HikvisionUtil.doPost(host, path, body, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加人脸
|
* 添加人脸
|
||||||
*
|
*
|
||||||
@ -941,21 +924,11 @@ public class HikvisionCall {
|
|||||||
public void addWorkerFace(WorkerInfo workerInfo, Project project) throws Exception {
|
public void addWorkerFace(WorkerInfo workerInfo, Project project) throws Exception {
|
||||||
String fieldAcquisitionUrl = workerInfo.getFieldAcquisitionUrl();
|
String fieldAcquisitionUrl = workerInfo.getFieldAcquisitionUrl();
|
||||||
if (StringUtils.isNotBlank(fieldAcquisitionUrl)) {
|
if (StringUtils.isNotBlank(fieldAcquisitionUrl)) {
|
||||||
String rs = doAddWorkerFace(workerInfo, project);
|
String rs = HikvisionUtil.doAddWorkerFace(workerInfo, project);
|
||||||
sendNoticeAndSetStatusForWorker("添加人员照片到海康isc", rs, workerInfo, 2, 1);
|
sendNoticeAndSetStatusForWorker("添加人员照片到海康isc", rs, workerInfo, 2, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String doAddWorkerFace(WorkerInfo workerInfo, Project project) throws Exception {
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/face/single/add";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
JSONObject jo = new JSONObject();
|
|
||||||
jo.put("personId", String.valueOf(workerInfo.getId()));
|
|
||||||
jo.put("faceData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + workerInfo.getFieldAcquisitionUrl())));
|
|
||||||
return HikvisionUtil.doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendNoticeAndSetStatusForCarInfo(String title, String rs, CarInfo carInfo, Integer type, Integer operate, Boolean setSuc, boolean isNotice) {
|
public void sendNoticeAndSetStatusForCarInfo(String title, String rs, CarInfo carInfo, Integer type, Integer operate, Boolean setSuc, boolean isNotice) {
|
||||||
String msg;
|
String msg;
|
||||||
if (setSuc == null) {
|
if (setSuc == null) {
|
||||||
@ -1435,7 +1408,7 @@ public class HikvisionCall {
|
|||||||
addJo.put("driver", c.getDriverWorkerName());
|
addJo.put("driver", c.getDriverWorkerName());
|
||||||
addJo.put("driverPhone", c.getDriverTelephone());
|
addJo.put("driverPhone", c.getDriverTelephone());
|
||||||
addJo.put("plateNo", carInfo.getCarNumber());
|
addJo.put("plateNo", carInfo.getCarNumber());
|
||||||
JSONObject rs = addAlarmCarForHttp(project, addJo);
|
JSONObject rs = HikvisionUtil.addAlarmCarForHttp(project, addJo);
|
||||||
sendNoticeAndSetStatusForCarInfo("车辆添加黑名单到海康isc", rs.toJSONString(), carInfo, 7, null, null, true);
|
sendNoticeAndSetStatusForCarInfo("车辆添加黑名单到海康isc", rs.toJSONString(), carInfo, 7, null, null, true);
|
||||||
} else {
|
} else {
|
||||||
sendNoticeAndSetStatusForCarInfo("车辆取消黑名单到海康isc", null, carInfo, 7, null, true, false);
|
sendNoticeAndSetStatusForCarInfo("车辆取消黑名单到海康isc", null, carInfo, 7, null, true, false);
|
||||||
@ -1448,7 +1421,7 @@ public class HikvisionCall {
|
|||||||
String alarmSyscode = joOne.getString("alarmSyscode");
|
String alarmSyscode = joOne.getString("alarmSyscode");
|
||||||
JSONObject deleteJo = new JSONObject();
|
JSONObject deleteJo = new JSONObject();
|
||||||
deleteJo.put("alarmSyscodes", alarmSyscode);
|
deleteJo.put("alarmSyscodes", alarmSyscode);
|
||||||
JSONObject rs = this.deletionAlarmCarForHttp(project, deleteJo);
|
JSONObject rs = HikvisionUtil.deletionAlarmCarForHttp(project, deleteJo);
|
||||||
sendNoticeAndSetStatusForCarInfo("车辆取消黑名单到海康isc", rs.toJSONString(), carInfo, 7, null, null, true);
|
sendNoticeAndSetStatusForCarInfo("车辆取消黑名单到海康isc", rs.toJSONString(), carInfo, 7, null, null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1468,38 +1441,6 @@ public class HikvisionCall {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆布防
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject addAlarmCarForHttp(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/pms/v1/alarmCar/addition";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消车辆布防
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject deletionAlarmCarForHttp(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/pms/v1/alarmCar/deletion";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存固定车
|
* 保存固定车
|
||||||
*
|
*
|
||||||
@ -1755,7 +1696,7 @@ public class HikvisionCall {
|
|||||||
JSONObject oldCarInfo = searchCarInfoByCarNumberFromHttp(carInfo.getCarNumber(), project);
|
JSONObject oldCarInfo = searchCarInfoByCarNumberFromHttp(carInfo.getCarNumber(), project);
|
||||||
if (oldCarInfo != null) {
|
if (oldCarInfo != null) {
|
||||||
log.info("海康存在车辆,车牌号:{}", oldCarInfo.getString("plateNo"));
|
log.info("海康存在车辆,车牌号:{}", oldCarInfo.getString("plateNo"));
|
||||||
String rs = deleteCarInfoByIdFromHttp(oldCarInfo.getString("vehicleId"), project);
|
String rs = HikvisionUtil.deleteCarInfoByIdFromHttp(oldCarInfo.getString("vehicleId"), project);
|
||||||
sendNoticeAndSetStatusForCarInfo("删除车辆白名单到海康isc", rs, carInfo, 4, 3, null, true);
|
sendNoticeAndSetStatusForCarInfo("删除车辆白名单到海康isc", rs, carInfo, 4, 3, null, true);
|
||||||
} else {
|
} else {
|
||||||
sendNoticeAndSetStatusForCarInfo("删除车辆白名单到海康isc", null, carInfo, 4, 3, true, false);
|
sendNoticeAndSetStatusForCarInfo("删除车辆白名单到海康isc", null, carInfo, 4, 3, true, false);
|
||||||
@ -1786,18 +1727,6 @@ public class HikvisionCall {
|
|||||||
return o1;
|
return o1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String deleteCarInfoByIdFromHttp(String carId, Project project) throws Exception {
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/vehicle/batch/delete";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
JSONObject jo = new JSONObject();
|
|
||||||
ArrayList<String> list = new ArrayList<>();
|
|
||||||
list.add(carId);
|
|
||||||
jo.put("vehicleIds", list);
|
|
||||||
String rs = HikvisionUtil.doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
return rs;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消车位预约
|
* 取消车位预约
|
||||||
*
|
*
|
||||||
@ -1940,10 +1869,7 @@ public class HikvisionCall {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void editOrgFromHttp(Project project, HikvisionOrganization hikvisionOrganization) throws Exception {
|
private void editOrgFromHttp(Project project, HikvisionOrganization hikvisionOrganization) throws Exception {
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
String rs = HikvisionUtil.editOrg(project, hikvisionOrganization);
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/org/single/update";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
String rs = HikvisionUtil.doPost(host, path, JSONArray.toJSONString(hikvisionOrganization), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
sendNoticeForOrg("更新组织到海康isc", rs, hikvisionOrganization.getOrgName());
|
sendNoticeForOrg("更新组织到海康isc", rs, hikvisionOrganization.getOrgName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2040,25 +1966,6 @@ public class HikvisionCall {
|
|||||||
HikvisionUtil.addOrgFromHttp(project, hikvisionOrganization);
|
HikvisionUtil.addOrgFromHttp(project, hikvisionOrganization);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取组织列表
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
*/
|
|
||||||
public void getOrg(Project project) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/org/orgList";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
JSONObject jo = new JSONObject();
|
|
||||||
jo.put("pageNo", 1);
|
|
||||||
jo.put("pageSize", 100);
|
|
||||||
String body = jo.toJSONString();
|
|
||||||
HikvisionUtil.doPost(host, path, body, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织是否存在
|
* 组织是否存在
|
||||||
*
|
*
|
||||||
@ -2120,7 +2027,7 @@ public class HikvisionCall {
|
|||||||
private void cancelCharge(Project project, CarInfo carInfo) throws Exception {
|
private void cancelCharge(Project project, CarInfo carInfo) throws Exception {
|
||||||
//取消车辆包期
|
//取消车辆包期
|
||||||
String parkIndexCode = HikvisionUtil.getProjectParkCode(project);
|
String parkIndexCode = HikvisionUtil.getProjectParkCode(project);
|
||||||
chargeDeletion(project, new ChargeDeletionParam(parkIndexCode, carInfo.getCarNumber()));
|
HikvisionUtil.chargeDeletion(project, new ChargeDeletionParam(parkIndexCode, carInfo.getCarNumber()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reservationCarFromHttp(Project project, CarInfo carInfo) throws Exception {
|
private void reservationCarFromHttp(Project project, CarInfo carInfo) throws Exception {
|
||||||
@ -2212,78 +2119,6 @@ public class HikvisionCall {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询门禁点事件v2
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
public String getDoorEventsForHttp(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/acs/v2/door/events";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return HikvisionUtil.doPost(host, path, param.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询过车记录
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
public String getCrossRecordsForHttp(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/pms/v1/crossRecords/page";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
JSONObject jo = new JSONObject();
|
|
||||||
jo.put("pageNo", param.getIntValue("pageNo"));
|
|
||||||
jo.put("pageSize", 1000);
|
|
||||||
//ISO8601时间格式
|
|
||||||
jo.put("startTime", param.getString("startTime"));
|
|
||||||
jo.put("endTime", param.getString("endTime"));
|
|
||||||
jo.put("parkSyscode", param.getString("parkSyscode"));
|
|
||||||
return HikvisionUtil.doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询门禁点列表v2
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @param param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject doorSearchV2ForHttp(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v2/door/search";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, param.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 简单同步权限下载_根据人员与设备通道指定下载
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject simpleDownload(Project project, String param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/acps/v1/authDownload/task/simpleDownload";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, param, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param i 0新增,2删除
|
* @param i 0新增,2删除
|
||||||
*/
|
*/
|
||||||
@ -2307,7 +2142,7 @@ public class HikvisionCall {
|
|||||||
" }\n" +
|
" }\n" +
|
||||||
" ],\n" +
|
" ],\n" +
|
||||||
"}";
|
"}";
|
||||||
JSONObject rs = doorSearchV2ForHttp(project, JSONObject.parseObject(json));
|
JSONObject rs = HikvisionUtil.doorSearchV2ForHttp(project, JSONObject.parseObject(json));
|
||||||
if (HikvisionUtil.isFail(rs)) {
|
if (HikvisionUtil.isFail(rs)) {
|
||||||
log.error(workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + rs.toJSONString() + ",");
|
log.error(workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + rs.toJSONString() + ",");
|
||||||
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",失败原因:下发异常;");
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",失败原因:下发异常;");
|
||||||
@ -2332,7 +2167,7 @@ public class HikvisionCall {
|
|||||||
"\t\t\"operatorType\": " + i + "\n" +
|
"\t\t\"operatorType\": " + i + "\n" +
|
||||||
"\t}\n" +
|
"\t}\n" +
|
||||||
"}";
|
"}";
|
||||||
JSONObject sdRs = simpleDownload(project, sdStr);
|
JSONObject sdRs = HikvisionUtil.simpleDownload(project, sdStr);
|
||||||
if (HikvisionUtil.isFail(sdRs)) {
|
if (HikvisionUtil.isFail(sdRs)) {
|
||||||
log.error("下发人员权限失败:" + workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + sdRs.toJSONString() + ",");
|
log.error("下发人员权限失败:" + workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + sdRs.toJSONString() + ",");
|
||||||
String code = sdRs.getString("code");
|
String code = sdRs.getString("code");
|
||||||
@ -2364,70 +2199,4 @@ public class HikvisionCall {
|
|||||||
updateSuccessStatusByNow(workerInfo.getProjectSn(), workerInfo.getId(), 3, i == 0 ? 1 : 3, AsyncHikvision.getSyncTime(), devSn);
|
updateSuccessStatusByNow(workerInfo.getProjectSn(), workerInfo.getId(), 3, i == 0 ? 1 : 3, AsyncHikvision.getSyncTime(), devSn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消车辆包期,调用预约车之前需要调用
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject chargeDeletion(Project project, ChargeDeletionParam param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/pms/v1/car/charge/deletion";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据父组织编号获取下级组织列表
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject getSubOrgListByParentOrg(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/org/parentOrgIndexCode/subOrgList";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据组织编号获取组织详细信息
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject getOrgListByIndex(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v1/org/orgIndexCodes/orgInfo";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取组织下人员列表v2
|
|
||||||
*
|
|
||||||
* @param project
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public JSONObject getWorkerListByOrg(Project project, JSONObject param) throws Exception {
|
|
||||||
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final String ARTEMIS_PATH = "/artemis";
|
|
||||||
final String path = ARTEMIS_PATH + "/api/resource/v2/person/orgIndexCode/personList";
|
|
||||||
String host = "https://" + project.getArtemisConfigHost();
|
|
||||||
return JSON.parseObject(HikvisionUtil.doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public class XzHikvisionCompareDataServiceImpl extends ServiceImpl<XzHikvisionCo
|
|||||||
//查询id是否存在isc,存在就更新,不存在就新增
|
//查询id是否存在isc,存在就更新,不存在就新增
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
||||||
JSONObject rtJo = hikvisionCall.getOrgListByIndex(projectInfoBySn, param);
|
JSONObject rtJo = HikvisionUtil.getOrgListByIndex(projectInfoBySn, param);
|
||||||
if (HikvisionUtil.isSuccess(rtJo)) {
|
if (HikvisionUtil.isSuccess(rtJo)) {
|
||||||
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
||||||
if (CollUtil.isEmpty(list)) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
@ -241,7 +241,7 @@ public class XzHikvisionCompareDataServiceImpl extends ServiceImpl<XzHikvisionCo
|
|||||||
//查询id是否存在isc,存在就更新,不存在就新增
|
//查询id是否存在isc,存在就更新,不存在就新增
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
||||||
JSONObject rtJo = hikvisionCall.getOrgListByIndex(projectInfoBySn, param);
|
JSONObject rtJo = HikvisionUtil.getOrgListByIndex(projectInfoBySn, param);
|
||||||
if (HikvisionUtil.isSuccess(rtJo)) {
|
if (HikvisionUtil.isSuccess(rtJo)) {
|
||||||
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
||||||
if (CollUtil.isEmpty(list)) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
@ -275,7 +275,7 @@ public class XzHikvisionCompareDataServiceImpl extends ServiceImpl<XzHikvisionCo
|
|||||||
//查询id是否存在isc,存在就更新,不存在就新增
|
//查询id是否存在isc,存在就更新,不存在就新增
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
param.put("orgIndexCodes", Collections.singletonList(data.getUniqueId()));
|
||||||
JSONObject rtJo = hikvisionCall.getOrgListByIndex(projectInfoBySn, param);
|
JSONObject rtJo = HikvisionUtil.getOrgListByIndex(projectInfoBySn, param);
|
||||||
if (HikvisionUtil.isSuccess(rtJo)) {
|
if (HikvisionUtil.isSuccess(rtJo)) {
|
||||||
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
JSONArray list = HikvisionUtil.getJSONObjectData(rtJo).getJSONArray("list");
|
||||||
if (CollUtil.isEmpty(list)) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
|||||||
@ -186,7 +186,7 @@ public class HikvisionTask {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
HikvisionUtil.addPageParamIfAbsent(param);
|
HikvisionUtil.addPageParamIfAbsent(param);
|
||||||
param.put("parentOrgIndexCode", project.getProjectSn());
|
param.put("parentOrgIndexCode", project.getProjectSn());
|
||||||
JSONObject rtJo = hikvisionCall.getSubOrgListByParentOrg(project, param);
|
JSONObject rtJo = HikvisionUtil.getSubOrgListByParentOrg(project, param);
|
||||||
List<EnterpriseInfo> enterpriseInfos = BeanUtil.copyToList(enterpriseInfoService.getEnterpriseInfoList(new MapBuilder<String, Object>().put(Cts.PROJECT_SN, project.getProjectSn()).build()), EnterpriseInfo.class);
|
List<EnterpriseInfo> enterpriseInfos = BeanUtil.copyToList(enterpriseInfoService.getEnterpriseInfoList(new MapBuilder<String, Object>().put(Cts.PROJECT_SN, project.getProjectSn()).build()), EnterpriseInfo.class);
|
||||||
JSONObject dataJo = HikvisionUtil.getJSONObjectData(rtJo);
|
JSONObject dataJo = HikvisionUtil.getJSONObjectData(rtJo);
|
||||||
JSONArray listJa = dataJo.getJSONArray("list");
|
JSONArray listJa = dataJo.getJSONArray("list");
|
||||||
@ -223,7 +223,7 @@ public class HikvisionTask {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
HikvisionUtil.addPageParamIfAbsent(param);
|
HikvisionUtil.addPageParamIfAbsent(param);
|
||||||
param.put("parentOrgIndexCode", orgIndex);
|
param.put("parentOrgIndexCode", orgIndex);
|
||||||
JSONObject rtJo = hikvisionCall.getSubOrgListByParentOrg(project, param);
|
JSONObject rtJo = HikvisionUtil.getSubOrgListByParentOrg(project, param);
|
||||||
List<TeamInfo> teamList = teamInfoService.getProjectTeamList(new MapBuilder<String, Object>()
|
List<TeamInfo> teamList = teamInfoService.getProjectTeamList(new MapBuilder<String, Object>()
|
||||||
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, orgIndex).build());
|
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, orgIndex).build());
|
||||||
List<DepartmentInfo> departmentInfoList = departmentInfoMapper.getDepartmentInfoList(new MapBuilder<String, Object>()
|
List<DepartmentInfo> departmentInfoList = departmentInfoMapper.getDepartmentInfoList(new MapBuilder<String, Object>()
|
||||||
@ -289,7 +289,7 @@ public class HikvisionTask {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
HikvisionUtil.addPageParamIfAbsent(param);
|
HikvisionUtil.addPageParamIfAbsent(param);
|
||||||
param.put("orgIndexCode", orgIndex);
|
param.put("orgIndexCode", orgIndex);
|
||||||
JSONObject rtJo = hikvisionCall.getWorkerListByOrg(project, param);
|
JSONObject rtJo = HikvisionUtil.getWorkerListByOrg(project, param);
|
||||||
IPage<WorkerInfo> workerPage = workerInfoService.selectWorkerInfoList(new MapBuilder<String, Object>()
|
IPage<WorkerInfo> workerPage = workerInfoService.selectWorkerInfoList(new MapBuilder<String, Object>()
|
||||||
.put(Cts.PROJECT_SN, project.getProjectSn())
|
.put(Cts.PROJECT_SN, project.getProjectSn())
|
||||||
.put(type == 1, Cts.TEAM_ID, orgIndex)
|
.put(type == 1, Cts.TEAM_ID, orgIndex)
|
||||||
|
|||||||
@ -12,7 +12,10 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
|||||||
import com.zhgd.jeecg.common.execption.OpenPromptException;
|
import com.zhgd.jeecg.common.execption.OpenPromptException;
|
||||||
import com.zhgd.xmgl.base.HikvisionOrganization;
|
import com.zhgd.xmgl.base.HikvisionOrganization;
|
||||||
import com.zhgd.xmgl.base.HikvisionReservationCarInfo;
|
import com.zhgd.xmgl.base.HikvisionReservationCarInfo;
|
||||||
|
import com.zhgd.xmgl.call.HikvisionCall;
|
||||||
|
import com.zhgd.xmgl.call.entity.ChargeDeletionParam;
|
||||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -415,4 +418,219 @@ public class HikvisionUtil {
|
|||||||
String host = "https://" + project.getArtemisConfigHost();
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取组织下人员列表v2
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getWorkerListByOrg(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v2/person/orgIndexCode/personList";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据组织编号获取组织详细信息
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getOrgListByIndex(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/org/orgIndexCodes/orgInfo";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父组织编号获取下级组织列表
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getSubOrgListByParentOrg(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/org/parentOrgIndexCode/subOrgList";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消车辆包期,调用预约车之前需要调用
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject chargeDeletion(Project project, ChargeDeletionParam param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/pms/v1/car/charge/deletion";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简单同步权限下载_根据人员与设备通道指定下载
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject simpleDownload(Project project, String param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/acps/v1/authDownload/task/simpleDownload";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, param, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doAddWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v2/person/single/add";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
String body = HikvisionCall.getWorkerJson(workerInfo);
|
||||||
|
String rs = doPost(host, path, body, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doEditWorkerFromHttp(WorkerInfo workerInfo, Project project) throws Exception {
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/person/single/update";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
String body = HikvisionCall.getWorkerJson(workerInfo);
|
||||||
|
return doPost(host, path, body, null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doAddWorkerFace(WorkerInfo workerInfo, Project project) throws Exception {
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/face/single/add";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("personId", String.valueOf(workerInfo.getId()));
|
||||||
|
jo.put("faceData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(PathUtil.getBasePath() + "/" + workerInfo.getFieldAcquisitionUrl())));
|
||||||
|
return doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆布防
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject addAlarmCarForHttp(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/pms/v1/alarmCar/addition";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消车辆布防
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject deletionAlarmCarForHttp(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/pms/v1/alarmCar/deletion";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, JSON.toJSONString(param), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String deleteCarInfoByIdFromHttp(String carId, Project project) throws Exception {
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/vehicle/batch/delete";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
ArrayList<String> list = new ArrayList<>();
|
||||||
|
list.add(carId);
|
||||||
|
jo.put("vehicleIds", list);
|
||||||
|
String rs = doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门禁点事件v2
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
public static String getDoorEventsForHttp(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/acs/v2/door/events";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return doPost(host, path, param.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询过车记录
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
public static String getCrossRecordsForHttp(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/pms/v1/crossRecords/page";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("pageNo", param.getIntValue("pageNo"));
|
||||||
|
jo.put("pageSize", 1000);
|
||||||
|
//ISO8601时间格式
|
||||||
|
jo.put("startTime", param.getString("startTime"));
|
||||||
|
jo.put("endTime", param.getString("endTime"));
|
||||||
|
jo.put("parkSyscode", param.getString("parkSyscode"));
|
||||||
|
return doPost(host, path, jo.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门禁点列表v2
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject doorSearchV2ForHttp(Project project, JSONObject param) throws Exception {
|
||||||
|
if (project == null || !Objects.equals(project.getSyncHikvision(), 1)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v2/door/search";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
return JSON.parseObject(doPost(host, path, param.toJSONString(), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String editOrg(Project project, HikvisionOrganization hikvisionOrganization) throws Exception {
|
||||||
|
final String ARTEMIS_PATH = "/artemis";
|
||||||
|
final String path = ARTEMIS_PATH + "/api/resource/v1/org/single/update";
|
||||||
|
String host = "https://" + project.getArtemisConfigHost();
|
||||||
|
String rs = doPost(host, path, JSONArray.toJSONString(hikvisionOrganization), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user