mirror of https://gitee.com/y_project/RuoYi.git
部门非空条件判断
parent
2f6e6736ca
commit
116f3ac6fc
|
@ -6,9 +6,6 @@ import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import com.ruoyi.project.system.dept.domain.Dept;
|
|
||||||
import com.ruoyi.project.system.user.domain.User;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean 工具类
|
* Bean 工具类
|
||||||
*
|
*
|
||||||
|
@ -122,20 +119,4 @@ public class BeanUtils
|
||||||
{
|
{
|
||||||
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
|
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,11 @@ public class LogAspect
|
||||||
if (currentUser != null)
|
if (currentUser != null)
|
||||||
{
|
{
|
||||||
operLog.setOperName(currentUser.getLoginName());
|
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)
|
if (e != null)
|
||||||
|
|
Loading…
Reference in New Issue