Browse Source

Merge branch 'wrdp' into 'release'

Wrdp to Rlelease

See merge request o2oa/o2oa!2206
胡起 5 years ago
parent
commit
843a859e33
94 changed files with 1368 additions and 1186 deletions
  1. 20 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSSubjectInfoFactory.java
  2. 2 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForBBSIndex.java
  3. 24 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForPage.java
  4. 2 2
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java
  5. 4 4
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoServiceAdv.java
  6. 5 2
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/queue/QueueDataRowImport.java
  7. 48 0
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CmsBatchOperationProcessService.java
  8. 2 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ActionApplication.java
  9. 10 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/FileJaxrsFilter.java
  10. 54 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/ActionGeneralFile.java
  11. 7 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/BaseAction.java
  12. 13 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/ExceptionInputFileObject.java
  13. 43 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/GeneralFileAction.java
  14. 26 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/ActionIsHoliday.java
  15. 18 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/WorkTimeAction.java
  16. 17 21
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java
  17. 30 10
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/BaseAction.java
  18. 12 21
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/ActionGetWorkOrWorkCompleted.java
  19. 25 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/BaseAction.java
  20. 77 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
  21. 34 56
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2Get.java
  22. 34 56
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2GetMobile.java
  23. 79 138
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java
  24. 80 139
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java
  25. 23 14
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/ActionListWithWorkOrWorkCompleted.java
  26. 22 14
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/ActionListWithWorkOrWorkCompletedPaging.java
  27. 82 49
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCountWithPerson.java
  28. 104 216
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
  29. 60 61
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionRefer.java
  30. 28 11
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/BaseAction.java
  31. 124 124
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2GetWorkOrWorkCompleted.java
  32. 7 7
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageGetAssignment.java
  33. 9 9
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/BaseAction.java
  34. 6 6
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java
  35. 3 3
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/workcompleted/ActionMerge.java
  36. 5 5
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java
  37. 5 4
      o2server/x_program_center/src/main/webapp/jest/list.html
  38. 1 2
      o2web/source/o2_core/o2.js
  39. 0 1
      o2web/source/o2_core/o2/actionWorker.js
  40. 1 2
      o2web/source/o2_core/o2/ie_adapter.js
  41. 2 2
      o2web/source/o2_core/o2/widget/Calendar.js
  42. 3 3
      o2web/source/o2_core/o2/widget/Combox.js
  43. 1 1
      o2web/source/o2_core/o2/widget/Dialog.js
  44. 3 3
      o2web/source/o2_core/o2/widget/JavascriptEditor.js
  45. 1 1
      o2web/source/o2_core/o2/widget/Maplist.js
  46. 1 1
      o2web/source/o2_core/o2/widget/O2Identity.js
  47. 1 1
      o2web/source/o2_core/o2/widget/ScriptArea.js
  48. 2 2
      o2web/source/o2_core/o2/widget/Tablet.js
  49. 2 2
      o2web/source/o2_core/o2/widget/Toolbar.js
  50. 1 1
      o2web/source/o2_core/o2/xAction/RestActions.js
  51. 1 1
      o2web/source/o2_core/o2/xAction/services/x_faceset_control.js
  52. 1 1
      o2web/source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js
  53. 4 4
      o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
  54. 1 1
      o2web/source/o2_core/o2/xDesktop/Authentication.js
  55. 2 2
      o2web/source/o2_core/o2/xDesktop/Common.js
  56. 4 4
      o2web/source/o2_core/o2/xDesktop/Default.js
  57. 4 4
      o2web/source/o2_core/o2/xDesktop/Dialog.js
  58. 3 3
      o2web/source/o2_core/o2/xDesktop/Layout.js
  59. 10 10
      o2web/source/o2_core/o2/xDesktop/WebSocket.js
  60. 4 4
      o2web/source/o2_core/o2/xScript/CMSEnvironment.js
  61. 7 7
      o2web/source/o2_core/o2/xScript/Environment.js
  62. 5 5
      o2web/source/o2_core/o2/xScript/PageEnvironment.js
  63. 5 5
      o2web/source/o2_core/o2/xScript/ViewEnvironment.js
  64. 0 0
      o2web/source/x_component_Template/test2.js
  65. 2 2
      o2web/source/x_component_portal_Portal/Main.js
  66. 7 1
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/actionbar.html
  67. 0 3
      o2web/source/x_component_process_Xform/$Input.js
  68. 0 1
      o2web/source/x_component_process_Xform/$Module.js
  69. 4 2
      o2web/source/x_component_process_Xform/Actionbar.js
  70. 0 5
      o2web/source/x_component_process_Xform/Attachment.js
  71. 1 1
      o2web/source/x_component_process_Xform/Calendar.js
  72. 1 1
      o2web/source/x_component_process_Xform/DatagridMobile.js
  73. 2 2
      o2web/source/x_component_process_Xform/DatagridPC.js
  74. 13 13
      o2web/source/x_component_process_Xform/Documenteditor.js
  75. 10 10
      o2web/source/x_component_process_Xform/Form.js
  76. 4 4
      o2web/source/x_component_process_Xform/Log.js
  77. 1 1
      o2web/source/x_component_process_Xform/Number.js
  78. 7 7
      o2web/source/x_component_process_Xform/Org.js
  79. 1 1
      o2web/source/x_component_process_Xform/Orgfield.js
  80. 2 2
      o2web/source/x_component_process_Xform/Personfield.js
  81. 1 1
      o2web/source/x_component_process_Xform/Select.js
  82. 1 1
      o2web/source/x_component_process_Xform/Statement.js
  83. 1 1
      o2web/source/x_component_process_Xform/StatementSelector.js
  84. 1 1
      o2web/source/x_component_process_Xform/Subform.js
  85. 1 1
      o2web/source/x_component_process_Xform/View.js
  86. 1 1
      o2web/source/x_component_process_Xform/Widget.js
  87. 2 0
      o2web/source/x_component_process_Xform/lp/zh-cn.js
  88. 3 3
      o2web/source/x_component_process_Xform/widget/DocumentHistory.js
  89. 3 3
      o2web/source/x_component_process_Xform/widget/Monitor.js
  90. 77 59
      o2web/source/x_desktop/js/base.js
  91. 3 3
      o2web/source/x_desktop/js/base_simple.js
  92. 2 2
      o2web/source/x_desktop/js/base_simple_anonymous.js
  93. 2 2
      o2web/source/x_desktop/js/qywxStartProcess.js
  94. 1 1
      o2web/source/x_desktop/smapsso.html

+ 20 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSSubjectInfoFactory.java

@@ -263,7 +263,7 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 	}
 	
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题数量" )
-	public Long countSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, List<String> viewSectionIds ) throws Exception {
+	public Long countSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, List<String> viewSectionIds , Date startTime , Date endTime) throws Exception {
 		EntityManager em = this.entityManagerContainer().get(BBSSubjectInfo.class);
 		CriteriaBuilder cb = em.getCriteriaBuilder();
 		CriteriaQuery<Long> cq = cb.createQuery(Long.class);
@@ -298,13 +298,22 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 		}
+		
+		if(startTime!= null) {
+			   p = cb.and(p, cb.greaterThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), startTime));
+		}
+			
+		if(endTime!= null) {
+			   p = cb.and(p, cb.lessThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), endTime));
+		}
+		
 		cq.select( cb.count( root ) );
 		//SELECT COUNT(b) FROM BBSSubjectInfo b WHERE ((b.id IS NOT NULL AND b.sectionId IN ('1c1d9dfc-0034-4d9a-adc7-bb4b3925bbd5')) AND b.title LIKE 'Count')
 		return em.createQuery(cq.where(p)).getSingleResult();
 	}
 	
 	//@MethodDescribe( "根据版块ID, 主版块ID,版块ID,创建者姓名查询符合要求所有主题列表,不包括子版块内的主题" )
-	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds ) throws Exception {
+	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds, Date startTime , Date endTime) throws Exception {
 		if( maxRecordCount == null ){
 			throw new Exception( "maxRecordCount is null." );
 		}
@@ -341,6 +350,15 @@ public class BBSSubjectInfoFactory extends AbstractFactory {
 		if( StringUtils.isNotEmpty( searchTitle ) ){
 			p = cb.and( p, cb.like( root.get( BBSSubjectInfo_.title ), searchTitle ) );
 		}
+		
+		if(startTime!= null) {
+			   p = cb.and(p, cb.greaterThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), startTime));
+		}
+			
+		if(endTime!= null) {
+			   p = cb.and(p, cb.lessThanOrEqualTo(root.get(BBSSubjectInfo_.createTime), endTime));
+		}
+			
 		cq.orderBy( cb.desc( root.get( BBSSubjectInfo_.latestReplyTime ) ) );
 		return em.createQuery(cq.where(p)).setMaxResults( maxRecordCount ).getResultList();
 	}	

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForBBSIndex.java

