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

Merge branch 'wrdp' into 'release'

Wrdp

See merge request o2oa/o2oa!2353
o2null 5 лет назад
Родитель
Сommit
e7081444b6
14 измененных файлов с 247 добавлено и 159 удалено
  1. 1 1
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSource.java
  2. 56 56
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/view/ActionListNextPageViewData.java
  3. 25 24
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreate.java
  4. 31 30
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateForce.java
  5. 23 25
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcess.java
  6. 18 16
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcessForce.java
  7. 1 2
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java
  8. 18 1
      o2web/source/x_component_process_FormDesigner/Module/Datagrid$Data.js
  9. 36 3
      o2web/source/x_component_process_FormDesigner/Module/Datagrid$Title.js
  10. 7 0
      o2web/source/x_component_process_FormDesigner/Module/Datagrid$Title/datagrid$Title.html
  11. 8 0
      o2web/source/x_component_process_FormDesigner/Module/Datagrid.js
  12. 2 0
      o2web/source/x_component_process_Xform/Actionbar.js
  13. 13 1
      o2web/source/x_component_process_Xform/DatagridMobile.js
  14. 8 0
      o2web/source/x_component_process_Xform/DatagridPC.js

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ExternalDataSource.java

@@ -76,7 +76,7 @@ public class ExternalDataSource extends ConfigObject {
 	@FieldDescribe("空闲阈值,默认300秒.")
 	private Integer maxIdleTime;
 
-	public static final Integer DEFAULT_MAXTOTAL = 50;
+	public static final Integer DEFAULT_MAXTOTAL = 100;
 
 	public static final Integer DEFAULT_MAXIDLE = 0;
 

+ 56 - 56
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/view/ActionListNextPageViewData.java

@@ -30,9 +30,9 @@ import java.util.List;
 import java.util.Map;
 
 public class ActionListNextPageViewData extends BaseAction {
-	
+
 	private static  Logger logger = LoggerFactory.getLogger( ActionListNextPageViewData.class );
-	
+
 	protected ActionResult<List<Wo>> execute( HttpServletRequest request, EffectivePerson effectivePerson, String lastDocId, Integer pageSize, JsonElement jsonElement ) throws Exception {
 		ActionResult<List<Wo>> result = new ActionResult<>();
 		List<Wo> wos = new ArrayList<>();
@@ -54,15 +54,15 @@ public class ActionListNextPageViewData extends BaseAction {
 		List<String> sortableFieldNames = null;
 		List<String> sortableFieldNames_upperCase = null;
 		QueryFilter queryFilter = null;
-		
+
 		if( pageSize <= 0 || pageSize == null ){
 			pageSize = 12;
 		}
-		
+
 		if( "(0)".equals( lastDocId ) || StringUtils.isEmpty( lastDocId ) ){
 			lastDocId = null;
 		}
-		
+
 		try {
 			wi = this.convertToWrapIn( jsonElement, Wi.class );
 		} catch (Exception e ) {
@@ -71,19 +71,19 @@ public class ActionListNextPageViewData extends BaseAction {
 			result.error( exception );
 			logger.error( e, effectivePerson, request, null );
 		}
-		
+
 		if( StringUtils.isEmpty( wi.getCategoryId() ) ) {
 			check = false;
 			Exception exception = new ExceptionViewDateQueryCategoryIdEmpty();
 			result.error( exception );
 		}
-		
+
 		if( StringUtils.isEmpty( wi.getViewId() ) ) {
 			check = false;
 			Exception exception = new ExceptionViewDataQueryViewIdEmpty();
 			result.error( exception );
 		}
-		
+
 		try {
 			isManager = userManagerService.isManager(effectivePerson );
 		} catch (Exception e) {
@@ -108,7 +108,7 @@ public class ActionListNextPageViewData extends BaseAction {
 				logger.error( e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if( check ){
 			try{
 				view = viewServiceAdv.get( wi.getViewId() );
@@ -133,7 +133,7 @@ public class ActionListNextPageViewData extends BaseAction {
 				result.error( exception );
 			}
 		}
-		
+
 		if( check ){
 			try{
 				//检查当前Category与View的关联是否存在
@@ -151,7 +151,7 @@ public class ActionListNextPageViewData extends BaseAction {
 				logger.error( e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if( check ){//设置查询条件的默认值,如果不传入则使用列表设置的值
 			if( StringUtils.isEmpty( wi.getOrderField() ) ) {
 				wi.setOrderField(view.getOrderField());
@@ -184,7 +184,7 @@ public class ActionListNextPageViewData extends BaseAction {
 				}
 			}
 		}
-		
+
 		if (check) {
 			try {
 				queryFilter = wi.getQueryFilter();
@@ -195,12 +195,12 @@ public class ActionListNextPageViewData extends BaseAction {
 				logger.error(e, effectivePerson, request, null);
 			}
 		}
-		
+
 		if( check ) {
 			if( StringUtils.isNotEmpty( lastDocId )) {
 				document = documentQueryService.get( lastDocId );
 			}
-			
+
 			//判断一下,如果排序的列不是Document的常规列, 需要从Item里查出符合条件的DocumentID列表
 			//从正常的Document属性列和全大写的属性列中都需要判断一下, sortableFieldNames and sortableFieldNames_upperCase
 			//如果sortableFieldNames and sortableFieldNames_upperCase都没有,那么就属性业务属性数据了,需要从item里去查询
@@ -209,20 +209,20 @@ public class ActionListNextPageViewData extends BaseAction {
 				List<String> viewableDocList = null;
 				if( isManager ) {
 					documentCount = documentQueryService.countWithConditionOutofPermission( queryFilter );
-					viewableDocList = documentQueryService.listIdsByCategoryId( category.getId(), wi.getOrderField(), wi.getOrderField(), 2000 );
+					viewableDocList = documentQueryService.listIdsByCategoryId( category.getId(), wi.getOrderField(), wi.getOrderType(), 2000 );
 				}else {
 					documentCount = documentQueryService.countWithConditionInReview( personName, queryFilter );
-					viewableDocList = documentQueryService.listDocIdsWithConditionInReview( personName, wi.getOrderField(), wi.getOrderField(), queryFilter, 2000 );
+					viewableDocList = documentQueryService.listDocIdsWithConditionInReview( personName, wi.getOrderField(), wi.getOrderType(), queryFilter, 2000 );
 				}
-				
+				logger.debug("documentCount:{}===viewableDocListCount:{}",documentCount,viewableDocList.size());
 				//以所有可见的DocId为基准,从Item里查询出2000个排序好的对象,拼成 dataObjList ( docId, sortFieldValue )返回
 				List<SimpleItemObj> simpleItems = documentQueryService.listSortObjWithOrderFieldInData( viewableDocList, wi.getOrderField(), wi.getOrderField(), wi.getOrderType() );
-			
+
 				if( ListTools.isNotEmpty( simpleItems )) {
 					String sequence = null;
 					Boolean  pickDocument = false;
-					documentList = new ArrayList<>();
-					for( SimpleItemObj item : simpleItems ) {				
+					searchResultList = new ArrayList<>();
+					for( SimpleItemObj item : simpleItems ) {
 						//填充Document数据
 						sequence = documentQueryService.getSequence( item.getId() );
 						if( StringUtils.isNotEmpty( sequence)) {
@@ -232,10 +232,10 @@ public class ActionListNextPageViewData extends BaseAction {
 								}
 							}else {
 								pickDocument = true;//取第1页的pageSize个document
-							}							
+							}
 							if( pickDocument ) {
-								if( documentList.size() < pageSize ) {
-									documentList.add( documentQueryService.get( item.getId() ));
+								if( searchResultList.size() < pageSize ) {
+									searchResultList.add( documentQueryService.get( item.getId() ));
 								}else {//数据够一页了
 									break;
 								}
@@ -297,10 +297,10 @@ public class ActionListNextPageViewData extends BaseAction {
 							}
 						}
 					}
-				}	
+				}
 			}
-		}		
-		
+		}
+
 		if( check ){
 			//补充业务数据
 			if( searchResultList != null && searchResultList.size() > 0 ){
@@ -334,7 +334,7 @@ public class ActionListNextPageViewData extends BaseAction {
 							result.error( exception );
 							logger.error( e, effectivePerson, request, null);
 						}
-					}					
+					}
 					wos.add( wo );
 				}
 			}
@@ -342,36 +342,36 @@ public class ActionListNextPageViewData extends BaseAction {
 			result.setData( wos );
 			result.setCount( documentCount );
 		}
-		
+
 		return result;
 	}
 
 	public class Wi {
-		
+
 		@FieldDescribe( "是否置顶:ALL|TOP|UNTOP." )
 		private String topFlag = "ALL";
-		
+
 		@FieldDescribe("需要过滤文档的分类ID")
 		private String categoryId;
 
 		@FieldDescribe("需要查询的列表ID")
 		private String viewId;
-		
+
 		@FieldDescribe("当前查询用于排序的列名,默认以列表配置为主")
 		private String orderField;
 
 		@FieldDescribe("当前排序方式:DESC|ASC,默认以列表配置为主")
 		private String orderType;
-		
+
 		@FieldDescribe("值类别:支持string | date | time | datetime | boolean | boolean | text")
 		private String fieldType;
-		
+
 		@FieldDescribe("查询文档类型: 全部 | 信息 | 数据 ")
 		private String documentType;
-		
+
 		@FieldDescribe("需要查询的文档状态:published | draft | archived")
 		private String docStatus;
-		
+
 		public String getFieldType() {
 			return fieldType;
 		}
@@ -427,7 +427,7 @@ public class ActionListNextPageViewData extends BaseAction {
 		public void setDocumentType(String documentType) {
 			this.documentType = documentType;
 		}
-		
+
 		public String getTopFlag() {
 			return topFlag;
 		}
@@ -439,27 +439,27 @@ public class ActionListNextPageViewData extends BaseAction {
 		/**
 		 * 根据传入的查询参数,组织一个完整的QueryFilter对象
 		 * @return
-		 * @throws Exception 
+		 * @throws Exception
 		 */
 		public QueryFilter getQueryFilter() throws Exception {
-			QueryFilter queryFilter = new QueryFilter();		
+			QueryFilter queryFilter = new QueryFilter();
 			queryFilter.setJoinType( "and" );
-			
+
 			if( StringUtils.isNotEmpty( this.getCategoryId() )) {
 				queryFilter.addEqualsTerm( new EqualsTerm( "categoryId", this.getCategoryId() ) );
 			}
-			
+
 			//文档类型:全部 | 信息 | 数据
-			if( StringUtils.isNotEmpty( this.getDocumentType())) {			
+			if( StringUtils.isNotEmpty( this.getDocumentType())) {
 				if( "信息".equals( this.getDocumentType() )) {
 					queryFilter.addEqualsTerm( new EqualsTerm( "documentType", this.getDocumentType() ) );
 				}else if( "数据".equals( this.getDocumentType() )) {
 					queryFilter.addEqualsTerm( new EqualsTerm( "documentType", this.getDocumentType() ) );
 				}
 			}
-			
+
 			//是否置顶:ALL|TOP|UNTOP
-			if( StringUtils.isNotEmpty( this.getTopFlag())) {			
+			if( StringUtils.isNotEmpty( this.getTopFlag())) {
 				if( "TOP".equals( this.getTopFlag() )) {
 					queryFilter.addIsTrueTerm( new IsTrueTerm( "isTop" ) );
 				}else if( "UNTOP".equals( this.getDocumentType() )) {
@@ -470,20 +470,20 @@ public class ActionListNextPageViewData extends BaseAction {
 			if( StringUtils.isNotEmpty( this.getDocStatus())) {
 				queryFilter.addEqualsTerm( new EqualsTerm( "docStatus", this.getDocStatus() ) );
 			}
-			
+
 			return queryFilter;
 		}
 
 	}
-	
+
 	public static class Wo extends GsonPropertyObject {
-		
+
 		@FieldDescribe( "文档对象的序列." )
 		private String sequence = null;
-		
+
 		@FieldDescribe( "文档对象的ID." )
 		private String id = null;
-		
+
 		@FieldDescribe( "排序列的值." )
 		private String orderFieldValue = null;
 
@@ -531,21 +531,21 @@ public class ActionListNextPageViewData extends BaseAction {
 
 		public void setOrderFieldValue(String orderFieldValue) {
 			this.orderFieldValue = orderFieldValue;
-		}		
+		}
 	}
-	
+
 	public static class WoDocument extends Document {
-		
+
 		private static final long serialVersionUID = -5076990764713538973L;
-		
+
 		public static WrapCopier<Document, WoDocument> copier = WrapCopierFactory.wo( Document.class, WoDocument.class, null, JpaObject.FieldsInvisible);
 
 		@FieldDescribe("创建者姓名(简称)")
 		private String creatorPersonShort = null;
-		
+
 		@FieldDescribe("创建者所属组织(简称)")
 		private String creatorUnitNameShort = null;
-		
+
 		@FieldDescribe("创建者顶层组织(简称)")
 		private String creatorTopUnitNameShort = null;
 
@@ -571,6 +571,6 @@ public class ActionListNextPageViewData extends BaseAction {
 
 		public void setCreatorTopUnitNameShort(String creatorTopUnitNameShort) {
 			this.creatorTopUnitNameShort = creatorTopUnitNameShort;
-		}		
+		}
 	}
-}
+}

+ 25 - 24
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreate.java

@@ -75,20 +75,20 @@ class ActionCreate extends BaseAction {
 				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getId());
 			}
 			if (BooleanUtils.isTrue(wi.getLatest())) {
-				/* 判断是否是要直接打开之前创建的草稿,草稿的判断标准:有待办无任何已办 */
+				// 判断是否是要直接打开之前创建的草稿,草稿的判断标准:有待办无任何已办
 				lastestWorkId = this.latest(business, process, identity);
 				workId = lastestWorkId;
 			}
 		}
 		if (StringUtils.isEmpty(workId)) {
 			WoId woId = ThisApplication.context().applications().postQuery(x_processplatform_service_processing.class,
-					Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), process.getId())
+					Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), null)
 					.getData(WoId.class);
 			workId = woId.getId();
 		}
-		/* 设置Work信息 */
+		// 设置Work信息
 		if (BooleanUtils.isFalse(wi.getLatest()) || (StringUtils.isEmpty(lastestWorkId))) {
-			/* 如果不是草稿那么需要进行设置 */
+			// 如果不是草稿那么需要进行设置
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
 				Organization organization = business.organization();
@@ -111,21 +111,21 @@ class ActionCreate extends BaseAction {
 			ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class,
 					Applications.joinQueryUri("work", workId, "processing", "nonblocking"), null);
 		} else {
-			/* 如果是草稿,准备后面的直接打开 */
+			// 如果是草稿,准备后面的直接打开
 			workId = lastestWorkId;
 		}
-		/* 拼装返回结果 */
+		// 拼装返回结果
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			Work work = emc.find(workId, Work.class);
-			/* 如果work是从开始->执行任务->结束,这里work已经结束那么有可能这里已经没有work了. */
+			// 如果work是从开始->执行任务->结束,这里work已经结束那么有可能这里已经没有work了.
 			if (null != work) {
 				List<String> ids = business.workLog()
 						.listWithFromActivityTokenForwardNotConnected(work.getActivityToken());
-				/* 先取得没有结束的WorkLog */
+				// 先取得没有结束的WorkLog
 				List<WorkLog> list = emc.list(WorkLog.class, ids);
 				wos = this.refercenceWorkLog(business, list);
-				/* 标识当前用户的待办 */
+				// 标识当前用户的待办
 				for (Wo o : wos) {
 					o.setCurrentTaskIndex(-1);
 					for (int i = 0; i < o.getTaskList().size(); i++) {
@@ -368,21 +368,22 @@ class ActionCreate extends BaseAction {
 				return ObjectUtils.compare(o1.getCompletedTime(), o2.getCompletedTime(), true);
 			}
 		});
-		/* 补充召回 */
-		List<WoTaskCompleted> results = new ArrayList<>();
-		for (WoTaskCompleted o : list) {
-			results.add(o);
-			if (o.getProcessingType().equals(ProcessingType.retract)) {
-				WoTaskCompleted retract = new WoTaskCompleted();
-				o.copyTo(retract);
-				retract.setRouteName("撤回");
-				retract.setOpinion("撤回");
-				retract.setStartTime(retract.getRetractTime());
-				retract.setCompletedTime(retract.getRetractTime());
-				results.add(retract);
-			}
-		}
-		wo.setTaskCompletedList(results);
+		wo.setTaskCompletedList(list);
+//		/* 补充召回 */
+//		List<WoTaskCompleted> results = new ArrayList<>();
+//		for (WoTaskCompleted o : list) {
+//			results.add(o);
+//			if (o.getProcessingType().equals(ProcessingType.retract)) {
+//				WoTaskCompleted retract = new WoTaskCompleted();
+//				o.copyTo(retract);
+//				retract.setRouteName("撤回");
+//				retract.setOpinion("撤回");
+//				retract.setStartTime(retract.getRetractTime());
+//				retract.setCompletedTime(retract.getRetractTime());
+//				results.add(retract);
+//			}
+//		}
+//		wo.setTaskCompletedList(results);
 	}
 
 }

+ 31 - 30
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateForce.java

@@ -45,9 +45,9 @@ class ActionCreateForce extends BaseAction {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String processFlag, JsonElement jsonElement)
 			throws Exception {
 		Audit audit = logger.audit(effectivePerson);
-		/* 新建工作id */
+		// 新建工作id
 		String workId = "";
-		/* 已存在草稿id */
+		// 已存在草稿id
 		String lastestWorkId = "";
 		String identity = null;
 		Process process = null;
@@ -69,20 +69,20 @@ class ActionCreateForce extends BaseAction {
 				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getId());
 			}
 			if (BooleanUtils.isTrue(wi.getLatest())) {
-				/* 判断是否是要直接打开之前创建的草稿,草稿的判断标准:有待办无任何已办 */
+				// 判断是否是要直接打开之前创建的草稿,草稿的判断标准:有待办无任何已办
 				lastestWorkId = this.latest(business, process, identity);
 				workId = lastestWorkId;
 			}
 		}
 		if (StringUtils.isEmpty(workId)) {
 			WoId woId = ThisApplication.context().applications().postQuery(x_processplatform_service_processing.class,
-					Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), process.getId())
+					Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), null)
 					.getData(WoId.class);
 			workId = woId.getId();
 		}
-		/* 设置Work信息 */
+		// 设置Work信息
 		if (BooleanUtils.isFalse(wi.getLatest()) || (StringUtils.isEmpty(lastestWorkId))) {
-			/* 如果不是草稿那么需要进行设置 */
+			// 如果不是草稿那么需要进行设置
 			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 				Business business = new Business(emc);
 				Organization organization = business.organization();
@@ -101,25 +101,25 @@ class ActionCreateForce extends BaseAction {
 				}
 				emc.commit();
 			}
-			/* 驱动工作,使用非队列方式 */
+			// 驱动工作,使用非队列方式
 			ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class,
-					Applications.joinQueryUri("work", workId, "processing", "nonblocking"), null, processFlag);
+					Applications.joinQueryUri("work", workId, "processing", "nonblocking"), null, null);
 		} else {
-			/* 如果是草稿,准备后面的直接打开 */
+			// 如果是草稿,准备后面的直接打开
 			workId = lastestWorkId;
 		}
-		/* 拼装返回结果 */
+		// 拼装返回结果
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			Work work = emc.find(workId, Work.class);
-			/* 如果work是从开始->执行任务->结束,这里work已经结束那么有可能这里已经没有work了. */
+			// 如果work是从开始->执行任务->结束,这里work已经结束那么有可能这里已经没有work了.
 			if (null != work) {
 				List<String> ids = business.workLog()
 						.listWithFromActivityTokenForwardNotConnected(work.getActivityToken());
-				/* 先取得没有结束的WorkLog */
+				// 先取得没有结束的WorkLog
 				List<WorkLog> list = emc.list(WorkLog.class, ids);
 				wos = this.refercenceWorkLog(business, list);
-				/* 标识当前用户的待办 */
+				// 标识当前用户的待办
 				for (Wo o : wos) {
 					o.setCurrentTaskIndex(-1);
 					for (int i = 0; i < o.getTaskList().size(); i++) {
@@ -317,7 +317,7 @@ class ActionCreateForce extends BaseAction {
 			if (BooleanUtils.isNotTrue(o.getConnected())) {
 				this.referenceTask(business, wo);
 			} else {
-				/** 已经完成的不会有待办,返回一个空数组 */
+				// 已经完成的不会有待办,返回一个空数组
 				wo.setTaskList(new ArrayList<WoTask>());
 			}
 			this.referenceTaskCompleted(business, wo);
@@ -338,7 +338,7 @@ class ActionCreateForce extends BaseAction {
 			} else if (identities.size() == 1) {
 				return identities.get(0);
 			} else {
-				/* 有多个身份需要逐一判断是否包含. */
+				// 有多个身份需要逐一判断是否包含.
 				for (String o : identities) {
 					if (StringUtils.equals(o, wi.getIdentity())) {
 						return o;
@@ -371,21 +371,22 @@ class ActionCreateForce extends BaseAction {
 				return ObjectUtils.compare(o1.getCompletedTime(), o2.getCompletedTime(), true);
 			}
 		});
-		/* 补充召回 */
-		List<WoTaskCompleted> results = new ArrayList<>();
-		for (WoTaskCompleted o : list) {
-			results.add(o);
-			if (o.getProcessingType().equals(ProcessingType.retract)) {
-				WoTaskCompleted retract = new WoTaskCompleted();
-				o.copyTo(retract);
-				retract.setRouteName("撤回");
-				retract.setOpinion("撤回");
-				retract.setStartTime(retract.getRetractTime());
-				retract.setCompletedTime(retract.getRetractTime());
-				results.add(retract);
-			}
-		}
-		wo.setTaskCompletedList(results);
+		wo.setTaskCompletedList(list);
+//		/* 补充召回 */
+//		List<WoTaskCompleted> results = new ArrayList<>();
+//		for (WoTaskCompleted o : list) {
+//			results.add(o);
+//			if (o.getProcessingType().equals(ProcessingType.retract)) {
+//				WoTaskCompleted retract = new WoTaskCompleted();
+//				o.copyTo(retract);
+//				retract.setRouteName("撤回");
+//				retract.setOpinion("撤回");
+//				retract.setStartTime(retract.getRetractTime());
+//				retract.setCompletedTime(retract.getRetractTime());
+//				results.add(retract);
+//			}
+//		}
+//		wo.setTaskCompletedList(results);
 	}
 
 }

+ 23 - 25
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcess.java

@@ -1,11 +1,14 @@
 package com.x.processplatform.assemble.surface.jaxrs.work;
 
-import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -24,14 +27,12 @@ import com.x.base.core.project.logger.Audit;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.organization.Unit;
-import com.x.base.core.project.tools.DefaultCharset;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.SortTools;
 import com.x.organization.core.express.Organization;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.ThisApplication;
 import com.x.processplatform.assemble.surface.WorkControl;
-import com.x.processplatform.core.entity.content.ProcessingType;
 import com.x.processplatform.core.entity.content.Task;
 import com.x.processplatform.core.entity.content.TaskCompleted;
 import com.x.processplatform.core.entity.content.Work;
@@ -39,10 +40,6 @@ import com.x.processplatform.core.entity.content.WorkLog;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.Process;
 
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
-
 /*
  * 根据应用名称和流程名称进行创建,和直接用process创建基本相同
  * */
@@ -89,7 +86,7 @@ class ActionCreateWithApplicationProcess extends BaseAction {
 			if (StringUtils.isEmpty(workId)) {
 				WoId woId = ThisApplication.context().applications()
 						.postQuery(x_processplatform_service_processing.class,
-								"work/process/" + URLEncoder.encode(process.getId(), DefaultCharset.name), wi.getData())
+								Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), null)
 						.getData(WoId.class);
 				workId = woId.getId();
 			}
@@ -117,7 +114,7 @@ class ActionCreateWithApplicationProcess extends BaseAction {
 			}
 			/* 驱动工作,使用非队列方式 */
 			ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class,
-					Applications.joinQueryUri("work", workId, "processing", "nonblocking"), null,processFlag);
+					Applications.joinQueryUri("work", workId, "processing", "nonblocking"), null, null);
 		} else {
 			/* 如果是草稿,准备后面的直接打开 */
 			workId = lastestWorkId;
@@ -336,7 +333,7 @@ class ActionCreateWithApplicationProcess extends BaseAction {
 			} else if (identities.size() == 1) {
 				return identities.get(0);
 			} else {
-				/* 有多个身份需要逐一判断是否包含. */
+				// 有多个身份需要逐一判断是否包含.
 				for (String o : identities) {
 					if (StringUtils.equals(o, wi.getIdentity())) {
 						return o;
@@ -369,21 +366,22 @@ class ActionCreateWithApplicationProcess extends BaseAction {
 				return ObjectUtils.compare(o1.getCompletedTime(), o2.getCompletedTime(), true);
 			}
 		});
-		/* 补充召回 */
-		List<WoTaskCompleted> results = new ArrayList<>();
-		for (WoTaskCompleted o : list) {
-			results.add(o);
-			if (o.getProcessingType().equals(ProcessingType.retract)) {
-				WoTaskCompleted retract = new WoTaskCompleted();
-				o.copyTo(retract);
-				retract.setRouteName("撤回");
-				retract.setOpinion("撤回");
-				retract.setStartTime(retract.getRetractTime());
-				retract.setCompletedTime(retract.getRetractTime());
-				results.add(retract);
-			}
-		}
-		wo.setTaskCompletedList(results);
+		wo.setTaskCompletedList(list);
+//		/* 补充召回 */
+//		List<WoTaskCompleted> results = new ArrayList<>();
+//		for (WoTaskCompleted o : list) {
+//			results.add(o);
+//			if (o.getProcessingType().equals(ProcessingType.retract)) {
+//				WoTaskCompleted retract = new WoTaskCompleted();
+//				o.copyTo(retract);
+//				retract.setRouteName("撤回");
+//				retract.setOpinion("撤回");
+//				retract.setStartTime(retract.getRetractTime());
+//				retract.setCompletedTime(retract.getRetractTime());
+//				results.add(retract);
+//			}
+//		}
+//		wo.setTaskCompletedList(results);
 	}
 
 }

+ 18 - 16
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCreateWithApplicationProcessForce.java

@@ -19,6 +19,7 @@ import com.x.base.core.project.organization.Unit;
 import com.x.base.core.project.tools.DefaultCharset;
 import com.x.base.core.project.tools.ListTools;
 import com.x.base.core.project.tools.SortTools;
+import com.x.base.core.project.Applications;
 import com.x.base.core.project.x_processplatform_service_processing;
 import com.x.organization.core.express.Organization;
 import com.x.processplatform.assemble.surface.Business;
@@ -80,7 +81,7 @@ class ActionCreateWithApplicationProcessForce extends BaseAction {
 			if (StringUtils.isEmpty(workId)) {
 				WoId woId = ThisApplication.context().applications()
 						.postQuery(x_processplatform_service_processing.class,
-								"work/process/" + URLEncoder.encode(process.getId(), DefaultCharset.name), wi.getData())
+								Applications.joinQueryUri("work", "process", process.getId()), wi.getData(), null)
 						.getData(WoId.class);
 				workId = woId.getId();
 			}
@@ -360,21 +361,22 @@ class ActionCreateWithApplicationProcessForce extends BaseAction {
 				return ObjectUtils.compare(o1.getCompletedTime(), o2.getCompletedTime(), true);
 			}
 		});
