diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java index 85c0890844aefe76027d54a156e6a43851b59379..9cd6b1a36c0f84d6705af38c028e73dc042f329f 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/DocumentFactory.java @@ -75,14 +75,17 @@ public class DocumentFactory extends AbstractFactory { } //@MethodDescribe("根据ID列示指定分类所有Document信息列表") - public List listByCategoryId( String categoryId ) throws Exception { + public List 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 cq = cb.createQuery( String.class ); Root 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信息数量") diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java index ddc812a17668a8ee98ad988be0d8b4c0d3884ade..b22a5f3c87a17a875905d6743efe35cc9efeee22 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionArchive.java @@ -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 execute( HttpServletRequest request, String id, EffectivePerson effectivePerson ) throws Exception { ActionResult 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 diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java index b02974c407e082eb84eb1ddff7b189b0378d03b6..3359b8d3a95dffc1c81bf306d0b1a96dcf22a3c8 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionBatchModifyDataWithIds.java @@ -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 execute(HttpServletRequest request, JsonElement jsonElement, EffectivePerson effectivePerson) throws Exception { ActionResult result = new ActionResult<>(); Boolean check = true; @@ -73,6 +86,11 @@ public class ActionBatchModifyDataWithIds extends BaseAction { } } + /** + * 数据修改信息结构 + * @author O2LEE + * + */ public static class WiDataChange{ @FieldDescribe( "数据路径或者属性名." ) diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java index f9f85a3f7ec4289a3571f0e01094906bd333c643..bcb92407bdbaf1aa53be6a8052a0c911b03d201f 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionView.java @@ -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); diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java index e69a68f243c0b98de663a131ae01dd0b005a8b4e..a7fbe7ad52447b50cba1dc84ec7b9ed51bc52d6b 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/ActionTransferAllDocumentInfoPermission.java @@ -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; } diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java index 2a0f8925a24a4dfc450e1640c56264b073bb5fbb..b8efa65e025e1f516784f9fc3c2e3d9fd90d73aa 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/permission/element/PermissionInfo.java @@ -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( "权限类别:读者|阅读|作者|管理" ) diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java index 59ed98195946e4689d83de703b11e2eb986e390c..3c3dd051dafd0d0e540c3ba043c826bded815c9c 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/AppInfoService.java @@ -23,14 +23,6 @@ import com.x.query.core.entity.Item; public class AppInfoService { -// public List list( EntityManagerContainer emc, List 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 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 ); diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java index 883106aa0eb38ebcbb984fb8ce2df8de3f36d4f0..01b8afbdc9a9c98a2089ae2e95be739e6ede9993 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CategoryInfoService.java @@ -23,14 +23,6 @@ import com.x.cms.core.entity.tools.LogUtil; import com.x.query.core.entity.Item; public class CategoryInfoService { - -// public List list(EntityManagerContainer emc, List 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 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 ); diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java index eb4c7874fa5602dd07ea00089dce572978c985fa..4f766cf6e75aa33fe557ebda8695c4da0c54b2c0 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoService.java @@ -17,21 +17,13 @@ import com.x.query.core.entity.Item; public class DocumentInfoService { -// public List list( EntityManagerContainer emc, List ids ) throws Exception { -// if( ids == null || ids.isEmpty() ){ -// return null; -// } -// Business business = new Business( emc ); -// return business.getDocumentFactory().list( ids ); -// } - @SuppressWarnings("unchecked") - public List listByCategoryId( EntityManagerContainer emc, String categoryId ) throws Exception { + public List 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 { diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java index d1aa9ae9d7067770bba0870096880f4abb205f29..d52571e4e3048248c241f80ecd830ef117280a2a 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentInfoServiceAdv.java @@ -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 listByCategoryId( String categoryId ) throws Exception { + /** + * 根据指定的信息分类ID,获取分类下所有的信息文档对象 + * @param categoryId 信息分类ID + * @param maxCount 查询最大条目数量 + * @return + * @throws Exception + */ + public List listByCategoryId( String categoryId, Integer maxCount ) throws Exception { if( categoryId == null || categoryId.isEmpty() ){ throw new Exception("categoryId is null!"); } List 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 listIdsByCategoryId( String categoryId ) throws Exception { + /** + * 根据指定的信息分类ID,获取分类下所有的文档ID列表 + * @param categoryId 信息分类ID + * @param maxCount 查询最大条目数量 + * @return + * @throws Exception + */ + public List 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 list(List 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 viewAbleCategoryIds, String title, List publisherList, List createDateList, List publishDateList, List statusList, String documentType, - List creatorUnitNameList, - List importBatchNames, List personNames, + List creatorUnitNameList, List importBatchNames, List personNames, List unitNames, List 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 listNextWithCondition(String id, Integer count, List viewAbleCategoryIds, String title, List publisherList, List createDateList, List publishDateList, List statusList, String documentType, List creatorUnitNameList, List importBatchNames, List personNames, @@ -219,6 +293,14 @@ public class DocumentInfoServiceAdv { } } + /** + * 根据指定的信息分类ID列表以及文档类别,列示指定人员(根据creatorPerson匹配)草稿状态的文档信息列表 + * @param name 指定人员名称 + * @param categoryIdList 指定信息分类ID列表 + * @param documentType 指定信息类别 + * @return + * @throws Exception + */ public List listMyDraft( String name, List 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 readerList, List 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 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 docIds, List dataChanges) throws Exception { if( ListTools.isEmpty( docIds )){ throw new Exception("docIds is empty!"); diff --git a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java index 6bb3a8d30232d9c4a25c83bc9ccce95f4ef0abd0..d18055c32fbd40518283a7b18c3261c2ad0c56be 100644 --- a/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java +++ b/o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java @@ -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 );