@@ -136,7 +136,7 @@ public class ActionSubjectListForBBSIndex extends BaseAction {
 		if( check ){
 			if( selectTotal > 0 ){
 				try{
-					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, viewSectionIds );
+					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, viewSectionIds,null,null);
 				} catch (Exception e) {
 					check = false;
 					Exception exception = new ExceptionSubjectFilter( e );
@@ -155,7 +155,7 @@ public class ActionSubjectListForBBSIndex extends BaseAction {
 
 				try{
 					//内存分页
-					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, selectTotal, viewSectionIds );
+					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), null, selectTotal, viewSectionIds ,null,null);
 					if(ListTools.isNotEmpty( subjectInfoList ) ){
 						try {
 							wraps_out = Wo.copier.copy( subjectInfoList );

+ 24 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectListForPage.java

@@ -1,6 +1,7 @@
 package com.x.bbs.assemble.control.jaxrs.subjectinfo;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -172,7 +173,7 @@ public class ActionSubjectListForPage extends BaseAction {
 			selectTopInSection = false; //置顶贴的处理已经在前面处理过了,置顶贴已经放到一个List里,不需要再次查询出来了,后续的查询过滤置顶贴
 			if( selectTotal > 0 ){
 				try{
-					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, viewSectionIds );
+					total = subjectInfoServiceAdv.countSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, viewSectionIds ,wrapIn.getStartTime() ,  wrapIn.getEndTime());
 				} catch (Exception e) {
 					check = false;
 					Exception exception = new ExceptionSubjectFilter( e );
@@ -185,7 +186,7 @@ public class ActionSubjectListForPage extends BaseAction {
 		if( check ){
 			if( selectTotal > 0 && total > 0 ){
 				try{
-					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, selectTotal, viewSectionIds );
+					subjectInfoList = subjectInfoServiceAdv.listSubjectInSectionForPage( wrapIn.getSearchContent(), wrapIn.getForumId(), wrapIn.getMainSectionId(), wrapIn.getSectionId(), wrapIn.getCreatorName(), wrapIn.getNeedPicture(), selectTopInSection, selectTotal, viewSectionIds ,  wrapIn.getStartTime() ,  wrapIn.getEndTime() );
 					if( subjectInfoList != null ){
 						try {
 							wraps_nonTop = Wo.copier.copy( subjectInfoList );
@@ -308,6 +309,12 @@ public class ActionSubjectListForPage extends BaseAction {
 		@FieldDescribe( "是否包含置顶贴." )
 		private Boolean withTopSubject = false; // 是否包含置顶贴
 		
+		@FieldDescribe( "创建日期开始." )
+		private Date startTime = null; 
+		
+		@FieldDescribe( "创建日期结束." )
+		private Date endTime = null; 
+		
 		public static List<String> Excludes = new ArrayList<String>( JpaObject.FieldsUnmodify );
 	
 		
@@ -413,6 +420,21 @@ public class ActionSubjectListForPage extends BaseAction {
 			return sb.toString();
 		}
 		
+		public Date getStartTime() {
+			return startTime;
+		}
+		public void setStartTime(Date startTime) {
+			this.startTime = startTime;
+		}
+		public Date getEndTime() {
+			return endTime;
+		}
+		public void setEndTime(Date endTime) {
+			this.endTime = endTime;
+		}
+		
+		
+		
 	}
 	
 	public static class Wo extends BBSSubjectInfo{

+ 2 - 2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java

@@ -651,7 +651,7 @@ public class BBSSubjectInfoService {
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
-			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds );
+			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds,null,null );
 		}catch( Exception e ){
 			throw e;
 		}
@@ -664,7 +664,7 @@ public class BBSSubjectInfoService {
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
-			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds );
+			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds ,null,null );
 		}catch( Exception e ){
 			throw e;
 		}

+ 4 - 4
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoServiceAdv.java

@@ -329,7 +329,7 @@ public class BBSSubjectInfoServiceAdv {
 		}
 	}
 
-	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds ) throws Exception {
+	public List<BBSSubjectInfo> listSubjectInSectionForPage( String searchTitle, String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, Integer maxRecordCount, List<String> viewSectionIds,Date startTime , Date endTime ) throws Exception {
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 			return null;
 		}
@@ -339,7 +339,7 @@ public class BBSSubjectInfoServiceAdv {
 		Business business = null;
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
-			return business.subjectInfoFactory().listSubjectInSectionForPage( searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds );
+			return business.subjectInfoFactory().listSubjectInSectionForPage(searchTitle, forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, maxRecordCount, viewSectionIds , startTime , endTime);
 		}catch( Exception e ){
 			throw e;
 		}
@@ -347,7 +347,7 @@ public class BBSSubjectInfoServiceAdv {
 	
 	public Long countSubjectInSectionForPage( String searchTitle,
 			String forumId, String mainSectionId, String sectionId, String creatorName, Boolean needPicture, Boolean isTopSubject, 
-			List<String> viewSectionIds ) throws Exception {
+			List<String> viewSectionIds , Date startTime , Date endTime) throws Exception {
 		if( viewSectionIds == null || viewSectionIds.isEmpty() ){
 			return 0L;
 		}
@@ -355,7 +355,7 @@ public class BBSSubjectInfoServiceAdv {
 		try ( EntityManagerContainer emc = EntityManagerContainerFactory.instance().create() ) {
 			business = new Business(emc);
 			return business.subjectInfoFactory().countSubjectInSectionForPage( searchTitle,
-					forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds );
+					forumId, mainSectionId, sectionId, creatorName, needPicture, isTopSubject, viewSectionIds ,  startTime ,  endTime);
 		}catch( Exception e ){
 			throw e;
 		}

+ 5 - 2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/queue/QueueDataRowImport.java

@@ -19,6 +19,8 @@ import com.x.cms.core.entity.Document;
 import com.x.cms.core.entity.content.Data;
 
 public class QueueDataRowImport extends AbstractQueue<ImportDataRow> {
+
+	private CmsBatchOperationProcessService cmsBatchOperationProcessService = new CmsBatchOperationProcessService();
 	
 	public void execute( ImportDataRow dataRow ) throws Exception {
 		int curRow = dataRow.getCurRow();
@@ -114,9 +116,10 @@ public class QueueDataRowImport extends AbstractQueue<ImportDataRow> {
 				}
 
 				if(flag) {
-					new CmsBatchOperationPersistService().addOperation(
+					cmsBatchOperationProcessService.refreshDocumentReview(document.getId());
+					/*new CmsBatchOperationPersistService().addOperation(
 							CmsBatchOperationProcessService.OPT_OBJ_DOCUMENT,
-							CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "导入新文档:ID=" + document.getId());
+							CmsBatchOperationProcessService.OPT_TYPE_PERMISSION, document.getId(), document.getId(), "导入新文档:ID=" + document.getId());*/
 				}
 			}else {
 				System.out.println("数据导入不成功,propertyNames为空,无法识别数据列对应的属性!");

+ 48 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/service/CmsBatchOperationProcessService.java

@@ -276,6 +276,54 @@ public class CmsBatchOperationProcessService {
 		CacheManager.notify( Document.class );
 	}
 
+	/**
+	 * 根据数据库中的文档的信息,重新计算文档的Review信息
+	 * 全部删除,然后再重新插入Review记录
+	 * @param docId
+	 * @throws Exception
+	 */
+	public void refreshDocumentReview(String docId ) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			reviewService.refreshDocumentReview( emc, docId );
+
+			Document document = emc.find( docId, Document.class );
+			if( document != null ) {
+				emc.beginTransaction( Document.class );
+				document.setReviewed( true );
+
+				if( StringUtils.isEmpty( document.getAppAlias()  )) {
+					document.setAppAlias( document.getAppName() );
+				}
+
+				document.setSequenceAppAlias( document.getAppAlias() + document.getId() );
+				document.setSequenceCategoryAlias( document.getCategoryAlias() + document.getId() );
+				if( StringUtils.isNotEmpty( document.getTitle() ) && document.getTitle().length() > 30 ) {
+					document.setSequenceTitle( document.getTitle().substring(0, 30) + document.getId() );
+				}else {
+					document.setSequenceTitle( document.getTitle() + document.getId() );
+				}
+				if( StringUtils.isNotEmpty( document.getCreatorPerson() ) && document.getCreatorPerson().length() > 50 ) {
+					document.setSequenceCreatorPerson( document.getCreatorPerson().substring(0, 50) + document.getId() );
+				}else {
+					document.setSequenceCreatorPerson( document.getCreatorPerson() + document.getId() );
+				}
+				if( StringUtils.isNotEmpty( document.getCreatorUnitName() ) && document.getCreatorUnitName().length() > 50 ) {
+					document.setSequenceCreatorUnitName( document.getCreatorUnitName().substring(0, 50) + document.getId() );
+				}else {
+					document.setSequenceCreatorUnitName( document.getCreatorUnitName() + document.getId() );
+				}
+
+				emc.check( document, CheckPersistType.all );
+				emc.commit();
+			}
+		} catch (Exception e) {
+			logger.warn("refreshDocumentReview error:{}",e.getMessage());
+		}finally {
+			CacheManager.notify( Review.class );
+			CacheManager.notify( Document.class );
+		}
+	}
+
 
 	/**
 	 * 将栏目下所有的文档删除,最后删除当前的批处理信息

+ 2 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/ActionApplication.java

@@ -8,6 +8,7 @@ import com.x.base.core.project.jaxrs.AbstractActionApplication;
 import com.x.general.assemble.control.jaxrs.area.AreaAction;
 import com.x.general.assemble.control.jaxrs.ecnet.EcnetAction;
 import com.x.general.assemble.control.jaxrs.office.OfficeAction;
+import com.x.general.assemble.control.jaxrs.file.GeneralFileAction;
 import com.x.general.assemble.control.jaxrs.worktime.WorkTimeAction;
 
 @ApplicationPath("jaxrs")
@@ -18,6 +19,7 @@ public class ActionApplication extends AbstractActionApplication {
 		classes.add(EcnetAction.class);
 		classes.add(OfficeAction.class);
 		classes.add(WorkTimeAction.class);
+		classes.add(GeneralFileAction.class);
 		return classes;
 	}
 

+ 10 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/FileJaxrsFilter.java

@@ -0,0 +1,10 @@
+package com.x.general.assemble.control.jaxrs;
+
+import com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter;
+
+import javax.servlet.annotation.WebFilter;
+
+@WebFilter(urlPatterns = "/jaxrs/generalfile/*", asyncSupported = true)
+public class FileJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
+
+}

+ 54 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/ActionGeneralFile.java

@@ -0,0 +1,54 @@
+package com.x.general.assemble.control.jaxrs.file;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.config.StorageMapping;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WoFile;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.general.assemble.control.ThisApplication;
+import com.x.general.core.entity.file.GeneralFile;
+
+
+public class ActionGeneralFile extends BaseAction {
+
+    private static Logger logger = LoggerFactory.getLogger(ActionGeneralFile.class);
+
+    protected ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
+        logger.debug(effectivePerson, "flag:{}.", flag);
+        ActionResult<Wo> result = new ActionResult<>();
+        Wo wo = null;
+        try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+            GeneralFile generalFile = emc.find(flag, GeneralFile.class);
+            if(generalFile!=null){
+                StorageMapping gfMapping = ThisApplication.context().storageMappings().get(GeneralFile.class,
+                        generalFile.getStorage());
+                wo = new Wo(generalFile.readContent(gfMapping), this.contentType(false, generalFile.getName()),
+                        this.contentDisposition(false, generalFile.getName()));
+                result.setData(wo);
+
+                generalFile.deleteContent(gfMapping);
+                emc.beginTransaction(GeneralFile.class);
+                emc.delete(GeneralFile.class, generalFile.getId());
+                emc.commit();
+            } else {
+                throw new ExceptionInputFileObject(flag);
+            }
+
+        }
+        result.setData(wo);
+        return result;
+
+    }
+
+    public static class Wo extends WoFile {
+
+        public Wo(byte[] bytes, String contentType, String contentDisposition) {
+            super(bytes, contentType, contentDisposition);
+        }
+
+    }
+
+}

+ 7 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/BaseAction.java

@@ -0,0 +1,7 @@
+package com.x.general.assemble.control.jaxrs.file;
+
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+abstract class BaseAction extends StandardJaxrsAction {
+
+}

+ 13 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/ExceptionInputFileObject.java

@@ -0,0 +1,13 @@
+package com.x.general.assemble.control.jaxrs.file;
+
+import com.x.base.core.project.exception.PromptException;
+
+public class ExceptionInputFileObject extends PromptException {
+
+    private static final long serialVersionUID = 9085364457175859374L;
+
+    ExceptionInputFileObject(String flag) {
+        super("对象不存在:{}.", flag);
+    }
+
+}

+ 43 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/file/GeneralFileAction.java

@@ -0,0 +1,43 @@
+package com.x.general.assemble.control.jaxrs.file;
+
+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.jaxrs.ResponseFactory;
+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 javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+@Path("generalfile")
+@JaxrsDescribe("获取附件")
+public class GeneralFileAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(GeneralFileAction.class);
+
+	@JaxrsMethodDescribe(value = "获取附件.", action = ActionGeneralFile.class)
+	@GET
+	@Path("flag/{flag}")
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getResult(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+						  @JaxrsParameterDescribe("附件标记") @PathParam("flag") String flag) {
+		ActionResult<ActionGeneralFile.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGeneralFile().execute(effectivePerson, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+}

+ 26 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/ActionIsHoliday.java

@@ -0,0 +1,26 @@
+package com.x.general.assemble.control.jaxrs.worktime;
+
+import java.util.Date;
+
+import com.x.base.core.project.config.Config;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WrapBoolean;
+import com.x.base.core.project.tools.DateTools;
+
+public class ActionIsHoliday extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String date) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Date dateObject = DateTools.parse(date);
+		Wo wo = new Wo();
+		wo.setValue(!Config.workTime().isWorkDay(dateObject));
+		result.setData(wo);
+		return result;
+	}
+
+	public static class Wo extends WrapBoolean {
+
+	}
+
+}

+ 18 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/jaxrs/worktime/WorkTimeAction.java

@@ -138,4 +138,22 @@ public class WorkTimeAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
+	@JaxrsMethodDescribe(value = "返回指定时间是否是节假日.", action = ActionIsHoliday.class)
+	@GET
+	@Path("isholiday/{date}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void isHoliday(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("指定日期") @PathParam("date") String date) {
+		ActionResult<ActionIsHoliday.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionIsHoliday().execute(effectivePerson, date);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
 }

+ 17 - 21
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionListWithWorkOrWorkCompleted.java

@@ -5,6 +5,7 @@ import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -12,6 +13,7 @@ import org.apache.commons.lang3.BooleanUtils;
 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;
@@ -31,14 +33,24 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 
 		ActionResult<List<Wo>> result = new ActionResult<>();
+		CompletableFuture<List<Wo>> listFuture = listFuture(effectivePerson, workOrWorkCompleted);
+		CompletableFuture<Boolean> checkControlFuture = checkControlFuture(effectivePerson, workOrWorkCompleted);
+		result.setData(listFuture.get(10, TimeUnit.SECONDS));
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
+			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
+		}
+		return result;
+
+	}
 
-		CompletableFuture<List<Wo>> _wos = CompletableFuture.supplyAsync(() -> {
+	private CompletableFuture<List<Wo>> listFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
 			List<Wo> wos = new ArrayList<>();
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
 				List<String> identities = business.organization().identity().listWithPerson(effectivePerson);
 				List<String> units = business.organization().unit().listWithPerson(effectivePerson);
-				final String job = business.job().findWithWorkOrWorkCompleted(workOrWorkCompleted);
+				final String job = business.job().findWithWorkOrWorkCompleted(flag);
 				for (Attachment attachment : business.entityManagerContainer().listEqual(Attachment.class,
 						Attachment.job_FIELDNAME, job)) {
 					Wo wo = Wo.copier.copy(attachment);
@@ -63,25 +75,6 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 			return wos;
 		});
 
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
-			}
-			return value;
-		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-		}
-
-		result.setData(_wos.get());
-
-		return result;
 	}
 
 	public static class Wo extends Attachment {
@@ -105,8 +98,11 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 
 	public static class WoControl extends GsonPropertyObject {
 		private static final long serialVersionUID = -7283783148043076205L;
+		@FieldDescribe("可读")
 		private Boolean allowRead = false;
+		@FieldDescribe("可写")
 		private Boolean allowEdit = false;
+		@FieldDescribe("可控制")
 		private Boolean allowControl = false;
 
 		public Boolean getAllowRead() {

+ 30 - 10
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/BaseAction.java

@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.surface.jaxrs.attachment;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CompletableFuture;
 
 import javax.persistence.EntityManager;
 import javax.persistence.criteria.CriteriaBuilder;
@@ -13,9 +14,14 @@ import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
 
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.EffectivePerson;
 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 com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.StringTools;
 import com.x.processplatform.assemble.surface.Business;
@@ -24,6 +30,8 @@ import com.x.processplatform.core.entity.content.Attachment_;
 
 abstract class BaseAction extends StandardJaxrsAction {
 
+	private static Logger logger = LoggerFactory.getLogger(BaseAction.class);
+
 	public static class WiExtraParam {
 		private String site;
 
@@ -176,13 +184,12 @@ abstract class BaseAction extends StandardJaxrsAction {
 	public boolean read(Attachment attachment, EffectivePerson effectivePerson, List<String> identities,
 			List<String> units, Business business) throws Exception {
 		boolean value = false;
-		if (ListTools.isEmpty(attachment.getReadIdentityList())
-				&& ListTools.isEmpty(attachment.getReadUnitList())) {
+		if (ListTools.isEmpty(attachment.getReadIdentityList()) && ListTools.isEmpty(attachment.getReadUnitList())) {
 			value = true;
-		}else if (ListTools.containsAny(identities, attachment.getReadIdentityList())
-					|| ListTools.containsAny(units, attachment.getReadUnitList())) {
+		} else if (ListTools.containsAny(identities, attachment.getReadIdentityList())
+				|| ListTools.containsAny(units, attachment.getReadUnitList())) {
 			value = true;
-		}else{
+		} else {
 			value = this.edit(attachment, effectivePerson, identities, units, business);
 		}
 		return value;
@@ -191,13 +198,12 @@ abstract class BaseAction extends StandardJaxrsAction {
 	public boolean edit(Attachment attachment, EffectivePerson effectivePerson, List<String> identities,
 			List<String> units, Business business) throws Exception {
 		boolean value = false;
-		if (ListTools.isEmpty(attachment.getEditIdentityList())
-				&& ListTools.isEmpty(attachment.getEditUnitList())) {
+		if (ListTools.isEmpty(attachment.getEditIdentityList()) && ListTools.isEmpty(attachment.getEditUnitList())) {
 			value = true;
-		}else if (ListTools.containsAny(identities, attachment.getEditIdentityList())
-					|| ListTools.containsAny(units, attachment.getEditUnitList())) {
+		} else if (ListTools.containsAny(identities, attachment.getEditIdentityList())
+				|| ListTools.containsAny(units, attachment.getEditUnitList())) {
 			value = true;
-		}else{
+		} else {
 			value = this.control(attachment, effectivePerson, identities, units, business);
 		}
 		return value;
@@ -221,4 +227,18 @@ abstract class BaseAction extends StandardJaxrsAction {
 		}
 		return value;
 	}
+
+	protected CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
+			Boolean value = false;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag,
+						new ExceptionEntityNotExist(flag));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return value;
+		});
+	}
 }

+ 12 - 21
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/ActionGetWorkOrWorkCompleted.java

@@ -3,13 +3,13 @@ package com.x.processplatform.assemble.surface.jaxrs.control;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.lang3.BooleanUtils;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
-import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Logger;
@@ -47,7 +47,17 @@ class ActionGetWorkOrWorkCompleted extends BaseAction {
 
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
-		CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
+		CompletableFuture<Wo> getFuture = this.getFuture(effectivePerson, workOrWorkCompleted);
+		CompletableFuture<Boolean> checkControlFuture = this.checkControlFuture(effectivePerson, workOrWorkCompleted);
+		result.setData(getFuture.get(10, TimeUnit.SECONDS));
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
+			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
+		}
+		return result;
+	}
+
+	private CompletableFuture<Wo> getFuture(EffectivePerson effectivePerson, String workOrWorkCompleted) {
+		return CompletableFuture.supplyAsync(() -> {
 			Wo wo = null;
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
@@ -65,25 +75,6 @@ class ActionGetWorkOrWorkCompleted extends BaseAction {
 			}
 			return wo;
 		});
-
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
-			}
-			return value;
-		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-		}
-
-		result.setData(_wo.get());
-		return result;
 	}
 
 	private Wo workCompleted(Business business, EffectivePerson effectivePerson, WorkCompleted workCompleted)

+ 25 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/control/BaseAction.java

@@ -1,10 +1,21 @@
 package com.x.processplatform.assemble.surface.jaxrs.control;
 
+import java.util.concurrent.CompletableFuture;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.GsonPropertyObject;
+import com.x.base.core.project.http.EffectivePerson;
 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 com.x.processplatform.assemble.surface.Business;
 
 abstract class BaseAction extends StandardJaxrsAction {
 
+	private static Logger logger = LoggerFactory.getLogger(BaseAction.class);
+
 	protected static class AbstractControl extends GsonPropertyObject {
 		/* 是否可以看到 */
 		private Boolean allowVisit = false;
@@ -119,4 +130,18 @@ abstract class BaseAction extends StandardJaxrsAction {
 
 	}
 
+	protected CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
+			Boolean value = false;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag,
+						new ExceptionEntityNotExist(flag));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return value;
+		});
+	}
+
 }

+ 77 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java

@@ -1,18 +1,33 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
 
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.project.cache.Cache.CacheCategory;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
 import com.x.base.core.project.jaxrs.WoMaxAgeFastETag;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedForm;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedScript;
 import com.x.processplatform.core.entity.element.Form;
+import com.x.processplatform.core.entity.element.FormProperties;
 import com.x.processplatform.core.entity.element.Script;
 
 abstract class BaseAction extends StandardJaxrsAction {
 
+	private static Logger logger = LoggerFactory.getLogger(BaseAction.class);
+
+	
 	CacheCategory cacheCategory = new CacheCategory(Form.class, Script.class, com.x.portal.core.entity.Script.class,
 			com.x.cms.core.entity.element.Script.class);
 
@@ -52,4 +67,66 @@ abstract class BaseAction extends StandardJaxrsAction {
 
 	}
 
+	protected Map<String, RelatedScript> convertScript(Business bus, FormProperties properties) throws Exception {
+		Map<String, RelatedScript> map = new TreeMap<>();
+		for (Entry<String, String> entry : properties.getMobileRelatedScriptMap().entrySet()) {
+			switch (entry.getValue()) {
+			case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
+				Script pp = bus.script().pick(entry.getKey());
+				if (null != pp) {
+					map.put(entry.getKey(),
+							new RelatedScript(pp.getId(), pp.getName(), pp.getAlias(), pp.getText(), entry.getValue()));
+				}
+				break;
+			case WorkCompletedProperties.RelatedScript.TYPE_CMS:
+				com.x.cms.core.entity.element.Script cms = bus.cms().script().pick(entry.getKey());
+				if (null != cms) {
+					map.put(entry.getKey(), new RelatedScript(cms.getId(), cms.getName(), cms.getAlias(), cms.getText(),
+							entry.getValue()));
+				}
+				break;
+			case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
+				com.x.portal.core.entity.Script p = bus.portal().script().pick(entry.getKey());
+				if (null != p) {
+					map.put(entry.getKey(),
+							new RelatedScript(p.getId(), p.getName(), p.getAlias(), p.getText(), entry.getValue()));
+				}
+				break;
+			default:
+				break;
+			}
+		}
+		return map;
+	}
+
+	protected List<String> convertScriptToCacheTag(Business business, Map<String, String> map) throws Exception {
+		List<String> list = new ArrayList<>();
+		for (Entry<String, String> entry : map.entrySet()) {
+			switch (entry.getValue()) {
+			case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
+				Script pp = business.script().pick(entry.getKey());
+				if (null != pp) {
+					list.add(pp.getId() + pp.getUpdateTime().getTime());
+				}
+				break;
+			case WorkCompletedProperties.RelatedScript.TYPE_CMS:
+				com.x.cms.core.entity.element.Script cms = business.cms().script().pick(entry.getKey());
+				if (null != cms) {
+					list.add(cms.getId() + cms.getUpdateTime().getTime());
+				}
+				break;
+			case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
+				com.x.portal.core.entity.Script p = business.portal().script().pick(entry.getKey());
+				if (null != p) {
+					list.add(p.getId() + p.getUpdateTime().getTime());
+				}
+				break;
+			default:
+				break;
+			}
+		}
+		return list;
+	}
+
+
 }

+ 34 - 56
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2Get.java

@@ -1,10 +1,10 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.TreeMap;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -17,12 +17,10 @@ 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.processplatform.assemble.surface.Business;
-import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedForm;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedScript;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.FormProperties;
-import com.x.processplatform.core.entity.element.Script;
 
 class V2Get extends BaseAction {
 
@@ -35,36 +33,41 @@ class V2Get extends BaseAction {
 		if (optional.isPresent()) {
 			result.setData((Wo) optional.get());
 		} else {
-			Wo wo = this.get(id);
+			Form form = null;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				form = business.form().pick(id);
+			}
+			if (null == form) {
+				throw new ExceptionEntityNotExist(id, Form.class);
+			}
+			Wo wo = new Wo();
+			final FormProperties properties = form.getProperties();
+			wo.setFastETag(form.getId() + form.getUpdateTime().getTime());
+			wo.setForm(new RelatedForm(form, form.getDataOrMobileData()));
+			CompletableFuture<Map<String, RelatedForm>> getRelatedFormFuture = this.getRelatedFormFuture(properties);
+			CompletableFuture<Map<String, RelatedScript>> getRelatedScriptFuture = this
+					.getRelatedScriptFuture(properties);
+			wo.setRelatedFormMap(getRelatedFormFuture.get(10, TimeUnit.SECONDS));
+			wo.setRelatedScriptMap(getRelatedScriptFuture.get(10, TimeUnit.SECONDS));
+			wo.setMaxAge(3600 * 24);
 			CacheManager.put(cacheCategory, cacheKey, wo);
 			result.setData(wo);
 		}
 		return result;
 	}
 
-	private Wo get(String id) throws Exception {
-		Form form = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			form = business.form().pick(id);
-		}
-		if (null == form) {
-			throw new ExceptionEntityNotExist(id, Form.class);
-		}
-		Wo wo = new Wo();
-		final FormProperties properties = form.getProperties();
-		wo.setFastETag(form.getId() + form.getUpdateTime().getTime());
-		wo.setForm(new RelatedForm(form, form.getDataOrMobileData()));
-		CompletableFuture<Map<String, RelatedForm>> _relatedForm = CompletableFuture.supplyAsync(() -> {
+	private CompletableFuture<Map<String, RelatedForm>> getRelatedFormFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
 			Map<String, RelatedForm> map = new TreeMap<>();
 			if (ListTools.isNotEmpty(properties.getRelatedFormList())) {
 				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 					Business bus = new Business(emc);
-					Form _f;
-					for (String _id : properties.getRelatedFormList()) {
-						_f = bus.form().pick(_id);
-						if (null != _f) {
-							map.put(_id, new RelatedForm(_f, _f.getDataOrMobileData()));
+					Form f;
+					for (String id : properties.getRelatedFormList()) {
+						f = bus.form().pick(id);
+						if (null != f) {
+							map.put(id, new RelatedForm(f, f.getDataOrMobileData()));
 						}
 					}
 				} catch (Exception e) {
@@ -73,52 +76,27 @@ class V2Get extends BaseAction {
 			}
 			return map;
 		});
-		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+	}
+
+	private CompletableFuture<Map<String, RelatedScript>> getRelatedScriptFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
 			Map<String, RelatedScript> map = new TreeMap<>();
 			if ((null != properties.getRelatedScriptMap()) && (properties.getRelatedScriptMap().size() > 0)) {
 				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					Business bus = new Business(emc);
-					for (Entry<String, String> entry : properties.getRelatedScriptMap().entrySet()) {
-						switch (entry.getValue()) {
-						case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
-							Script _pp = bus.script().pick(entry.getKey());
-							if (null != _pp) {
-								map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
-										_pp.getText(), entry.getValue()));
-							}
-							break;
-						case WorkCompletedProperties.RelatedScript.TYPE_CMS:
-							com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
-							if (null != _cms) {
-								map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
-										_cms.getText(), entry.getValue()));
-							}
-							break;
-						case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
-							com.x.portal.core.entity.Script _p = bus.portal().script().pick(entry.getKey());
-							if (null != _p) {
-								map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
-										_p.getText(), entry.getValue()));
-							}
-							break;
-						default:
-							break;
-						}
-					}
+					Business business = new Business(emc);
+					map = convertScript(business, properties);
 				} catch (Exception e) {
 					logger.error(e);
 				}
 			}
 			return map;
 		});
-		wo.setRelatedFormMap(_relatedForm.get());
-		wo.setRelatedScriptMap(_relatedScript.get());
-		wo.setMaxAge(3600 * 24);
-		return wo;
 	}
 
 	public static class Wo extends AbstractWo {
 
+		private static final long serialVersionUID = 2776033956637839042L;
+
 	}
 
 }

+ 34 - 56
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2GetMobile.java

@@ -1,10 +1,10 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.TreeMap;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -17,12 +17,10 @@ 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.processplatform.assemble.surface.Business;
-import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedForm;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.RelatedScript;
 import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.FormProperties;
-import com.x.processplatform.core.entity.element.Script;
 
 class V2GetMobile extends BaseAction {
 
@@ -35,36 +33,41 @@ class V2GetMobile extends BaseAction {
 		if (optional.isPresent()) {
 			result.setData((Wo) optional.get());
 		} else {
-			Wo wo = this.get(id);
+			Form form = null;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				form = business.form().pick(id);
+			}
+			if (null == form) {
+				throw new ExceptionEntityNotExist(id, Form.class);
+			}
+			Wo wo = new Wo();
+			final FormProperties properties = form.getProperties();
+			wo.setFastETag(form.getId() + form.getUpdateTime().getTime());
+			wo.setForm(new RelatedForm(form, form.getMobileDataOrData()));
+			CompletableFuture<Map<String, RelatedForm>> getRelatedFormFuture = this.getRelatedFormFuture(properties);
+			CompletableFuture<Map<String, RelatedScript>> getRelatedScriptFuture = this
+					.getRelatedScriptFuture(properties);
+			wo.setRelatedFormMap(getRelatedFormFuture.get(10, TimeUnit.SECONDS));
+			wo.setRelatedScriptMap(getRelatedScriptFuture.get(10, TimeUnit.SECONDS));
+			wo.setMaxAge(3600 * 24);
 			CacheManager.put(cacheCategory, cacheKey, wo);
 			result.setData(wo);
 		}
 		return result;
 	}
 
-	private Wo get(String id) throws Exception {
-		Form form = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			form = business.form().pick(id);
-		}
-		if (null == form) {
-			throw new ExceptionEntityNotExist(id, Form.class);
-		}
-		Wo wo = new Wo();
-		final FormProperties properties = form.getProperties();
-		wo.setFastETag(form.getId() + form.getUpdateTime().getTime());
-		wo.setForm(new RelatedForm(form, form.getMobileDataOrData()));
-		CompletableFuture<Map<String, RelatedForm>> _relatedForm = CompletableFuture.supplyAsync(() -> {
+	private CompletableFuture<Map<String, RelatedForm>> getRelatedFormFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
 			Map<String, RelatedForm> map = new TreeMap<>();
 			if (ListTools.isNotEmpty(properties.getMobileRelatedFormList())) {
 				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 					Business bus = new Business(emc);
-					Form _f;
-					for (String _id : properties.getMobileRelatedFormList()) {
-						_f = bus.form().pick(_id);
-						if (null != _f) {
-							map.put(_id, new RelatedForm(_f, _f.getMobileDataOrData()));
+					Form f;
+					for (String id : properties.getMobileRelatedFormList()) {
+						f = bus.form().pick(id);
+						if (null != f) {
+							map.put(id, new RelatedForm(f, f.getMobileDataOrData()));
 						}
 					}
 				} catch (Exception e) {
@@ -73,53 +76,28 @@ class V2GetMobile extends BaseAction {
 			}
 			return map;
 		});
-		CompletableFuture<Map<String, RelatedScript>> _relatedScript = CompletableFuture.supplyAsync(() -> {
+	}
+
+	private CompletableFuture<Map<String, RelatedScript>> getRelatedScriptFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
 			Map<String, RelatedScript> map = new TreeMap<>();
 			if ((null != properties.getMobileRelatedScriptMap())
 					&& (properties.getMobileRelatedScriptMap().size() > 0)) {
 				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					Business bus = new Business(emc);
-					for (Entry<String, String> entry : properties.getMobileRelatedScriptMap().entrySet()) {
-						switch (entry.getValue()) {
-						case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
-							Script _pp = bus.script().pick(entry.getKey());
-							if (null != _pp) {
-								map.put(entry.getKey(), new RelatedScript(_pp.getId(), _pp.getName(), _pp.getAlias(),
-										_pp.getText(), entry.getValue()));
-							}
-							break;
-						case WorkCompletedProperties.RelatedScript.TYPE_CMS:
-							com.x.cms.core.entity.element.Script _cms = bus.cms().script().pick(entry.getKey());
-							if (null != _cms) {
-								map.put(entry.getKey(), new RelatedScript(_cms.getId(), _cms.getName(), _cms.getAlias(),
-										_cms.getText(), entry.getValue()));
-							}
-							break;
-						case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
-							com.x.portal.core.entity.Script _p = bus.portal().script().pick(entry.getKey());
-							if (null != _p) {
-								map.put(entry.getKey(), new RelatedScript(_p.getId(), _p.getName(), _p.getAlias(),
-										_p.getText(), entry.getValue()));
-							}
-							break;
-						default:
-							break;
-						}
-					}
+					Business business = new Business(emc);
+					map = convertScript(business, properties);
 				} catch (Exception e) {
 					logger.error(e);
 				}
 			}
 			return map;
 		});
-		wo.setRelatedFormMap(_relatedForm.get());
-		wo.setRelatedScriptMap(_relatedScript.get());
-		wo.setMaxAge(3600 * 24);
-		return wo;
 	}
 
 	public static class Wo extends AbstractWo {
 
+		private static final long serialVersionUID = 6413992232196084934L;
+
 	}
 
 }