-		/* 补充召回 */
-		List<WoTaskCompleted> results = new ArrayList<>();
-		for (WoTaskCompleted o : list) {
-			results.add(o);
-			if (o.getProcessingType().equals(ProcessingType.retract)) {
-				WoTaskCompleted retract = new WoTaskCompleted();
-				o.copyTo(retract);
-				retract.setRouteName("撤回");
-				retract.setOpinion("撤回");
-				retract.setStartTime(retract.getRetractTime());
-				retract.setCompletedTime(retract.getRetractTime());
-				results.add(retract);
-			}
-		}
-		wo.setTaskCompletedList(results);
+		wo.setTaskCompletedList(list);
+//		/* 补充召回 */
+//		List<WoTaskCompleted> results = new ArrayList<>();
+//		for (WoTaskCompleted o : list) {
+//			results.add(o);
+//			if (o.getProcessingType().equals(ProcessingType.retract)) {
+//				WoTaskCompleted retract = new WoTaskCompleted();
+//				o.copyTo(retract);
+//				retract.setRouteName("撤回");
+//				retract.setOpinion("撤回");
+//				retract.setStartTime(retract.getRetractTime());
+//				retract.setCompletedTime(retract.getRetractTime());
+//				results.add(retract);
+//			}
+//		}
+//		wo.setTaskCompletedList(results);
 	}
 
 }

