Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
e63530fd
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,发现更多精彩内容 >>
提交
e63530fd
编写于
12月 25, 2018
作者:
liyi_hz2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CMS代码注释调整以及部分代码优化
上级
53ec39ee
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
229 addition
and
103 deletion
+229
-103
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java
...a/com/x/cms/assemble/control/factory/DocumentFactory.java
+5
-2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java
.../x/cms/assemble/control/jaxrs/document/ActionArchive.java
+24
-11
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java
.../control/jaxrs/document/ActionBatchModifyDataWithIds.java
+18
-0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java
...com/x/cms/assemble/control/jaxrs/document/ActionView.java
+1
-1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java
...s/permission/ActionTransferAllDocumentInfoPermission.java
+1
-1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java
...mble/control/jaxrs/permission/element/PermissionInfo.java
+5
-0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java
...va/com/x/cms/assemble/control/service/AppInfoService.java
+4
-10
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java
...m/x/cms/assemble/control/service/CategoryInfoService.java
+4
-10
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java
...m/x/cms/assemble/control/service/DocumentInfoService.java
+2
-10
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java
.../cms/assemble/control/service/DocumentInfoServiceAdv.java
+163
-56
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java
...ms/assemble/control/service/PermissionOperateService.java
+2
-2
未找到文件。
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java
浏览文件 @
e63530fd
...
...
@@ -75,14 +75,17 @@ public class DocumentFactory<T> extends AbstractFactory {
}
//@MethodDescribe("根据ID列示指定分类所有Document信息列表")
public
List
<
String
>
listByCategoryId
(
String
categoryId
)
throws
Exception
{
public
List
<
String
>
listByCategoryId
(
String
categoryId
,
Integer
maxCount
)
throws
Exception
{
if
(
maxCount
==
null
||
maxCount
==
0
)
{
maxCount
=
10000
;
}
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Document
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Document
>
root
=
cq
.
from
(
Document
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Document_
.
categoryId
),
categoryId
);
cq
.
select
(
root
.
get
(
Document_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
setMaxResults
(
10000
).
getResultList
();
return
em
.
createQuery
(
cq
).
setMaxResults
(
maxCount
).
getResultList
();
}
//@MethodDescribe("根据ID列示指定分类所有Document信息数量")
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java
浏览文件 @
e63530fd
...
...
@@ -13,48 +13,61 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.cms.assemble.control.Business
;
import
com.x.cms.core.entity.Document
;
/**
* 文档归档操作执行类
* @author O2LEE
*
*/
public
class
ActionArchive
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionArchive
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionArchive
.
class
);
/**
* 文档归档操作
* @param request
* @param id 文档ID
* @param effectivePerson 系统登录用户
* @return
* @throws Exception
*/
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
String
id
,
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
Business
business
=
new
Business
(
emc
);
Document
document
=
business
.
getDocumentFactory
().
get
(
id
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
Business
business
=
new
Business
(
emc
);
Document
document
=
business
.
getDocumentFactory
().
get
(
id
);
if
(
null
==
document
)
{
Exception
exception
=
new
ExceptionDocumentNotExists
(
id
);
result
.
error
(
exception
);
throw
exception
;
}
try
{
modifyDocStatus
(
id
,
"archived"
,
effectivePerson
.
getDistinguishedName
()
);
modifyDocStatus
(
id
,
"archived"
,
effectivePerson
.
getDistinguishedName
()
);
document
.
setDocStatus
(
"archived"
);
ApplicationCache
.
notify
(
Document
.
class
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"系统将文档状态修改为归档状态时发生异常。Id:"
+
id
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
throw
exception
;
}
//信息操作日志记录
logService
.
log
(
emc
,
effectivePerson
.
getDistinguishedName
(),
document
.
getCategoryAlias
()
+
":"
+
document
.
getTitle
(),
document
.
getAppId
(),
document
.
getCategoryId
(),
document
.
getId
(),
""
,
"DOCUMENT"
,
"删除"
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
document
.
getId
()
);
result
.
setData
(
wo
);
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"
系统将文档状态修改为归档状态时
发生异常。Id:"
+
id
);
}
catch
(
Exception
e
)
{
Exception
exception
=
new
ExceptionDocumentInfoProcess
(
e
,
"
文档归档操作
发生异常。Id:"
+
id
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
throw
exception
;
}
return
result
;
}
public
static
class
Wo
extends
WoId
{
}
}
\ No newline at end of file
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java
浏览文件 @
e63530fd
...
...
@@ -14,10 +14,23 @@ import com.x.base.core.project.logger.Logger;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.cms.core.entity.Document
;
/**
* 根据ID列表批量修改文档数据操作类
* @author O2LEE
*
*/
public
class
ActionBatchModifyDataWithIds
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionBatchModifyDataWithIds
.
class
);
/**
* 根据ID列表批量修改文档数据操作
* @param request
* @param jsonElement 传入的Json
* @param effectivePerson
* @return
* @throws Exception
*/
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
JsonElement
jsonElement
,
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Boolean
check
=
true
;
...
...
@@ -73,6 +86,11 @@ public class ActionBatchModifyDataWithIds extends BaseAction {
}
}
/**
* 数据修改信息结构
* @author O2LEE
*
*/
public
static
class
WiDataChange
{
@FieldDescribe
(
"数据路径或者属性名."
)
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java
浏览文件 @
e63530fd
...
...
@@ -76,7 +76,7 @@ public class ActionView extends BaseAction {
}
else
{
if
(
check
)
{
try
{
document
=
documentInfoServiceAdv
.
view
(
id
,
effectivePerson
);
document
=
documentInfoServiceAdv
.
get
(
id
);
if
(
document
==
null
)
{
check
=
false
;
Exception
exception
=
new
ExceptionDocumentNotExists
(
id
);
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java
浏览文件 @
e63530fd
...
...
@@ -63,7 +63,7 @@ public class ActionTransferAllDocumentInfoPermission extends BaseAction {
//查询该分类下所有的文档ID列表
try
{
documentIds
=
documentServiceAdv
.
listIdsByCategoryId
(
categoryId
);
documentIds
=
documentServiceAdv
.
listIdsByCategoryId
(
categoryId
,
9999999
);
if
(
ListTools
.
isEmpty
(
documentIds
)
){
continue
;
}
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java
浏览文件 @
e63530fd
...
...
@@ -2,6 +2,11 @@ package com.x.cms.assemble.control.jaxrs.permission.element;
import
com.x.base.core.project.annotation.FieldDescribe
;
/**
* 信息权限信息结构
* @author O2LEE
*
*/
public
class
PermissionInfo
{
@FieldDescribe
(
"权限类别:读者|阅读|作者|管理"
)
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java
浏览文件 @
e63530fd
...
...
@@ -23,14 +23,6 @@ import com.x.query.core.entity.Item;
public
class
AppInfoService
{
// public List<AppInfo> list( EntityManagerContainer emc, List<String> ids ) throws Exception {
// if( ids == null || ids.isEmpty() ){
// return null;
// }
// return emc.list( AppInfo.class, ids );
// Business business = new Business( emc );
// return business.getAppInfoFactory().list( ids );
// }
public
List
<
String
>
listAllIds
(
EntityManagerContainer
emc
,
String
documentType
)
throws
Exception
{
Business
business
=
new
Business
(
emc
);
return
business
.
getAppInfoFactory
().
listAllIds
(
documentType
);
...
...
@@ -170,6 +162,7 @@ public class AppInfoService {
return
business
.
getCategoryInfoFactory
().
countByAppId
(
id
,
documentType
);
}
@SuppressWarnings
(
"unchecked"
)
public
AppInfo
save
(
EntityManagerContainer
emc
,
AppInfo
wrapIn
)
throws
Exception
{
AppInfo
appInfo
=
null
;
if
(
wrapIn
.
getId
()
==
null
){
...
...
@@ -191,6 +184,7 @@ public class AppInfoService {
appInfo
.
setAppAlias
(
appInfo
.
getAppName
()
);
emc
.
persist
(
appInfo
,
CheckPersistType
.
all
);
}
else
{
//如果用户修改了栏目的名称
if
(
!
wrapIn
.
getAppName
().
equals
(
appInfo
.
getAppName
()
)){
emc
.
beginTransaction
(
CategoryInfo
.
class
);
emc
.
beginTransaction
(
Document
.
class
);
...
...
@@ -202,10 +196,10 @@ public class AppInfoService {
categoryInfo
=
emc
.
find
(
categoryId
,
CategoryInfo
.
class
);
categoryInfo
.
setAppName
(
wrapIn
.
getAppName
()
);
categoryInfo
.
setCategoryAlias
(
wrapIn
.
getAppName
()
+
"-"
+
categoryInfo
.
getCategoryName
()
);
emc
.
check
(
categoryInfo
,
CheckPersistType
.
all
);
emc
.
check
(
categoryInfo
,
CheckPersistType
.
all
);
//对该目录下所有的文档的栏目名称和分类别名进行调整
document_ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryId
);
document_ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryId
,
9999999
);
if
(
document_ids
!=
null
&&
!
document_ids
.
isEmpty
()
){
for
(
String
docId
:
document_ids
){
document
=
emc
.
find
(
docId
,
Document
.
class
);
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java
浏览文件 @
e63530fd
...
...
@@ -23,14 +23,6 @@ import com.x.cms.core.entity.tools.LogUtil;
import
com.x.query.core.entity.Item
;
public
class
CategoryInfoService
{
// public List<CategoryInfo> list(EntityManagerContainer emc, List<String> ids) throws Exception {
// if( ids == null || ids.isEmpty() ){
// return null;
// }
// Business business = new Business( emc );
// return business.getCategoryInfoFactory().list( ids );
// }
public
CategoryInfo
get
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
if
(
id
==
null
||
id
.
isEmpty
()
){
...
...
@@ -130,6 +122,7 @@ public class CategoryInfoService {
return
categoryInfo
;
}
@SuppressWarnings
(
"unchecked"
)
public
CategoryInfo
save
(
EntityManagerContainer
emc
,
CategoryInfo
temp_categoryInfo
,
String
extContent
)
throws
Exception
{
CategoryInfo
categoryInfo
=
null
;
CategoryExt
categoryExt
=
null
;
...
...
@@ -191,7 +184,7 @@ public class CategoryInfoService {
if
(
!
oldCategoryName
.
equals
(
categoryInfo
.
getCategoryName
()
)){
emc
.
beginTransaction
(
Document
.
class
);
//对该目录下所有的文档的栏目名称和分类别名进行调整
document_ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
);
document_ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
,
9999999
);
if
(
document_ids
!=
null
&&
!
document_ids
.
isEmpty
()
){
for
(
String
docId
:
document_ids
){
document
=
emc
.
find
(
docId
,
Document
.
class
);
...
...
@@ -259,6 +252,7 @@ public class CategoryInfoService {
return
categoryExt
;
}
@SuppressWarnings
(
"unchecked"
)
public
void
delete
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
List
<
String
>
ids
=
null
;
CategoryInfo
categoryInfo
=
null
;
...
...
@@ -299,7 +293,7 @@ public class CategoryInfoService {
}
//还有文档以及文档权限需要删除
ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
id
);
ids
=
business
.
getDocumentFactory
().
listByCategoryId
(
id
,
9999999
);
if
(
ids
!=
null
&&
!
ids
.
isEmpty
()
){
for
(
String
del_id
:
ids
){
document
=
emc
.
find
(
del_id
,
Document
.
class
);
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java
浏览文件 @
e63530fd
...
...
@@ -17,21 +17,13 @@ import com.x.query.core.entity.Item;
public
class
DocumentInfoService
{
// public List<Document> list( EntityManagerContainer emc, List<String> ids ) throws Exception {
// if( ids == null || ids.isEmpty() ){
// return null;
// }
// Business business = new Business( emc );
// return business.getDocumentFactory().list( ids );
// }
@SuppressWarnings
(
"unchecked"
)
public
List
<
String
>
listByCategoryId
(
EntityManagerContainer
emc
,
String
categoryId
)
throws
Exception
{
public
List
<
String
>
listByCategoryId
(
EntityManagerContainer
emc
,
String
categoryId
,
Integer
maxCount
)
throws
Exception
{
if
(
categoryId
==
null
||
categoryId
.
isEmpty
()
){
return
null
;
}
Business
business
=
new
Business
(
emc
);
return
business
.
getDocumentFactory
().
listByCategoryId
(
categoryId
);
return
business
.
getDocumentFactory
().
listByCategoryId
(
categoryId
,
maxCount
);
}
public
Document
get
(
EntityManagerContainer
emc
,
String
id
)
throws
Exception
{
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java
浏览文件 @
e63530fd
...
...
@@ -11,8 +11,8 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.dataitem.DataItemConverter
;
import
com.x.base.core.entity.dataitem.ItemCategory
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.cms.assemble.control.Business
;
import
com.x.cms.assemble.control.DocumentDataHelper
;
...
...
@@ -25,8 +25,7 @@ import com.x.cms.core.entity.content.Data;
import
com.x.query.core.entity.Item
;
/**
* 对文档信息进行管理的服务类(高级)
* 高级服务器可以利用Service完成事务控制
* 对文档信息进行管理的服务类
*
* @author O2LEE
*/
...
...
@@ -34,55 +33,67 @@ public class DocumentInfoServiceAdv {
private
DocumentInfoService
documentInfoService
=
new
DocumentInfoService
();
private
PermissionOperateService
permissionService
=
new
PermissionOperateService
();
public
List
<
Document
>
listByCategoryId
(
String
categoryId
)
throws
Exception
{
/**
* 根据指定的信息分类ID,获取分类下所有的信息文档对象
* @param categoryId 信息分类ID
* @param maxCount 查询最大条目数量
* @return
* @throws Exception
*/
public
List
<
Document
>
listByCategoryId
(
String
categoryId
,
Integer
maxCount
)
throws
Exception
{
if
(
categoryId
==
null
||
categoryId
.
isEmpty
()
){
throw
new
Exception
(
"categoryId is null!"
);
}
List
<
String
>
ids
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
ids
=
documentInfoService
.
listByCategoryId
(
emc
,
categoryId
);
ids
=
documentInfoService
.
listByCategoryId
(
emc
,
categoryId
,
maxCount
);
return
emc
.
list
(
Document
.
class
,
ids
);
// return documentInfoService.list( emc, ids );
}
catch
(
Exception
e
)
{
throw
e
;
}
}
public
List
<
String
>
listIdsByCategoryId
(
String
categoryId
)
throws
Exception
{
/**
* 根据指定的信息分类ID,获取分类下所有的文档ID列表
* @param categoryId 信息分类ID
* @param maxCount 查询最大条目数量
* @return
* @throws Exception
*/
public
List
<
String
>
listIdsByCategoryId
(
String
categoryId
,
Integer
maxCount
)
throws
Exception
{
if
(
categoryId
==
null
||
categoryId
.
isEmpty
()
){
throw
new
Exception
(
"categoryId is null!"
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
return
documentInfoService
.
listByCategoryId
(
emc
,
categoryId
);
return
documentInfoService
.
listByCategoryId
(
emc
,
categoryId
,
maxCount
);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
/**
* 根据ID获取指定信息文档对象
* @param id 信息文档ID
* @return
* @throws Exception
*/
public
Document
get
(
String
id
)
throws
Exception
{
if
(
id
==
null
||
id
.
isEmpty
()
){
throw
new
Exception
(
"id is null!"
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
return
documentInfoService
.
get
(
emc
,
id
);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
public
Document
view
(
String
id
,
EffectivePerson
currentPerson
)
throws
Exception
{
if
(
id
==
null
||
id
.
isEmpty
()
){
throw
new
Exception
(
"id is null!"
);
}
Document
document
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
document
=
emc
.
find
(
id
,
Document
.
class
);
return
document
;
return
emc
.
find
(
id
,
Document
.
class
,
ExceptionWhen
.
none
);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
/**
* 根据文档信息对象查询该文档信息的数据对象
* @param document 文档信息
* @return
* @throws Exception
*/
public
Data
getDocumentData
(
Document
document
)
throws
Exception
{
if
(
document
==
null
){
throw
new
Exception
(
"document is null!"
);
...
...
@@ -115,6 +126,12 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据信息分类ID,获取分类下所有文档的数量
* @param categoryId 信息分类ID
* @return
* @throws Exception
*/
public
Long
countByCategoryId
(
String
categoryId
)
throws
Exception
{
if
(
categoryId
==
null
||
categoryId
.
isEmpty
()
){
throw
new
Exception
(
"categoryId is null!"
);
...
...
@@ -126,18 +143,30 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据ID列表列示指定ID的文档信息
* @param ids 信息文档ID列表
* @return
* @throws Exception
*/
public
List
<
Document
>
list
(
List
<
String
>
ids
)
throws
Exception
{
if
(
ListTools
.
isEmpty
(
ids
)
){
throw
new
Exception
(
"ids is empty!"
);
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
return
emc
.
list
(
Document
.
class
,
ids
);
// return documentInfoService.list(emc, ids);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
/**
* 保存文档信息
* @param document 文档信息对象
* @param jsonElement 文档数据对象
* @return
* @throws Exception
*/
public
Document
save
(
Document
document
,
JsonElement
jsonElement
)
throws
Exception
{
if
(
document
==
null
){
throw
new
Exception
(
"document is null!"
);
...
...
@@ -145,8 +174,8 @@ public class DocumentInfoServiceAdv {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
document
=
documentInfoService
.
save
(
emc
,
document
);
//如果有数据信息,则保存数据信息
//如果有数据信息, 则保存数据信息
DocumentDataHelper
documentDataHelper
=
new
DocumentDataHelper
(
emc
,
document
);
if
(
jsonElement
!=
null
)
{
documentDataHelper
.
update
(
jsonElement
);
...
...
@@ -164,6 +193,12 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 向文档数据表同步文档的最新数据信息
* @param document 文档信息对象(包含数据)
* @return
* @throws Exception
*/
public
Document
refreshDocInfoData
(
Document
document
)
throws
Exception
{
if
(
document
==
null
){
throw
new
Exception
(
"document is null!"
);
...
...
@@ -182,10 +217,27 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据指定的条件获取符合条件的文档信息数量
* @param viewAbleCategoryIds 用于过滤的可见信息分类ID列表
* @param title 用于过滤的文档标题
* @param publisherList 用于过滤的发布者列表
* @param createDateList 用于过滤的信息创建日期列表
* @param publishDateList 用于过滤的信息发布日期列表
* @param statusList 用于过滤的信息文档状态列表
* @param documentType 用于过滤的信息类别
* @param creatorUnitNameList 用于过滤的创建者所属组织名称列表
* @param importBatchNames 用于过滤的导入数据批次名称列表
* @param personNames 用于过滤权限的人员姓名列表
* @param unitNames 用于过滤权限的人员所属组织名称列表
* @param groupNames 用于过滤权限的群组名称列表
* @param manager 查询者身份是否为管理员权限
* @return
* @throws Exception
*/
public
Long
countWithCondition
(
List
<
String
>
viewAbleCategoryIds
,
String
title
,
List
<
String
>
publisherList
,
List
<
String
>
createDateList
,
List
<
String
>
publishDateList
,
List
<
String
>
statusList
,
String
documentType
,
List
<
String
>
creatorUnitNameList
,
List
<
String
>
importBatchNames
,
List
<
String
>
personNames
,
List
<
String
>
creatorUnitNameList
,
List
<
String
>
importBatchNames
,
List
<
String
>
personNames
,
List
<
String
>
unitNames
,
List
<
String
>
groupNames
,
Boolean
manager
)
throws
Exception
{
if
(
ListTools
.
isEmpty
(
viewAbleCategoryIds
)
&&
!
manager
){
return
0L
;
...
...
@@ -198,6 +250,28 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据指定的条件获取符合条件的下一页文档信息列表
* @param id 上一页最后一条信息ID,如果为第一页,则传入"(0)"
* @param count 一页查询的条目数量
* @param viewAbleCategoryIds 用于过滤的可见信息分类ID列表
* @param title 用于过滤的文档标题
* @param publisherList 用于过滤的发布者列表
* @param createDateList 用于过滤的信息创建日期列表
* @param publishDateList 用于过滤的信息发布日期列表
* @param statusList 用于过滤的信息文档状态列表
* @param documentType 用于过滤的信息类别
* @param creatorUnitNameList 用于过滤的创建者所属组织名称列表
* @param importBatchNames 用于过滤的导入数据批次名称列表
* @param personNames 用于过滤权限的人员姓名列表
* @param unitNames 用于过滤权限的人员所属组织名称列表
* @param groupNames 用于过滤权限的群组名称列表
* @param orderField 用于查询结果排序的属性名称
* @param order 查询结果的排序方式
* @param manager 查询者身份是否为管理员权限
* @return
* @throws Exception
*/
public
List
<
Document
>
listNextWithCondition
(
String
id
,
Integer
count
,
List
<
String
>
viewAbleCategoryIds
,
String
title
,
List
<
String
>
publisherList
,
List
<
String
>
createDateList
,
List
<
String
>
publishDateList
,
List
<
String
>
statusList
,
String
documentType
,
List
<
String
>
creatorUnitNameList
,
List
<
String
>
importBatchNames
,
List
<
String
>
personNames
,
...
...
@@ -219,6 +293,14 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据指定的信息分类ID列表以及文档类别,列示指定人员(根据creatorPerson匹配)草稿状态的文档信息列表
* @param name 指定人员名称
* @param categoryIdList 指定信息分类ID列表
* @param documentType 指定信息类别
* @return
* @throws Exception
*/
public
List
<
Document
>
listMyDraft
(
String
name
,
List
<
String
>
categoryIdList
,
String
documentType
)
throws
Exception
{
if
(
name
==
null
||
name
.
isEmpty
()){
throw
new
Exception
(
"name is null!"
);
...
...
@@ -233,6 +315,13 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 从文档中获取指定数据根路径为path0的数据
* @param document 文档信息对象
* @param path0 path0名称
* @return
* @throws Exception
*/
public
Item
getDataWithDocIdWithPath
(
Document
document
,
String
path0
)
throws
Exception
{
if
(
path0
==
null
||
path0
.
isEmpty
()){
throw
new
Exception
(
"path0 is null!"
);
...
...
@@ -248,17 +337,17 @@ public class DocumentInfoServiceAdv {
}
/**
* 普通用戶的查詢
,帶權限查詢
* @param title
* @param appIdList
* @param categoryIdList
* @param publisherList
* @param createDateList
* @param publishDateList
* @param statusList
* @param personName
* @param viewableCategoryIds
* @param maxResultCount
* 普通用戶的查詢
(帶權限查詢)
* @param title
用于过滤的文档标题
* @param appIdList
用于过滤的信息栏目ID列表
* @param categoryIdList
用于过滤的信息分类ID列表
* @param publisherList
用于过滤的发布者列表
* @param createDateList
用于过滤的信息创建日期列表
* @param publishDateList
用于过滤的信息发布日期列表
* @param statusList
用于过滤的信息文档状态列表
* @param personName
用于过滤权限的人员名称
* @param viewableCategoryIds
用于过滤的可见信息分类ID列表
* @param maxResultCount
查询最大文档数量
* @return
* @throws Exception
*/
...
...
@@ -285,17 +374,17 @@ public class DocumentInfoServiceAdv {
}
/**
* 管理員的查詢
,跨越權限
* @param title
* @param appIdList
* @param appAliasList
* @param categoryIdList
* @param categoryAliasList
* @param publisherList
* @param createDateList
* @param publishDateList
* @param statusList
* @param maxResultCount
* 管理員的查詢
(跨越權限)
* @param title
用于过滤的文档标题
* @param appIdList
用于过滤的信息栏目ID列表
* @param appAliasList
用于过滤的信息栏目别外列表
* @param categoryIdList
用于过滤的信息分类ID列表
* @param categoryAliasList
用于过滤的信息分类别名列表
* @param publisherList
用于过滤的发布者列表
* @param createDateList
用于过滤的信息创建日期列表
* @param publishDateList
用于过滤的信息发布日期列表
* @param statusList
用于过滤的信息文档状态列表
* @param maxResultCount
查询最大文档数量
* @return
* @throws Exception
*/
...
...
@@ -310,6 +399,11 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据信息文档对象,向信息数据Item对象里补充distributeFactor、bundle和itemCategory信息
* @param o 信息数据对象
* @param document 信息对象
*/
void
fill
(
Item
o
,
Document
document
)
{
/** 将DateItem与Document放在同一个分区 */
o
.
setDistributeFactor
(
document
.
getDistributeFactor
());
...
...
@@ -317,6 +411,12 @@ public class DocumentInfoServiceAdv {
o
.
setItemCategory
(
ItemCategory
.
cms
);
}
/**
* 获取信息被阅读次数
* @param id 信息文档ID
* @return
* @throws Exception
*/
public
Long
getViewCount
(
String
id
)
throws
Exception
{
if
(
id
==
null
||
id
.
isEmpty
()
){
throw
new
Exception
(
"id is null!"
);
...
...
@@ -332,7 +432,7 @@ public class DocumentInfoServiceAdv {
/**
* 根据组织好的document对象更新数据库中文档的权限信息
* @param document
* @param document
信息文档对象
* @throws Exception
*/
public
void
updateAllPermission
(
Document
document
)
throws
Exception
{
...
...
@@ -363,9 +463,9 @@ public class DocumentInfoServiceAdv {
/**
* 根据读者作者列表更新文档所有的权限信息
* @param docId
* @param readerList
* @param authorList
* @param docId
信息文档ID
* @param readerList
信息读者权限列表
* @param authorList
信息作者权限列表(允许修改信息的人员)
* @throws Exception
*/
public
void
refreshDocumentPermission
(
String
docId
,
List
<
PermissionInfo
>
readerList
,
List
<
PermissionInfo
>
authorList
)
throws
Exception
{
...
...
@@ -377,8 +477,8 @@ public class DocumentInfoServiceAdv {
/**
* 根据组织好的权限信息列表更新指定文档的权限信息
* @param docId
* @param permissionList
* @param docId
信息文档ID
* @param permissionList
信息权限列表
* @throws Exception
*/
public
void
refreshDocumentPermission
(
String
docId
,
List
<
PermissionInfo
>
permissionList
)
throws
Exception
{
...
...
@@ -390,8 +490,8 @@ public class DocumentInfoServiceAdv {
/**
* 变更一个文档的分类信息
* @param document
* @param categoryInfo
* @param document
信息文档对象
* @param categoryInfo
新的信息分类对象
* @throws Exception
*/
public
Boolean
changeCategory
(
Document
document
,
CategoryInfo
categoryInfo
)
throws
Exception
{
...
...
@@ -432,6 +532,13 @@ public class DocumentInfoServiceAdv {
}
}
/**
* 根据文档ID列表,批量修改数据
* @param docIds 文档ID
* @param dataChanges 数据修改信息
* @return
* @throws Exception
*/
public
Wo
changeData
(
List
<
String
>
docIds
,
List
<
WiDataChange
>
dataChanges
)
throws
Exception
{
if
(
ListTools
.
isEmpty
(
docIds
)){
throw
new
Exception
(
"docIds is empty!"
);
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java
浏览文件 @
e63530fd
...
...
@@ -224,7 +224,7 @@ public class PermissionOperateService {
emc
.
commit
();
continue
;
}
documentIds
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
);
documentIds
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
,
9999999
);
if
(
ListTools
.
isNotEmpty
(
documentIds
))
{
documentList
=
emc
.
list
(
Document
.
class
,
documentIds
);
// documentList = business.getDocumentFactory().list( documentIds );
...
...
@@ -286,7 +286,7 @@ public class PermissionOperateService {
return
;
}
appInfo
=
emc
.
find
(
categoryInfo
.
getAppId
(),
AppInfo
.
class
);
documentIds
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
);
documentIds
=
business
.
getDocumentFactory
().
listByCategoryId
(
categoryInfo
.
getId
()
,
9999999
);
if
(
ListTools
.
isNotEmpty
(
documentIds
))
{
documentList
=
emc
.
list
(
Document
.
class
,
documentIds
);
// documentList = business.getDocumentFactory().list( documentIds );
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录