+ 79 - 138
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java

@@ -1,14 +1,13 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.ArrayList;
 import java.util.List;
-import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
-import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.container.EntityManagerContainer;
@@ -16,8 +15,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.cache.Cache.CacheKey;
 import com.x.base.core.project.cache.CacheManager;
-import com.x.base.core.project.exception.ExceptionAccessDenied;
-import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
@@ -27,172 +24,116 @@ import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
-import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.StoreForm;
 import com.x.processplatform.core.entity.element.Activity;
 import com.x.processplatform.core.entity.element.Form;
-import com.x.processplatform.core.entity.element.Script;
+import com.x.processplatform.core.entity.element.FormProperties;
 
 class V2LookupWorkOrWorkCompleted extends BaseAction {
 
 	private static Logger logger = LoggerFactory.getLogger(V2LookupWorkOrWorkCompleted.class);
 
+	private Form form = null;
+	private Wo wo = new Wo();
+
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 
 		ActionResult<Wo> result = new ActionResult<>();
 
-		CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-			Wo wo = new Wo();
-			try {
-				Work work = null;
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					work = emc.fetch(workOrWorkCompleted, Work.class, ListTools.toList(JpaObject.id_FIELDNAME,
-							Work.form_FIELDNAME, Work.activity_FIELDNAME, Work.activityType_FIELDNAME));
-				}
-				if (null != work) {
-					wo = this.work(work);
-				} else {
-					WorkCompleted workCompleted = null;
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
-					}
-					if (null != workCompleted) {
-						wo = this.workCompleted(workCompleted);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e);
-			}
-			return wo;
-		});
-
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
+		this.getWorkWorkCompletedForm(workOrWorkCompleted);
+
+		if (null != this.form) {
+			CacheKey cacheKey = new CacheKey(this.getClass(), this.form.getId());
+			Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+			if (optional.isPresent()) {
+				this.wo = (Wo) optional.get();
+			} else {
+				List<String> list = new ArrayList<>();
+				CompletableFuture<List<String>> relatedFormFuture = this.relatedFormFuture(this.form.getProperties());
+				CompletableFuture<List<String>> relatedScriptFuture = this
+						.relatedScriptFuture(this.form.getProperties());
+				list.add(this.form.getId() + this.form.getUpdateTime().getTime());
+				list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
+				list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
+				list = list.stream().sorted().collect(Collectors.toList());
+				this.wo.setId(this.form.getId());
+				CRC32 crc = new CRC32();
+				crc.update(StringUtils.join(list, "#").getBytes());
+				this.wo.setCacheTag(crc.getValue() + "");
+				CacheManager.put(cacheCategory, cacheKey, wo);
 			}
-			return value;
-		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
 		}
-		result.setData(_wo.get());
+		result.setData(wo);
 		return result;
 	}
 
-	private Wo work(Work work) throws Exception {
-		Form form = null;
+	private void getWorkWorkCompletedForm(String flag) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
-			form = business.form().pick(work.getForm());
-			if (null == form) {
-				Activity activity = business.getActivity(work);
-				if (null != activity) {
-					form = business.form().pick(activity.getForm());
+			WorkCompleted workCompleted = null;
+			Work work = emc.fetch(flag, Work.class, ListTools.toList(JpaObject.id_FIELDNAME, Work.form_FIELDNAME,
+					Work.activity_FIELDNAME, Work.activityType_FIELDNAME));
+			if (null == work) {
+				workCompleted = emc.flag(flag, WorkCompleted.class);
+			}
+			if (null != work) {
+				this.form = business.form().pick(work.getForm());
+				if (null == this.form) {
+					Activity activity = business.getActivity(work);
+					if (null != activity) {
+						this.form = business.form().pick(activity.getForm());
+					}
+				}
+			} else if (null != workCompleted) {
+				this.form = business.form().pick(workCompleted.getForm());
+				if (null == this.form) {
+					StoreForm storeForm = workCompleted.getProperties().getStoreForm();
+					this.wo = XGsonBuilder.convert(storeForm, Wo.class);
 				}
 			}
 		}
-		if (null != form) {
-			return this.get(form);
-		}
-		return new Wo();
 	}
 
-	private Wo get(Form form) throws Exception {
-		CacheKey cacheKey = new CacheKey(this.getClass(), form.getId());
-		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
-		if (optional.isPresent()) {
-			return (Wo) optional.get();
-		} else {
-			final List<String> list = new CopyOnWriteArrayList<>();
-			CompletableFuture<Void> _relatedForm = CompletableFuture.runAsync(() -> {
-				if (ListTools.isNotEmpty(form.getProperties().getRelatedFormList())) {
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						Business business = new Business(emc);
-						Form _f;
-						for (String _id : form.getProperties().getRelatedFormList()) {
-							_f = business.form().pick(_id);
-							if (null != _f) {
-								list.add(_f.getId() + _f.getUpdateTime().getTime());
-							}
-						}
-					} catch (Exception e) {
-						logger.error(e);
-					}
-				}
-			});
-			CompletableFuture<Void> _relatedScript = CompletableFuture.runAsync(() -> {
-				if ((null != form.getProperties().getRelatedScriptMap())
-						&& (form.getProperties().getRelatedScriptMap().size() > 0)) {
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						Business business = new Business(emc);
-						for (Entry<String, String> entry : form.getProperties().getRelatedScriptMap().entrySet()) {
-							switch (entry.getValue()) {
-							case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
-								Script _pp = business.script().pick(entry.getKey());
-								if (null != _pp) {
-									list.add(_pp.getId() + _pp.getUpdateTime().getTime());
-								}
-								break;
-							case WorkCompletedProperties.RelatedScript.TYPE_CMS:
-								com.x.cms.core.entity.element.Script _cms = business.cms().script()
-										.pick(entry.getKey());
-								if (null != _cms) {
-									list.add(_cms.getId() + _cms.getUpdateTime().getTime());
-								}
-								break;
-							case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
-								com.x.portal.core.entity.Script _p = business.portal().script().pick(entry.getKey());
-								if (null != _p) {
-									list.add(_p.getId() + _p.getUpdateTime().getTime());
-								}
-								break;
-							default:
-								break;
-							}
+	private CompletableFuture<List<String>> relatedFormFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<String> list = new ArrayList<>();
+			if (ListTools.isNotEmpty(properties.getRelatedFormList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					Form f;
+					for (String id : properties.getRelatedFormList()) {
+						f = business.form().pick(id);
+						if (null != f) {
+							list.add(f.getId() + f.getUpdateTime().getTime());
 						}
-					} catch (Exception e) {
-						logger.error(e);
 					}
+				} catch (Exception e) {
+					logger.error(e);
 				}
-			});
-			_relatedForm.get();
-			_relatedScript.get();
-			list.add(form.getId() + form.getUpdateTime().getTime());
-			List<String> sortList = list.stream().sorted().collect(Collectors.toList());
-			Wo wo = new Wo();
-			wo.setId(form.getId());
-			CRC32 crc = new CRC32();
-			crc.update(StringUtils.join(sortList, "#").getBytes());
-			wo.setCacheTag(crc.getValue() + "");
-			return wo;
-		}
+			}
+			return list;
+		});
 	}
 
-	private Wo workCompleted(WorkCompleted workCompleted) throws Exception {
-		// 先使用当前库的表单,如果不存在使用储存的表单.
-		Wo wo = new Wo();
-		Form form = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			form = business.form().pick(workCompleted.getForm());
-		}
-		if (null != form) {
-			return this.get(form);
-		} else if (null != workCompleted.getProperties().getStoreForm()) {
-			StoreForm storeForm = workCompleted.getProperties().getStoreForm();
-			wo = XGsonBuilder.convert(storeForm, Wo.class);
-		}
-		return wo;
+	private CompletableFuture<List<String>> relatedScriptFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<String> list = new ArrayList<>();
+			if ((null != properties.getRelatedScriptMap()) && (properties.getRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					list = convertScriptToCacheTag(business, properties.getMobileRelatedScriptMap());
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return list;
+		});
 	}
 
 	public static class Wo extends AbstractWo {
 
+		private static final long serialVersionUID = -6321756621818503364L;
+
 		private String id;
 
 		private String cacheTag;

+ 80 - 139
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java

@@ -1,14 +1,13 @@
 package com.x.processplatform.assemble.surface.jaxrs.form;
 
+import java.util.ArrayList;
 import java.util.List;
-import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
-import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import com.x.base.core.container.EntityManagerContainer;
@@ -16,8 +15,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.cache.Cache.CacheKey;
 import com.x.base.core.project.cache.CacheManager;
-import com.x.base.core.project.exception.ExceptionAccessDenied;
-import com.x.base.core.project.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
@@ -27,173 +24,117 @@ import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
-import com.x.processplatform.core.entity.content.WorkCompletedProperties;
 import com.x.processplatform.core.entity.content.WorkCompletedProperties.StoreForm;
 import com.x.processplatform.core.entity.element.Activity;
 import com.x.processplatform.core.entity.element.Form;
-import com.x.processplatform.core.entity.element.Script;
+import com.x.processplatform.core.entity.element.FormProperties;
 
 class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 
 	private static Logger logger = LoggerFactory.getLogger(V2LookupWorkOrWorkCompletedMobile.class);
 
+	private Form form = null;
+	private Wo wo = new Wo();
+
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 
 		ActionResult<Wo> result = new ActionResult<>();
 
-		CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-			Wo wo = new Wo();
-			try {
-				Work work = null;
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					work = emc.fetch(workOrWorkCompleted, Work.class, ListTools.toList(JpaObject.id_FIELDNAME,
-							Work.form_FIELDNAME, Work.activity_FIELDNAME, Work.activityType_FIELDNAME));
-				}
-				if (null != work) {
-					wo = this.work(work);
-				} else {
-					WorkCompleted workCompleted = null;
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
-					}
-					if (null != workCompleted) {
-						wo = this.workCompleted(workCompleted);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e);
-			}
-			return wo;
-		});
-
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
+		this.getWorkWorkCompletedForm(workOrWorkCompleted);
+
+		if (null != this.form) {
+			CacheKey cacheKey = new CacheKey(this.getClass(), this.form.getId());
+			Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
+			if (optional.isPresent()) {
+				this.wo = (Wo) optional.get();
+			} else {
+				List<String> list = new ArrayList<>();
+				CompletableFuture<List<String>> relatedFormFuture = this.relatedFormFuture(this.form.getProperties());
+				CompletableFuture<List<String>> relatedScriptFuture = this
+						.relatedScriptFuture(this.form.getProperties());
+				list.add(this.form.getId() + this.form.getUpdateTime().getTime());
+				list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
+				list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
+				list = list.stream().sorted().collect(Collectors.toList());
+				this.wo.setId(this.form.getId());
+				CRC32 crc = new CRC32();
+				crc.update(StringUtils.join(list, "#").getBytes());
+				this.wo.setCacheTag(crc.getValue() + "");
+				CacheManager.put(cacheCategory, cacheKey, wo);
 			}
-			return value;
-		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
 		}
-		result.setData(_wo.get());
+		result.setData(wo);
 		return result;
 	}
 
-	private Wo work(Work work) throws Exception {
-		Form form = null;
+	private void getWorkWorkCompletedForm(String flag) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
-			form = business.form().pick(work.getForm());
-			if (null == form) {
-				Activity activity = business.getActivity(work);
-				if (null != activity) {
-					form = business.form().pick(activity.getForm());
+			WorkCompleted workCompleted = null;
+			Work work = emc.fetch(flag, Work.class, ListTools.toList(JpaObject.id_FIELDNAME, Work.form_FIELDNAME,
+					Work.activity_FIELDNAME, Work.activityType_FIELDNAME));
+			if (null == work) {
+				workCompleted = emc.flag(flag, WorkCompleted.class);
+			}
+			if (null != work) {
+				this.form = business.form().pick(work.getForm());
+				if (null == this.form) {
+					Activity activity = business.getActivity(work);
+					if (null != activity) {
+						this.form = business.form().pick(activity.getForm());
+					}
+				}
+			} else if (null != workCompleted) {
+				this.form = business.form().pick(workCompleted.getForm());
+				if (null == this.form) {
+					StoreForm storeForm = workCompleted.getProperties().storeForm(true);
+					this.wo = XGsonBuilder.convert(storeForm, Wo.class);
 				}
 			}
 		}
-		if (null != form) {
-			return this.get(form);
-		}
-		return new Wo();
 	}
 
-	private Wo get(Form form) throws Exception {
-		CacheKey cacheKey = new CacheKey(this.getClass(), form.getId());
-		Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);
-		if (optional.isPresent()) {
-			return (Wo) optional.get();
-		} else {
-			final List<String> list = new CopyOnWriteArrayList<>();
-			CompletableFuture<Void> _relatedForm = CompletableFuture.runAsync(() -> {
-				if (ListTools.isNotEmpty(form.getProperties().getMobileRelatedFormList())) {
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						Business business = new Business(emc);
-						Form _f;
-						for (String _id : form.getProperties().getMobileRelatedFormList()) {
-							_f = business.form().pick(_id);
-							if (null != _f) {
-								list.add(_f.getId() + _f.getUpdateTime().getTime());
-							}
-						}
-					} catch (Exception e) {
-						logger.error(e);
-					}
-				}
-			});
-			CompletableFuture<Void> _relatedScript = CompletableFuture.runAsync(() -> {
-				if ((null != form.getProperties().getMobileRelatedScriptMap())
-						&& (form.getProperties().getMobileRelatedScriptMap().size() > 0)) {
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						Business business = new Business(emc);
-						for (Entry<String, String> entry : form.getProperties().getMobileRelatedScriptMap()
-								.entrySet()) {
-							switch (entry.getValue()) {
-							case WorkCompletedProperties.RelatedScript.TYPE_PROCESSPLATFORM:
-								Script _pp = business.script().pick(entry.getKey());
-								if (null != _pp) {
-									list.add(_pp.getId() + _pp.getUpdateTime().getTime());
-								}
-								break;
-							case WorkCompletedProperties.RelatedScript.TYPE_CMS:
-								com.x.cms.core.entity.element.Script _cms = business.cms().script()
-										.pick(entry.getKey());
-								if (null != _cms) {
-									list.add(_cms.getId() + _cms.getUpdateTime().getTime());
-								}
-								break;
-							case WorkCompletedProperties.RelatedScript.TYPE_PORTAL:
-								com.x.portal.core.entity.Script _p = business.portal().script().pick(entry.getKey());
-								if (null != _p) {
-									list.add(_p.getId() + _p.getUpdateTime().getTime());
-								}
-								break;
-							default:
-								break;
-							}
+	private CompletableFuture<List<String>> relatedFormFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<String> list = new ArrayList<>();
+			if (ListTools.isNotEmpty(properties.getMobileRelatedFormList())) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					Form f;
+					for (String id : properties.getMobileRelatedFormList()) {
+						f = business.form().pick(id);
+						if (null != f) {
+							list.add(f.getId() + f.getUpdateTime().getTime());
 						}
-					} catch (Exception e) {
-						logger.error(e);
 					}
+				} catch (Exception e) {
+					logger.error(e);
 				}
-			});
-			_relatedForm.get();
-			_relatedScript.get();
-			list.add(form.getId() + form.getUpdateTime().getTime());
-			List<String> sortList = list.stream().sorted().collect(Collectors.toList());
-			Wo wo = new Wo();
-			wo.setId(form.getId());
-			CRC32 crc = new CRC32();
-			crc.update(StringUtils.join(sortList, "#").getBytes());
-			wo.setCacheTag(crc.getValue() + "");
-			return wo;
-		}
+			}
+			return list;
+		});
 	}
 
-	private Wo workCompleted(WorkCompleted workCompleted) throws Exception {
-		// 先使用当前库的表单,如果不存在使用储存的表单.
-		Wo wo = new Wo();
-		Form form = null;
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			form = business.form().pick(workCompleted.getForm());
-		}
-		if (null != form) {
-			return this.get(form);
-		} else if (null != workCompleted.getProperties().getStoreFormMobile()) {
-			StoreForm storeForm = workCompleted.getProperties().getStoreFormMobile();
-			wo = XGsonBuilder.convert(storeForm, Wo.class);
-		}
-		return wo;
+	private CompletableFuture<List<String>> relatedScriptFuture(FormProperties properties) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<String> list = new ArrayList<>();
+			if ((null != properties.getMobileRelatedScriptMap())
+					&& (properties.getMobileRelatedScriptMap().size() > 0)) {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					list = convertScriptToCacheTag(business, properties.getMobileRelatedScriptMap());
+				} catch (Exception e) {
+					logger.error(e);
+				}
+			}
+			return list;
+		});
 	}
 
 	public static class Wo extends AbstractWo {
 
+		private static final long serialVersionUID = 4034113778768000046L;
+
 		private String id;
 
 		private String cacheTag;

+ 23 - 14
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/ActionListWithWorkOrWorkCompleted.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -32,15 +33,29 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 
 		ActionResult<List<Wo>> result = new ActionResult<>();
-		CompletableFuture<List<Wo>> _wos = CompletableFuture.supplyAsync(() -> {
+		CompletableFuture<List<Wo>> listFuture = this.listFuture(workOrWorkCompleted);
+		CompletableFuture<Boolean> checkControlFuture = this.checkControlFuture(effectivePerson, workOrWorkCompleted);
+
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
+			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
+		}
+
+		result.setData(listFuture.get(10, TimeUnit.SECONDS));
+
+		return result;
+
+	}
+
+	private CompletableFuture<List<Wo>> listFuture(String flag) {
+		return CompletableFuture.supplyAsync(() -> {
 			List<Wo> wos = new ArrayList<>();
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
-				String job = business.job().findWithWork(workOrWorkCompleted);
+				String job = business.job().findWithWork(flag);
 				if (null != job) {
 					wos = emc.fetchEqual(Record.class, Wo.copier, Record.job_FIELDNAME, job);
 				} else {
-					job = business.job().findWithWorkCompleted(workOrWorkCompleted);
+					job = business.job().findWithWorkCompleted(flag);
 					WorkCompleted workCompleted = emc.firstEqual(WorkCompleted.class, WorkCompleted.job_FIELDNAME, job);
 					if (ListTools.isNotEmpty(workCompleted.getProperties().getRecordList())) {
 						wos = Wo.copier.copy(workCompleted.getProperties().getRecordList());
@@ -59,26 +74,20 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 			}
 			return wos;
 		});
+	}
 
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
+	private CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
 			Boolean value = false;
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
+				value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag,
+						new ExceptionEntityNotExist(flag));
 			} catch (Exception e) {
 				logger.error(e);
 			}
 			return value;
 		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-		}
