Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
173a593b
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
333
Star
10
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
173a593b
编写于
3月 07, 2024
作者:
NoSubject
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '增加注销用户日志分页查询接口' into 'develop'
增加注销用户日志分页查询接口 See merge request o2oa/o2oa!2572
上级
b83ee0ce
648c7d8c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
129 addition
and
6 deletion
+129
-6
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
...anization/assemble/control/jaxrs/person/ActionDelete.java
+3
-1
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionListDeletePaging.java
...assemble/control/jaxrs/person/ActionListDeletePaging.java
+91
-0
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
...rganization/assemble/control/jaxrs/person/BaseAction.java
+16
-5
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/PersonAction.java
...anization/assemble/control/jaxrs/person/PersonAction.java
+19
-0
未找到文件。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionDelete.java
浏览文件 @
173a593b
package
com.x.organization.assemble.control.jaxrs.person
;
import
java.util.Date
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -109,9 +110,10 @@ class ActionDelete extends BaseAction {
emc
.
beginTransaction
(
Custom
.
class
);
Custom
custom
=
new
Custom
();
custom
.
setPerson
(
person
.
getDistinguishedName
());
custom
.
setName
(
"person#delete"
);
custom
.
setName
(
PERSON_DELETE_CUSTOM_NAME
);
CustomPersonInfo
customPersonInfo
=
new
CustomPersonInfo
();
customPersonInfo
.
setOperator
(
effectivePerson
.
getDistinguishedName
());
customPersonInfo
.
setOperateTime
(
new
Date
());
customPersonInfo
.
setPerson
(
WrapPerson
.
copier
.
copy
(
person
));
custom
.
setData
(
gson
.
toJson
(
customPersonInfo
));
emc
.
persist
(
custom
);
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/ActionListDeletePaging.java
0 → 100755
浏览文件 @
173a593b
package
com.x.organization.assemble.control.jaxrs.person
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.organization.assemble.control.Business
;
import
com.x.organization.core.entity.Custom
;
import
com.x.organization.core.entity.Custom_
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Tuple
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.List
;
class
ActionListDeletePaging
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
page
,
Integer
size
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
if
(!
this
.
editable
(
business
,
effectivePerson
,
""
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Predicate
p
=
toFilterPredicate
(
business
,
wi
);
List
<
WoCustom
>
woCustoms
=
emc
.
fetchDescPaging
(
Custom
.
class
,
WoCustom
.
copier
,
p
,
page
,
size
,
JpaObject
.
sequence_FIELDNAME
);
List
<
Wo
>
wos
=
new
ArrayList
<>();
for
(
WoCustom
woCustom
:
woCustoms
){
Wo
wo
=
gson
.
fromJson
(
woCustom
.
getData
(),
Wo
.
class
);
wo
.
setOperateTime
(
woCustom
.
getCreateTime
());
wos
.
add
(
wo
);
}
result
.
setData
(
wos
);
result
.
setCount
(
emc
.
count
(
Custom
.
class
,
p
));
return
result
;
}
}
private
Predicate
toFilterPredicate
(
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Custom
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Tuple
>
cq
=
cb
.
createQuery
(
Tuple
.
class
);
Root
<
Custom
>
root
=
cq
.
from
(
Custom
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Custom_
.
name
),
PERSON_DELETE_CUSTOM_NAME
);
if
(
StringUtils
.
isNotBlank
(
wi
.
getPerson
())){
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Custom_
.
person
),
"%"
+
wi
.
getPerson
()
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
p
;
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"用户"
)
private
String
person
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
}
public
static
class
Wo
extends
CustomPersonInfo
{
private
static
final
long
serialVersionUID
=
8462618330733553654L
;
}
public
static
class
WoCustom
extends
Custom
{
private
static
final
long
serialVersionUID
=
8501479874360244059L
;
static
WrapCopier
<
Custom
,
WoCustom
>
copier
=
WrapCopierFactory
.
wo
(
Custom
.
class
,
WoCustom
.
class
,
JpaObject
.
singularAttributeField
(
Custom
.
class
,
true
,
false
),
null
);
}
}
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
浏览文件 @
173a593b
package
com.x.organization.assemble.control.jaxrs.person
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
...
...
@@ -57,6 +54,8 @@ import com.x.organization.core.entity.Unit_;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
static
final
String
PERSON_DELETE_CUSTOM_NAME
=
"person#delete"
;
private
static
final
List
<
String
>
KEYWORDS
=
ListUtils
.
unmodifiableList
(
Arrays
.
asList
(
Token
.
defaultInitialManager
,
TernaryManagement
.
INIT_SYSTEM_MANAGER
,
TernaryManagement
.
INIT_SECURITY_MANAGER
,
TernaryManagement
.
INIT_AUDIT_MANAGER
));
...
...
@@ -418,8 +417,12 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
public
class
CustomPersonInfo
{
protected
static
class
CustomPersonInfo
extends
GsonPropertyObject
{
@FieldDescribe
(
"操作人"
)
private
String
operator
;
@FieldDescribe
(
"操作时间"
)
private
Date
operateTime
;
@FieldDescribe
(
"被操作用户对象"
)
private
WrapPerson
person
;
private
List
<
WrapIdentity
>
identityList
;
...
...
@@ -431,6 +434,14 @@ abstract class BaseAction extends StandardJaxrsAction {
this
.
operator
=
operator
;
}
public
Date
getOperateTime
()
{
return
operateTime
;
}
public
void
setOperateTime
(
Date
operateTime
)
{
this
.
operateTime
=
operateTime
;
}
public
WrapPerson
getPerson
()
{
return
person
;
}
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/PersonAction.java
浏览文件 @
173a593b
...
...
@@ -625,4 +625,23 @@ public class PersonAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
@JaxrsMethodDescribe
(
value
=
"分页查询删除(注销)用户信息."
,
action
=
ActionListDeletePaging
.
class
)
@POST
@Path
(
"list/delete/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listDeletePaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"size"
)
Integer
size
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionListDeletePaging
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListDeletePaging
().
execute
(
effectivePerson
,
page
,
size
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录