+ 1 - 2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java

@@ -4,16 +4,15 @@ import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.container.Suspended;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 
+import com.x.base.core.project.Application;
 import com.x.base.core.project.annotation.JaxrsDescribe;
 import com.x.base.core.project.annotation.JaxrsMethodDescribe;
-import com.x.base.core.project.annotation.JaxrsParameterDescribe;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.http.HttpMediaType;

+ 18 - 1
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Data.js

@@ -64,7 +64,7 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
 			"MWFType": "datagrid$Data",
 			"id": this.json.id
 		});
-		
+
 		if (!this.form.json.moduleList[this.json.id]){
 			this.form.json.moduleList[this.json.id] = this.json;
 		}
@@ -76,6 +76,11 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
         this._setEditStyle_custom("id");
         this.checkSequence();
         this.json.moduleName = this.moduleName;
+
+        debugger;
+		if( this.json.isShow === false ){
+			this._switchShow();
+		}
 	},
     _setEditStyle_custom: function(name, obj, oldValue) {
         if (name == "cellType") this.checkSequence(obj, oldValue);
@@ -118,6 +123,10 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
         }.bind(this));
 
 		this.setCustomNodeStyles(this.node, this.parentContainer.json.contentStyles);
+
+		if( this.json.isShow === false ){
+			this._switchShow();
+		}
 	},
     checkSequence: function(obj, oldValue){
         if ((this.json.cellType == "sequence") && (oldValue != "sequence")){
@@ -251,6 +260,14 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
 			}
 			
 		}