-
-		result.setData(_wos.get());
-		return result;
-
 	}
 
 	private Record taskToRecord(Task task) {

+ 22 - 14
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/record/ActionListWithWorkOrWorkCompletedPaging.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -34,16 +35,29 @@ class ActionListWithWorkOrWorkCompletedPaging extends BaseAction {
 
 		ActionResult<List<Wo>> result = new ActionResult<>();
 
-		CompletableFuture<List<Wo>> _wos = CompletableFuture.supplyAsync(() -> {
+		CompletableFuture<List<Wo>> listFuture = this.listFuture(workOrWorkCompleted, page, size);
+		CompletableFuture<Boolean> checkControlFuture = this.checkControlFuture(effectivePerson, workOrWorkCompleted);
+
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
+			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
+		}
+
+		result.setData(listFuture.get(10, TimeUnit.SECONDS));
+		return result;
+
+	}
+
+	private CompletableFuture<List<Wo>> listFuture(String flag, Integer page, Integer size) {
+		return CompletableFuture.supplyAsync(() -> {
 			List<Wo> wos = new ArrayList<>();
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
-				String job = business.job().findWithWork(workOrWorkCompleted);
+				String job = business.job().findWithWork(flag);
 				if (null != job) {
 					wos = emc.fetchEqualAscPaging(Record.class, Wo.copier, Record.job_FIELDNAME, job, page, size,
 							Record.order_FIELDNAME);
 				} else {
-					job = business.job().findWithWorkCompleted(workOrWorkCompleted);
+					job = business.job().findWithWorkCompleted(flag);
 					WorkCompleted workCompleted = emc.firstEqual(WorkCompleted.class, WorkCompleted.job_FIELDNAME, job);
 					if (ListTools.isNotEmpty(workCompleted.getProperties().getRecordList())) {
 						List<Record> os = workCompleted.getProperties().getRecordList();
@@ -67,26 +81,20 @@ class ActionListWithWorkOrWorkCompletedPaging extends BaseAction {
 			}
 			return wos;
 		});
+	}
 
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
+	private CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
 			Boolean value = false;
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
+				value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag,
+						new ExceptionEntityNotExist(flag));
 			} catch (Exception e) {
 				logger.error(e);
 			}
 			return value;
 		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
-			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
-		}
-
-		result.setData(_wos.get());
-		return result;
-
 	}
 
 	private Record taskToRecord(Task task) {

+ 82 - 49
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCountWithPerson.java

@@ -41,62 +41,95 @@ class ActionCountWithPerson extends BaseAction {
 		}
 		if (StringUtils.isNotEmpty(person)) {
 			final String dn = person;
-			CompletableFuture<Void> future_task = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					wo.setTask(emc.countEqual(Task.class, Task.person_FIELDNAME, dn));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 已办仅取latest */
-			CompletableFuture<Void> future_taskCompleted = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					EntityManager em;
-					em = emc.get(TaskCompleted.class);
-					CriteriaBuilder cb = em.getCriteriaBuilder();
-					CriteriaQuery<Long> cq = cb.createQuery(Long.class);
-					Root<TaskCompleted> root = cq.from(TaskCompleted.class);
-					Predicate p = cb.equal(root.get(TaskCompleted_.person), dn);
-					p = cb.and(p, cb.or(cb.equal(root.get(TaskCompleted_.latest), true),
-							cb.isNull(root.get(TaskCompleted_.latest))));
-					wo.setTaskCompleted(em.createQuery(cq.select(cb.count(root)).where(p)).getSingleResult());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_read = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					wo.setRead(emc.countEqual(Read.class, Read.person_FIELDNAME, dn));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_readCompleted = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					wo.setReadCompleted(emc.countEqual(ReadCompleted.class, ReadCompleted.person_FIELDNAME, dn));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_review = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					wo.setReview(emc.countEqual(Review.class, Review.person_FIELDNAME, dn));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			future_task.get(300, TimeUnit.SECONDS);
-			future_taskCompleted.get(300, TimeUnit.SECONDS);
-			future_read.get(300, TimeUnit.SECONDS);
-			future_readCompleted.get(300, TimeUnit.SECONDS);
-			future_review.get(300, TimeUnit.SECONDS);
+			CompletableFuture<Long> taskFuture = this.taskFuture(dn);
+			CompletableFuture<Long> taskCompletedFuture = this.taskCompletedFuture(dn);
+			CompletableFuture<Long> readFuture = this.readFuture(dn);
+			CompletableFuture<Long> readCompletedFuture = this.readCompletedFuture(dn);
+			CompletableFuture<Long> reviewFuture = this.reviewFuture(dn);
+			wo.setTask(taskFuture.get(10, TimeUnit.SECONDS));
+			wo.setTaskCompleted(taskCompletedFuture.get(10, TimeUnit.SECONDS));
+			wo.setRead(readFuture.get(10, TimeUnit.SECONDS));
+			wo.setReadCompleted(readCompletedFuture.get(10, TimeUnit.SECONDS));
+			wo.setReview(reviewFuture.get(10, TimeUnit.SECONDS));
 		}
 		result.setData(wo);
 		return result;
 	}
 
+	private CompletableFuture<Long> taskFuture(String dn) {
+		return CompletableFuture.supplyAsync(() -> {
+			Long count = 0L;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				count = emc.countEqual(Task.class, Task.person_FIELDNAME, dn);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return count;
+		});
+	}
+
+	private CompletableFuture<Long> taskCompletedFuture(String dn) {
+		return CompletableFuture.supplyAsync(() -> {
+			Long count = 0L;
+			// 已办仅取latest
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				EntityManager em;
+				em = emc.get(TaskCompleted.class);
+				CriteriaBuilder cb = em.getCriteriaBuilder();
+				CriteriaQuery<Long> cq = cb.createQuery(Long.class);
+				Root<TaskCompleted> root = cq.from(TaskCompleted.class);
+				Predicate p = cb.equal(root.get(TaskCompleted_.person), dn);
+				p = cb.and(p, cb.or(cb.equal(root.get(TaskCompleted_.latest), true),
+						cb.isNull(root.get(TaskCompleted_.latest))));
+				count = em.createQuery(cq.select(cb.count(root)).where(p)).getSingleResult();
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return count;
+		});
+
+	}
+
+	private CompletableFuture<Long> readFuture(String dn) {
+		return CompletableFuture.supplyAsync(() -> {
+			Long count = 0L;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				count = emc.countEqual(Read.class, Read.person_FIELDNAME, dn);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return count;
+		});
+	}
+
+	private CompletableFuture<Long> readCompletedFuture(String dn) {
+		return CompletableFuture.supplyAsync(() -> {
+			Long count = 0L;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				count = emc.countEqual(ReadCompleted.class, ReadCompleted.person_FIELDNAME, dn);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return count;
+		});
+	}
+
+	private CompletableFuture<Long> reviewFuture(String dn) {
+		return CompletableFuture.supplyAsync(() -> {
+			Long count = 0L;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				count = emc.countEqual(Review.class, Review.person_FIELDNAME, dn);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return count;
+		});
+	}
+
 	public static class Wo extends GsonPropertyObject {
 
+		private static final long serialVersionUID = -4391978436352777470L;
+
 		@FieldDescribe("待办数量")
 		private Long task = 0L;
 		@FieldDescribe("已办数量")

+ 104 - 216
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java

@@ -1,7 +1,9 @@
 package com.x.processplatform.assemble.surface.jaxrs.work;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
 
 import javax.persistence.EntityManager;
 import javax.persistence.criteria.CriteriaBuilder;
@@ -31,8 +33,6 @@ import com.x.processplatform.core.entity.content.Read;
 import com.x.processplatform.core.entity.content.Task;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkCompleted;
-import com.x.processplatform.core.entity.element.Activity;
-import com.x.processplatform.core.entity.element.ManualMode;
 import com.x.query.core.entity.Item;
 import com.x.query.core.entity.Item_;
 
@@ -43,146 +43,130 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 
 		ActionResult<Wo> result = new ActionResult<>();
-		CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-			Wo wo = null;
-			try {
-				Work work = null;
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					work = emc.find(workOrWorkCompleted, Work.class);
-				}
-				if (null != work) {
-					wo = this.work(effectivePerson, work);
-				} else {
-					WorkCompleted workCompleted = null;
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
-					}
-					if (null != workCompleted) {
-						wo = this.workCompleted(effectivePerson, workCompleted);
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e);
+		Wo wo = new Wo();
+		Work work = null;
+		WorkCompleted workCompleted = null;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			work = emc.find(workOrWorkCompleted, Work.class);
+			if (null == work) {
+				workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
 			}
-			return wo;
-		});
+		}
 
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
-			}
-			return value;
-		});
+		CompletableFuture<Boolean> checkControlFuture = this.checkControlFuture(effectivePerson, workOrWorkCompleted);
 
-		if (BooleanUtils.isFalse(_control.get())) {
+		if (null != work) {
+			CompletableFuture<Data> dataFuture = this.dataFuture(work);
+			CompletableFuture<List<WoTask>> taskFuture = this.taskFuture(work.getJob());
+			CompletableFuture<List<WoRead>> readFuture = this.readFuture(work.getJob());
+			wo.setData(dataFuture.get(10, TimeUnit.SECONDS));
+			wo.setTaskList(taskFuture.get(10, TimeUnit.SECONDS));
+			wo.setReadList(readFuture.get(10, TimeUnit.SECONDS));
+			this.setCurrentReadIndex(effectivePerson, wo);
+			this.setCurrentTaskIndex(effectivePerson, wo);
+		} else if (null != workCompleted) {
+			CompletableFuture<Data> dataFuture = this.dataFuture(workCompleted);
+			CompletableFuture<List<WoRead>> readFuture = this.readFuture(workCompleted.getJob());
+			wo.setData(dataFuture.get(10, TimeUnit.SECONDS));
+			wo.setReadList(readFuture.get(10, TimeUnit.SECONDS));
+			this.setCurrentReadIndex(effectivePerson, wo);
+		}
+
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
 			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
 		}
 
-		result.setData(_wo.get());
+		result.setData(wo);
 		return result;
 	}
 
-	private Wo work(EffectivePerson effectivePerson, Work work) throws Exception {
-		Wo wo = new Wo();
-		wo.setWork(gson.toJsonTree(WoWork.copier.copy(work)));
-		wo.setActivity(this.activity(work));
-		CompletableFuture<Data> future_data = CompletableFuture.supplyAsync(() -> {
-			return this.data(work.getJob());
-		});
-		CompletableFuture<List<WoTask>> future_task = CompletableFuture.supplyAsync(() -> {
-			return this.tasks(work.getId());
-		});
-		CompletableFuture<List<WoRead>> future_read = CompletableFuture.supplyAsync(() -> {
-			return this.reads(work.getJob());
-		});
-		wo.setData(future_data.get());
-		wo.setTaskList(future_task.get());
-		wo.setReadList(future_read.get());
-		this.setCurrentReadIndex(effectivePerson, wo);
-		this.setCurrentTaskIndex(effectivePerson, wo);
-		return wo;
-	}
 
-	private Wo workCompleted(EffectivePerson effectivePerson, WorkCompleted workCompleted) throws Exception {
-		Wo wo = new Wo();
-		wo.setWork(gson.toJsonTree(WoWorkCompleted.copier.copy(workCompleted)));
-		CompletableFuture<Data> future_data = CompletableFuture.supplyAsync(() -> {
-			if (BooleanUtils.isTrue(workCompleted.getMerged())) {
-				/* 如果data已经merged */
-				return workCompleted.getProperties().getData();
-			} else {
-				return this.data(workCompleted.getJob());
+
+	private CompletableFuture<Data> dataFuture(Work work) {
+		return CompletableFuture.supplyAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				EntityManager em = business.entityManagerContainer().get(Item.class);
+				CriteriaBuilder cb = em.getCriteriaBuilder();
+				CriteriaQuery<Item> cq = cb.createQuery(Item.class);
+				Root<Item> root = cq.from(Item.class);
+				Predicate p = cb.equal(root.get(Item_.bundle), work.getJob());
+				p = cb.and(p, cb.equal(root.get(Item_.itemCategory), ItemCategory.pp));
+				List<Item> list = em.createQuery(cq.where(p)).getResultList();
+				if (list.isEmpty()) {
+					return new Data();
+				} else {
+					JsonElement jsonElement = itemConverter.assemble(list);
+					if (jsonElement.isJsonObject()) {
+						return gson.fromJson(jsonElement, Data.class);
+					} else {
+						// 如果不是Object强制返回一个Map对象
+						return new Data();
+					}
+				}
+			} catch (Exception e) {
+				logger.error(e);
 			}
+			return null;
 		});
-		CompletableFuture<List<WoRead>> future_read = CompletableFuture.supplyAsync(() -> {
-			return this.reads(workCompleted.getJob());
-		});
-		wo.setData(future_data.get());
-		wo.setReadList(future_read.get());
-		this.setCurrentReadIndex(effectivePerson, wo);
-		return wo;
 	}
 
-	private Data data(String job) {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			EntityManager em = business.entityManagerContainer().get(Item.class);
-			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Item> cq = cb.createQuery(Item.class);
-			Root<Item> root = cq.from(Item.class);
-			Predicate p = cb.equal(root.get(Item_.bundle), job);
-			p = cb.and(p, cb.equal(root.get(Item_.itemCategory), ItemCategory.pp));
-			List<Item> list = em.createQuery(cq.where(p)).getResultList();
-			if (list.isEmpty()) {
-				return new Data();
+	private CompletableFuture<Data> dataFuture(WorkCompleted workCompleted) {
+		return CompletableFuture.supplyAsync(() -> {
+			if (BooleanUtils.isTrue(workCompleted.getMerged())) {
+				return workCompleted.getProperties().getData();
 			} else {
-				JsonElement jsonElement = itemConverter.assemble(list);
-				if (jsonElement.isJsonObject()) {
-					return gson.fromJson(jsonElement, Data.class);
-				} else {
-					/* 如果不是Object强制返回一个Map对象 */
-					return new Data();
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					EntityManager em = business.entityManagerContainer().get(Item.class);
+					CriteriaBuilder cb = em.getCriteriaBuilder();
+					CriteriaQuery<Item> cq = cb.createQuery(Item.class);
+					Root<Item> root = cq.from(Item.class);
+					Predicate p = cb.equal(root.get(Item_.bundle), workCompleted.getJob());
+					p = cb.and(p, cb.equal(root.get(Item_.itemCategory), ItemCategory.pp));
+					List<Item> list = em.createQuery(cq.where(p)).getResultList();
+					if (list.isEmpty()) {
+						return new Data();
+					} else {
+						JsonElement jsonElement = itemConverter.assemble(list);
+						if (jsonElement.isJsonObject()) {
+							return gson.fromJson(jsonElement, Data.class);
+						} else {
+							// 如果不是Object强制返回一个Map对象
+							return new Data();
+						}
+					}
+				} catch (Exception e) {
+					logger.error(e);
 				}
 			}
-		} catch (Exception e) {
-			logger.error(e);
-		}
-		return null;
-	}
+			return null;
+		});
 
-	private List<WoTask> tasks(String workId) {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return WoTask.copier.copy(emc.listEqual(Task.class, Task.work_FIELDNAME, workId));
-		} catch (Exception e) {
-			logger.error(e);
-		}
-		return null;
 	}
 
-	private List<WoRead> reads(String job) {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			return WoRead.copier.copy(emc.listEqual(Read.class, Read.job_FIELDNAME, job));
-		} catch (Exception e) {
-			logger.error(e);
-		}
-		return null;
+	private CompletableFuture<List<WoTask>> taskFuture(String job) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<WoTask> list = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				list = WoTask.copier.copy(emc.listEqual(Task.class, Task.work_FIELDNAME, job));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return list;
+		});
 	}
 
-	private WoActivity activity(Work work) throws Exception {
-		WoActivity woActivity = new WoActivity();
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			Business business = new Business(emc);
-			Activity activity = business.getActivity(work);
-			if (null != activity) {
-				activity.copyTo(woActivity);
+	private CompletableFuture<List<WoRead>> readFuture(String job) {
+		return CompletableFuture.supplyAsync(() -> {
+			List<WoRead> list = new ArrayList<>();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				list = WoRead.copier.copy(emc.listEqual(Read.class, Read.job_FIELDNAME, job));
+			} catch (Exception e) {
+				logger.error(e);
 			}
-			return woActivity;
-		}
+			return list;
+		});
 	}
 
 	private void setCurrentTaskIndex(EffectivePerson effectivePerson, Wo wo) {
@@ -210,6 +194,7 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 
 	public static class Wo extends GsonPropertyObject {
 
+		private static final long serialVersionUID = -869684415398137301L;
 		/* work和workCompleted都有 */
 		private JsonElement work;
 		/* work和workCompleted都有 */
@@ -319,101 +304,4 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
 
 	}
 
-	public static class WoActivity extends GsonPropertyObject {
-
-		static WrapCopier<Activity, WoActivity> copier = WrapCopierFactory.wo(Activity.class, WoActivity.class,
-				JpaObject.singularAttributeField(Activity.class, true, true), JpaObject.FieldsInvisible);
-
-		private String id;
-
-		private String name;
-
-		private String description;
-
-		private String alias;
-
-		private String position;
-
-		private String resetRange;
-
-		private Integer resetCount;
-
-		private Boolean allowReset;
-
-		private ManualMode manualMode;
-
-		public String getName() {
-			return name;
-		}
-
-		public void setName(String name) {
-			this.name = name;
-		}
-
-		public String getDescription() {
-			return description;
-		}
-
-		public void setDescription(String description) {
-			this.description = description;
-		}
-
-		public String getAlias() {
-			return alias;
-		}
-
-		public void setAlias(String alias) {
-			this.alias = alias;
-		}
-
-		public String getPosition() {
-			return position;
-		}
-
-		public void setPosition(String position) {
-			this.position = position;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		public void setId(String id) {
-			this.id = id;
-		}
-
-		public String getResetRange() {
-			return resetRange;
-		}
-
-		public void setResetRange(String resetRange) {
-			this.resetRange = resetRange;
-		}
-
-		public Integer getResetCount() {
-			return resetCount;
-		}
-
-		public void setResetCount(Integer resetCount) {
-			this.resetCount = resetCount;
-		}
-
-		public Boolean getAllowReset() {
-			return allowReset;
-		}
-
-		public void setAllowReset(Boolean allowReset) {
-			this.allowReset = allowReset;
-		}
-
-		public ManualMode getManualMode() {
-			return manualMode;
-		}
-
-		public void setManualMode(ManualMode manualMode) {
-			this.manualMode = manualMode;
-		}
-
-	}
-
 }

+ 60 - 61
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionRefer.java

@@ -16,7 +16,6 @@ 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.utils.time.TimeStamp;
 import com.x.processplatform.core.entity.content.Read;
 import com.x.processplatform.core.entity.content.ReadCompleted;
 import com.x.processplatform.core.entity.content.Review;
@@ -29,66 +28,66 @@ class ActionRefer extends BaseAction {
 
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId) throws Exception {
 
-			ActionResult<Wo> result = new ActionResult<>();
-			Wo wo = new Wo();
-			CompletableFuture<Void> future_task = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<Task> os = emc.listEqualAndEqual(Task.class, Task.work_FIELDNAME, workId,
-							Task.person_FIELDNAME, effectivePerson.getDistinguishedName());
-					wo.getTaskList().addAll(WoTask.copier.copy(os));
-					wo.setHasTask(!os.isEmpty());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_taskCompleted = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<TaskCompleted> os = emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.work_FIELDNAME,
-							workId, TaskCompleted.person_FIELDNAME, effectivePerson.getDistinguishedName());
-					wo.getTaskCompletedList().addAll(WoTaskCompleted.copier.copy(os));
-					wo.setHasTaskCompleted(!os.isEmpty());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_read = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<Read> os = emc.listEqualAndEqual(Read.class, Read.work_FIELDNAME, workId,
-							Read.person_FIELDNAME, effectivePerson.getDistinguishedName());
-					wo.getReadList().addAll(WoRead.copier.copy(os));
-					wo.setHasRead(!os.isEmpty());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_readCompleted = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<ReadCompleted> os = emc.listEqualAndEqual(ReadCompleted.class, ReadCompleted.work_FIELDNAME,
-							workId, ReadCompleted.person_FIELDNAME, effectivePerson.getDistinguishedName());
-					wo.getReadCompletedList().addAll(WoReadCompleted.copier.copy(os));
-					wo.setHasReadCompleted(!os.isEmpty());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			CompletableFuture<Void> future_review = CompletableFuture.runAsync(() -> {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<Review> os = emc.listEqualAndEqual(Review.class, Review.work_FIELDNAME, workId,
-							Review.person_FIELDNAME, effectivePerson.getDistinguishedName());
-					wo.getReviewList().addAll(WoReview.copier.copy(os));
-					wo.setHasReview(!os.isEmpty());
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			future_task.get(300, TimeUnit.SECONDS);
-			future_taskCompleted.get(300, TimeUnit.SECONDS);
-			future_read.get(300, TimeUnit.SECONDS);
-			future_readCompleted.get(300, TimeUnit.SECONDS);
-			future_review.get(300, TimeUnit.SECONDS);
-			result.setData(wo);
-
-			return result;
+		ActionResult<Wo> result = new ActionResult<>();
+		Wo wo = new Wo();
+		CompletableFuture<Void> future_task = CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<Task> os = emc.listEqualAndEqual(Task.class, Task.work_FIELDNAME, workId, Task.person_FIELDNAME,
+						effectivePerson.getDistinguishedName());
+				wo.getTaskList().addAll(WoTask.copier.copy(os));
+				wo.setHasTask(!os.isEmpty());
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+		CompletableFuture<Void> future_taskCompleted = CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<TaskCompleted> os = emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.work_FIELDNAME,
+						workId, TaskCompleted.person_FIELDNAME, effectivePerson.getDistinguishedName());
+				wo.getTaskCompletedList().addAll(WoTaskCompleted.copier.copy(os));
+				wo.setHasTaskCompleted(!os.isEmpty());
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+		CompletableFuture<Void> future_read = CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<Read> os = emc.listEqualAndEqual(Read.class, Read.work_FIELDNAME, workId, Read.person_FIELDNAME,
+						effectivePerson.getDistinguishedName());
+				wo.getReadList().addAll(WoRead.copier.copy(os));
+				wo.setHasRead(!os.isEmpty());
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+		CompletableFuture<Void> future_readCompleted = CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<ReadCompleted> os = emc.listEqualAndEqual(ReadCompleted.class, ReadCompleted.work_FIELDNAME,
+						workId, ReadCompleted.person_FIELDNAME, effectivePerson.getDistinguishedName());
+				wo.getReadCompletedList().addAll(WoReadCompleted.copier.copy(os));
+				wo.setHasReadCompleted(!os.isEmpty());
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+		CompletableFuture<Void> future_review = CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				List<Review> os = emc.listEqualAndEqual(Review.class, Review.work_FIELDNAME, workId,
+						Review.person_FIELDNAME, effectivePerson.getDistinguishedName());
+				wo.getReviewList().addAll(WoReview.copier.copy(os));
+				wo.setHasReview(!os.isEmpty());
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+		future_task.get(10, TimeUnit.SECONDS);
+		future_taskCompleted.get(10, TimeUnit.SECONDS);
+		future_read.get(10, TimeUnit.SECONDS);
+		future_readCompleted.get(10, TimeUnit.SECONDS);
+		future_review.get(10, TimeUnit.SECONDS);
+		result.setData(wo);
+
+		return result;
 	}
 
 	public static class Wo extends GsonPropertyObject {

+ 28 - 11
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/BaseAction.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.CompletableFuture;
 
 import javax.persistence.EntityManager;
 import javax.persistence.criteria.CriteriaBuilder;
@@ -15,12 +16,14 @@ import org.apache.commons.collections4.ListUtils;
 
 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.entity.dataitem.DataItemConverter;
 import com.x.base.core.entity.dataitem.ItemCategory;
 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.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
@@ -110,6 +113,20 @@ abstract class BaseAction extends StandardJaxrsAction {
 		}
 	}
 
+	protected CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
+		return CompletableFuture.supplyAsync(() -> {
+			Boolean value = false;
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag,
+						new ExceptionEntityNotExist(flag));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+			return value;
+		});
+	}
+
 	public static class AbstractWo extends GsonPropertyObject {
 
 		@FieldDescribe("活动节点")
@@ -591,7 +608,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //		Activity activity = null;
 //		Long reviewCount = 0L;
 //
-//		CompletableFuture111111<Void> future_tasks = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_tasks = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<Task> os = business.entityManagerContainer()
 //						.listEqual(Task.class, WoTask.job_FIELDNAME, work.getJob()).stream()
@@ -611,7 +628,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //		});
 //
-//		CompletableFuture111111<Void> future_taskCompleteds = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_taskCompleteds = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<TaskCompleted> os = business.entityManagerContainer()
 //						.listEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME, work.getJob()).stream()
@@ -624,7 +641,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //		});
 //
-//		CompletableFuture111111<Void> future_reads = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_reads = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<Read> os = business.entityManagerContainer()
 //						.listEqual(Read.class, Read.job_FIELDNAME, work.getJob()).stream()
@@ -643,7 +660,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_readCompleteds = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_readCompleteds = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<ReadCompleted> os = business.entityManagerContainer()
 //						.listEqual(ReadCompleted.class, ReadCompleted.job_FIELDNAME, work.getJob()).stream()
@@ -655,7 +672,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_attachments = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_attachments = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<Attachment> os = business.entityManagerContainer()
 //						.listEqual(Attachment.class, Attachment.job_FIELDNAME, work.getJob()).stream()
@@ -670,7 +687,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_workLogs = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_workLogs = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<WorkLog> os = business.entityManagerContainer()
 //						.listEqual(WorkLog.class, WorkLog.job_FIELDNAME, work.getJob()).stream()
@@ -681,14 +698,14 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_data = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_data = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				t.setData(this.loadData(business, work));
 //			} catch (Exception e) {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Application> future_application = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Application> future_application = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Application o = null;
 //			try {
 //				o = business.application().pick(work.getApplication());
@@ -697,7 +714,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //			return o;
 //		});
-//		CompletableFuture111111<Process> future_process = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Process> future_process = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Process o = null;
 //			try {
 //				o = business.process().pick(work.getProcess());
@@ -706,7 +723,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //			return o;
 //		});
-//		CompletableFuture111111<Activity> future_activity = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Activity> future_activity = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Activity o = null;
 //			try {
 //				o = business.getActivity(work);
@@ -721,7 +738,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //			return o;
 //		});
-//		CompletableFuture111111<Long> future_reviewCount = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Long> future_reviewCount = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Long o = 0L;
 //			try {
 //				o = business.entityManagerContainer().countEqualAndEqual(Review.class, Review.person_FIELDNAME,

+ 124 - 124
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/V2GetWorkOrWorkCompleted.java

@@ -6,7 +6,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.commons.collections4.ListUtils;
@@ -21,7 +21,6 @@ import com.x.base.core.entity.dataitem.ItemCategory;
 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.exception.ExceptionEntityNotExist;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
@@ -53,61 +52,69 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 	ActionResult<Wo> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
 		ActionResult<Wo> result = new ActionResult<>();
 
-		CompletableFuture<Wo> _wo = CompletableFuture.supplyAsync(() -> {
-			Wo wo = null;
-			Work work = null;
-			try {
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					work = emc.find(workOrWorkCompleted, Work.class);
-				}
-				if (null != work) {
-					wo = this.work(effectivePerson, work);
-				} else {
-					WorkCompleted workCompleted = null;
-					try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-						workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
-						if (null != workCompleted) {
-							wo = this.workCompleted(effectivePerson, workCompleted);
-						}
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e);
+		Wo wo = new Wo();
+		Work work = null;
+		WorkCompleted workCompleted = null;
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			work = emc.find(workOrWorkCompleted, Work.class);
+			if (null == work) {
+				workCompleted = emc.flag(workOrWorkCompleted, WorkCompleted.class);
 			}
-			return wo;
-		});
+		}
 
