Просмотр исходного кода

Merge branch 'fix/CMS.readerNotify' into 'develop'

[内容管理]修复了发布文档时会通知所有人员的问题

See merge request o2oa/o2oa!1243
李义 5 лет назад
Родитель
Сommit
190dfd76f9

+ 2 - 2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishAndNotify.java

@@ -175,9 +175,9 @@ public class ActionPersistPublishAndNotify extends BaseAction {
 		}
 
 		//将读者以及作者信息持久化到数据库中
-		if( wi.getSkipPermission() ) {
+		if( !wi.getSkipPermission() ) {
 			try {
-				documentPersistService.refreshDocumentPermission( id, wi.getReaderList(), wi.getAuthorList() );
+				document = documentPersistService.refreshDocumentPermission( id, wi.getReaderList(), wi.getAuthorList() );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在核对文档访问管理权限信息时发生异常!");

+ 1 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishByWorkFlow.java

@@ -365,7 +365,7 @@ public class ActionPersistPublishByWorkFlow extends BaseAction {
 		if ( check && !wi.getSkipPermission() ) {
 			//将读者以及作者信息持久化到数据库中
 			try {
-				documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
+				document = documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在核对文档访问管理权限信息时发生异常!");

+ 1 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistPublishContent.java

@@ -381,7 +381,7 @@ public class ActionPersistPublishContent extends BaseAction {
 		if ( check && !wi.getSkipPermission() ) {
 			//将读者以及作者信息持久化到数据库中
 			try {
-				documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
+				document = documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在核对文档访问管理权限信息时发生异常!");

+ 1 - 1
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/document/ActionPersistSaveDocument.java

@@ -365,7 +365,7 @@ public class ActionPersistSaveDocument extends BaseAction {
 		
 		if (check) {
 			try {//将读者以及作者信息持久化到数据库中
-				documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
+				document = documentPersistService.refreshDocumentPermission( document.getId(), wi.getReaderList(), wi.getAuthorList() );
 			} catch (Exception e) {
 				check = false;
 				Exception exception = new ExceptionDocumentInfoProcess(e, "系统在核对文档访问管理权限信息时发生异常!");

+ 4 - 2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/DocumentPersistService.java

@@ -298,15 +298,17 @@ public class DocumentPersistService {
 	 * @param authorList
 	 * @throws Exception
 	 */
-	public void refreshDocumentPermission( String docId, List<PermissionInfo> readerList, List<PermissionInfo> authorList ) throws Exception {
+	public Document refreshDocumentPermission( String docId, List<PermissionInfo> readerList, List<PermissionInfo> authorList ) throws Exception {
 		if( StringUtils.isEmpty( docId ) ){
 			throw new Exception("docId is empty!");
 		}
-		permissionService.refreshDocumentPermission( docId, readerList, authorList);
+		Document document = permissionService.refreshDocumentPermission( docId, readerList, authorList);
 		
 		new CmsBatchOperationPersistService().addOperation( 
 				CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT, 
 				CmsBatchOperationProcessService.OPT_TYPE_PERMISSION,  docId,  docId, "刷新文档权限:ID=" +  docId );
+
+		return document;
 	}
 
 	/**

+ 9 - 6
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/PermissionOperateService.java

@@ -33,11 +33,11 @@ public class PermissionOperateService {
 	 * @param authorList
 	 * @throws Exception
 	 */
-	public void refreshDocumentPermission( String docId, List<PermissionInfo> readerList, List<PermissionInfo> authorList ) throws Exception {
+	public Document refreshDocumentPermission( String docId, List<PermissionInfo> readerList, List<PermissionInfo> authorList ) throws Exception {
 		List<PermissionInfo> permissionList = composeDocmentAllPermissions(readerList, authorList);
 		try {
 			//将读者以及作者信息持久化到数据库中
-			refreshDocumentPermission( docId, permissionList );
+			return refreshDocumentPermission( docId, permissionList );
 		} catch (Exception e) {
 			throw e;
 		}
@@ -141,13 +141,14 @@ public class PermissionOperateService {
 	 * @param permissionList
 	 * @throws Exception 
 	 */
-	public void refreshDocumentPermission( String docId, List<PermissionInfo> permissionList ) throws Exception {
+	public Document refreshDocumentPermission( String docId, List<PermissionInfo> permissionList ) throws Exception {
 		if( StringUtils.isEmpty(docId) ){
 			throw new Exception( "docId is empty!" );
 		}
+		Document document = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			emc.beginTransaction( Document.class );
-			Document document = emc.find( docId, Document.class );		
+			document = emc.find( docId, Document.class );
 			
 			if( document != null ) {
 				//清空文档权限信息
@@ -196,12 +197,12 @@ public class PermissionOperateService {
 				if( ListTools.isEmpty( document.getAuthorPersonList() ) && ListTools.isEmpty( document.getAuthorUnitList() ) 
 						&& ListTools.isEmpty( document.getAuthorGroupList() )) {
 					//编辑全部都为空,则是创建人可编辑
-					document.addToAuthorPersonList( document.getCreatorPerson() );
+					document.addToReadPersonList( document.getCreatorPerson() );
 					document.addToAuthorPersonList( document.getCreatorPerson() );
 				}
 				if( ListTools.isEmpty( document.getManagerList() ) ) {
 					//管理全部都为空,则是创建人可以管理
-					document.addToManagerList( document.getCreatorPerson() );
+					document.addToReadPersonList( document.getCreatorPerson() );
 					document.addToManagerList( document.getCreatorPerson() );
 				}
 		
@@ -211,6 +212,8 @@ public class PermissionOperateService {
 		} catch ( Exception e ) {
 			throw e;
 		}
+
+		return document;
 	}
 
 //	private boolean existsPermission(List<PermissionInfo> permissionList, String objectType, String permissionCode) {