bug修改

This commit is contained in:
guoshengxiong 2024-04-17 21:50:31 +08:00
parent e904c134c4
commit c491e98c11
2 changed files with 17 additions and 5 deletions

View File

@ -74,7 +74,12 @@ public class AsyncHikvision {
if (SecurityUtils.getUser().getUserId() != null) {
String title = action + "人员到海康isc失败";
String type = "23";
String msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:" + e.getMessage();
String msg;
if (e instanceof java.net.ConnectException) {
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:网络超时";
} else {
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:下发异常";
}
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
}
}
@ -288,7 +293,11 @@ public class AsyncHikvision {
hikvisionCall.updatePersonAuth(workerInfo, ds, sucSb, failSb, 0);
}
} catch (Exception e) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
if (e instanceof java.net.ConnectException) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), "下发异常", "人员下发设备提醒", "1");
} else {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
}
return;
}

View File

@ -1933,7 +1933,8 @@ public class HikvisionCall {
"}";
JSONObject rs = doorSearchV2ForHttp(project, JSONObject.parseObject(json));
if (HikvisionUtil.isFail(rs)) {
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail" + rs.toJSONString() + ",");
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail" + rs.toJSONString() + ",");
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + "");
return;
}
JSONObject jo = HikvisionUtil.getJSONObjectData(rs);
@ -1957,14 +1958,16 @@ public class HikvisionCall {
"}";
JSONObject sdRs = simpleDownload(project, sdStr);
if (HikvisionUtil.isFail(sdRs)) {
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail" + sdRs.toJSONString() + ",");
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail" + sdRs.toJSONString() + ",");
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + "");
return;
}
JSONObject sdRsJo = HikvisionUtil.getJSONObjectData(sdRs);
Integer downloadResult = sdRsJo.getJSONObject("resourceDownloadResult").getInteger("downloadResult");
if (downloadResult == 0) {
sucSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ",");
sucSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + "");
} else {
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + "");
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ",fail" + sdRsJo.toJSONString());
}
}