+	},
+	_switchShow : function (isShow) {
+		if( typeOf(isShow) === "boolean" ){
+			this.json.isShow = isShow;
+		}else{
+			isShow = this.json.isShow !== false ;
+		}
+		this.node.setStyle("opacity", isShow ? "1" : "0.3");
 	}
 	
 });

+ 36 - 3
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Title.js

@@ -104,14 +104,18 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Title = MWF.FCDatagrid$Tit
 		this.parentContainer = this.treeNode.parentNode.module;
         this._setEditStyle_custom("id");
         this.json.moduleName = this.moduleName;
+
+		if( this.json.isShow === false ){
+			this._switchShow();
+		}
 	},
 	
 	_createMoveNode: function(){
 		return false;
 	},
-	_setEditStyle_custom: function(name){
-
-	},
+	// _setEditStyle_custom: function(name){
+	//
+	// },
 	_dragInLikeElement: function(module){
 		return false;
 	},
@@ -134,6 +138,10 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Title = MWF.FCDatagrid$Tit
 		}.bind(this));
 
 		this.setCustomNodeStyles(this.node, this.parentContainer.json.titleStyles);
+
+		if( this.json.isShow === false ){
+			this._switchShow();
+		}
 	},
 
 	insertCol: function(){
@@ -265,5 +273,30 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Title = MWF.FCDatagrid$Tit
 				this.node.set("text", this.json.name);
 			}
 		}
