From 116f3ac6fcf41a9be0eeab825a0acd8079657aef Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 15 Jul 2018 10:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E9=9D=9E=E7=A9=BA=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/utils/bean/BeanUtils.java | 19 ------------------- .../ruoyi/framework/aspectj/LogAspect.java | 6 +++++- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java b/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java index 0a4d7899d..32b180db7 100644 --- a/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java +++ b/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java @@ -6,9 +6,6 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.ruoyi.project.system.dept.domain.Dept; -import com.ruoyi.project.system.user.domain.User; - /** * Bean 工具类 * @@ -122,20 +119,4 @@ public class BeanUtils { return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); } - - public static void main(String[] args) - { - User user = new User(); - - User zhen = new User(); - zhen.setUserName("测试名称"); - Dept dept = new Dept(); - dept.setDeptId(11L); - dept.setDeptName("测试部门"); - zhen.setDept(dept); - - BeanUtils.copyBeanProp(user, zhen); - - System.out.println(user.getDept().getDeptName()); - } } diff --git a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index f246ba59c..dcadd826b 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -98,7 +98,11 @@ public class LogAspect if (currentUser != null) { operLog.setOperName(currentUser.getLoginName()); - operLog.setDeptName(currentUser.getDept().getDeptName()); + if (StringUtils.isNotNull(currentUser.getDept()) + && StringUtils.isEmpty(currentUser.getDept().getDeptName())) + { + operLog.setDeptName(currentUser.getDept().getDeptName()); + } } if (e != null)