Parcourir la source

Merge branch 'develop' into 'release'

From develop into release

See merge request o2oa/o2oa!289
胡起 il y a 5 ans
Parent
commit
899261d4aa
18 fichiers modifiés avec 360 ajouts et 96 suppressions
  1. 2 4
      o2server/x_message_assemble_communicate/src/main/webapp/describe/sources/com/x/message/assemble/communicate/jaxrs/message/ActionCustomCreate.java
  2. 44 37
      o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/empower/ActionListWithIdentityObject.java
  3. 13 0
      o2server/x_organization_assemble_express/src/main/webapp/describe/describe.json
  4. 44 37
      o2server/x_organization_assemble_express/src/main/webapp/describe/sources/com/x/organization/assemble/express/jaxrs/empower/ActionListWithIdentityObject.java
  5. 0 3
      o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPersonEnable.java
  6. 68 0
      o2server/x_organization_assemble_personal/src/main/webapp/describe/describe.json
  7. 0 3
      o2server/x_organization_assemble_personal/src/main/webapp/describe/sources/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPersonEnable.java
  8. 15 0
      o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/Empower.java
  9. 2 1
      o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/ActionListWithIdentityObject.java
  10. 11 0
      o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/BaseAction.java
  11. 5 5
      o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/EmpowerFactory.java
  12. 12 0
      o2server/x_processplatform_assemble_designer/src/main/webapp/describe/sources/com/x/processplatform/assemble/designer/jaxrs/output/ActionList.java
  13. 3 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithApplication.java
  14. 43 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithApplicationMobile.java
  15. 20 2
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java
  16. 55 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java
  17. 21 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ProcessAction.java
  18. 2 2
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java

+ 2 - 4
o2server/x_message_assemble_communicate/src/main/webapp/describe/sources/com/x/message/assemble/communicate/jaxrs/message/ActionCustomCreate.java

@@ -1,7 +1,5 @@
 package com.x.message.assemble.communicate.jaxrs.message;
 
-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;
@@ -14,13 +12,13 @@ import com.x.base.core.project.config.Config;
 import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WoId;
 import com.x.base.core.project.jaxrs.WrapBoolean;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.message.MessageConnector;
 import com.x.message.assemble.communicate.ThisApplication;
-import com.x.message.core.entity.Message;
+
+import org.apache.commons.lang3.StringUtils;
 
 class ActionCustomCreate extends BaseAction {
 

+ 44 - 37
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/empower/ActionListWithIdentityObject.java

@@ -14,8 +14,6 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-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;
@@ -23,10 +21,8 @@ import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.Applications;
 import com.x.base.core.project.x_processplatform_assemble_surface;
 import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.connection.ActionResponse;
 import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Logger;
@@ -39,7 +35,7 @@ import com.x.organization.core.entity.accredit.Empower;
 import com.x.organization.core.entity.accredit.Empower_;
 import com.x.organization.core.entity.accredit.Filter;
 
-import net.sf.ehcache.Element;
+import org.apache.commons.lang3.StringUtils;
 
 class ActionListWithIdentityObject extends BaseAction {
 
@@ -61,6 +57,9 @@ class ActionListWithIdentityObject extends BaseAction {
 		@FieldDescribe("应用")
 		private String application;
 
+		@FieldDescribe("流程版本")
+		private String edition;
+
 		@FieldDescribe("流程")
 		private String process;
 
@@ -102,6 +101,14 @@ class ActionListWithIdentityObject extends BaseAction {
 			this.work = work;
 		}
 
+		public String getEdition() {
+			return edition;
+		}
+
+		public void setEdition(String edition) {
+			this.edition = edition;
+		}
+
 	}
 
 	public static class Wo extends Empower {
@@ -131,25 +138,7 @@ class ActionListWithIdentityObject extends BaseAction {
 			List<Empower> list = map.get(str);
 
 			if (ListTools.isNotEmpty(list)) {
-				list.sort(new Comparator<Empower>() {
-					public int compare(Empower o1, Empower o2) {
-						if (StringUtils.equals(Empower.TYPE_FILTER, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_FILTER, o2.getType())) {
-							return 1;
-						} else if (StringUtils.equals(Empower.TYPE_PROCESS, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_PROCESS, o2.getType())) {
-							return 1;
-						} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o2.getType())) {
-							return 1;
-						} else {
-							return 0;
-						}
-					}
-				});
+				list.sort(new EmpowerComparator());
 				Empower empower = this.pick(business, list, wi.getWork());
 				if (null != empower) {
 					Wo wo = new Wo(str, str);
@@ -163,6 +152,7 @@ class ActionListWithIdentityObject extends BaseAction {
 
 	private Empower pick(Business business, List<Empower> list, String work) throws Exception {
 		for (Empower empower : list) {
+
 			if (StringUtils.equals(Empower.TYPE_FILTER, empower.getType())
 					&& StringUtils.isNotEmpty(empower.getFilterListData())) {
 				List<Filter> filters = gson.fromJson(empower.getFilterListData(), Filter.LISTTYPE);
@@ -171,12 +161,8 @@ class ActionListWithIdentityObject extends BaseAction {
 						x_processplatform_assemble_surface.class, Applications.joinQueryUri("data", "work", work) + "/"
 								+ StringUtils.replace(filter.path, ".", "/"));
 				if (null != response.getData()) {
-					switch (Objects.toString(filter.formatType, "")) {
-					default:
-						if (StringUtils.equals(filter.value, response.getData().getAsString())) {
-							return empower;
-						}
-						break;
+					if (StringUtils.equals(filter.value, response.getData().getAsString())) {
+						return empower;
 					}
 				} else {
 					return empower;
@@ -186,6 +172,26 @@ class ActionListWithIdentityObject extends BaseAction {
 		return list.get(0);
 	}
 
+	private class EmpowerComparator implements Comparator<Empower> {
+		public int compare(Empower o1, Empower o2) {
+			if (StringUtils.equals(Empower.TYPE_FILTER, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_FILTER, o2.getType())) {
+				return 1;
+			} else if (StringUtils.equals(Empower.TYPE_PROCESS, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_PROCESS, o2.getType())) {
+				return 1;
+			} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o2.getType())) {
+				return 1;
+			} else {
+				return 0;
+			}
+		}
+	}
+
 	private List<Empower> list(Business business, Wi wi) throws Exception {
 
 		List<Identity> identities = business.identity().pick(wi.getIdentityList());
@@ -198,18 +204,19 @@ class ActionListWithIdentityObject extends BaseAction {
 		Predicate p = cb.or(cb.equal(root.get(Empower_.type), Empower.TYPE_ALL),
 				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_APPLICATION),
 						cb.equal(root.get(Empower_.application), wi.getApplication())),
-				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_PROCESS),
-						cb.equal(root.get(Empower_.process), wi.getProcess())),
-				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_FILTER),
-						cb.equal(root.get(Empower_.process), wi.getProcess())));
+				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_PROCESS), cb.or(
+						cb.and(cb.isNotNull(root.get(Empower_.edition)), cb.notEqual(root.get(Empower_.edition), ""),
+								cb.equal(root.get(Empower_.edition), wi.getEdition())),
+						cb.equal(root.get(Empower_.process), wi.getProcess()))),
+				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_FILTER), cb.or(
+						cb.and(cb.isNotNull(root.get(Empower_.edition)), cb.notEqual(root.get(Empower_.edition), ""),
+								cb.equal(root.get(Empower_.edition), wi.getEdition())),
+						cb.equal(root.get(Empower_.process), wi.getProcess()))));
 		p = cb.and(p, root.get(Empower_.fromIdentity).in(names));
-		// p = cb.and(p, cb.isMember(root.get(Empower_.fromIdentity),
-		// cb.literal(names)));
 		p = cb.and(p, cb.equal(root.get(Empower_.enable), true));
 		p = cb.and(p, cb.lessThan(root.get(Empower_.startTime), new Date()),
 				cb.greaterThan(root.get(Empower_.completedTime), new Date()));
 		return em.createQuery(cq.select(root).where(p).distinct(true)).getResultList();
-
 	}
 
 }

+ 13 - 0
o2server/x_organization_assemble_express/src/main/webapp/describe/describe.json

@@ -136,6 +136,13 @@
               "description": "应用",
               "isBaseType": true
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本",
+              "isBaseType": true
+            },
             {
               "name": "process",
               "type": "String",
@@ -207,6 +214,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",

+ 44 - 37
o2server/x_organization_assemble_express/src/main/webapp/describe/sources/com/x/organization/assemble/express/jaxrs/empower/ActionListWithIdentityObject.java

@@ -14,8 +14,6 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-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;
@@ -23,10 +21,8 @@ import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.Applications;
 import com.x.base.core.project.x_processplatform_assemble_surface;
 import com.x.base.core.project.annotation.FieldDescribe;
-import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.connection.ActionResponse;
 import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.logger.Logger;
@@ -39,7 +35,7 @@ import com.x.organization.core.entity.accredit.Empower;
 import com.x.organization.core.entity.accredit.Empower_;
 import com.x.organization.core.entity.accredit.Filter;
 
-import net.sf.ehcache.Element;
+import org.apache.commons.lang3.StringUtils;
 
 class ActionListWithIdentityObject extends BaseAction {
 
@@ -61,6 +57,9 @@ class ActionListWithIdentityObject extends BaseAction {
 		@FieldDescribe("应用")
 		private String application;
 
+		@FieldDescribe("流程版本")
+		private String edition;
+
 		@FieldDescribe("流程")
 		private String process;
 
@@ -102,6 +101,14 @@ class ActionListWithIdentityObject extends BaseAction {
 			this.work = work;
 		}
 
+		public String getEdition() {
+			return edition;
+		}
+
+		public void setEdition(String edition) {
+			this.edition = edition;
+		}
+
 	}
 
 	public static class Wo extends Empower {
@@ -131,25 +138,7 @@ class ActionListWithIdentityObject extends BaseAction {
 			List<Empower> list = map.get(str);
 
 			if (ListTools.isNotEmpty(list)) {
-				list.sort(new Comparator<Empower>() {
-					public int compare(Empower o1, Empower o2) {
-						if (StringUtils.equals(Empower.TYPE_FILTER, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_FILTER, o2.getType())) {
-							return 1;
-						} else if (StringUtils.equals(Empower.TYPE_PROCESS, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_PROCESS, o2.getType())) {
-							return 1;
-						} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o1.getType())) {
-							return -1;
-						} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o2.getType())) {
-							return 1;
-						} else {
-							return 0;
-						}
-					}
-				});
+				list.sort(new EmpowerComparator());
 				Empower empower = this.pick(business, list, wi.getWork());
 				if (null != empower) {
 					Wo wo = new Wo(str, str);
@@ -163,6 +152,7 @@ class ActionListWithIdentityObject extends BaseAction {
 
 	private Empower pick(Business business, List<Empower> list, String work) throws Exception {
 		for (Empower empower : list) {
+
 			if (StringUtils.equals(Empower.TYPE_FILTER, empower.getType())
 					&& StringUtils.isNotEmpty(empower.getFilterListData())) {
 				List<Filter> filters = gson.fromJson(empower.getFilterListData(), Filter.LISTTYPE);
@@ -171,12 +161,8 @@ class ActionListWithIdentityObject extends BaseAction {
 						x_processplatform_assemble_surface.class, Applications.joinQueryUri("data", "work", work) + "/"
 								+ StringUtils.replace(filter.path, ".", "/"));
 				if (null != response.getData()) {
-					switch (Objects.toString(filter.formatType, "")) {
-					default:
-						if (StringUtils.equals(filter.value, response.getData().getAsString())) {
-							return empower;
-						}
-						break;
+					if (StringUtils.equals(filter.value, response.getData().getAsString())) {
+						return empower;
 					}
 				} else {
 					return empower;
@@ -186,6 +172,26 @@ class ActionListWithIdentityObject extends BaseAction {
 		return list.get(0);
 	}
 
+	private class EmpowerComparator implements Comparator<Empower> {
+		public int compare(Empower o1, Empower o2) {
+			if (StringUtils.equals(Empower.TYPE_FILTER, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_FILTER, o2.getType())) {
+				return 1;
+			} else if (StringUtils.equals(Empower.TYPE_PROCESS, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_PROCESS, o2.getType())) {
+				return 1;
+			} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o1.getType())) {
+				return -1;
+			} else if (StringUtils.equals(Empower.TYPE_APPLICATION, o2.getType())) {
+				return 1;
+			} else {
+				return 0;
+			}
+		}
+	}
+
 	private List<Empower> list(Business business, Wi wi) throws Exception {
 
 		List<Identity> identities = business.identity().pick(wi.getIdentityList());
@@ -198,18 +204,19 @@ class ActionListWithIdentityObject extends BaseAction {
 		Predicate p = cb.or(cb.equal(root.get(Empower_.type), Empower.TYPE_ALL),
 				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_APPLICATION),
 						cb.equal(root.get(Empower_.application), wi.getApplication())),
-				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_PROCESS),
-						cb.equal(root.get(Empower_.process), wi.getProcess())),
-				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_FILTER),
-						cb.equal(root.get(Empower_.process), wi.getProcess())));
+				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_PROCESS), cb.or(
+						cb.and(cb.isNotNull(root.get(Empower_.edition)), cb.notEqual(root.get(Empower_.edition), ""),
+								cb.equal(root.get(Empower_.edition), wi.getEdition())),
+						cb.equal(root.get(Empower_.process), wi.getProcess()))),
+				cb.and(cb.equal(root.get(Empower_.type), Empower.TYPE_FILTER), cb.or(
+						cb.and(cb.isNotNull(root.get(Empower_.edition)), cb.notEqual(root.get(Empower_.edition), ""),
+								cb.equal(root.get(Empower_.edition), wi.getEdition())),
+						cb.equal(root.get(Empower_.process), wi.getProcess()))));
 		p = cb.and(p, root.get(Empower_.fromIdentity).in(names));
-		// p = cb.and(p, cb.isMember(root.get(Empower_.fromIdentity),
-		// cb.literal(names)));
 		p = cb.and(p, cb.equal(root.get(Empower_.enable), true));
 		p = cb.and(p, cb.lessThan(root.get(Empower_.startTime), new Date()),
 				cb.greaterThan(root.get(Empower_.completedTime), new Date()));
 		return em.createQuery(cq.select(root).where(p).distinct(true)).getResultList();
-
 	}
 
 }

+ 0 - 3
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPersonEnable.java

@@ -7,14 +7,11 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.organization.assemble.personal.Business;
 import com.x.organization.core.entity.accredit.Empower;
 
-import net.sf.ehcache.Element;
-
 class ActionListWithCurrentPersonEnable extends BaseAction {
 
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {

+ 68 - 0
o2server/x_organization_assemble_personal/src/main/webapp/describe/describe.json

@@ -386,6 +386,13 @@
               "description": "应用别名.",
               "isBaseType": true
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本.",
+              "isBaseType": true
+            },
             {
               "name": "process",
               "type": "String",
@@ -579,6 +586,13 @@
               "description": "应用别名.",
               "isBaseType": true
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本.",
+              "isBaseType": true
+            },
             {
               "name": "process",
               "type": "String",
@@ -743,6 +757,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -885,6 +905,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1021,6 +1047,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1140,6 +1172,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1277,6 +1315,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1414,6 +1458,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1551,6 +1601,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1694,6 +1750,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",
@@ -1864,6 +1926,12 @@
               "isCollection": false,
               "description": "应用别名."
             },
+            {
+              "name": "edition",
+              "type": "String",
+              "isCollection": false,
+              "description": "流程版本."
+            },
             {
               "name": "process",
               "type": "String",

+ 0 - 3
o2server/x_organization_assemble_personal/src/main/webapp/describe/sources/com/x/organization/assemble/personal/jaxrs/empower/ActionListWithCurrentPersonEnable.java

@@ -7,14 +7,11 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
-import com.x.base.core.project.cache.ApplicationCache;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.organization.assemble.personal.Business;
 import com.x.organization.core.entity.accredit.Empower;
 
-import net.sf.ehcache.Element;
-
 class ActionListWithCurrentPersonEnable extends BaseAction {
 
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {

+ 15 - 0
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/Empower.java

@@ -111,6 +111,13 @@ public class Empower extends SliceJpaObject {
 	@CheckPersist(allowEmpty = true)
 	private String applicationAlias;
 
+	public static final String edition_FIELDNAME = "edition";
+	@FieldDescribe("流程版本.")
+	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + edition_FIELDNAME)
+	@Index(name = TABLE + IndexNameMiddle + edition_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String edition;
+
 	public static final String process_FIELDNAME = "process";
 	@FieldDescribe("流程ID.")
 	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + process_FIELDNAME)
@@ -287,4 +294,12 @@ public class Empower extends SliceJpaObject {
 		this.type = type;
 	}
 
+	public String getEdition() {
+		return edition;
+	}
+
+	public void setEdition(String edition) {
+		this.edition = edition;
+	}
+
 }

+ 2 - 1
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/ActionListWithIdentityObject.java

@@ -9,7 +9,7 @@ import com.x.base.core.project.organization.Empower;
 
 class ActionListWithIdentityObject extends BaseAction {
 
-	public static List<Empower> execute(AbstractContext context, String application, String process, String work,
+	public static List<Empower> execute(AbstractContext context, String application, String edition,String process, String work,
 			Collection<String> collection) throws Exception {
 		Wi wi = new Wi();
 		List<Empower> wos = new ArrayList<>();
@@ -17,6 +17,7 @@ class ActionListWithIdentityObject extends BaseAction {
 			wi.getIdentityList().addAll(collection);
 			wi.setApplication(application);
 			wi.setProcess(process);
+			wi.setEdition(edition);
 			wi.setWork(work);
 			wos = context.applications().postQuery(applicationClass, "empower/list/identity/object", wi)
 					.getDataAsList(Empower.class);

+ 11 - 0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/BaseAction.java

@@ -19,6 +19,9 @@ abstract class BaseAction {
 		@FieldDescribe("应用")
 		private String application;
 
+		@FieldDescribe("流程版本")
+		private String edition;
+
 		@FieldDescribe("流程")
 		private String process;
 
@@ -57,6 +60,14 @@ abstract class BaseAction {
 			this.process = process;
 		}
 
+		public String getEdition() {
+			return edition;
+		}
+
+		public void setEdition(String edition) {
+			this.edition = edition;
+		}
+
 	}
 
 }

+ 5 - 5
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/empower/EmpowerFactory.java

@@ -16,15 +16,15 @@ public class EmpowerFactory {
 	private AbstractContext context;
 
 	/** 根据应用和流程获取指定身份是否有委托 */
-	public List<Empower> listWithIdentityObject(String application, String process, String work, String value)
-			throws Exception {
-		return ActionListWithIdentityObject.execute(context, application, process, work, Arrays.asList(value));
+	public List<Empower> listWithIdentityObject(String application, String edition, String process, String work,
+			String value) throws Exception {
+		return ActionListWithIdentityObject.execute(context, application, edition, process, work, Arrays.asList(value));
 	}
 
 	/** 根据应用和流程获取指定身份是否有委托 */
-	public List<Empower> listWithIdentityObject(String application, String process, String work,
+	public List<Empower> listWithIdentityObject(String application, String edition, String process, String work,
 			Collection<String> values) throws Exception {
-		return ActionListWithIdentityObject.execute(context, application, process, work, values);
+		return ActionListWithIdentityObject.execute(context, application, edition, process, work, values);
 	}
 
 }

+ 12 - 0
o2server/x_processplatform_assemble_designer/src/main/webapp/describe/sources/com/x/processplatform/assemble/designer/jaxrs/output/ActionList.java

@@ -1,5 +1,6 @@
 package com.x.processplatform.assemble.designer.jaxrs.output;
 
+import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -25,6 +26,8 @@ import com.x.processplatform.core.entity.element.wrap.WrapForm;
 import com.x.processplatform.core.entity.element.wrap.WrapProcess;
 import com.x.processplatform.core.entity.element.wrap.WrapProcessPlatform;
 import com.x.processplatform.core.entity.element.wrap.WrapScript;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
 
 class ActionList extends BaseAction {
 
@@ -36,6 +39,15 @@ class ActionList extends BaseAction {
 			List<Wo> wos = emc.fetchAll(Application.class, Wo.copier);
 
 			List<WrapProcess> processList = emc.fetchAll(Process.class, processCopier);
+			processList.stream().forEach( o -> {
+				if(StringUtils.isEmpty(o.getEdition())){
+					o.setName(o.getName() + "_V1.0");
+				}else{
+					o.setName(o.getEditionName());
+				}
+			});
+			processList = processList.stream().sorted(Comparator.comparing(WrapProcess::getName, Comparator.nullsLast(String::compareTo)))
+					.collect(Collectors.toList());
 
 			List<WrapForm> formList = emc.fetchAll(Form.class, formCopier);
 

+ 3 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/ActionGetWithApplication.java

@@ -23,7 +23,9 @@ class ActionGetWithApplication extends BaseAction {
 				throw new ExceptionEntityNotExist(applicationFlag, Application.class);
 			}
 			Form form = business.form().pick(application, flag);
-			Wo wo = Wo.copier.copy(form);
+			//Wo wo = Wo.copier.copy(form);
+			Wo wo = new Wo();
+			wo.setData(form.getDataOrMobileData());
 			result.setData(wo);
 			return result;
 		}

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

@@ -0,0 +1,43 @@
+package com.x.processplatform.assemble.surface.jaxrs.form;
+
+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.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+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.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.element.Application;
+import com.x.processplatform.core.entity.element.Form;
+
+class ActionGetWithApplicationMobile extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String applicationFlag, String flag) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Application application = business.application().pick(applicationFlag);
+			if (null == application) {
+				throw new ExceptionEntityNotExist(applicationFlag, Application.class);
+			}
+			Form form = business.form().pick(application, flag);
+			//Wo wo = Wo.copier.copy(form);
+			Wo wo = new Wo();
+			wo.setData(form.getMobileDataOrData());
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends Form {
+
+		private static final long serialVersionUID = 1541438199059150837L;
+
+		static WrapCopier<Form, Wo> copier = WrapCopierFactory.wo(Form.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
+
+	}
+
+}

+ 20 - 2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java

@@ -10,7 +10,6 @@ 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 javax.ws.rs.core.Request;
 
 import com.google.gson.JsonElement;
 import com.x.base.core.project.annotation.JaxrsDescribe;
@@ -113,7 +112,7 @@ public class FormAction extends StandardJaxrsAction {
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void getWithApplication(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("表单标识") @PathParam("flag") String flag,
-			@JaxrsParameterDescribe("表单标识") @PathParam("applicationFlag") String applicationFlag) {
+			@JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag) {
 		ActionResult<ActionGetWithApplication.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
@@ -124,4 +123,23 @@ public class FormAction extends StandardJaxrsAction {
 		}
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
+
+	@JaxrsMethodDescribe(value = "根据标识和应用标识获取移动端表单.", action = ActionGetWithApplicationMobile.class)
+	@GET
+	@Path("{flag}/application/{applicationFlag}/mobile")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getWithApplicationMobile(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("表单标识") @PathParam("flag") String flag,
+			@JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag) {
+		ActionResult<ActionGetWithApplicationMobile.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetWithApplicationMobile().execute(effectivePerson, applicationFlag, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
 }

+ 55 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGet.java

@@ -0,0 +1,55 @@
+package com.x.processplatform.assemble.surface.jaxrs.process;
+
+import java.util.List;
+
+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.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+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.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.element.Agent;
+import com.x.processplatform.core.entity.element.Begin;
+import com.x.processplatform.core.entity.element.Cancel;
+import com.x.processplatform.core.entity.element.Choice;
+import com.x.processplatform.core.entity.element.Delay;
+import com.x.processplatform.core.entity.element.Embed;
+import com.x.processplatform.core.entity.element.End;
+import com.x.processplatform.core.entity.element.Invoke;
+import com.x.processplatform.core.entity.element.Manual;
+import com.x.processplatform.core.entity.element.Merge;
+import com.x.processplatform.core.entity.element.Message;
+import com.x.processplatform.core.entity.element.Parallel;
+import com.x.processplatform.core.entity.element.Process;
+import com.x.processplatform.core.entity.element.Route;
+import com.x.processplatform.core.entity.element.Service;
+import com.x.processplatform.core.entity.element.Split;
+
+class ActionGet extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Process process = business.process().pick(flag);
+			if (null == process) {
+				throw new ExceptionEntityNotExist(flag, Process.class);
+			}
+			Wo wo = Wo.copier.copy(process);
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends Process {
+
+		private static final long serialVersionUID = 1521228691441978462L;
+
+		static WrapCopier<Process, Wo> copier = WrapCopierFactory.wo(Process.class, Wo.class, JpaObject.singularAttributeField(Process.class, true, true),
+				JpaObject.FieldsInvisible);
+
+	}
+}

+ 21 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ProcessAction.java

@@ -12,7 +12,6 @@ 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 javax.ws.rs.core.Response;
 
 import com.x.base.core.project.annotation.JaxrsDescribe;
 import com.x.base.core.project.annotation.JaxrsMethodDescribe;
@@ -31,6 +30,27 @@ public class ProcessAction extends StandardJaxrsAction {
 
 	private static Logger logger = LoggerFactory.getLogger(ProcessAction.class);
 
+
+	@JaxrsMethodDescribe(value = "获取流程.", action = ActionGet.class)
+	@GET
+	@Path("{flag}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("流程标识") @PathParam("flag") String flag) {
+		ActionResult<ActionGet.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGet().execute(effectivePerson, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
+
+
+
 	@JaxrsMethodDescribe(value = "获取流程内容,附带所有的Activity信息", action = ActionGetComplex.class)
 	@GET
 	@Path("{flag}/complex")

+ 2 - 2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java

@@ -330,8 +330,8 @@ public class ManualProcessor extends AbstractManualProcessor {
 			List<String> values = taskIdentities.identities();
 			values = ListUtils.subtract(values, aeiObjects.getProcessingAttributes().getIgnoreEmpowerIdentityList());
 			taskIdentities.empower(aeiObjects.business().organization().empower().listWithIdentityObject(
-					aeiObjects.getWork().getApplication(), aeiObjects.getWork().getProcess(),
-					aeiObjects.getWork().getId(), values));
+					aeiObjects.getWork().getApplication(), aeiObjects.getProcess().getEdition(),
+					aeiObjects.getWork().getProcess(), aeiObjects.getWork().getId(), values));
 			for (TaskIdentity taskIdentity : taskIdentities) {
 				if (StringUtils.isNotEmpty(taskIdentity.getFromIdentity())) {
 					aeiObjects.getWork().getProperties().getManualEmpowerMap().put(taskIdentity.getIdentity(),