+		if( name=="isShow" ){
+			this._switchShow( true );
+		}
+	},
+	_switchShow: function( isChangeTd ){
+		debugger;
+		var tr = this.node.getParent("tr");
+		var table = tr.getParent("table");
+		var colIndex = this.node.cellIndex;
+		var isShow = this.json.isShow !== false;
+
+		var titleTr = table.rows[0];
+		var currentTh = titleTr.cells[colIndex];
+		if( currentTh ){
+			currentTh.setStyle("opacity", isShow ? "1" : "0.3")
+		}
+
+		if(isChangeTd){
+			var dataTr = table.rows[1];
+			var currentTd = dataTr.cells[colIndex];
+			if( currentTd ){
+				var module = currentTd.retrieve("module");
+				if( module )module._switchShow( isShow );
+			}
+		}
 	}
 });

+ 7 - 0
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Title/datagrid$Title.html

@@ -21,6 +21,13 @@
                     <input class="editTableRadio" name="total" text{($.total=='count')?'checked':''} type="radio" value="count"/>合计数量 <br/>
                 </td>
             </tr>
+            <tr>
+                <td class="editTableTitle">隐藏:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="isShow" text{($.isShow!==false)?'checked':''} type="radio" value="true"/>显示该列 <br/>
+                    <input class="editTableRadio" name="isShow" text{($.isShow==false)?'checked':''} type="radio" value="false"/>隐藏该列 <br/>
+                </td>
+            </tr>
         </table>
 
         <div class="MWFMaplist" name="styles" title="样式"></div>

