Commit fc9c82a2 by shiwenbo

兼容处理系统初始化时,集团关联的部门取不到当前登录用户的情况

parent c2d71525
......@@ -107,7 +107,10 @@ public class DinasOrganizationServiceImpl implements DinasOrganizationService {
department.set("orgId", quangongsi.getUuid("orgId"));
department.set("level", 1);
department.set("createTime", new Date());
department.set("createUser", getCurrentLoginStaff().getUuid("id"));
KObject staff = getCurrentLoginStaff();
if(staff != null) {
department.set("createUser", staff.getUuid("id"));
}
department.set("paths", quangongsi.getString("paths") + "$" + department.getUuid("id"));
department.set("enable", true);
departmentService.create(department);
......@@ -117,6 +120,9 @@ public class DinasOrganizationServiceImpl implements DinasOrganizationService {
}
private KObject getCurrentLoginStaff(){
if(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest() == null) {
return null;
}
String currentStaff = (String) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
.getRequest().getSession().getAttribute("currentStaff");
if (null == currentStaff || currentStaff.trim().length() == 0 ) {
......
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