Commit aff0a8f0 authored by 赵啸非's avatar 赵啸非

添加操作日志发送到管理平台

parent f8f74cf9
...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import com.mortals.framework.model.OperateLogPdu; import com.mortals.framework.model.OperateLogPdu;
import com.mortals.framework.service.IMessageProduceService; import com.mortals.framework.service.IMessageProduceService;
import com.mortals.xhx.system.MessageProducer;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
...@@ -15,6 +16,7 @@ import org.slf4j.Logger; ...@@ -15,6 +16,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
...@@ -29,9 +31,9 @@ import com.mortals.xhx.base.system.oper.service.OperLogService; ...@@ -29,9 +31,9 @@ import com.mortals.xhx.base.system.oper.service.OperLogService;
public class OperlogAspect extends FileLogServiceImpl implements ILogService { public class OperlogAspect extends FileLogServiceImpl implements ILogService {
private final static Logger logger = LoggerFactory.getLogger(OperlogAspect.class); private final static Logger logger = LoggerFactory.getLogger(OperlogAspect.class);
@Autowired @Autowired
private OperLogService operLogService; private OperLogService operLogService;
@Autowired @Autowired
private IMessageProduceService messageProducer; private IMessageProduceService messageProducer;
...@@ -40,6 +42,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService { ...@@ -40,6 +42,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
String content, String ip, Date logDate) { String content, String ip, Date logDate) {
super.doHandlerLog(platformMark, userId, userName, loginName, requestUrl, content, ip, logDate); super.doHandlerLog(platformMark, userId, userName, loginName, requestUrl, content, ip, logDate);
operLogService.insertOperLog(ip, requestUrl, userId, userName, loginName, content); operLogService.insertOperLog(ip, requestUrl, userId, userName, loginName, content);
OperateLogPdu operateLogPdu = new OperateLogPdu(); OperateLogPdu operateLogPdu = new OperateLogPdu();
operateLogPdu.initAttrValue(); operateLogPdu.initAttrValue();
operateLogPdu.setIp(ip); operateLogPdu.setIp(ip);
...@@ -52,7 +55,6 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService { ...@@ -52,7 +55,6 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
operateLogPdu.setContent(content); operateLogPdu.setContent(content);
operateLogPdu.setOperType(1); operateLogPdu.setOperType(1);
messageProducer.syncOperSend(operateLogPdu); messageProducer.syncOperSend(operateLogPdu);
} }
@Override @Override
...@@ -60,6 +62,8 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService { ...@@ -60,6 +62,8 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
// operLogService.insertOperLog(ip, requestUrl, null, "", loginName, // operLogService.insertOperLog(ip, requestUrl, null, "", loginName,
// content); // content);
this.doHandlerLog(platformMark, null, "", loginName, requestUrl, content, ip, new Date()); this.doHandlerLog(platformMark, null, "", loginName, requestUrl, content, ip, new Date());
} }
@Pointcut("execution(public * com.mortals.xhx..*Controller.*(..))") @Pointcut("execution(public * com.mortals.xhx..*Controller.*(..))")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment