Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
9e57cb00
提交
9e57cb00
编写于
7月 01, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong@lab.ibiz5.com 发布系统代码
上级
1b172a33
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
24 行增加
和
21 行删除
+24
-21
IIBZDepartmentService.java
...ava/cn/ibizlab/core/ou/service/IIBZDepartmentService.java
+0
-2
IIBZDeptMemberService.java
...ava/cn/ibizlab/core/ou/service/IIBZDeptMemberService.java
+0
-2
IIBZEmployeeService.java
.../java/cn/ibizlab/core/ou/service/IIBZEmployeeService.java
+0
-2
IIBZOrganizationService.java
...a/cn/ibizlab/core/ou/service/IIBZOrganizationService.java
+0
-2
IIBZPostService.java
...main/java/cn/ibizlab/core/ou/service/IIBZPostService.java
+0
-2
IIBZTeamMemberService.java
...ava/cn/ibizlab/core/ou/service/IIBZTeamMemberService.java
+0
-2
IIBZTeamService.java
...main/java/cn/ibizlab/core/ou/service/IIBZTeamService.java
+0
-2
DEFieldDefaultValueAspect.java
...ava/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
+1
-1
VersionCheckAspect.java
.../main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
+23
-6
未找到文件。
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZDepartmentService.java
浏览文件 @
9e57cb00
...
...
@@ -66,8 +66,6 @@ public interface IIBZDepartmentService extends IService<IBZDepartment>{
List
<
IBZDepartment
>
getIbzdepartmentByIds
(
List
<
String
>
ids
)
;
List
<
IBZDepartment
>
getIbzdepartmentByEntities
(
List
<
IBZDepartment
>
entities
)
;
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZDeptMemberService.java
浏览文件 @
9e57cb00
...
...
@@ -58,8 +58,6 @@ public interface IIBZDeptMemberService extends IService<IBZDeptMember>{
*/
boolean
execute
(
String
sql
,
Map
param
);
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZEmployeeService.java
浏览文件 @
9e57cb00
...
...
@@ -68,8 +68,6 @@ public interface IIBZEmployeeService extends IService<IBZEmployee>{
List
<
IBZEmployee
>
getIbzemployeeByIds
(
List
<
String
>
ids
)
;
List
<
IBZEmployee
>
getIbzemployeeByEntities
(
List
<
IBZEmployee
>
entities
)
;
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZOrganizationService.java
浏览文件 @
9e57cb00
...
...
@@ -61,8 +61,6 @@ public interface IIBZOrganizationService extends IService<IBZOrganization>{
List
<
IBZOrganization
>
getIbzorganizationByIds
(
List
<
String
>
ids
)
;
List
<
IBZOrganization
>
getIbzorganizationByEntities
(
List
<
IBZOrganization
>
entities
)
;
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZPostService.java
浏览文件 @
9e57cb00
...
...
@@ -52,8 +52,6 @@ public interface IIBZPostService extends IService<IBZPost>{
*/
boolean
execute
(
String
sql
,
Map
param
);
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZTeamMemberService.java
浏览文件 @
9e57cb00
...
...
@@ -58,8 +58,6 @@ public interface IIBZTeamMemberService extends IService<IBZTeamMember>{
*/
boolean
execute
(
String
sql
,
Map
param
);
}
ibzou-core/src/main/java/cn/ibizlab/core/ou/service/IIBZTeamService.java
浏览文件 @
9e57cb00
...
...
@@ -52,8 +52,6 @@ public interface IIBZTeamService extends IService<IBZTeam>{
*/
boolean
execute
(
String
sql
,
Map
param
);
}
ibzou-util/src/main/java/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
浏览文件 @
9e57cb00
...
...
@@ -23,7 +23,7 @@ import java.util.Map;
* 实体属性默认值切面,只有新建(Create)时才会填充默认值
*/
@Aspect
@Order
(
0
)
@Order
(
5
0
)
@Component
public
class
DEFieldDefaultValueAspect
{
...
...
ibzou-util/src/main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
浏览文件 @
9e57cb00
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.annotation.VersionCheck
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
...
...
@@ -24,7 +23,7 @@ import java.lang.reflect.Field;
* 数据库版本检查
*/
@Aspect
@Order
(
0
)
@Order
(
5
0
)
@Component
public
class
VersionCheckAspect
{
...
...
@@ -33,22 +32,40 @@ public class VersionCheckAspect
@SneakyThrows
@Before
(
"execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)"
)
public
void
BeforeUpdate
(
JoinPoint
point
,
VersionCheck
versionCheck
){
EvaluationContext
context
=
new
StandardEvaluationContext
();
Object
[]
args
=
point
.
getArgs
();
Object
id
=
args
[
0
];
Object
dto
=
args
[
1
];
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
return
;
String
versionField
=
versionCheck
.
versionfield
();
if
(
StringUtils
.
isEmpty
(
versionCheck
))
if
(
StringUtils
.
isEmpty
(
versionField
))
return
;
versionCheck
(
versionCheck
,
point
.
getTarget
(),
dto
,
id
);
}
@SneakyThrows
@Before
(
"execution(* cn.ibizlab.*.rest.*.updateBy*(..)) && @annotation(versionCheck)"
)
public
void
BeforeUpdateBy
(
JoinPoint
point
,
VersionCheck
versionCheck
){
Object
[]
args
=
point
.
getArgs
();
Object
id
=
args
[
1
];
Object
dto
=
args
[
2
];
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
return
;
String
versionField
=
versionCheck
.
versionfield
();
if
(
StringUtils
.
isEmpty
(
versionField
))
return
;
versionCheck
(
versionCheck
,
point
.
getTarget
(),
dto
,
id
);
}
private
void
versionCheck
(
VersionCheck
versionCheck
,
Object
resource
,
Object
dto
,
Object
id
){
EvaluationContext
context
=
new
StandardEvaluationContext
();
context
.
setVariable
(
"dto"
,
dto
);
Expression
newExp
=
parser
.
parseExpression
(
String
.
format
(
"#dto.%s"
,
version
Field
));
Expression
newExp
=
parser
.
parseExpression
(
String
.
format
(
"#dto.%s"
,
version
Check
.
versionfield
()
));
Object
newVersion
=
newExp
.
getValue
(
context
);
if
(
ObjectUtils
.
isEmpty
(
newVersion
))
return
;
//进行版本检查
Object
oldVersion
=
getDBVersion
(
versionCheck
,
getService
(
point
.
getTarget
()
,
versionCheck
.
entity
()),
id
);
Object
oldVersion
=
getDBVersion
(
versionCheck
,
getService
(
resource
,
versionCheck
.
entity
()),
id
);
if
(!
ObjectUtils
.
isEmpty
(
oldVersion
)){
if
(
RuleUtils
.
gt
(
newVersion
,
oldVersion
))
throw
new
BadRequestAlertException
(
"数据已变更,可能后台数据已被修改,请重新加载数据"
,
"VersionCheckAspect"
,
"versionCheck"
);
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录