|
@@ -1,6 +1,5 @@
|
|
|
package com.gree.mall.manager.config.aop;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
import com.gree.mall.manager.plus.entity.AdminUser;
|
|
@@ -9,12 +8,11 @@ import com.gree.mall.manager.plus.service.AdminUserService;
|
|
|
import com.gree.mall.manager.plus.service.OperationLogService;
|
|
|
import com.gree.mall.manager.utils.CommonUtils;
|
|
|
import com.gree.mall.manager.utils.IpUtil;
|
|
|
-import com.gree.mall.manager.utils.JwtUtils;
|
|
|
import com.gree.mall.manager.utils.RedisUtil;
|
|
|
-import io.jsonwebtoken.Claims;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
@@ -33,6 +31,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* 操作日志
|
|
@@ -101,17 +100,19 @@ public class OperationLogAspect {
|
|
|
//获取登录用户的企业微信id
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
//记录
|
|
|
- OperationLog operationLog = new OperationLog();
|
|
|
- operationLog.setContent(nickName + "于" + dateStr + value);
|
|
|
- operationLog.setModuleName(moduleName);
|
|
|
- operationLog.setAdminUserId(adminUserId);
|
|
|
- operationLog.setUserName(nickName);
|
|
|
- operationLog.setNickName(nickName);
|
|
|
- operationLog.setIp(IpUtil.getIpAddr(request));
|
|
|
- operationLog.setCreateTime(new Date());
|
|
|
- operationLog.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
|
- operationLog.setCompanyName(adminUser.getCompanyName());
|
|
|
- operationLogService.save(operationLog);
|
|
|
+ if (Objects.nonNull(adminUser)) {
|
|
|
+ OperationLog operationLog = new OperationLog();
|
|
|
+ operationLog.setContent(nickName + "于" + dateStr + value);
|
|
|
+ operationLog.setModuleName(moduleName);
|
|
|
+ operationLog.setAdminUserId(adminUserId);
|
|
|
+ operationLog.setUserName(nickName);
|
|
|
+ operationLog.setNickName(nickName);
|
|
|
+ operationLog.setIp(IpUtil.getIpAddr(request));
|
|
|
+ operationLog.setCreateTime(new Date());
|
|
|
+ operationLog.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
|
+ operationLog.setCompanyName(adminUser.getCompanyName());
|
|
|
+ operationLogService.save(operationLog);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|