+ 8 - 0
o2web/source/x_component_process_FormDesigner/Module/Datagrid.js

@@ -315,13 +315,17 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid = MWF.FCDatagrid = new Cla
         if (name=="titleStyles"){
             var ths = this.table.getElements("th");
             ths.each(function(th){
+            	var opacity = th.getStyle("opacity");
                 this.setCustomNodeStyles(th, this.json.titleStyles);
+                if(opacity)th.setStyle("opacity", opacity);
             }.bind(this));
         }
         if (name=="contentStyles"){
             var tds = this.table.getElements("td");
             tds.each(function(td){
+				var opacity = td.getStyle("opacity");
                 this.setCustomNodeStyles(td, this.json.contentStyles);
+				if(opacity)td.setStyle("opacity", opacity);
             }.bind(this));
         }
         //if (name=="sequence") this.checkSequenceShow();
@@ -330,13 +334,17 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid = MWF.FCDatagrid = new Cla
         if (this.json.titleStyles){
             var ths = this.table.getElements("th");
             ths.each(function(th){
+				var opacity = th.getStyle("opacity");
                 this.setCustomNodeStyles(th, this.json.titleStyles);
+				if(opacity)th.setStyle("opacity", opacity);
             }.bind(this));
         }
         if (this.json.contentStyles){
             var tds = this.table.getElements("td");
             tds.each(function(td){
+				var opacity = td.getStyle("opacity");
                 this.setCustomNodeStyles(td, this.json.contentStyles);
+				if(opacity)td.setStyle("opacity", opacity);
             }.bind(this));
         }
     },

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

