Commit 4decf579 authored by hezhen's avatar hezhen

添加上下架

parent 0adc8aa1
...@@ -81,7 +81,7 @@ public class SysLog implements Serializable { ...@@ -81,7 +81,7 @@ public class SysLog implements Serializable {
@Column(name = "crt_user") @Column(name = "crt_user")
@ApiModelProperty("用户id") @ApiModelProperty("用户id")
private Long crtUser; private String crtUser;
@Column(name = "crt_time") @Column(name = "crt_time")
......
...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.util.HttpContextUtils; ...@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.common.util.HttpContextUtils;
import com.github.wxiaoqi.security.common.util.IPUtils; import com.github.wxiaoqi.security.common.util.IPUtils;
import com.xxfc.platform.vehicle.biz.SysLogBiz; import com.xxfc.platform.vehicle.biz.SysLogBiz;
import com.xxfc.platform.vehicle.entity.SysLog; import com.xxfc.platform.vehicle.entity.SysLog;
import com.xxfc.platform.vehicle.entity.Vehicle;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
...@@ -36,13 +37,13 @@ public class LogAspect { ...@@ -36,13 +37,13 @@ public class LogAspect {
try { try {
// 执行方法 // 执行方法
result = point.proceed(); result = point.proceed();
} catch (Throwable e) {
e.printStackTrace();
}
// 执行时长(毫秒) // 执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime; long time = System.currentTimeMillis() - beginTime;
// 保存日志 // 保存日志
saveLog(point, time); saveLog(point, time);
} catch (Throwable e) {
e.printStackTrace();
}
return result; return result;
} }
...@@ -72,10 +73,11 @@ public class LogAspect { ...@@ -72,10 +73,11 @@ public class LogAspect {
Integer state = 0; Integer state = 0;
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
params += " " + paramNames[i] + ": " + args[i]; params += " " + paramNames[i] + ": " + args[i];
if (paramNames[i].contains("id")) if (paramNames[i].contains("vehicle")){
vehicleId = args[i].toString(); Vehicle vehicle = (Vehicle)args[i];
if (paramNames[i].contains("state")) vehicleId = vehicle.getId();
state = Integer.parseInt(args[i].toString()); state = vehicle.getState();
}
} }
sysLog.setParams(params); sysLog.setParams(params);
sysLog.setVehicleId(vehicleId); sysLog.setVehicleId(vehicleId);
......
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