|
|
|
@ -50,7 +50,7 @@ public class SysLogAspect {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SysLogQueue sysLogQueue; |
|
|
|
|
private SysLogQueue sysLogQueue; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 请求地址 |
|
|
|
@ -75,6 +75,17 @@ public class SysLogAspect {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 开始时间 |
|
|
|
|
*/ |
|
|
|
|
private Long startTime = 0L; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 结束时间 |
|
|
|
|
*/ |
|
|
|
|
private Long endTime = 0L; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置操作日志切入点 在注解的位置切入代码 |
|
|
|
|
*/ |
|
|
|
|
@Pointcut("@annotation(com.hnac.hzims.common.logs.annotation.OperationAnnotation)") |
|
|
|
@ -87,7 +98,10 @@ public class SysLogAspect {
|
|
|
|
|
*/ |
|
|
|
|
@Before(value = "logPointCut()") |
|
|
|
|
public void before(JoinPoint joinPoint) { |
|
|
|
|
stopWatch.start(); |
|
|
|
|
// if (!stopWatch.isRunning()) {
|
|
|
|
|
// stopWatch.start();
|
|
|
|
|
// }
|
|
|
|
|
startTime = System.currentTimeMillis(); |
|
|
|
|
log.info("前置通知"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -224,8 +238,11 @@ public class SysLogAspect {
|
|
|
|
|
sysLog.setOperationUserId(userId); |
|
|
|
|
sysLog.setTenantId(Func.toStr(AuthUtil.getTenantId(), BladeConstant.ADMIN_TENANT_ID)); |
|
|
|
|
sysLog.setLocalIp(WebUtil.getIP(request));// 请求IP
|
|
|
|
|
stopWatch.stop(); |
|
|
|
|
sysLog.setCostTime(stopWatch.getTotalTimeMillis() + "ms"); |
|
|
|
|
// if (stopWatch.isRunning()) {
|
|
|
|
|
// stopWatch.stop();
|
|
|
|
|
// }
|
|
|
|
|
endTime = System.currentTimeMillis(); |
|
|
|
|
sysLog.setCostTime((endTime - startTime) + "ms"); |
|
|
|
|
sysLog.setPath(requestPath); |
|
|
|
|
sysLog.setTitle(title); |
|
|
|
|
sysLog.setAction(action); |
|
|
|
|