@@ -16,6 +16,8 @@ MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar =  new Class({
         //     this.node.empty();
         // }else{
             this.toolbarNode = this.node.getFirst("div");
+            if(!this.toolbarNode)return;
+
             this.toolbarNode.empty();
 
             MWF.require("MWF.widget.Toolbar", function(){

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

@@ -83,6 +83,9 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                 "id": contentTds[i].get("id"),
                 "mwftype": contentTds[i].get("mwftype")
             });
+
+            var json = this.form._getDomjson(titleTd);
+            if( json && json.isShow === false )mobileTr.hide();
         }.bind(this));
         this.table.destroy();
         this.table = null;
@@ -298,6 +301,9 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                         cell.set("text", idx+1);
                     }
 
+                    var json = this.form._getDomjson(th);
+                    if( json && json.isShow === false )tr.hide();
+
                 }.bind(this));
             }.bind(this));
         }
@@ -407,6 +413,8 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                         cell.set("text", idx+1);
                     }
 
+                    var json = this.form._getDomjson(th);
+                    if( json && json.isShow === false )tr.hide();
                 }.bind(this));
                 var size = dataDiv.getSize();
                 //dataDiv.setStyle("height", ""+size.y+"px");
@@ -1224,6 +1232,9 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
                 }else{
                     tr.getElement("td").set("text", totalResaults[i] || "");
                 }