-		CompletableFuture<Boolean> _control = CompletableFuture.supplyAsync(() -> {
-			Boolean value = false;
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				value = business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
-						new ExceptionEntityNotExist(workOrWorkCompleted));
-			} catch (Exception e) {
-				logger.error(e);
+		CompletableFuture<Boolean> checkControlFuture = this.checkControlFuture(effectivePerson, workOrWorkCompleted);
+
+		if (null != work) {
+			CompletableFuture<Void> workJsonFuture = this.workJsonFuture(work, wo);
+			CompletableFuture<Void> activityRouteFuture = this.activityRouteFuture(work, wo);
+			CompletableFuture<Void> dataFuture = this.dataFuture(work, wo);
+			CompletableFuture<Void> taskFuture = this.taskFuture(effectivePerson, work.getJob(), wo);
+			CompletableFuture<Void> readFuture = this.readFuture(effectivePerson, work.getJob(), wo);
+			CompletableFuture<Void> creatorIdentityFuture = this.creatorIdentityFuture(work.getCreatorIdentity(), wo);
+			CompletableFuture<Void> creatorPersonFuture = this.creatorPersonFuture(work.getCreatorPerson(), wo);
+			CompletableFuture<Void> creatorUnitFuture = this.creatorUnitFuture(work.getCreatorUnit(), wo);
+			CompletableFuture<Void> attachmentFuture = this.attachmentFuture(effectivePerson, work.getJob(), wo);
+			CompletableFuture<Void> recordFuture = this.recordFuture(effectivePerson, work.getJob(), wo);
+			workJsonFuture.get(10, TimeUnit.SECONDS);
+			activityRouteFuture.get(10, TimeUnit.SECONDS);
+			dataFuture.get(10, TimeUnit.SECONDS);
+			taskFuture.get(10, TimeUnit.SECONDS);
+			readFuture.get(10, TimeUnit.SECONDS);
+			creatorIdentityFuture.get(10, TimeUnit.SECONDS);
+			creatorPersonFuture.get(10, TimeUnit.SECONDS);
+			creatorUnitFuture.get(10, TimeUnit.SECONDS);
+			attachmentFuture.get(10, TimeUnit.SECONDS);
+			recordFuture.get(10, TimeUnit.SECONDS);
+			for (WoTask woTask : wo.getTaskList()) {
+				wo.getRecordList().add(taskToRecord(woTask));
 			}
-			return value;
-		});
-
-		if (BooleanUtils.isFalse(_control.get())) {
+		} else if (null != workCompleted) {
+			CompletableFuture<Void> workCompletedJsonFuture = this.workCompletedJsonFuture(workCompleted, wo);
+			CompletableFuture<Void> workCompletedDataFuture = this.workCompletedDataFuture(workCompleted, wo);
+			CompletableFuture<Void> readFuture = readFuture(effectivePerson, workCompleted.getJob(), wo);
+			CompletableFuture<Void> creatorIdentityFuture = creatorIdentityFuture(workCompleted.getCreatorIdentity(),
+					wo);
+			CompletableFuture<Void> creatorPersonFuture = creatorPersonFuture(workCompleted.getCreatorPerson(), wo);
+			CompletableFuture<Void> creatorUnitFuture = creatorUnitFuture(workCompleted.getCreatorUnit(), wo);
+			CompletableFuture<Void> attachmentFuture = attachmentFuture(effectivePerson, workCompleted.getJob(), wo);
+			CompletableFuture<Void> workCompletedRecordFuture = this.workCompletedRecordFuture(effectivePerson,
+					workCompleted, wo);
+			workCompletedJsonFuture.get(10, TimeUnit.SECONDS);
+			workCompletedDataFuture.get(10, TimeUnit.SECONDS);
+			readFuture.get(10, TimeUnit.SECONDS);
+			creatorIdentityFuture.get(10, TimeUnit.SECONDS);
+			creatorPersonFuture.get(10, TimeUnit.SECONDS);
+			creatorUnitFuture.get(10, TimeUnit.SECONDS);
+			attachmentFuture.get(10, TimeUnit.SECONDS);
+			workCompletedRecordFuture.get(10, TimeUnit.SECONDS);
+		}
+
+		if (BooleanUtils.isFalse(checkControlFuture.get(10, TimeUnit.SECONDS))) {
 			throw new ExceptionAccessDenied(effectivePerson, workOrWorkCompleted);
 		}
-		result.setData(_wo.get());
-		return result;
-	}
 
-	private Wo work(EffectivePerson effectivePerson, Work work) throws InterruptedException, ExecutionException {
-		Wo wo = new Wo();
-		CompletableFuture
-				.allOf(workJson(work, wo), activity(work, wo), data(work, wo), task(effectivePerson, work, wo),
-						read(effectivePerson, work.getJob(), wo), creatorIdentity(work.getCreatorIdentity(), wo),
-						creatorPerson(work.getCreatorPerson(), wo), creatorUnit(work.getCreatorUnit(), wo),
-						attachment(effectivePerson, work.getJob(), wo), record(effectivePerson, work.getJob(), wo))
-				.get();
-		for (WoTask woTask : wo.getTaskList()) {
-			wo.getRecordList().add(taskToRecord(woTask));
-		}
-		return wo;
+		result.setData(wo);
+		return result;
 	}
 
 	private WoRecord taskToRecord(WoTask woTask) {
@@ -126,7 +133,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		return o;
 	}
 
