Commit 2717e250 authored by 赵啸非's avatar 赵啸非

修改日志记录

parent 1624c716
...@@ -8,6 +8,7 @@ import com.mortals.xhx.base.system.oper.service.OperLogService; ...@@ -8,6 +8,7 @@ import com.mortals.xhx.base.system.oper.service.OperLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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 java.util.Date; import java.util.Date;
...@@ -30,6 +31,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService { ...@@ -30,6 +31,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
public void doHandlerLog(String platformMark, Long userId, String userName, String loginName, String requestUrl, public void doHandlerLog(String platformMark, Long userId, String userName, String loginName, String requestUrl,
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);
if(ObjectUtils.isEmpty(userId)) return;
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();
...@@ -43,13 +45,10 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService { ...@@ -43,13 +45,10 @@ 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
public void doHandlerLog(String platformMark, String loginName, String requestUrl, String content, String ip) { public void doHandlerLog(String platformMark, String loginName, String requestUrl, String content, String ip) {
// operLogService.insertOperLog(ip, requestUrl, null, "", loginName,
// content);
this.doHandlerLog(platformMark, null, "", loginName, requestUrl, content, ip, new Date()); this.doHandlerLog(platformMark, null, "", loginName, requestUrl, content, ip, new Date());
......
...@@ -82,6 +82,5 @@ public class MessageProducer implements IMessageProduceService, RabbitMessageSer ...@@ -82,6 +82,5 @@ public class MessageProducer implements IMessageProduceService, RabbitMessageSer
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
System.out.println(111);
} }
} }
...@@ -104,15 +104,12 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL ...@@ -104,15 +104,12 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL
OperLogEntity operLogEntity = new OperLogEntity(); OperLogEntity operLogEntity = new OperLogEntity();
operLogEntity.setIp(ip); operLogEntity.setIp(ip);
operLogEntity.setLogDate(new Date()); operLogEntity.setLogDate(new Date());
operLogEntity.setPlatformMark(GlobalSysInfo.getPropertyValue(SysConstains.PROP_PLATFORM_MARK)==null?"unknow":GlobalSysInfo.getPropertyValue(SysConstains.PROP_PLATFORM_MARK));
operLogEntity.setPlatformMark(GlobalSysInfo.getPropertyValue(SysConstains.PROP_PLATFORM_MARK));
//operLogEntity.setOperType(operType.getValue());
operLogEntity.setRequestUrl(requestUrl); operLogEntity.setRequestUrl(requestUrl);
operLogEntity.setLoginName(loginName); operLogEntity.setLoginName(loginName);
operLogEntity.setUserId(userId); operLogEntity.setUserId(userId);
operLogEntity.setUserName(userName); operLogEntity.setUserName(userName);
operLogEntity.setContent(content); operLogEntity.setContent(content);
save(operLogEntity, null); save(operLogEntity, null);
} }
private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) { private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) {
......
...@@ -52,7 +52,7 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService { ...@@ -52,7 +52,7 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService {
List<DeviceEntity> deviceEntities = deviceService.find(new DeviceQuery().productCode(productCode)); List<DeviceEntity> deviceEntities = deviceService.find(new DeviceQuery().productCode(productCode));
for (DeviceEntity device : deviceEntities) { for (DeviceEntity device : deviceEntities) {
try { try {
Thread.sleep(2000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders(); TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
......
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