Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
5b8508ce
提交
5b8508ce
编写于
5月 23, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
上级选择时加上了递归判断
上级
bdd6b287
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
58 行增加
和
1 行删除
+58
-1
IBZEmp2UserAspect.java
.../cn/ibizlab/core/extensions/aspect/IBZEmp2UserAspect.java
+58
-1
未找到文件。
ibzou-core/src/main/java/cn/ibizlab/core/extensions/aspect/IBZEmp2UserAspect.java
浏览文件 @
5b8508ce
package
cn
.
ibizlab
.
core
.
extensions
.
aspect
;
import
cn.ibizlab.core.extensions.mapping.IBZEmp2UserMapping
;
import
cn.ibizlab.core.extensions.service.OUCoreService
;
import
cn.ibizlab.core.extensions.service.OUModelService
;
import
cn.ibizlab.core.ou.domain.IBZDepartment
;
import
cn.ibizlab.core.ou.domain.IBZEmployee
;
...
...
@@ -37,6 +38,9 @@ public class IBZEmp2UserAspect
@Qualifier
(
"userservice"
)
private
IBZUSERService
ibzuserService
;
@Autowired
@Lazy
private
OUCoreService
ouCoreService
;
@Autowired
@Lazy
...
...
@@ -61,14 +65,32 @@ public class IBZEmp2UserAspect
beforeSaveEmp
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZOrganizationService.updat*(..))"
)
public
void
BeforeUpdateOrg
(
JoinPoint
point
)
throws
Exception
{
beforeSaveOrg
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZOrganizationService.sav*(..))"
)
public
void
BeforeSaveOrg
(
JoinPoint
point
)
throws
Exception
{
beforeSaveOrg
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZDepartmentService.creat*(..))"
)
public
void
BeforeCreateDept
(
JoinPoint
point
)
throws
Exception
{
beforeSaveDept
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZDepartmentService.sav
*
(..))"
)
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZDepartmentService.sav
e
(..))"
)
public
void
BeforeSaveDept
(
JoinPoint
point
)
throws
Exception
{
beforeSaveDept
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZDepartmentService.updat*(..))"
)
public
void
BeforeUpdateDept
(
JoinPoint
point
)
throws
Exception
{
beforeSaveDept
(
point
);
}
@Before
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZDepartmentService.saveBatch(..))"
)
public
void
BeforeSaveBatchDept
(
JoinPoint
point
)
throws
Exception
{
beforeSaveDept
(
point
);
}
@After
(
value
=
"execution(* cn.ibizlab.core.ou.service.IIBZEmployeeService.creat*(..))"
)
public
void
AfterCreateEmp
(
JoinPoint
point
)
throws
Exception
{
...
...
@@ -137,6 +159,27 @@ public class IBZEmp2UserAspect
}
}
private
void
beforeSaveOrg
(
JoinPoint
point
)
{
Object
[]
args
=
point
.
getArgs
();
if
(
args
.
length
>
0
)
{
Object
obj
=
args
[
0
];
if
(
obj
instanceof
IBZOrganization
)
{
prepareOrg
((
IBZOrganization
)
obj
);
}
else
if
(
obj
instanceof
List
)
{
List
<
IBZOrganization
>
list
=(
List
<
IBZOrganization
>)
obj
;
for
(
IBZOrganization
org:
list
)
{
prepareOrg
(
org
);
}
}
}
}
private
void
prepareEmp
(
IBZEmployee
emp
)
{
String
userName
=
emp
.
getUsername
();
...
...
@@ -166,12 +209,26 @@ public class IBZEmp2UserAspect
private
void
prepareDept
(
IBZDepartment
dept
)
{
if
((!
StringUtils
.
isEmpty
(
dept
.
getDeptid
()))&&(!
StringUtils
.
isEmpty
(
dept
.
getParentdeptid
())))
{
if
(
ouCoreService
.
getDeptModel
(
dept
.
getDeptid
()).
getSub
().
contains
(
dept
.
getParentdeptid
()))
throw
new
BadRequestAlertException
(
"上级部门选择有误"
,
"IBZDepartment"
,
dept
.
getDeptid
());
}
if
(
StringUtils
.
isEmpty
(
dept
.
getDeptid
())
&&
(!
StringUtils
.
isEmpty
(
dept
.
getDeptcode
()))
&&
(!
StringUtils
.
isEmpty
(
dept
.
getOrgid
())))
{
dept
.
setDeptid
(
dept
.
getOrgid
()
+
dept
.
getDeptcode
());
}
}
private
void
prepareOrg
(
IBZOrganization
org
)
{
if
((!
StringUtils
.
isEmpty
(
org
.
getOrgid
()))&&(!
StringUtils
.
isEmpty
(
org
.
getParentorgid
())))
{
if
(
ouCoreService
.
getOrgModel
(
org
.
getOrgid
()).
getSub
().
contains
(
org
.
getParentorgid
()))
throw
new
BadRequestAlertException
(
"上级单位选择有误"
,
"IBZOrganization"
,
org
.
getOrgid
());
}
}
private
void
saveUser
(
JoinPoint
point
)
{
Object
[]
args
=
point
.
getArgs
();
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录