|
|
@ -109,7 +109,6 @@ public class OperationLogAspect { |
|
|
|
public void around(ProceedingJoinPoint joinPoint, OperationLog operationLog, String state, Object jsonResult, Exception exception) throws Throwable { |
|
|
|
|
|
|
|
ISysDeptService deptService = SpringUtils.getBean(ISysDeptService.class); |
|
|
|
IDcOperLogService dcOperLogService = SpringUtils.getBean(IDcOperLogService.class); |
|
|
|
IDcDeviceService dcDeviceService = SpringUtils.getBean(IDcDeviceService.class); |
|
|
|
IDcPublishManageService dcPublishManageService = SpringUtils.getBean(IDcPublishManageService.class); |
|
|
|
|
|
|
@ -207,7 +206,6 @@ public class OperationLogAspect { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Objects.equals(function.getString("functionId"), "13") && Objects.equals(deviceType, "2")) { |
|
|
|
JSONArray parameters = function.getJSONObject("params").getJSONArray("parameters"); |
|
|
|
List<String> content = parameters.stream().map(item -> ((JSONObject) item).getString("CONTENT")).collect(Collectors.toList()); |
|
|
@ -235,20 +233,13 @@ public class OperationLogAspect { |
|
|
|
operLog.setOperLocation(loginUser.getLoginLocation()); |
|
|
|
operLog.setOperType("2"); |
|
|
|
} else { |
|
|
|
operLog.setOperName("服务器"); |
|
|
|
operLog.setDeptName("服务器"); |
|
|
|
operLog.setOperLocation("服务器"); |
|
|
|
operLog.setOperType("1"); |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray jsonArray = (JSONArray) JSON.toJSON(pointArgs); |
|
|
|
|
|
|
|
operLog.setOperParam(String.valueOf(jsonArray)); |
|
|
|
operLog.setDcDeviceId(deviceIds.toString()); |
|
|
|
operLog.setDcDeviceName(deviceNames.toString()); |
|
|
|
operLog.setOperIp(IpUtils.getIpAddr(request)); |
|
|
|
operLog.setOperTime(new Date()); |
|
|
|
operLog.setDcDeviceType(deviceType); |
|
|
|
operLog.setRemark(remark.toString()); |
|
|
|
operLog.setJsonResult(jsonResult.toString()); |
|
|
|
dcOperLogService.save(operLog); |
|
|
|
saveOperLog(jsonResult, operLog, pointArgs, request, deviceIds, deviceNames, deviceType, remark); |
|
|
|
|
|
|
|
|
|
|
|
if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) { |
|
|
@ -312,17 +303,7 @@ public class OperationLogAspect { |
|
|
|
operLog.setOperType("1"); |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray jsonArray = (JSONArray) JSON.toJSON(pointArgs); |
|
|
|
|
|
|
|
operLog.setOperParam(String.valueOf(jsonArray)); |
|
|
|
operLog.setDcDeviceId(deviceIds.toString()); |
|
|
|
operLog.setDcDeviceName(deviceNames.toString()); |
|
|
|
operLog.setOperIp(IpUtils.getIpAddr(request)); |
|
|
|
operLog.setOperTime(new Date()); |
|
|
|
operLog.setDcDeviceType(deviceType); |
|
|
|
operLog.setRemark(remark.toString()); |
|
|
|
operLog.setJsonResult(jsonResult.toString()); |
|
|
|
dcOperLogService.save(operLog); |
|
|
|
saveOperLog(jsonResult, operLog, pointArgs, request, deviceIds, deviceNames, deviceType, remark); |
|
|
|
|
|
|
|
|
|
|
|
//if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) {
|
|
|
@ -360,4 +341,19 @@ public class OperationLogAspect { |
|
|
|
throw e; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void saveOperLog(Object jsonResult, DcOperLog operLog, Object[] pointArgs, HttpServletRequest request, ArrayList<String> deviceIds, ArrayList<String> deviceNames, String deviceType, StringBuilder remark) { |
|
|
|
IDcOperLogService dcOperLogService = SpringUtils.getBean(IDcOperLogService.class); |
|
|
|
JSONArray jsonArray = (JSONArray) JSON.toJSON(pointArgs); |
|
|
|
|
|
|
|
operLog.setOperParam(String.valueOf(jsonArray)); |
|
|
|
operLog.setDcDeviceId(deviceIds.toString()); |
|
|
|
operLog.setDcDeviceName(deviceNames.toString()); |
|
|
|
operLog.setOperIp(IpUtils.getIpAddr(request)); |
|
|
|
operLog.setOperTime(new Date()); |
|
|
|
operLog.setDcDeviceType(deviceType); |
|
|
|
operLog.setRemark(remark.toString()); |
|
|
|
operLog.setJsonResult(jsonResult.toString()); |
|
|
|
dcOperLogService.save(operLog); |
|
|
|
} |
|
|
|
} |
|
|
|