Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
3333e4d6
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
3333e4d6
编写于
5月 15, 2020
作者:
liyi_hz2008
提交者:
liyi_hz2008
5月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
内容管理添加管理员根据人员标识查询人员可以看到的文档列表服务
上级
f650f904
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
265 addition
and
14 deletion
+265
-14
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishContent.java
...e/control/jaxrs/document/ActionPersistPublishContent.java
+19
-10
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
.../jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
+218
-0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/DocumentCipherAction.java
...assemble/control/jaxrs/document/DocumentCipherAction.java
+28
-4
未找到文件。
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishContent.java
浏览文件 @
3333e4d6
...
...
@@ -176,6 +176,15 @@ public class ActionPersistPublishContent extends BaseAction {
if
(
check
)
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
if
(
StringUtils
.
isEmpty
(
wi
.
getIdentity
()))
{
wi
.
setCreatorIdentity
(
wi
.
getIdentity
()
);
}
if
(
StringUtils
.
isEmpty
(
wi
.
getCreatorPerson
()))
{
wi
.
setCreatorPerson
(
effectivePerson
.
getDistinguishedName
()
);
}
if
(
StringUtils
.
isEmpty
(
wi
.
getCreatorIdentity
()
))
{
if
(
"cipher"
.
equalsIgnoreCase
(
effectivePerson
.
getDistinguishedName
()
))
{
wi
.
setCreatorIdentity
(
"cipher"
);
...
...
@@ -188,13 +197,13 @@ public class ActionPersistPublishContent extends BaseAction {
wi
.
setCreatorUnitName
(
"xadmin"
);
wi
.
setCreatorTopUnitName
(
"xadmin"
);
}
else
{
//尝试一下根据当前用户获取用户的第一个身份
wi
.
setCreatorIdentity
(
userManagerService
.
getMajorIdentityWithPerson
(
effectivePerson
.
getDistinguishedName
()
)
);
//尝试一下根据
传入的用户或者
当前用户获取用户的第一个身份
wi
.
setCreatorIdentity
(
userManagerService
.
getMajorIdentityWithPerson
(
wi
.
getCreatorPerson
()
)
);
}
}
if
(
!
StringUtils
.
equals
(
"cipher"
,
wi
.
getCreatorIdentity
()
)
&&
!
StringUtils
.
equals
(
"xadmin"
,
wi
.
getCreatorIdentity
()
))
{
//说明是
指定的发布者
,并不使用cipher和xadmin代替
//说明是
实际的用户
,并不使用cipher和xadmin代替
if
(
StringUtils
.
isNotEmpty
(
wi
.
getCreatorIdentity
()
))
{
wi
.
setCreatorPerson
(
userManagerService
.
getPersonNameWithIdentity
(
wi
.
getCreatorIdentity
()
)
);
wi
.
setCreatorUnitName
(
userManagerService
.
getUnitNameByIdentity
(
wi
.
getCreatorIdentity
()
)
);
...
...
@@ -450,7 +459,7 @@ public class ActionPersistPublishContent extends BaseAction {
private
String
id
=
null
;
@FieldDescribe
(
"文档操作者身份
.
"
)
@FieldDescribe
(
"文档操作者身份"
)
private
String
identity
=
null
;
@FieldDescribe
(
"数据的路径列表."
)
...
...
@@ -488,15 +497,18 @@ public class ActionPersistPublishContent extends BaseAction {
@FieldDescribe
(
"文档类型,跟随分类类型,信息(默认) | 数据"
)
private
String
documentType
=
"信息"
;
@FieldDescribe
(
"文档状态: published | draft | checking | error"
)
private
String
docStatus
=
"draft"
;
@FieldDescribe
(
"分类ID"
)
private
String
categoryId
;
private
String
appId
;
private
String
appName
;
private
String
appAlias
;
@FieldDescribe
(
"分类ID"
)
private
String
categoryId
;
private
String
categoryName
;
private
String
categoryAlias
;
...
...
@@ -519,9 +531,6 @@ public class ActionPersistPublishContent extends BaseAction {
private
String
creatorTopUnitName
;
@FieldDescribe
(
"文档状态: published | draft | checking | error"
)
private
String
docStatus
=
"draft"
;
private
String
description
=
null
;
private
Long
viewCount
=
0L
;
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionQueryListWithFilterPagingAdmin.java
0 → 100644
浏览文件 @
3333e4d6
package
com.x.cms.assemble.control.jaxrs.document
;
import
com.google.gson.JsonElement
;
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.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.cms.core.entity.Document
;
import
com.x.cms.core.express.tools.filter.QueryFilter
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 管理员用
*/
public
class
ActionQueryListWithFilterPagingAdmin
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionQueryListWithFilterPagingAdmin
.
class
);
protected
ActionResult
<
List
<
Wo
>>
execute
(
HttpServletRequest
request
,
Integer
page
,
Integer
size
,
JsonElement
jsonElement
,
EffectivePerson
effectivePerson
)
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Long
total
=
0L
;
Wi
wi
=
null
;
List
<
Wo
>
wos
=
new
ArrayList
<>();
List
<
Document
>
searchResultList
=
new
ArrayList
<>();
Boolean
check
=
true
;
Boolean
isManager
=
false
;
String
personName
=
effectivePerson
.
getDistinguishedName
();
QueryFilter
queryFilter
=
null
;
try
{
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在将JSON信息转换为对象时发生异常。JSON:"
+
jsonElement
.
toString
()
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
if
(
wi
==
null
)
{
wi
=
new
Wi
();
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getPerson
()
)){
personName
=
wi
.
getPerson
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getDocumentType
()
))
{
wi
.
setDocumentType
(
"信息"
);
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOrderField
()
))
{
wi
.
setOrderField
(
"createTime"
);
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOrderType
()
))
{
wi
.
setOrderField
(
"DESC"
);
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getStatusList
()
))
{
List
<
String
>
status
=
new
ArrayList
<>();
status
.
add
(
"published"
);
wi
.
setStatusList
(
status
);
}
if
(
check
)
{
try
{
queryFilter
=
wi
.
getQueryFilter
();
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在获取查询条件信息时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
if
(
StringUtils
.
equals
(
effectivePerson
.
getDistinguishedName
(),
personName
)){
//管理员身份,查全部的
try
{
if
(
effectivePerson
.
isManager
()
||
userManagerService
.
isHasPlatformRole
(
personName
,
"CMSManager"
))
{
isManager
=
true
;
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在判断用户是否是管理时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
else
{
//管理员查其他人的,以指定人员的权限为准
logger
.
info
(
"管理员正在尝试查询人员[ {} ]可见的文档信息列表......"
,
personName
);
try
{
if
(
StringUtils
.
equals
(
"xadmin"
,
personName
)
||
userManagerService
.
isHasPlatformRole
(
personName
,
"CMSManager"
)
||
userManagerService
.
isHasPlatformRole
(
personName
,
"Manager"
))
{
isManager
=
true
;
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在判断用户是否是管理时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
}
if
(
check
)
{
// 从Review表中查询符合条件的对象总数
try
{
if
(
isManager
)
{
personName
=
null
;
}
total
=
documentQueryService
.
countWithCondition
(
personName
,
queryFilter
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在获取用户可查询到的文档数据条目数量时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
//document和Review除了sequence还有5个排序列支持title, appAlias, categoryAlias, categoryName, creatorUnitName的分页查询
//除了sequence和title, appAlias, categoryAlias, categoryName, creatorUnitName之外,其他的列排序全部在内存进行分页
try
{
searchResultList
=
documentQueryService
.
listPagingWithCondition
(
personName
,
wi
.
getOrderField
(),
wi
.
getOrderType
(),
queryFilter
,
page
,
size
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统在根据用户可访问的文档ID列表对文档进行分页查询时发生异常。"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
if
(
searchResultList
!=
null
)
{
Wo
wo
=
null
;
for
(
Document
document
:
searchResultList
)
{
try
{
wo
=
Wo
.
copier
.
copy
(
document
);
if
(
wo
.
getCreatorPerson
()
!=
null
&&
!
wo
.
getCreatorPerson
().
isEmpty
()
)
{
wo
.
setCreatorPersonShort
(
wo
.
getCreatorPerson
().
split
(
"@"
)[
0
]);
}
if
(
wo
.
getCreatorUnitName
()
!=
null
&&
!
wo
.
getCreatorUnitName
().
isEmpty
()
)
{
wo
.
setCreatorUnitNameShort
(
wo
.
getCreatorUnitName
().
split
(
"@"
)[
0
]);
}
if
(
wo
.
getCreatorTopUnitName
()
!=
null
&&
!
wo
.
getCreatorTopUnitName
().
isEmpty
()
)
{
wo
.
setCreatorTopUnitNameShort
(
wo
.
getCreatorTopUnitName
().
split
(
"@"
)[
0
]);
}
if
(
wi
.
getNeedData
()
)
{
//需要组装数据
wo
.
setData
(
documentQueryService
.
getDocumentData
(
document
)
);
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统获取文档数据内容信息时发生异常。Id:"
+
document
.
getCategoryId
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
wos
.
add
(
wo
);
}
}
}
result
.
setCount
(
total
);
result
.
setData
(
wos
);
return
result
;
}
public
class
DocumentCacheForFilter
{
private
Long
total
=
0L
;
private
List
<
Wo
>
documentList
=
null
;
public
Long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
Long
total
)
{
this
.
total
=
total
;
}
public
List
<
Wo
>
getDocumentList
()
{
return
documentList
;
}
public
void
setDocumentList
(
List
<
Wo
>
documentList
)
{
this
.
documentList
=
documentList
;
}
}
public
static
class
Wi
extends
WrapInDocumentFilter
{
@FieldDescribe
(
"可以查询的人员:DistinguishedName"
)
private
String
person
=
""
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
}
public
static
class
Wo
extends
WrapOutDocumentList
{
public
static
List
<
String
>
Excludes
=
new
ArrayList
<
String
>();
public
static
WrapCopier
<
Document
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Document
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
}
\ No newline at end of file
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/DocumentCipherAction.java
浏览文件 @
3333e4d6
package
com.x.cms.assemble.control.jaxrs.document
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.PUT
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.*
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
...
...
@@ -13,6 +10,7 @@ import javax.ws.rs.core.MediaType;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.annotation.JaxrsParameterDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
...
...
@@ -21,6 +19,8 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
java.util.List
;
@Path
(
"document/cipher"
)
@JaxrsDescribe
(
"信息发布信息文档管理(Cipher)"
)
public
class
DocumentCipherAction
extends
StandardJaxrsAction
{
...
...
@@ -48,4 +48,28 @@ public class DocumentCipherAction extends StandardJaxrsAction{
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"分页查询符合过滤条件的已发布的信息内容(管理员和Ciper使用)."
,
action
=
ActionQueryListWithFilterPagingAdmin
.
class
)
@PUT
@Path
(
"filter/list/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
query_listWithFilterPaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"size"
)
Integer
size
,
JsonElement
jsonElement
)
{
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
ActionResult
<
List
<
ActionQueryListWithFilterPagingAdmin
.
Wo
>>
result
=
new
ActionResult
<>();
Boolean
check
=
true
;
if
(
check
){
try
{
result
=
new
ActionQueryListWithFilterPagingAdmin
().
execute
(
request
,
page
,
size
,
jsonElement
,
effectivePerson
);
}
catch
(
Exception
e
)
{
result
=
new
ActionResult
<>();
result
.
error
(
e
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录