Commit 4decf579 authored by hezhen's avatar hezhen

添加上下架

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