+
+                if( m.isShow === false )tr.hide();
+
                 this.totalResaults[m.module.json.id] = totalResaults[i];
             }.bind(this));
             if (this.totalTable){
@@ -1641,7 +1652,8 @@ MWF.xApplication.process.Xform.DatagridMobile$Title =  new Class({
             this.dataGrid.totalModules.push({
                 "module": this,
                 "index": this.node.getParent("tr").rowIndex,
-                "type": this.json.total
+                "type": this.json.total,
+                "isShow": this.json.isShow
             })
         }
         //	this.form._loadModules(this.node);

+ 8 - 0
o2web/source/x_component_process_Xform/DatagridPC.js

@@ -280,6 +280,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 			var module = this.form._loadModule(json, cell);
 			cell.store("module", module);
 			this.form.modules.push(module);
+			if( json.isShow === false )cell.hide();
 		}
 
 	},
@@ -896,6 +897,8 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 						cell.set("text", tr.rowIndex);
 					}
 
+					var json = this.form._getDomjson(th);
+					if( json && json.isShow === false )cell.hide();
 				}.bind(this));
 			}.bind(this));
 		}
@@ -968,6 +971,9 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 		ths.each(function(th, idx){
 			var td = new Element("td", {"text": "", "styles": this.form.css.datagridTotalTd}).inject(this.totalTr);
 			if (this.json.amountStyles) td.setStyles(this.json.amountStyles);
+
+			var json = this.form._getDomjson(th);
+			if( json && json.isShow === false )td.hide();
 		}.bind(this));
 	},
 	_loadTotal: function(){
@@ -1060,6 +1066,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 			if (json){
 				var module = this.form._loadModule(json, th);
 				this.form.modules.push(module);
+				if( json.isShow === false )th.hide();
 			}
 		}.bind(this));
 	},
@@ -1079,6 +1086,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
 				}
 				td.store("module", module);
 				this.form.modules.push(module);
+				if( json.isShow === false )td.hide();
 			}
 		}.bind(this));
 	},