bug修复

This commit is contained in:
GUO 2024-05-05 23:01:33 +08:00
parent 58bdefaea5
commit 3cd0c79227
2 changed files with 112 additions and 112 deletions

View File

@ -108,7 +108,6 @@ public class AsyncHikvision {
} }
private void sendNoticeForWorker(WorkerInfo workerInfo, Exception e, String action) { private void sendNoticeForWorker(WorkerInfo workerInfo, Exception e, String action) {
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
String title = action + "人员到海康isc失败"; String title = action + "人员到海康isc失败";
String type = "23"; String type = "23";
String msg; String msg;
@ -119,6 +118,7 @@ public class AsyncHikvision {
} else { } else {
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:下发异常"; msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:下发异常";
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
} }
} }
@ -164,7 +164,6 @@ public class AsyncHikvision {
} }
private void sendNoticeForCar(CarInfo carInfo, Exception e, String action) { private void sendNoticeForCar(CarInfo carInfo, Exception e, String action) {
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
String title = action + "车辆到海康isc失败"; String title = action + "车辆到海康isc失败";
String type = "24"; String type = "24";
String msg = null; String msg = null;
@ -175,6 +174,7 @@ public class AsyncHikvision {
} else { } else {
msg = "同步失败,车牌号:" + carInfo.getCarNumber() + "。失败原因:下发异常"; msg = "同步失败,车牌号:" + carInfo.getCarNumber() + "。失败原因:下发异常";
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
} }
} }
@ -231,7 +231,6 @@ public class AsyncHikvision {
} }
private void sendNoticeForOrg(String name, Exception e, String action) { private void sendNoticeForOrg(String name, Exception e, String action) {
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
String title = action + "组织到海康isc失败"; String title = action + "组织到海康isc失败";
String type = "23"; String type = "23";
String msg; String msg;
@ -242,6 +241,7 @@ public class AsyncHikvision {
} else { } else {
msg = "同步失败,组织名称:" + name + "。失败原因:下发异常"; msg = "同步失败,组织名称:" + name + "。失败原因:下发异常";
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
} }
} }
@ -427,7 +427,6 @@ public class AsyncHikvision {
return; return;
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
String title = "人员下发设备提醒"; String title = "人员下发设备提醒";
String type = "1"; String type = "1";
String msg = ""; String msg = "";
@ -441,6 +440,7 @@ public class AsyncHikvision {
failSbStr = "下发权限失败:" + failSbStr; failSbStr = "下发权限失败:" + failSbStr;
msg += failSbStr; msg += failSbStr;
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), StringUtils.substring(msg, 0, msg.length() - 1), title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), StringUtils.substring(msg, 0, msg.length() - 1), title, type);
} }
} catch (Exception e) { } catch (Exception e) {
@ -489,7 +489,6 @@ public class AsyncHikvision {
return; return;
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
String title = "人员下发设备提醒"; String title = "人员下发设备提醒";
String type = "1"; String type = "1";
String msg = ""; String msg = "";
@ -503,6 +502,7 @@ public class AsyncHikvision {
failSbStr = "移除权限失败:" + failSbStr; failSbStr = "移除权限失败:" + failSbStr;
msg += failSbStr + ""; msg += failSbStr + "";
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -879,7 +879,6 @@ public class HikvisionCall {
if (StringUtils.isBlank(rs)) { if (StringUtils.isBlank(rs)) {
return; return;
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
boolean success = HikvisionUtil.isSuccess(rs); boolean success = HikvisionUtil.isSuccess(rs);
String msg = ""; String msg = "";
if (success) { if (success) {
@ -898,6 +897,7 @@ public class HikvisionCall {
title += "失败"; title += "失败";
} }
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, "24"); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, "24");
} }
} }
@ -906,7 +906,6 @@ public class HikvisionCall {
if (StringUtils.isBlank(rs)) { if (StringUtils.isBlank(rs)) {
return; return;
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
boolean success = HikvisionUtil.isSuccess(rs); boolean success = HikvisionUtil.isSuccess(rs);
String msg = ""; String msg = "";
String type = "25"; String type = "25";
@ -917,12 +916,12 @@ public class HikvisionCall {
msg = "同步失败,组织名称:" + orgName + "。失败原因:" + rs; msg = "同步失败,组织名称:" + orgName + "。失败原因:" + rs;
title += "失败"; title += "失败";
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
} }
} }
private void sendNoticeForWorker(String title, String rs, WorkerInfo workerInfo, int type, int operate) { private void sendNoticeForWorker(String title, String rs, WorkerInfo workerInfo, int type, int operate) {
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
boolean success = HikvisionUtil.isSuccess(rs); boolean success = HikvisionUtil.isSuccess(rs);
String msg = ""; String msg = "";
String noticeType = "23"; String noticeType = "23";
@ -958,6 +957,7 @@ public class HikvisionCall {
title += "失败"; title += "失败";
} }
} }
if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) {
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, noticeType); noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, noticeType);
} }
} }