-	private CompletableFuture<Void> data(Work work, Wo wo) {
+	private CompletableFuture<Void> dataFuture(Work work, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				List<Item> list = emc.listEqualAndEqual(Item.class, DataItem.bundle_FIELDNAME, work.getJob(),
@@ -144,58 +151,10 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> record(EffectivePerson effectivePerson, String job, Wo wo) {
-		return CompletableFuture.runAsync(() -> {
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				wo.setRecordList(emc.fetchEqual(Record.class, WoRecord.copier, Record.job_FIELDNAME, job).stream()
-						.sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
-			} catch (Exception e) {
-				logger.error(e);
-			}
-		});
-	}
-
-	private CompletableFuture<Void> completedRecord(EffectivePerson effectivePerson, WorkCompleted workCompleted,
-			Wo wo) {
-		return CompletableFuture.runAsync(() -> {
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				if (ListTools.isNotEmpty(workCompleted.getProperties().getRecordList())) {
-					wo.setRecordList(WoRecord.copier.copy(workCompleted.getProperties().getRecordList()).stream()
-							.sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
-				} else {
-					wo.setRecordList(emc
-							.fetchEqual(Record.class, WoRecord.copier, Record.job_FIELDNAME, workCompleted.getJob())
-							.stream().sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
-				}
-			} catch (Exception e) {
-				logger.error(e);
-			}
-		});
-	}
-
-	private CompletableFuture<Void> activity(Work work, Wo wo) {
-		return CompletableFuture.runAsync(() -> {
-			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				Business business = new Business(emc);
-				Activity activity = business.getActivity(work);
-				if (null != activity) {
-					WoActivity woActivity = new WoActivity();
-					activity.copyTo(woActivity);
-					wo.setActivity(woActivity);
-					if (Objects.equals(ActivityType.manual, activity.getActivityType())) {
-						wo.setRouteList(WoRoute.copier.copy(business.route().pick(((Manual) activity).getRouteList())));
-					}
-				}
-			} catch (Exception e) {
-				logger.error(e);
-			}
-		});
-	}
-
-	private CompletableFuture<Void> task(EffectivePerson effectivePerson, Work work, Wo wo) {
+	private CompletableFuture<Void> taskFuture(EffectivePerson effectivePerson, String job, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-				wo.setTaskList(WoTask.copier.copy(emc.listEqual(Task.class, Task.job_FIELDNAME, work.getJob())));
+				wo.setTaskList(WoTask.copier.copy(emc.listEqual(Task.class, Task.job_FIELDNAME, job)));
 				wo.setCurrentTaskIndex(
 						ListUtils.indexOf(wo.getTaskList(), e -> effectivePerson.isPerson(e.getPerson())));
 			} catch (Exception e) {
@@ -204,7 +163,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> attachment(EffectivePerson effectivePerson, String job, Wo wo) {
+	private CompletableFuture<Void> attachmentFuture(EffectivePerson effectivePerson, String job, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
@@ -237,7 +196,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> read(EffectivePerson effectivePerson, String job, Wo wo) {
+	private CompletableFuture<Void> readFuture(EffectivePerson effectivePerson, String job, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				wo.setReadList(WoRead.copier.copy(emc.listEqual(Read.class, Read.job_FIELDNAME, job)));
@@ -249,7 +208,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> workJson(Work work, Wo wo) {
+	private CompletableFuture<Void> workJsonFuture(Work work, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try {
 				wo.setWork(gson.toJsonTree(WoWork.copier.copy(work)));
@@ -259,7 +218,26 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> creatorIdentity(String creatorIdentity, Wo wo) {
+	private CompletableFuture<Void> activityRouteFuture(Work work, Wo wo) {
+		return CompletableFuture.runAsync(() -> {
+			WoActivity woActivity = new WoActivity();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				Activity activity = business.getActivity(work);
+				if (null != activity) {
+					activity.copyTo(woActivity);
+					wo.setActivity(woActivity);
+					if (Objects.equals(ActivityType.manual, activity.getActivityType())) {
+						wo.setRouteList(WoRoute.copier.copy(business.route().pick(((Manual) activity).getRouteList())));
+					}
+				}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private CompletableFuture<Void> creatorIdentityFuture(String creatorIdentity, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
@@ -270,7 +248,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> creatorPerson(String creatorPerson, Wo wo) {
+	private CompletableFuture<Void> creatorPersonFuture(String creatorPerson, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
@@ -281,7 +259,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> creatorUnit(String creatorUnit, Wo wo) {
+	private CompletableFuture<Void> creatorUnitFuture(String creatorUnit, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
@@ -292,19 +270,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private Wo workCompleted(EffectivePerson effectivePerson, WorkCompleted workCompleted)
-			throws InterruptedException, ExecutionException {
-		Wo wo = new Wo();
-		CompletableFuture.allOf(completedJson(workCompleted, wo), completedData(workCompleted, wo),
-				read(effectivePerson, workCompleted.getJob(), wo),
-				creatorIdentity(workCompleted.getCreatorIdentity(), wo),
-				creatorPerson(workCompleted.getCreatorPerson(), wo), creatorUnit(workCompleted.getCreatorUnit(), wo),
-				attachment(effectivePerson, workCompleted.getJob(), wo),
-				completedRecord(effectivePerson, workCompleted, wo)).get();
-		return wo;
-	}
-
-	private CompletableFuture<Void> completedJson(WorkCompleted workCompleted, Wo wo) {
+	private CompletableFuture<Void> workCompletedJsonFuture(WorkCompleted workCompleted, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			try {
 				wo.setWork(gson.toJsonTree(WoWorkCompleted.copier.copy(workCompleted)));
@@ -314,7 +280,36 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		});
 	}
 
-	private CompletableFuture<Void> completedData(WorkCompleted workCompleted, Wo wo) {
+	private CompletableFuture<Void> recordFuture(EffectivePerson effectivePerson, String job, Wo wo) {
+		return CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				wo.setRecordList(emc.fetchEqual(Record.class, WoRecord.copier, Record.job_FIELDNAME, job).stream()
+						.sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private CompletableFuture<Void> workCompletedRecordFuture(EffectivePerson effectivePerson,
+			WorkCompleted workCompleted, Wo wo) {
+		return CompletableFuture.runAsync(() -> {
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				if (ListTools.isNotEmpty(workCompleted.getProperties().getRecordList())) {
+					wo.setRecordList(WoRecord.copier.copy(workCompleted.getProperties().getRecordList()).stream()
+							.sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
+				} else {
+					wo.setRecordList(emc
+							.fetchEqual(Record.class, WoRecord.copier, Record.job_FIELDNAME, workCompleted.getJob())
+							.stream().sorted(Comparator.comparing(WoRecord::getOrder)).collect(Collectors.toList()));
+				}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private CompletableFuture<Void> workCompletedDataFuture(WorkCompleted workCompleted, Wo wo) {
 		return CompletableFuture.runAsync(() -> {
 			if (BooleanUtils.isTrue(workCompleted.getMerged())) {
 				wo.setData(workCompleted.getProperties().getData());
@@ -395,6 +390,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 
 	public static class Wo extends GsonPropertyObject {
 
+		private static final long serialVersionUID = -2651851022553574012L;
 		// work和workCompleted都有
 		private JsonElement work;
 		// work和workCompleted都有
@@ -416,8 +412,8 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 		// work和workCompleted都有
 		private List<WoAttachment> attachmentList;
 
-		// work和workCompleted都有
-		private List<WoRecord> recordList;
+		// work和workCompleted都有,需要先行初始化,因为record可能为空
+		private List<WoRecord> recordList = new ArrayList<>();
 
 		// 只有work有
 		private WoActivity activity;
@@ -680,6 +676,9 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 	}
 
 	public static class WoAttachment extends Attachment {
+
+		private static final long serialVersionUID = -5323646346508661416L;
+
 		static WrapCopier<Attachment, WoAttachment> copier = WrapCopierFactory.wo(Attachment.class, WoAttachment.class,
 				null, JpaObject.FieldsInvisibleIncludeProperites);
 
@@ -696,6 +695,7 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
 
 	public static class WoAttachmentControl extends GsonPropertyObject {
 
+		private static final long serialVersionUID = -1159880170066584166L;
 		private Boolean allowRead = false;
 		private Boolean allowEdit = false;
 		private Boolean allowControl = false;

+ 7 - 7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageGetAssignment.java

@@ -78,7 +78,7 @@ class ActionManageGetAssignment extends BaseAction {
 						.forEach(o -> {
 							try {
 								WoRead w = WoRead.copier.copy(o);
-								//w.setControl(control);
+								// w.setControl(control);
 								wo.getReadList().add(w);
 							} catch (Exception e) {
 								logger.error(e);
@@ -95,7 +95,7 @@ class ActionManageGetAssignment extends BaseAction {
 						.forEach(o -> {
 							try {
 								WoReadCompleted w = WoReadCompleted.copier.copy(o);
-								//w.setControl(control);
+								// w.setControl(control);
 								wo.getReadCompletedList().add(w);
 							} catch (Exception e) {
 								logger.error(e);
@@ -112,7 +112,7 @@ class ActionManageGetAssignment extends BaseAction {
 						.forEach(o -> {
 							try {
 								WoReview w = WoReview.copier.copy(o);
-								//w.setControl(control);
+								// w.setControl(control);
 								wo.getReviewList().add(w);
 							} catch (Exception e) {
 								logger.error(e);
@@ -122,10 +122,10 @@ class ActionManageGetAssignment extends BaseAction {
 				logger.error(e);
 			}
 		});
-		future_taskCompleted.get(300, TimeUnit.SECONDS);
-		future_read.get(300, TimeUnit.SECONDS);
-		future_readCompleted.get(300, TimeUnit.SECONDS);
-		future_review.get(300, TimeUnit.SECONDS);
+		future_taskCompleted.get(10, TimeUnit.SECONDS);
+		future_read.get(10, TimeUnit.SECONDS);
+		future_readCompleted.get(10, TimeUnit.SECONDS);
+		future_review.get(10, TimeUnit.SECONDS);
 		result.setData(wo);
 		return result;
 	}

+ 9 - 9
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/BaseAction.java

@@ -348,7 +348,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //		Activity activity = null;
 //		Long reviewCount = 0L;
 //
-//		CompletableFuture111111<Void> future_taskCompleteds = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_taskCompleteds = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<TaskCompleted> os = business.entityManagerContainer()
 //						.listEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME, workCompleted.getJob()).stream()
@@ -360,7 +360,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_reads = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_reads = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<Read> os = business.entityManagerContainer()
 //						.listEqual(Read.class, Read.job_FIELDNAME, workCompleted.getJob()).stream()
@@ -379,7 +379,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_readCompleteds = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_readCompleteds = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<ReadCompleted> os = business.entityManagerContainer()
 //						.listEqual(ReadCompleted.class, ReadCompleted.job_FIELDNAME, workCompleted.getJob()).stream()
@@ -391,7 +391,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_attachments = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_attachments = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<Attachment> os = business.entityManagerContainer()
 //						.listEqual(Attachment.class, Attachment.job_FIELDNAME, workCompleted.getJob()).stream()
@@ -402,7 +402,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_workLogs = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_workLogs = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				List<WorkLog> os = business.entityManagerContainer()
 //						.listEqual(WorkLog.class, WorkLog.job_FIELDNAME, workCompleted.getJob()).stream()
@@ -413,14 +413,14 @@ abstract class BaseAction extends StandardJaxrsAction {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Void> future_data = CompletableFuture111111.runAsync(() -> {
+//		CompletableFuture111111111111111111111111<Void> future_data = CompletableFuture111111111111111111111111.runAsync(() -> {
 //			try {
 //				t.setData(this.loadData(business, workCompleted));
 //			} catch (Exception e) {
 //				logger.error(e);
 //			}
 //		});
-//		CompletableFuture111111<Application> future_application = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Application> future_application = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Application o = null;
 //			try {
 //				o = business.application().pick(workCompleted.getApplication());
@@ -429,7 +429,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //			return o;
 //		});
-//		CompletableFuture111111<Process> future_process = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Process> future_process = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Process o = null;
 //			try {
 //				o = business.process().pick(workCompleted.getProcess());
@@ -438,7 +438,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 //			}
 //			return o;
 //		});
-//		CompletableFuture111111<Long> future_reviewCount = CompletableFuture111111.supplyAsync(() -> {
+//		CompletableFuture111111111111111111111111<Long> future_reviewCount = CompletableFuture111111111111111111111111.supplyAsync(() -> {
 //			Long o = 0L;
 //			try {
 //				o = business.entityManagerContainer().countEqualAndEqual(Review.class, Review.person_FIELDNAME,

+ 6 - 6
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java

@@ -35,7 +35,7 @@ public class WorkCompletedProperties extends JsonProperties {
 	private StoreForm storeForm;
 
 	@FieldDescribe("合并工作Form,移动端.")
-	private StoreForm storeFormMobile;
+	private StoreForm mobileStoreForm;
 
 	@FieldDescribe("标题")
 	private String title;
@@ -98,7 +98,7 @@ public class WorkCompletedProperties extends JsonProperties {
 
 	public StoreForm storeForm(boolean mobile) throws Exception {
 		if (mobile) {
-			return this.getStoreFormMobile();
+			return this.getMobileStoreForm();
 		} else {
 			return this.getStoreForm();
 		}
@@ -112,12 +112,12 @@ public class WorkCompletedProperties extends JsonProperties {
 		this.storeForm = storeForm;
 	}
 
-	public StoreForm getStoreFormMobile() {
-		return storeFormMobile;
+	public StoreForm getMobileStoreForm() {
+		return mobileStoreForm;
 	}
 
-	public void setStoreFormMobile(StoreForm storeFormMobile) {
-		this.storeFormMobile = storeFormMobile;
+	public void setMobileStoreForm(StoreForm mobileStoreForm) {
+		this.mobileStoreForm = mobileStoreForm;
 	}
 
 	public static class StoreForm extends GsonPropertyObject {

+ 3 - 3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/workcompleted/ActionMerge.java

@@ -93,14 +93,14 @@ class ActionMerge extends BaseAction {
 					Form form = business.element().get(workCompleted.getForm(), Form.class);
 					if (null != form) {
 						StoreForm storeForm = new StoreForm();
-						StoreForm storeFormMobile = new StoreForm();
+						StoreForm mobileStoreForm = new StoreForm();
 						storeForm.setForm(new RelatedForm(form, form.getDataOrMobileData()));
-						storeFormMobile.setForm(new RelatedForm(form, form.getMobileDataOrData()));
+						mobileStoreForm.setForm(new RelatedForm(form, form.getMobileDataOrData()));
 						CompletableFuture.allOf(relateForm(business, form, storeForm),
 								relateScript(business, form, storeForm), relateFormMobile(business, form, storeForm),
 								relateScriptMobile(business, form, storeForm)).get();
 						workCompleted.getProperties().setStoreForm(storeForm);
-						workCompleted.getProperties().setStoreFormMobile(storeFormMobile);
+						workCompleted.getProperties().setMobileStoreForm(mobileStoreForm);
 					}
 					CompletableFuture.allOf(mergeItem(business, workCompleted, items),
 							mergeTaskCompleted(business, workCompleted, taskCompleteds),

+ 5 - 5
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java

@@ -188,9 +188,9 @@ public class EndProcessor extends AbstractEndProcessor {
 			Form form = (aeiObjects.business().element().get(work.getForm(), Form.class));
 			if (null != form) {
 				StoreForm storeForm = new StoreForm();
-				StoreForm storeFormMobile = new StoreForm();
+				StoreForm mobileStoreForm = new StoreForm();
 				storeForm.setForm(new RelatedForm(form, form.getDataOrMobileData()));
-				storeFormMobile.setForm(new RelatedForm(form, form.getMobileDataOrData()));
+				mobileStoreForm.setForm(new RelatedForm(form, form.getMobileDataOrData()));
 				CompletableFuture<Map<String, RelatedForm>> _relatedForm = CompletableFuture.supplyAsync(() -> {
 					Map<String, RelatedForm> map = new TreeMap<>();
 					try {
@@ -300,10 +300,10 @@ public class EndProcessor extends AbstractEndProcessor {
 						});
 				storeForm.setRelatedFormMap(_relatedForm.get());
 				storeForm.setRelatedScriptMap(_relatedScript.get());
-				storeFormMobile.setRelatedFormMap(_relatedFormMobile.get());
-				storeFormMobile.setRelatedScriptMap(_relatedScriptMobile.get());
+				mobileStoreForm.setRelatedFormMap(_relatedFormMobile.get());
+				mobileStoreForm.setRelatedScriptMap(_relatedScriptMobile.get());
 				workCompleted.getProperties().setStoreForm(storeForm);
-				workCompleted.getProperties().setStoreFormMobile(storeFormMobile);
+				workCompleted.getProperties().setMobileStoreForm(mobileStoreForm);
 			}
 		}
 		return workCompleted;

+ 5 - 4
o2server/x_program_center/src/main/webapp/jest/list.html

@@ -123,6 +123,7 @@
 				if (json.type == 'success') {
 					if (json.data) {
 						var str = '<table border="1" id = "apiTable" >';
+                        str += '<tr><td colspan="3"><center id="title" style="font-size:32px; font-weight:bold;">O2OA Service API URL</center></td></tr>';
 						$.each(json.data, function(index, o) {
 							str += '<tr>';
 							str += '<td>' + o.name + '</td>';
@@ -149,9 +150,9 @@
 
 </head>
 
-<body style="font-size: 12px; font-family: Microsoft Yahei; margin: 0px">
-<center id="title" style="font-size:32px; font-weight:bold;">O2OA Service API URL</center>
-<div id="content" style="margin-top:10px;margin-left: 50px;float: left;">&nbsp;</div>
-<div id="contentTable" style="margin-top:20px;margin-left: 50px;float: left;">&nbsp;</div>
+<body style="font-size: 12px; font-family: Microsoft Yahei; margin-top: 50px">
+<center id="title" style="font-size:32px; font-weight:bold;"></center>
+<div id="content" style="margin-top:10px;margin-left: 50px;">&nbsp;</div>
+<div id="contentTable" style="margin-top:20px;margin-left: 50px;">&nbsp;</div>
 </body>
 </html>

+ 1 - 2
o2web/source/o2_core/o2.js

@@ -1406,7 +1406,6 @@ if (!window.Promise){
         var useWebWorker = (window.layout && layout.config && layout.config.useWebWorker);
         //var noCache = false;
         if (!loadAsync || !useWebWorker){
-            debugger;
             var res;
             var p = new Promise(function(s,f){
                 res = new Request.JSON({
@@ -1869,7 +1868,7 @@ if (!window.Promise){
                 return { "then": function(s){ s(p); return this;} };
             }
         }else{
-            if (o2.typeOf(p.then)=="function"){
+            if (p && o2.typeOf(p.then)=="function"){
                 return Promise.resolve(p);
             }else{
                 return { "then": function(s){ s(p); return this;} };

+ 0 - 1
o2web/source/o2_core/o2/actionWorker.js

@@ -70,7 +70,6 @@ function V(httpRequest) {
 })();
 
 onmessage = function(e) {
-    debugger;
     this.action.sendRequest(e.data);
     //
     //

+ 1 - 2
o2web/source/o2_core/o2/ie_adapter.js

@@ -1,5 +1,4 @@
 (function(){
-    debugger;
     if (Browser.iecomp){
         // if (!document.body.addEvent){
         //     document.body.addEvent = function(type, fn){
@@ -141,4 +140,4 @@
 //
 // if (Browser.iecomp){
 //
-// }
+// }

+ 2 - 2
o2web/source/o2_core/o2/widget/Calendar.js

@@ -431,7 +431,7 @@ o2.widget.Calendar = o2.Calendar = new Class({
 		}
 	},
 	show: function(){
-		debugger;
+		;
 		if (!this.visible){
 			var dStr = this.node.get("value");
 			if (dStr && Date.isValid(dStr)){
@@ -884,7 +884,7 @@ o2.widget.Calendar = o2.Calendar = new Class({
 		}
 	},
 	_setTimeDate: function(node, h, m, s){
-		debugger;
+		;
 		if( !this.options.secondEnable ){
 			var div = this.contentTimeTable.getElement(".MWF_calendar_time_s");
 			if( div )div.hide();

+ 3 - 3
o2web/source/o2_core/o2/widget/Combox.js

@@ -218,7 +218,7 @@ o2.widget.Combox = new Class({
         }
     },
     createItem: function(values, i, data, callback){
-	    debugger;
+	    ;
         if (values[i]){
             var value = values[i];
 
@@ -741,7 +741,7 @@ o2.widget.Combox.Input = new Class({
                 "offset": {"y": 3}
             });
         }
-        debugger;
+
         var p = this.optionListNode.getPosition(pNode);
         if (p.y<10){
             var top = this.optionListNode.getStyle("top").toInt();
@@ -772,4 +772,4 @@ o2.widget.Combox.Input = new Class({
             });
         }
     }
-});
+});

+ 1 - 1
o2web/source/o2_core/o2/widget/Dialog.js

@@ -36,7 +36,7 @@ o2.widget.Dialog = o2.DL = new Class({
         "container": null
 	},
 	initialize: function(options){
-		debugger;
+
 		this.setOptions(options);
 
 		this.path = o2.session.path+"/widget/$Dialog/";

+ 3 - 3
o2web/source/o2_core/o2/widget/JavascriptEditor.js

@@ -238,7 +238,7 @@ o2.widget.JavascriptEditor = new Class({
         }.bind(this));
     },
     registerCompletion: function(){
-        debugger;
+
         if (this.editor){
             switch (this.options.type.toLowerCase()) {
                 case "ace": this.registerCompletionAce(); break;
@@ -323,7 +323,7 @@ o2.widget.JavascriptEditor = new Class({
         }
     },
     changeEditor: function(type){
-	    debugger;
+
         if (this.editor){
             var value = this.getValue();
             this.destroyEditor();
@@ -569,7 +569,7 @@ o2.widget.JavascriptEditor = new Class({
 
 o2.widget.JavascriptEditor.runtimeEnvironment = {};
 o2.widget.JavascriptEditor.getCompletionEnvironment = function(runtime, callback) {
-    debugger;
+
     if (!o2.widget.JavascriptEditor.runtimeEnvironment[runtime]) {
         o2.require("o2.xScript.Macro", function() {
             switch (runtime) {

+ 1 - 1
o2web/source/o2_core/o2/widget/Maplist.js

@@ -80,7 +80,7 @@ o2.widget.Maplist = new Class({
         }.bind(this));
 	},
 	showCode: function(){
-		debugger;
+
 		// var display = this.contentNode.getStyle("display");
 		// if (display=="none") this.expand();
 			

+ 1 - 1
o2web/source/o2_core/o2/widget/O2Identity.js

@@ -12,7 +12,7 @@ o2.widget.O2Identity = new Class({
         "disableInfor" : false
 	},
 	initialize: function(data, container, options){
-	    debugger;
+
 		this.setOptions(options);
 		this.loadedInfor = false;
 

+ 1 - 1
o2web/source/o2_core/o2/widget/ScriptArea.js

@@ -69,7 +69,7 @@ o2.widget.ScriptArea = new Class({
         }
     },
     maxSize: function(){
-        debugger;
+
         var obj = this.options.maxObj;
         var coordinates = obj.getCoordinates(obj.getOffsetParent());
 

+ 2 - 2
o2web/source/o2_core/o2/widget/Tablet.js

@@ -1173,7 +1173,7 @@ o2.widget.Tablet.ImageMover = new Class({
         var	y=offset.y;
         if( y == 0 )return;
 
-        debugger;
+
 
         var coordinates = this.dragNode.getCoordinates( this.node );
         var containerSize = this.node.getSize();
@@ -1281,4 +1281,4 @@ o2.widget.Tablet.ImageMover = new Class({
 
         delete this;
     }
-});
+});

+ 2 - 2
o2web/source/o2_core/o2/widget/Toolbar.js

@@ -272,7 +272,7 @@ o2.widget.ToolbarButton = new Class({
 		if (this.modifiyStyle) if (!this.options.disable){this.node.set("styles", this.toolbar.css.buttonUp);};
 	},
 	_buttonClick: function(e){
-		debugger;
+
 		if (!this.options.disable){
 			if (this.options.action){
 				if (typeOf(this.options.action)==="string"){
@@ -519,4 +519,4 @@ o2.widget.ToolbarMenu = new Class({
 		this.menu.addMenuLine();
 	}
 
-});
+});

+ 1 - 1
o2web/source/o2_core/o2/xAction/RestActions.js

@@ -95,7 +95,7 @@ MWF.xAction.RestActions = MWF.Actions = {
 
     //actions: [{"action": "", "name": "list", "par": [], "body": "",  "urlEncode": false, "cache": false}]
     invokeAsync2: function(actions, callback){
-        debugger;
+
         var cbs = (o2.typeOf(callback)==="function") ? callback : callback.success;
         var cbf = (o2.typeOf(callback)==="function") ? null : callback.failure;
         var res = [];

+ 1 - 1
o2web/source/o2_core/o2/xAction/services/x_faceset_control.js

@@ -13,7 +13,7 @@ MWF.xAction.RestActions.Action["x_faceset_control"] = new Class({
         }.bind(this));
     },
     invoke: function(service, options){
-        debugger;
+
         if (this.faceKeys){
             if(service.enctype && (service.enctype.toLowerCase()==="formdata")){
                 options.data.append("api_key", this.faceKeys.api_key);

+ 1 - 1
o2web/source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js

@@ -42,7 +42,7 @@ MWF.xAction.RestActions.Action["x_organization_assemble_authentication"] = new C
     getAuthentication: function(success, failure, async){
         this.action.invoke({"name": "getAuthentication",
             "success": function(json, responseText){
-                if (json.data.tokenType!="anonymous"){
+                if (json.data.tokenType!=="anonymous" || layout.anonymous){
                     if (success) success(json);
                 }else{
                     if (failure) failure(null, responseText, json.message);

+ 4 - 4
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js

@@ -279,7 +279,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
             messageItem.status = "completed";
         }
         //@upload message
-        debugger;
+
         if (messageItem && messageItem.moduleMessage){
             if (messageItem.moduleMessage.transferComplete) messageItem.moduleMessage.transferComplete();
         }
@@ -317,7 +317,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
             }
         }
         //@upload message
-        debugger;
+
         if (messageItem && messageItem.moduleMessage){
             if (messageItem.moduleMessage.updateProgress) messageItem.moduleMessage.updateProgress(percent);
         }
@@ -460,7 +460,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
         return xhr;
 	},
 	addFormDataMessage: function(file, noProgress, xhr, showMsg){
-        debugger;
+
         if (layout.desktop.message){
             var contentHTML = "";
             if (noProgress){
@@ -497,7 +497,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
                 }
             };
         }
-debugger;
+
         //@upload message
         if (this.targetModule){
             var moduleMessage = this.targetModule.module.addFormDataMessage(this.targetModule.file);

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/Authentication.js

@@ -396,7 +396,7 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         return max - min;
     },
     checkCameraLogin: function () {
-        debugger;
+
         if (this.cameraLoginConfig.errorCount > this.cameraLoginConfig.errorMax) {
             this.cameraLoginVideoInfoNode.set("text", MWF.LP.desktop.login.camera_loginError);
         } else {

+ 2 - 2
o2web/source/o2_core/o2/xDesktop/Common.js

@@ -492,14 +492,14 @@ MWF.xDesktop.getServiceAddressConfigArray = function(config, callback, error) {
     config.center.each(function(center){
         requests.push(
             MWF.xDesktop.getServiceAddressConfigObject(center, function(serviceAddressList, center){
-                debugger;
+
                 requests.each(function(res){
                     if (res && res.res) if (res.res.isRunning()){res.res.cancel();}
                     if (res && res.actionWorker) res.actionWorker.terminate();
                 });
                 if (callback) callback(serviceAddressList, center);
             }.bind(this), function(){
-                debugger;
+
                 if (requests.length){
                     for (var i=0; i<requests.length; i++){
                         if (requests[i].res) if (requests[i].res.isRunning()) return "";

+ 4 - 4
o2web/source/o2_core/o2/xDesktop/Default.js

@@ -265,7 +265,7 @@ o2.xDesktop.Default = new Class({
     },
 
     loadStatus: function(){
-        debugger;
+
         if (this.status){
             var keys = Object.keys(this.status.apps);
             if (this.status.apps && keys.length){
@@ -511,7 +511,7 @@ o2.xDesktop.Default = new Class({
                 var appStatus = this.getAppStatusData(app, id);
                 if (appStatus) status.apps[id] = appStatus;
             }
-            debugger;
+
             if (app.isIndex){
                 if (!status.apps[id]) status.apps[id] = {};
                 status.apps[id].isIndex = true;
@@ -1181,8 +1181,8 @@ o2.xDesktop.Default.StartMenu = new Class({
     },
 
     checkMenuItem: function(value, currentNames){
-        debugger;
-        debugger;
+
+
         if (value.visible===false) return false;
         var isAllow = true;
         if (value.allowList) isAllow = (value.allowList.length) ? (value.allowList.isIntersect(currentNames)) : true;

+ 4 - 4
o2web/source/o2_core/o2/xDesktop/Dialog.js

@@ -142,7 +142,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
                         button = new Element( bt.tag, {}).inject(this.button);
                     }
                 }
-                debugger;
+
                 if( button.get("type") === "button" ){
                     button.set({
                         "value": bt.text,
@@ -780,7 +780,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
 
     },
     setContentSize: function(height, width){
-        debugger;
+
         //this.content.setStyle("height", this.getContentSize(height));
         // if (!this.options.height && !height){
         //    this.content.setStyle("height", "auto");
@@ -822,7 +822,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
     }
 });
 o2.DL.open = function(options){
-    debugger;
+
     if (!options) options = {};
     if (!options.style) options.style = "user";
     //if (!options.transition) options.transition = Fx.Transitions.Back.easeOut;
@@ -907,4 +907,4 @@ o2.DL.open = function(options){
     }
     dlg.show();
     return dlg;
-};
+};

+ 3 - 3
o2web/source/o2_core/o2/xDesktop/Layout.js

@@ -158,7 +158,7 @@ MWF.xDesktop.Layout = new Class({
         }
     },
     initNode: function(node){
-        debugger;
+
 
         this.loadCss();
 
@@ -633,7 +633,7 @@ MWF.xDesktop.Layout = new Class({
                 if (!this.notRecordStatus) this.recordDesktopStatus();
                 if (this.socket && this.socket.webSocket) {
                     //console.log("websocket is onbeforeunload close ...");
-                    debugger;
+
                     this.socket.reConnect = false;
                     this.socket.webSocket.close();
                     //return false;
@@ -668,7 +668,7 @@ MWF.xDesktop.Layout = new Class({
             "widgets": {}
         };
         Object.each(this.apps, function(app, id){
-            debugger;
+
             if (app.window){
                 if (app.options.desktopReload){
                     var appStatus ={

+ 10 - 10
o2web/source/o2_core/o2/xDesktop/WebSocket.js

@@ -236,7 +236,7 @@ MWF.xDesktop.WebSocket = new Class({
         }
     },
     receiveCMSPublishMessage: function(data){
-        debugger;
+
         var content = "<font style='color: #ea621f'>"+(data.body.creatorPerson||"").split("@")[0]+"</font>"+MWF.LP.desktop.messsage.publishDocument+data.body.title;
 
         var msg = {
@@ -286,7 +286,7 @@ MWF.xDesktop.WebSocket = new Class({
         }.bind(this));
     },
     receiveTaskMessage: function(data){
-        debugger;
+
         var task = data.body;
         //var content = MWF.LP.desktop.messsage.receiveTask+"《"+task.title+"》, "+MWF.LP.desktop.messsage.activity+": <font style='color: #ea621f'>"+(task.activityName || "")+"</font>";
         var content = data.title;
@@ -406,7 +406,7 @@ MWF.xDesktop.WebSocket = new Class({
     },
 
     receiveFileEditorMessage: function(data){
-        debugger;
+
         var content = "<font style='color: #ea621f; font-weight: bold'>"+MWF.name.cn(data.body.person)+"</font> "+MWF.LP.desktop.messsage.receiveFileEditor+"“"+data.body.name+"”. ";
         var msg = {
             "subject": MWF.LP.desktop.messsage.fileEditorMessage,
@@ -437,7 +437,7 @@ MWF.xDesktop.WebSocket = new Class({
     },
 
     receiveFileShareMessage: function(data){
-        debugger;
+
         var content = "<font style='color: #ea621f; font-weight: bold'>"+MWF.name.cn(data.body.person)+"</font> "+MWF.LP.desktop.messsage.receiveFileShare+"“"+data.body.name+"”. ";
         var msg = {
             "subject": MWF.LP.desktop.messsage.fileShareMessage,
@@ -492,7 +492,7 @@ MWF.xDesktop.WebSocket = new Class({
         }
     },
     receiveMeetingInviteMessage: function(data){
-        debugger;
+
         this.getMeeting(data, function(meeting){
             var content = MWF.LP.desktop.messsage.meetingInvite;
             content = content.replace(/{person}/g, MWF.name.cn(meeting.applicant));
@@ -520,7 +520,7 @@ MWF.xDesktop.WebSocket = new Class({
         }.bind(this));
     },
     receiveMeetingCancelMessage: function(data){
-        debugger;
+
         this.getMeeting(data, function(meeting){
             var content = MWF.LP.desktop.messsage.meetingCancel;
             content = content.replace(/{person}/g, MWF.name.cn(meeting.applicant));
@@ -548,7 +548,7 @@ MWF.xDesktop.WebSocket = new Class({
         }.bind(this));
     },
     receiveMeetingAcceptMessage: function(data){
-        debugger;
+
         this.getMeeting(data, function(meeting){
             var content = MWF.LP.desktop.messsage.meetingAccept;
             //content = content.replace(/{person}/g, MWF.name.cn(meeting.applicant));
@@ -577,7 +577,7 @@ MWF.xDesktop.WebSocket = new Class({
         }.bind(this));
     },
     receiveMeetingRejectMessage: function(data){
-        debugger;
+
         this.getMeeting(data, function(meeting){
             var content = MWF.LP.desktop.messsage.meetingReject;
             //content = content.replace(/{person}/g, MWF.name.cn(meeting.applicant));
@@ -669,7 +669,7 @@ MWF.xDesktop.WebSocket = new Class({
         });
     },
     receiveCalendarAlarmMessage: function(data){
-        debugger;
+
         var content = MWF.LP.desktop.messsage.canlendarAlarm;
         content = content.replace(/{title}/g, data.title);
 
@@ -715,7 +715,7 @@ MWF.xDesktop.WebSocket = new Class({
         });
     },
     receiveTeamWorkMessage: function(data){
-        debugger;
+
         var task = data.body;
         //var content = MWF.LP.desktop.messsage.receiveTask+"《"+task.title+"》, "+MWF.LP.desktop.messsage.activity+": <font style='color: #ea621f'>"+(task.activityName || "")+"</font>";
         var content = data.title;

+ 4 - 4
o2web/source/o2_core/o2/xScript/CMSEnvironment.js

@@ -580,7 +580,7 @@ MWF.xScript.CMSEnvironment = function(ev){
         },
         //查询组织的下级--返回组织的对象数组
         //nested  布尔  true嵌套下级;false直接下级;默认false;
-        listSubUnit: function(name, nested){
+        listSubUnit: function(name, nested, async){
             getOrgActions();
             var data = {"unitList": getNameFlag(name)};
             var v = null;
@@ -795,7 +795,7 @@ MWF.xScript.CMSEnvironment = function(ev){
             var data = {"identityList":getNameFlag(name)};
             var v = null;
             var cb = function(json){
-                v = json.data;
+                v = json.data.nameList;
                 if (async && o2.typeOf(async)=="function") return async(v);
                 return v;
             };
@@ -2330,9 +2330,9 @@ MWF.xScript.createCMSDict = function(application){
             if (path){
                 var p = encodePath( path );
                 //var p = path.replace(/\./g, "/");
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async, false);
             }else{
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async, false);
             }
             return (!!async) ? promise : value;
 

+ 7 - 7
o2web/source/o2_core/o2/xScript/Environment.js

@@ -747,7 +747,7 @@ MWF.xScript.Environment = function(ev){
         },
         //查询组织的下级--返回组织的对象数组
         //nested  布尔  true嵌套下级;false直接下级;默认false;
-        listSubUnit: function(name, nested){
+        listSubUnit: function(name, nested, async){
             getOrgActions();
             var data = {"unitList": getNameFlag(name)};
             var v = null;
@@ -962,7 +962,7 @@ MWF.xScript.Environment = function(ev){
             var data = {"identityList":getNameFlag(name)};
             var v = null;
             var cb = function(json){
-                v = json.data;
+                v = json.data.nameList;
                 if (async && o2.typeOf(async)=="function") return async(v);
                 return v;
             };
@@ -1457,7 +1457,7 @@ MWF.xScript.Environment = function(ev){
                 }
                 break;
         }
-debugger;
+
         scriptAction.getScriptByName( application, name, includedScripts, function(json){
             if (json.data){
                 includedScripts.push( key );
@@ -1982,7 +1982,7 @@ MWF.xScript.JSONData = function(data, callback, key, parent, _form){
     };
     var setter = function(data, callback, k, _self){
         return function(v){
-            debugger;
+
             data[k] = v;
             //debugger;
             //this.add(k, v, true);
@@ -2010,7 +2010,7 @@ MWF.xScript.JSONData = function(data, callback, key, parent, _form){
                         }
                         if (path.length) _form.sectionListObj[path.join(".")] = newKey;
                     }catch(e){
-                        debugger;
+
                     }
                 }},
             "add": {"value": function(newKey, newValue, overwrite){
@@ -2417,9 +2417,9 @@ MWF.xScript.createDict = function(application){
             if (path){
                 var p = encodePath( path );
                 //var p = path.replace(/\./g, "/");
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async, false);
             }else{
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async, false);
             }
             return (!!async) ? promise : value;
 

+ 5 - 5
o2web/source/o2_core/o2/xScript/PageEnvironment.js

@@ -632,7 +632,7 @@ MWF.xScript.PageEnvironment = function (ev) {
         },
         //查询组织的下级--返回组织的对象数组
         //nested  布尔  true嵌套下级;false直接下级;默认false;
-        listSubUnit: function(name, nested){
+        listSubUnit: function(name, nested, async){
             getOrgActions();
             var data = {"unitList": getNameFlag(name)};
             var v = null;
@@ -847,7 +847,7 @@ MWF.xScript.PageEnvironment = function (ev) {
             var data = {"identityList":getNameFlag(name)};
             var v = null;
             var cb = function(json){
-                v = json.data;
+                v = json.data.nameList;
                 if (async && o2.typeOf(async)=="function") return async(v);
                 return v;
             };
@@ -1856,7 +1856,7 @@ MWF.xScript.JSONData = function(data, callback, key, parent, _form){
                         }
                         if (path.length) _form.sectionListObj[path.join(".")] = newKey;
                     }catch(e){
-                        debugger;
+
                     }
                 }},
             "add": {"value": function(newKey, newValue, overwrite){
@@ -2143,9 +2143,9 @@ MWF.xScript.createDict = function(application){
             if (path){
                 var p = encodePath( path );
                 //var p = path.replace(/\./g, "/");
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async, false);
             }else{
-                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async);
+                promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async, false);
             }
             return (!!async) ? promise : value;
 

+ 5 - 5
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -556,7 +556,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
         },
         //查询组织的下级--返回组织的对象数组
         //nested  布尔  true嵌套下级;false直接下级;默认false;
-        listSubUnit: function(name, nested){
+        listSubUnit: function(name, nested, async){
             getOrgActions();
             var data = {"unitList": getNameFlag(name)};
             var v = null;
@@ -771,7 +771,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
             var data = {"identityList":getNameFlag(name)};
             var v = null;
             var cb = function(json){
-                v = json.data;
+                v = json.data.nameList;
                 if (async && o2.typeOf(async)=="function") return async(v);
                 return v;
             };
@@ -1588,7 +1588,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
             })
         },
         "startProcess": function (app, process, data, identity, callback, target, latest) {
-            debugger;
+
             if (arguments.length > 2) {
                 for (var i = 2; i < arguments.length; i++) {
                     if (typeOf(arguments[i]) == "boolean") {
@@ -1911,9 +1911,9 @@ if( !MWF.xScript.createDict ){
                 if (path){
                     var p = encodePath( path );
                     //var p = path.replace(/\./g, "/");
-                    promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async);
+                    promise = action[ ( (enableAnonymous && type == "cms") ? "getDictDataAnonymous" : "getDictData" ) ](encodeURIComponent(this.name), applicationId, p, cb, null, !!async, false);
                 }else{
-                    promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async);
+                    promise = action[ ( (enableAnonymous && type == "cms") ? "getDictRootAnonymous" : "getDictRoot" ) ](this.name, applicationId, cb, null, !!async, false);
                 }
                 return (!!async) ? promise : value;
 

+ 0 - 0
o2web/source/x_component_Template/test2.js


+ 2 - 2
o2web/source/x_component_portal_Portal/Main.js

@@ -91,7 +91,7 @@ MWF.xApplication.portal.Portal.Main = new Class({
         var loadModuleFlag = false;
         var check = function(){
             if (!!pageJson && loadModuleFlag){
-                layout.sessionPromise.then(function(){
+                layout.sessionPromise.finally(function(){
                     this.pageInfor = pageJson.data;
                     this.setTitle(this.portal.name+"-"+pageJson.data.name);
                     var page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null;
@@ -156,7 +156,7 @@ MWF.xApplication.portal.Portal.Main = new Class({
         var loadModuleFlag = false;
         var check = function(){
             if (!!pageJson && loadModuleFlag){
-                layout.sessionPromise.then(function(){
+                layout.sessionPromise.finally(function(){
                     this.setTitle(pageJson.data.name);
                     if (pageJson.data.page){
                         this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null;

+ 7 - 1
o2web/source/x_component_process_FormDesigner/Module/Actionbar/actionbar.html

@@ -20,7 +20,13 @@
                 <input type="radio" name="hideSystemTools" value="true" text{($.hideSystemTools)?'checked':''}/>不显示
             </td>
           </tr>
-
+			<tr>
+			<td class="editTableTitle">已阅:</td>
+			<td class="editTableValue">
+				<input type="radio" name="hideReadedAction" value="false" text{(!$.hideReadedAction)?'checked':''}/>显示
+				<input type="radio" name="hideReadedAction" value="true" text{($.hideReadedAction)?'checked':''}/>不显示
+			</td>
+		</tr>
 		</table>
 	</div>
     <div title="操作"  class="MWFTab" style="overflow: hidden">

+ 0 - 3
o2web/source/x_component_process_Xform/$Input.js

@@ -184,14 +184,12 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
         return (this.json.defaultValue && this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value || "");
     },
 	getValue: function(){
-        debugger;
         if (this.moduleValueAG) return this.moduleValueAG;
         var value = this._getBusinessData();
         if (!value) value = this._computeValue();
 		return value || "";
 	},
     _setValue: function(value){
-	    debugger;
 	    // if (value && value.isAG){
 	    //     var ag = o2.AG.all(value).then(function(v){
 	    //         if (o2.typeOf(v)=="array") v = v[0];
@@ -393,7 +391,6 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
     },
     notValidationMode: function(text){
         if (!this.isNotValidationMode){
-            debugger;
             this.isNotValidationMode = true;
             this.node.store("borderStyle", this.node.getStyles("border-left", "border-right", "border-top", "border-bottom"));
             this.node.setStyle("border-color", "red");

+ 0 - 1
o2web/source/x_component_process_Xform/$Module.js

@@ -214,7 +214,6 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module =  new Class({
         }
     },
     _setBusinessSectionData: function(v){
-        debugger;
         switch (this.json.sectionBy){
             case "person":
                 this._setBusinessSectionDataByPerson(v);

+ 4 - 2
o2web/source/x_component_process_Xform/Actionbar.js

@@ -29,7 +29,7 @@ MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar =  new Class({
                 //alert(this.readonly)
 
                 if( this.json.multiTools ){ //自定义操作和系统操作混合的情况,用 system : true 来区分系统和自定义
-                    var addReadActionFlag = !this.json.hideSystemTools; //是否需要增加已阅
+                    var addReadActionFlag = !this.json.hideSystemTools && !this.json.hideReadedAction; //是否需要增加已阅
                     this.json.multiTools.each( function (tool) {
                         if( tool.system ){
                             if( !this.json.hideSystemTools ){
@@ -80,7 +80,9 @@ MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar =  new Class({
 
                             //this.json.defaultTools.push(o);
                             this.setToolbars(this.json.defaultTools, this.toolbarNode, this.readonly);
-                            this.setToolbars(addActions, this.toolbarNode, this.readonly);
+                            if( !this.json.hideReadedAction ){
+                                this.setToolbars(addActions, this.toolbarNode, this.readonly);
+                            }
 
                             this.setCustomToolbars(this.json.tools, this.toolbarNode);
                             this.toolbarWidget.load();

+ 0 - 5
o2web/source/x_component_process_Xform/Attachment.js

@@ -558,7 +558,6 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
         if (this.closeOfficeAction) this.setActionDisabled(this.closeOfficeAction);
     },
     loadMinActions: function () {
-        debugger;
         var hiddenGroup = this.options.toolbarGroupHidden;
         if (!hiddenGroup.contains("edit")) {
             this.min_uploadAction = this.createAction(this.minActionAreaNode, "upload", MWF.LP.widget.upload, function (e, node) {
@@ -701,7 +700,6 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
         }
     },
     setAttachmentConfig: function (readInput, editInput, controllerInput) {
-        debugger;
         if (this.selectedAttachments.length) {
             var readList = readInput.retrieve("data-value");
             var editList = editInput.retrieve("data-value");
@@ -754,7 +752,6 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
                 o2.Actions.get("x_processplatform_assemble_surface").configAttachment(att.data.id, this.module.form.businessData.work.id, att.data, function () {
                     //刷新附件权限,以后要加一个刷新附件的功能
                     o2.Actions.load("x_processplatform_assemble_surface").AttachmentAction.getWithWorkOrWorkCompleted(att.data.id, this.module.form.businessData.work.id, function (json) {
-                        debugger;
                         var attachment = this.getAttachmentById( att.data.id );
                         if( attachment ){
                             attachment.data = json.data;
@@ -1050,7 +1047,6 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
         this.json = json;
         this.form = form;
         this.field = true;
-        debugger;
     },
 
     _loadUserInterface: function () {
@@ -1119,7 +1115,6 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
     },
 
     _loadEvents: function (editorConfig) {
-        debugger;
         Object.each(this.json.events, function (e, key) {
             if (e.code) {
                 if (this.options.moduleEvents.indexOf(key) !== -1) {

+ 1 - 1
o2web/source/x_component_process_Xform/Calendar.js

@@ -70,7 +70,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar =  new Class({
     },
 
 	clickSelect: function(){
-	    debugger;
+
         var _self = this;
         if (!this.calendar){
             MWF.require("MWF.widget.Calendar", function(){

+ 1 - 1
o2web/source/x_component_process_Xform/DatagridMobile.js

@@ -1017,7 +1017,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                 var data = currentTable.retrieve("data");
 
                 //var attKeys = [];
-                debugger;
+
                 var titleThs = _self.table.getElements("th");
                 titleThs.each(function(th, i){
                     var key = th.get("id");

+ 2 - 2
o2web/source/x_component_process_Xform/DatagridPC.js

@@ -164,7 +164,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 
 
 	_getValueText: function(idx, value){
-		debugger;
+
 		var module = this.editModules[idx];
 		if (module){
 			switch (module.json.type){
@@ -348,7 +348,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 					if (module.json.type=="sequence"){
 						module.node.set("text", module.node.getParent("tr").rowIndex);
 					}else {
-						debugger;
+
 						if (data[id]) {
 							module.setData(data[id][module.json.id]);
 						} else {

+ 13 - 13
o2web/source/x_component_process_Xform/Documenteditor.js

@@ -564,7 +564,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         this.layout_meetingRecordContent = this.contentNode.getElement(".doc_layout_meeting_record_content");
     },
     _loadCustom: function(){
-        debugger;
+
         var nodes = this.contentNode.getElements(".doc_layout");
         nodes.each(function(node){
             var name = node.get("data-doc-layout");
@@ -606,7 +606,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         //自定义
         this._loadCustom();
 
-        debugger;
+
 
         this.reSetShow(control);
         this.reSetEdit();
@@ -665,7 +665,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         if (this.layout_fileNoUpTable) this.layout_fileNoUpTable[m("signer")]();
         if (this.layout_filenoArea) this.layout_filenoArea[(!control.signer) ? "show" : "hide"]();
 
-        debugger;
+
         if (this.layout_signerTitle) this.layout_signerTitle[m("signer")]();
         if (this.layout_signer) this.layout_signer[m("signer")]();
 
@@ -677,7 +677,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         if (this.layout_issuanceUnit) this.layout_issuanceUnit[m("issuanceUnit")]();
         if (this.layout_issuanceDate) this.layout_issuanceDate[m("issuanceDate")]();
 
-        debugger;
+
         if (this.layout_issuanceUnit && this.layout_issuanceDate){
             var table = this.layout_issuanceUnit.getParent("table")
             if (table && !table.hasClass("doc_layout_headIssuance")) {
@@ -988,7 +988,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
     },
 
     checkSaveNewEdition: function(callback){
-        debugger;
+
         if (!this.allowEdit || !this.data.filetext || this.data.filetext == this.json.defaultValue.filetext) return false;
         if (this.form.businessData.work){
             var originaData = this.form.businessData.originalData[this.json.id];
@@ -1667,7 +1667,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         }.bind(this));
 
         this.zoomAddAction.addEvent("click", function(){
-            debugger;
+
             var i = (this.scale/0.05).toInt();
             if (i*0.05<this.scale) i++;
             var v = i*0.05;
@@ -1944,7 +1944,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         // ];
 
         //CKEDITOR.plugins.addExternal('ckeditor_wiris', 'https://ckeditor.com/docs/ckeditor4/4.13.0/examples/assets/plugins/ckeditor_wiris/', 'plugin.js');
-debugger;
+
         var editorConfig = {
             qtRows: 20, // Count of rows
             qtColumns: 20, // Count of columns
@@ -2306,7 +2306,7 @@ debugger;
                         case "issuanceDate":
                         case "editionDate":
                             var d = new Date(v);
-                            debugger;
+
                             if (d.isValid() && d.getFullYear()!=1970){
                                 var y = d.getFullYear();
                                 var m = d.getMonth();
@@ -2426,7 +2426,7 @@ debugger;
                 this._computeItemFieldData(name, null, dataItem);
                 //if (this.data[name]){
                 if (this[dom]){
-                    debugger;
+
                     if (dom=="layout_redHeader" || dom=="layout_subject" || dom=="layout_issuanceUnit"){
                         this[dom].set("html", this.data[name]|| "");
                     }else if (dom=="layout_attachment"){
@@ -2500,7 +2500,7 @@ debugger;
 
             this.setData(this.data, diffFiletext);
             //this._checkSplitPage(this.pages[0]);
-debugger;
+
             this._repage();
         }.bind(this));
     },
@@ -2511,7 +2511,7 @@ debugger;
     },
     getData: function(){
         //if (this.editMode){
-        debugger;
+
         if (this.layout_copies) this.data.copies = this.layout_copies.get("text");
         if (this.layout_secret) this.data.secret = this.layout_secret.get("text");
         if (this.layout_priority) this.data.priority = this.layout_priority.get("text");
@@ -2664,7 +2664,7 @@ debugger;
                 }.bind(this))
             }
 
-            debugger;
+
 
             if (this.layout_issuanceUnit && this.layout_issuanceDate ){
                 var table = this.layout_issuanceUnit.getParent("table")
@@ -2923,7 +2923,7 @@ debugger;
         return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+htmlStr+"</body></html>";
     },
     toWord: function(callback, name){
-        debugger;
+
         var docNmae = name || "";
         if (!docNmae){
             try{

+ 10 - 10
o2web/source/x_component_process_Xform/Form.js

@@ -236,7 +236,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         }.bind(this));
     },
     loadRelatedScript: function () {
-        debugger;
+
         if (this.json.includeScripts && this.json.includeScripts.length) {
             var includeScriptText = "";
             var includedIds = [];
@@ -1015,7 +1015,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         var data = this.businessData.data;
         Object.each(this.forms, function (module, id) {
             if (module.json.type === "Opinion") {
-                debugger;
+
                 if (issubmit) {
                     this.saveOpinion(module);
 
@@ -1151,7 +1151,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
     },
 
     saveWork: function (callback, silent) {
-        debugger;
+
         if (this.businessData.control["allowSave"]) {
             this.fireEvent("beforeSave");
 
@@ -1333,7 +1333,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         if (!this.options.readonly) {
             if (this.businessData.work && this.businessData.work.id) {
                 if (this.app.inBrowser && navigator.sendBeacon) {
-                    debugger;
+
                     var obj = this.workAction.action.actions["checkDraft"];
                     var url = this.workAction.action.address + obj.uri;
                     url = url.replace("{id}", this.businessData.work.id);
@@ -1544,7 +1544,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
     //    return this;
     //},
     getIgnoreImpowerIdentity: function (processorOrgList) {
-        debugger;
+
         var list = [];
         var check = function (org, isProcessOrg) {
             var moduleData = isProcessOrg ? org.getValue() : org.getData();
@@ -1786,7 +1786,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         }
         var _work = this;
         options.onPostLoad = function () {
-            debugger;
+
             var dialog = this;
             dialog.node.setStyle("display", "block");
             var nodeSize = div.getSize();
@@ -1920,7 +1920,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
 
     processWork: function () {
         var _self = this;
-        debugger;
+
         if (!this.businessData.work.startTime) {
             this.startDraftProcess();
         } else if (this.json.submitFormType === "select") {
@@ -1953,7 +1953,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
             return false;
         }
 
-        debugger;
+
         if (!this.submitFormModule) {
             if (!MWF["APPSubmitform"]) {
                 MWF.xDesktop.requireApp("process.Xform", "Subform", null, false);
@@ -1989,7 +1989,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         }
 
         var setSize = function (notRecenter) {
-            debugger;
+
             var dlg = this;
             if (!dlg || !dlg.node) return;
             dlg.node.setStyle("display", "block");
@@ -1998,7 +1998,7 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                 "height": size.y,
                 "width": size.x
             });
-            debugger;
+
             var s = dlg.setContentSize();
             // if ( dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto" ) {
             //     var paddingRight = (dlg.content.getStyle("padding-right").toInt() || 0 );

+ 4 - 4
o2web/source/x_component_process_Xform/Log.js

@@ -378,7 +378,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
         }
     },
     loadRecordTaskLine_default: function(task, node, isTask, margin, isZebra, nodeStyle, noIconNode){
-        debugger;
+
         var style = "logTaskNode";
         var textStyle = "logTaskFloatTextNode";
         if (nodeStyle){
@@ -446,7 +446,7 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
 
             switch (task.type) {
                 case "empower":
-                    debugger;
+
                     router = MWF.xApplication.process.Xform.LP.empower;
                     var empowerTo = (task.properties.nextManualTaskIdentityList && task.properties.nextManualTaskIdentityList.length) ? o2.name.cns(task.properties.nextManualTaskIdentityList).join(",") : "";
                     opinion = MWF.xApplication.process.Xform.LP.empowerTo + empowerTo;
@@ -1420,14 +1420,14 @@ MWF.xApplication.process.Xform.Log = MWF.APPLog =  new Class({
         var logReadNode = new Element("div", {"styles": this.form.css.logReadTextNode}).inject(node);
         if (readNames.length){
             var readStrTitle = readNames.join(", ");
-            var readStr = (readNames.length>20) ? readNames.slice(0,20).join(", ") : readStrTitle;
+            var readStr = (readNames.length>20) ? (readNames.slice(0,20).join(", ") + MWF.xApplication.process.Xform.LP.andSoForth ): readStrTitle;
             html = "<span style='color: #0000ff'>"+(this.json.showReadTitle || MWF.xApplication.process.Xform.LP.showReadTitle)+": </span>"+readStr+"<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>";
 
             //var logReadPersonNode = new Element("div", {"styles": this.form.css.logReadTextNode}).inject(logReadNode);
         }
         if (readCompletedNames.length){
             var readCompletedStrTitle = readCompletedNames.join(", ");
-            var readCompletedStr = (readCompletedNames.length>20) ? readCompletedNames.slice(0,20).join(", ") : readCompletedStrTitle;
+            var readCompletedStr = (readCompletedNames.length>20) ? (readCompletedNames.slice(0,20).join(", ") + MWF.xApplication.process.Xform.LP.andSoForth ): readCompletedStrTitle;
             html += "<span style='color: #0000ff'>"+(this.json.showReadCompletedTitle || MWF.xApplication.process.Xform.LP.showReadCompletedTitle)+": </span>"+readCompletedStr+"<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>";
         }
         if (html) logReadNode.set("html", html);

+ 1 - 1
o2web/source/x_component_process_Xform/Number.js

@@ -22,7 +22,7 @@ MWF.xApplication.process.Xform.Number = MWF.APPNumber =  new Class({
     //     return (isNaN(n)) ? 0 : n;
     // },
     validationFormat: function(){
-        debugger;
+
         if( !this.node.getElement("input") )return true;
         var n = this.node.getElement("input").get("value");
         if (isNaN(n)) {

+ 7 - 7
o2web/source/x_component_process_Xform/Org.js

@@ -101,7 +101,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         }
     },
     _computeValue: function(){
-        debugger;
+
         var simple = this.json.storeRange === "simple";
         var values = [];
         if (this.json.identityValue) {
@@ -493,7 +493,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         }
     },
     resetData: function(){
-        debugger;
+
         var v = this.getValue();
         //this.setData((v) ? v.join(", ") : "");
         this.setData(v);
@@ -702,7 +702,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg =  new Class({
         this.node = node;
     },
     _loadNodeInputEdit: function(){
-        debugger;
+
         this.node.setStyle("overflow","visible");
         var input=null;
         MWF.require("MWF.widget.Combox", function(){
@@ -1331,7 +1331,7 @@ MWF.APPOrg.EmpowerChecker = new Class({
         return array;
     },
     setIgnoreEmpowerFlag : function(data, callback){
-        debugger;
+
         var ignoreList = this.getIgnoreEmpowerArray();
         for( var i=0; i<data.length; i++ ){
             var d = data[i];
@@ -1344,7 +1344,7 @@ MWF.APPOrg.EmpowerChecker = new Class({
         if( callback )callback( data );
     },
     replaceEmpowerIdentity : function(data, callback){
-        debugger;
+
         var empowerData = {};
         this.empowerSelectNodes.each(function(node){
             if( node.retrieve("isSelected") ){
@@ -1389,7 +1389,7 @@ MWF.APPOrg.EmpowerChecker = new Class({
     },
     openSelectEmpowerDlg_mobile : function( data, orginData, callback, container ){
 
-        debugger;
+
 
         var that = this;
 
@@ -1440,7 +1440,7 @@ MWF.APPOrg.EmpowerChecker = new Class({
                 "zIndex" : 3001,
                 "closeOnclickOk" : true,
                 "onComplete": function (items) {
-                    debugger;
+
                     var arr = [];
                     items.each(function (item) {
                         arr.push( item.data.id )

+ 1 - 1
o2web/source/x_component_process_Xform/Orgfield.js

@@ -520,7 +520,7 @@ MWF.xApplication.process.Xform.Orgfield = MWF.APPOrgfield =  new Class({
 		this._setValue(this.getValue());
 	},
 	clickSelect: function( ev ){
-        debugger;
+
         this.validationMode();
 		var count = (this.json.count) ? this.json.count : 0;
 

+ 2 - 2
o2web/source/x_component_process_Xform/Personfield.js

@@ -388,7 +388,7 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
     },
 
 	clickSelect: function( ev ){
-        debugger;
+
         var options = this.getOptions();
         if( this.selector && this.selector.loading ) {
         }else if( this.selector && this.selector.selector && this.selector.selector.active ){
@@ -648,7 +648,7 @@ MWF.xApplication.process.Xform.Personfield = MWF.APPPersonfield =  new Class({
         var values = [];
         var comboxValues = [];
 
-        debugger;
+
         var simple = this.json.storeRange === "simple";
 
         var type = typeOf(value);

+ 1 - 1
o2web/source/x_component_process_Xform/Select.js

@@ -318,7 +318,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
 		return (value.length==1) ? value[0] : value;
 	},
     resetData: function(){
-		debugger;
+
         this.setData(this.getValue());
     },
 	getOptionsObj : function(){

+ 1 - 1
o2web/source/x_component_process_Xform/Statement.js

@@ -42,7 +42,7 @@ MWF.xApplication.process.Xform.Statement = MWF.APPStatement =  new Class({
             }.bind(this));
         }
 
-        debugger;
+
 
         //var data = JSON.parse(this.json.data);
         var viewJson = {

+ 1 - 1
o2web/source/x_component_process_Xform/StatementSelector.js

@@ -117,7 +117,7 @@ MWF.xApplication.process.Xform.StatementSelector = MWF.APPStatementSelector =  n
                             "text": MWF.LP.process.button.ok,
                             "action": function(){
                                 //if (callback) callback(_self.view.selectedItems);
-                                debugger;
+
                                 if (callback) callback(_self.view.getData());
                                 this.close();
                             }

+ 1 - 1
o2web/source/x_component_process_Xform/Subform.js

@@ -13,7 +13,7 @@ MWF.xApplication.process.Xform.Subform = MWF.APPSubform = new Class({
             this.form.checkSubformLoaded();
             this.checked = true;
         } else {
-            debugger;
+
             this.getSubform(function () {
                 this.loadSubform();
             }.bind(this));

+ 1 - 1
o2web/source/x_component_process_Xform/View.js

@@ -50,7 +50,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
             }.bind(this));
         }
 
-        debugger;
+
 
         //var data = JSON.parse(this.json.data);
         var viewJson = {

+ 1 - 1
o2web/source/x_component_process_Xform/Widget.js

@@ -3,7 +3,7 @@ MWF.xApplication.process.Xform.Widget = MWF.APPWidget =  new Class({
     Extends: MWF.APP$Module,
 
     _loadUserInterface: function(){
-        debugger;
+
         this.node.empty();
         this.getWidget(function(){
             this.loadWidget();

+ 2 - 0
o2web/source/x_component_process_Xform/lp/zh-cn.js

@@ -38,6 +38,8 @@ MWF.xApplication.process.Xform.LP = {
     "rollbackTo": "流程回溯到",
     "in": "在",
 
+    "andSoForth" : "等",
+
     "noIdentitySelectRange" : "无法确定身份的选择范围",
     "noIdentityDutySelectRange" : "无法确定职务的选择范围",
     "noUnitSelectRange" : "无法确定组织的选择范围",

+ 3 - 3
o2web/source/x_component_process_Xform/widget/DocumentHistory.js

@@ -7,7 +7,7 @@ MWF.xApplication.process.Xform.widget.DocumentHistory = new Class({
         "inforTime": 2000
     },
     initialize: function(documentEditor, options){
-        debugger;
+
         this.setOptions(options);
         this.documentEditor = documentEditor;
         this.css = this.documentEditor.css;
@@ -24,7 +24,7 @@ MWF.xApplication.process.Xform.widget.DocumentHistory = new Class({
                     if (!layout.mobile || this.is_iPad()) this.createHistoryListNode();
 
                     this.documentEditor.options.pageShow = "single";
-                    debugger;
+
                     this.documentEditor.resetData();
 
                     this.beginDiffHistory();
@@ -998,4 +998,4 @@ MWF.xApplication.process.Xform.widget.DocumentHistory.Item = new Class({
             });
         }
     }
-})
+})

+ 3 - 3
o2web/source/x_component_process_Xform/widget/Monitor.js

@@ -111,7 +111,7 @@ MWF.xApplication.process.Xform.widget.Monitor = new Class({
     },
 
     logPlay: function(){
-        debugger;
+
         if (this.process){
             this.isPlaying = true;
             this.toolbar.childrenButton[0].setDisable(true);
@@ -159,7 +159,7 @@ MWF.xApplication.process.Xform.widget.Monitor = new Class({
         }
     },
     playMoveByRoutePoint: function(points, callback){
-        debugger;
+
         var p = {"x": this.playIcon.attr("x").toFloat(), "y": this.playIcon.attr("y").toFloat()};
         var toP = points.shift();
 
@@ -327,7 +327,7 @@ MWF.xApplication.process.Xform.widget.Monitor = new Class({
                 route.point.attr(this.css.passedRouteFillShap);
                 route.arrow.attr(this.css.passedRouteFillShap);
             }
-            debugger;
+
 
             if (log.taskCompletedList && log.taskCompletedList.length){
                 log.taskCompletedList.each(function(tc){

+ 77 - 59
o2web/source/x_desktop/js/base.js

@@ -57,9 +57,11 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
             app.appId = (options.appId) ? options.appId : ((appNamespace.options.multitask) ? appName + "-" + (new o2.widget.UUID()) : appName);
             app.options.appId = app.appId;
 
-            if (!taskitem) taskitem = layout.desktop.createTaskItem(app);
-            app.taskitem = taskitem;
-            app.taskitem.app = app;
+            if (layout.desktop.createTaskItem){
+                if (!taskitem) taskitem = layout.desktop.createTaskItem(app);
+                app.taskitem = taskitem;
+                app.taskitem.app = app;
+            }
 
             app.isLoadApplication = true;
             app.load(!notCurrent);
@@ -72,10 +74,11 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
                 layout.desktop.apps[app.appId] = app;
             }
 
-            layout.desktop.appArr.push(app);
-            layout.desktop.appCurrentList.push(app);
-            if (!notCurrent) layout.desktop.currentApp = app;
-
+            //if (layout.desktop.appArr){
+                layout.desktop.appArr.push(app);
+                layout.desktop.appCurrentList.push(app);
+                if (!notCurrent) layout.desktop.currentApp = app;
+            //}
             //app.taskitem = new MWF.xDesktop.Layout.Taskitem(app, this);
         } else {
             app.load(true);
@@ -427,7 +430,7 @@ o2.addReady(function () {
         layout.desktop.centerServer = center;
     };
     var _getDistribute = function (callback) {
-        debugger;
+
         if (layout.config.app_protocol === "auto") {
             layout.config.app_protocol = window.location.protocol;
         }
@@ -484,64 +487,78 @@ o2.addReady(function () {
             Cookie.write("x-token", options["x-token"]);
         }
 
-        layout.sessionPromise = {
-            "resolveList": [],
-            "rejectList": [],
-            "init": function(resolve, reject){
-                if (resolve) this.resolveList.push(resolve);
-                if (reject) this.rejectList.push(reject);
-                this.status = "pending";
-                this.resolveReturn = this;
-
-                //先判断用户是否登录
-                console.log("layout.sessionPromise.init")
-                o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) {
-                    this.status = "fulfilled";
-                    this.resolveReturn = json.data;
-                    this.runResolve(this.resolveReturn);
-                }.bind(this), function (xhr, text, error) {
-                    this.status = "rejected";
-                    this.resolveReturn = {"xhr": xhr, "text": text, "error": error};
-                    this.runReject(this.resolveReturn);
-                }.bind(this));
-            },
-            "runResolve": function(json){
-                while (this.resolveList.length){
-                    var r = this.resolveList.shift()(this.resolveReturn);
-                    if (r) this.resolveReturn = r;
-                }
-            },
-            "runReject": function(json){
-                while (this.rejectList.length){
-                    var r = this.rejectList.shift()(json);
-                    if (r) this.resolveReturn = r;
-                }
-            },
-            "then": function(resolve, reject){
-                if (resolve) this.resolveList.push(resolve);
-                if (reject) this.rejectList.push(reject);
-                switch (this.status){
-                    case "fulfilled":
-                        this.runResolve();
-                        break;
-                    case "rejected":
-                        this.runReject();
-                        break;
-                    default:
-                    //nothing
-                }
-                return this;
-            }
-        }
+        layout.sessionPromise = new Promise(function(resolve, reject){
+            o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) {
+                if (resolve) resolve(json.data);
+                //this.status = "fulfilled";
+                // this.resolveReturn = json.data;
+                // this.runResolve(this.resolveReturn);
+            }.bind(this), function (xhr, text, error) {
+                if (reject) reject({"xhr": xhr, "text": text, "error": error});
+                // this.status = "rejected";
+                // this.resolveReturn = {"xhr": xhr, "text": text, "error": error};
+                // this.runReject(this.resolveReturn);
+            }.bind(this));
+        });
+
+        // layout.sessionPromise = {
+        //     "resolveList": [],
+        //     "rejectList": [],
+        //     "init": function(resolve, reject){
+        //         if (resolve) this.resolveList.push(resolve);
+        //         if (reject) this.rejectList.push(reject);
+        //         this.status = "pending";
+        //         this.resolveReturn = this;
+        //
+        //         //先判断用户是否登录
+        //         console.log("layout.sessionPromise.init")
+        //         o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) {
+        //             this.status = "fulfilled";
+        //             this.resolveReturn = json.data;
+        //             this.runResolve(this.resolveReturn);
+        //         }.bind(this), function (xhr, text, error) {
+        //             this.status = "rejected";
+        //             this.resolveReturn = {"xhr": xhr, "text": text, "error": error};
+        //             this.runReject(this.resolveReturn);
+        //         }.bind(this));
+        //     },
+        //     "runResolve": function(json){
+        //         while (this.resolveList.length){
+        //             var r = this.resolveList.shift()(this.resolveReturn);
+        //             if (r) this.resolveReturn = r;
+        //         }
+        //     },
+        //     "runReject": function(json){
+        //         while (this.rejectList.length){
+        //             var r = this.rejectList.shift()(json);
+        //             if (r) this.resolveReturn = r;
+        //         }
+        //     },
+        //     "then": function(resolve, reject){
+        //         if (resolve) this.resolveList.push(resolve);
+        //         if (reject) this.rejectList.push(reject);
+        //         switch (this.status){
+        //             case "fulfilled":
+        //                 this.runResolve();
+        //                 break;
+        //             case "rejected":
+        //                 this.runReject();
+        //                 break;
+        //             default:
+        //             //nothing
+        //         }
+        //         return this;
+        //     }
+        // }
 
-        layout.sessionPromise.init(function(data){
+        layout.sessionPromise.then(function(data){
             //已经登录
             layout.user = data;
             layout.session = layout.session || {};
             layout.session.user = data;
             layout.session.token = data.token;
             layout.desktop.session = layout.session;
-
+            //_loadApp();
         }, function(){
             //允许匿名访问
             if (layout.anonymous) {
@@ -604,6 +621,7 @@ o2.addReady(function () {
 
 
         layout.openLogin = function () {
+            layout.desktop.type = "app";
             layout.authentication = new o2.xDesktop.Authentication({
                 "style": "flat",
                 "onLogin": _load.bind(layout)

+ 3 - 3
o2web/source/x_desktop/js/base_simple.js

@@ -13,7 +13,7 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
     o2.requireApp(module, clazz, callback, async);
 };
 o2.addReady(function () {
-    debugger;
+
     var loadingNode = $("loaddingArea");
     var loadeds = 0;
     var loadCount = 16;
@@ -256,7 +256,7 @@ o2.addReady(function () {
         });
     };
     var _createNewApplication = function (e, appNamespace, appName, options, statusObj) {
-        debugger;
+
         var app = new appNamespace["Main"](this, options);
         app.desktop = layout;
         app.inBrowser = true;
@@ -422,7 +422,7 @@ o2.addReady(function () {
             } else {
                 var par = "app=" + encodeURIComponent(appNames) + "&status=" + encodeURIComponent((statusObj) ? JSON.encode(statusObj) : "") + "&option=" + encodeURIComponent((options) ? JSON.encode(options) : "");
 
-                debugger;
+
                 if (layout.app.$openWithSelf) {
                     return window.location = o2.filterUrl("../x_desktop/app.html?" + par + ((layout.debugger) ? "&debugger" : ""));
                 } else {

+ 2 - 2
o2web/source/x_desktop/js/base_simple_anonymous.js

@@ -178,7 +178,7 @@ o2.addReady(function () {
         });
     };
     var _createNewApplication = function (e, appNamespace, appName, options, statusObj) {
-        debugger;
+
         var app = new appNamespace["Main"](this, options);
         app.desktop = layout;
         app.inBrowser = true;
@@ -340,7 +340,7 @@ o2.addReady(function () {
             } else {
                 var par = "app=" + encodeURIComponent(appNames) + "&status=" + encodeURIComponent((statusObj) ? JSON.encode(statusObj) : "") + "&option=" + encodeURIComponent((options) ? JSON.encode(options) : "");
 
-                debugger;
+
                 if (layout.app.$openWithSelf) {
                     return window.location = o2.filterUrl("../x_desktop/app.html?" + par + ((layout.debugger) ? "&debugger" : ""));
                 } else {

+ 2 - 2
o2web/source/x_desktop/js/qywxStartProcess.js

@@ -115,7 +115,7 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
                         "identity": null,
                         "latest": false,
                         "onStarted": function (data, title, processName) {
-                            debugger;
+
                             if (data.work){
                                 layout.startProcessDraft(data, title, processName, redirect);
                             }else{
@@ -145,7 +145,7 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
                 history.replaceState(null, "startProcess", "../x_desktop/appMobile.html?app=process.TaskCenter");
                 
             }
-            debugger;
+
             // layout.openApplication(null, "process.Work", options);
             layout.openWorkIn(options);
         });

+ 1 - 1
o2web/source/x_desktop/smapsso.html

@@ -74,7 +74,7 @@
                 window.layout = {};
                 window.layout.config = config;
                 getServiceAddress(config, function(address){
-                    debugger;
+
                     var uri = new URI(window.location.toString());
                     var xtoken = uri.getData("SMAP_SESSION_DATA");
                     var appID = uri.getData("appID");