Browse Source

修改系统内方法调用参数Class<?> -> String

roo00 6 năm trước cách đây
mục cha
commit
2aadcd2a3e
59 tập tin đã thay đổi với 1259 bổ sung599 xóa
  1. 74 69
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java
  2. 7 0
      o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingEngine.java
  3. 1 1
      o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/ActionCreateFormProcessPlatform.java
  4. 1 2
      o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/connector/ActionCreate.java
  5. 33 9
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ActionUpdate.java
  6. 4 7
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java
  7. 84 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionEditText.java
  8. 64 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionGetText.java
  9. 57 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java
  10. 32 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/data/BaseAction.java
  11. 28 7
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionGet.java
  12. 38 10
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionList.java
  13. 10 6
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionRemove.java
  14. 22 9
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionUpdate.java
  15. 0 29
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/BaseAction.java
  16. 4 7
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java
  17. 18 13
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
  18. 47 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/warp/ActionGetWorkOrWorkCompleted.java
  19. 10 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/warp/BaseAction.java
  20. 49 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/warp/WrapAction.java
  21. 104 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionAddSplit.java
  22. 0 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionComplex.java
  23. 12 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionCannotAddSplit.java
  24. 13 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionCurrentWorkLogNotFound.java
  25. 12 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionEmptySplitValue.java
  26. 13 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionUpManualNotFound.java
  27. 13 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionUpSplitNotFound.java
  28. 18 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
  29. 22 27
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionListNextWithFilter.java
  30. 22 28
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionListPrevWithFilter.java
  31. 0 90
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInFilter.java
  32. 0 18
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInSerialNumber.java
  33. 0 38
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInWork.java
  34. 2 2
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java
  35. 0 2
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Hint.java
  36. 3 2
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Work.java
  37. 11 1
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkLog.java
  38. 27 14
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Manual.java
  39. 12 0
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/util/ExceptionBeginNotFound.java
  40. 59 16
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/util/WorkLogTree.java
  41. 0 37
      o2server/x_processplatform_core_entity/src/test/resources/a.json
  42. 60 57
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/Processing.java
  43. 11 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ProcessingAttributes.java
  44. 40 32
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ScriptHelperFactory.java
  45. 11 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
  46. 110 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAddSplit.java
  47. 12 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionEmptySplitValue.java
  48. 12 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionInvalidWorkLog.java
  49. 12 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionNotSplit.java
  50. 19 1
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java
  51. 0 1
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractProcessor.java
  52. 4 4
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/invoke/InvokeProcessor.java
  53. 3 5
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java
  54. 7 7
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/split/SplitProcessor.java
  55. 1 1
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/ActionApplication.java
  56. 1 1
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/authentication/ActionWho.java
  57. 27 40
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/distribute/BaseAction.java
  58. 2 2
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/jest/BaseAction.java
  59. 1 2
      o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/schedule/ActionFire.java

+ 74 - 69
o2server/x_base_core_project/src/main/java/com/x/base/core/project/Applications.java

@@ -52,15 +52,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		return this.get(clz.getName());
 	}
 
-//	public void add(Class<?> applicationClass, Application application) throws Exception {
-//		CopyOnWriteArrayList<Application> list = this.get(applicationClass.getName());
-//		if (null == list) {
-//			list = new CopyOnWriteArrayList<Application>();
-//			this.put(applicationClass.getName(), list);
-//		}
-//		list.add(application);
-//	}
-
 	public void add(String className, Application application) throws Exception {
 		CopyOnWriteArrayList<Application> list = this.get(className);
 		if (null == list) {
@@ -70,120 +61,138 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		list.add(application);
 	}
 
+	public ActionResponse getQuery(Class<?> applicationClass, String uri) throws Exception {
+		return this.getQuery(false, applicationClass.getName(), uri);
+	}
+
 	public ActionResponse getQuery(Boolean xdebugger, Class<?> applicationClass, String uri) throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
+		return this.getQuery(xdebugger, applicationClass.getName(), uri);
 	}
 
-	public ActionResponse getQuery(Class<?> applicationClass, String uri) throws Exception {
-		return this.getQuery(false, applicationClass, uri);
+	public ActionResponse getQuery(Application application, String uri) throws Exception {
+		return this.getQuery(false, application, uri);
 	}
 
 	public ActionResponse getQuery(Boolean xdebugger, Application application, String uri) throws Exception {
-		return CipherConnectionAction.get(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot(), CipherConnectionAction.trim(uri)));
+		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse getQuery(Application application, String uri) throws Exception {
-		return this.getQuery(false, application, uri);
+	public ActionResponse getQuery(String applicationName, String uri) throws Exception {
+		return getQuery(false, applicationName, uri);
 	}
 
 	public ActionResponse getQuery(Boolean xdebugger, String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.getQuery(xdebugger, cls, uri);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("getQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.get(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse getQuery(String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.getQuery(false, cls, uri);
+	public ActionResponse deleteQuery(Class<?> applicationClass, String uri) throws Exception {
+		return this.deleteQuery(false, applicationClass.getName(), uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, Class<?> applicationClass, String uri) throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.delete(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
+		return this.deleteQuery(xdebugger, applicationClass.getName(), uri);
 	}
 
-	public ActionResponse deleteQuery(Class<?> applicationClass, String uri) throws Exception {
-		return this.deleteQuery(false, applicationClass, uri);
+	public ActionResponse deleteQuery(Application application, String uri) throws Exception {
+		return this.deleteQuery(false, application, uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, Application application, String uri) throws Exception {
 		return CipherConnectionAction.delete(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse deleteQuery(Application application, String uri) throws Exception {
-		return this.deleteQuery(false, application, uri);
+	public ActionResponse deleteQuery(String applicationName, String uri) throws Exception {
+		return deleteQuery(false, applicationName, uri);
 	}
 
 	public ActionResponse deleteQuery(Boolean xdebugger, String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.deleteQuery(xdebugger, cls, uri);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("deleteQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.delete(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri));
 	}
 
-	public ActionResponse deleteQuery(String applicationName, String uri) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.deleteQuery(false, cls, uri);
+	public ActionResponse postQuery(Class<?> applicationClass, String uri, Object body) throws Exception {
+		return this.postQuery(false, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object o)
+	public ActionResponse postQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object body)
 			throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.post(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), o);
+		return this.postQuery(xdebugger, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse postQuery(Class<?> applicationClass, String uri, Object o) throws Exception {
-		return this.postQuery(false, applicationClass, uri, o);
+	public ActionResponse postQuery(Application application, String uri, Object body) throws Exception {
+		return this.postQuery(false, application, uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, Application application, String uri, Object o) throws Exception {
-		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), o);
+	public ActionResponse postQuery(Boolean xdebugger, Application application, String uri, Object body)
+			throws Exception {
+		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri),
+				body);
 	}
 
-	public ActionResponse postQuery(Application application, String uri, Object o) throws Exception {
-		return this.postQuery(false, application, uri, o);
+	public ActionResponse postQuery(String applicationName, String uri, String body) throws Exception {
+		return this.postQuery(false, applicationName, uri, body);
 	}
 
-	public ActionResponse postQuery(Boolean xdebugger, String applicationName, String uri, String body)
+	public ActionResponse postQuery(Boolean xdebugger, String applicationName, String uri, Object body)
 			throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.postQuery(xdebugger, cls, uri, body);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("postQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.post(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri),
+				body);
 	}
 
-	public ActionResponse postQuery(String applicationName, String uri, String body) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.postQuery(false, cls, uri, body);
+	public ActionResponse putQuery(Class<?> applicationClass, String uri, Object body) throws Exception {
+		return this.putQuery(false, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object o)
+	public ActionResponse putQuery(Boolean xdebugger, Class<?> applicationClass, String uri, Object body)
 			throws Exception {
-		Application application = this.randomWithWeight(applicationClass);
-		return CipherConnectionAction.put(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), o);
+		return this.putQuery(xdebugger, applicationClass.getName(), uri, body);
 	}
 
-	public ActionResponse putQuery(Class<?> applicationClass, String uri, Object o) throws Exception {
-		return this.putQuery(false, applicationClass, uri, o);
+	public ActionResponse putQuery(Application application, String uri, Object body) throws Exception {
+		return this.putQuery(false, application, uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, Application application, String uri, Object o) throws Exception {
+	public ActionResponse putQuery(Boolean xdebugger, Application application, String uri, Object body)
+			throws Exception {
 		return CipherConnectionAction.put(xdebugger,
-				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), o);
+				StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)), body);
 	}
 
-	public ActionResponse putQuery(Application application, String uri, Object o) throws Exception {
-		return this.putQuery(false, application, uri, o);
+	public ActionResponse putQuery(String applicationName, String uri, Object body) throws Exception {
+		return this.putQuery(false, applicationName, uri, body);
 	}
 
-	public ActionResponse putQuery(Boolean xdebugger, String applicationName, String uri, String body)
+	public ActionResponse putQuery(Boolean xdebugger, String applicationName, String uri, Object body)
 			throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.putQuery(xdebugger, cls, uri, body);
+		String name = this.findApplicationName(applicationName);
+		if (StringUtils.isEmpty(name)) {
+			throw new Exception("putQuery can not find application with name:" + applicationName + ".");
+		}
+		Application application = this.randomWithWeight(name);
+		return CipherConnectionAction.put(xdebugger, application.getUrlRoot() + CipherConnectionAction.trim(uri), body);
 	}
 
-	public ActionResponse putQuery(String applicationName, String uri, String body) throws Exception {
-		Class<?> cls = Class.forName(Applications.class.getPackage().getName() + "." + applicationName);
-		return this.putQuery(false, cls, uri, body);
+	public String findApplicationName(String name) throws Exception {
+		for (String str : this.keySet()) {
+			if (StringUtils.equalsIgnoreCase(str, name) || StringUtils.endsWithIgnoreCase(str, "." + name)) {
+				return str;
+			}
+		}
+		return null;
 	}
 
 	public Application randomWithWeight(String className) throws Exception {
@@ -213,10 +222,6 @@ public class Applications extends ConcurrentHashMap<String, CopyOnWriteArrayList
 		throw new Exception("randomWithWeight error.");
 	}
 
-	public Application randomWithWeight(Class<?> clz) throws Exception {
-		return this.randomWithWeight(clz.getName());
-	}
-
 	public static String joinQueryUri(String... parts) {
 		return Stream.of(parts).map(s -> {
 			try {

+ 7 - 0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingEngine.java

@@ -23,6 +23,7 @@ public class ScriptingEngine {
 
 	private static final String distinguishedName = "distinguishedName";
 
+	public static final String BINDINGNAME_GSON = "gson";
 	public static final String BINDINGNAME_ORGANIZATION = "organization";
 	public static final String BINDINGNAME_WORKCONTEXT = "workContext";
 	public static final String BINDINGNAME_DATA = "data";
@@ -35,6 +36,7 @@ public class ScriptingEngine {
 	public static final String BINDINGNAME_EFFECTIVEPERSON = "effectivePerson";
 	public static final String BINDINGNAME_JAXRSRESPONSE = "jaxrsResponse";
 	public static final String BINDINGNAME_JAXWSRESPONSE = "jaxwsResponse";
+	public static final String BINDINGNAME_ROUTEDATA = "routeData";
 
 	public ScriptingEngine(ScriptEngine scriptEngine) {
 		this.scriptEngine = scriptEngine;
@@ -107,6 +109,11 @@ public class ScriptingEngine {
 		return this;
 	}
 
+	public ScriptingEngine bindingRouteData(String str) {
+		this.scriptEngine.put(BINDINGNAME_ROUTEDATA, str);
+		return this;
+	}
+
 	public Object eval(String scriptText) throws Exception {
 		StringBuffer sb = new StringBuffer();
 		try {

+ 1 - 1
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/jaxrs/attachment/ActionCreateFormProcessPlatform.java

@@ -85,7 +85,7 @@ public class ActionCreateFormProcessPlatform extends BaseAction {
 
 	private byte[] readAttachmentContent(String workId, String workAttachmentId) throws Exception {
 		Application app = ThisApplication.context().applications()
-				.randomWithWeight(x_processplatform_assemble_surface.class);
+				.randomWithWeight(x_processplatform_assemble_surface.class.getName());
 		String address = app.getUrlRoot() + "attachment/download/" + workAttachmentId + "/work/" + workId;
 		HttpURLConnection connection = HttpConnection.prepare(address, CipherConnectionAction.cipher());
 		connection.setRequestMethod("GET");

+ 1 - 2
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/connector/ActionCreate.java

@@ -183,7 +183,7 @@ class ActionCreate extends BaseAction {
 		try {
 			if (ListTools.contains(message.getConsumerList(), MessageConnector.CONSUME_CALENDAR)) {
 				Application app = ThisApplication.context().applications()
-						.randomWithWeight(x_calendar_assemble_control.class);
+						.randomWithWeight(x_calendar_assemble_control.class.getName());
 				if (null != app) {
 					WrapBoolean wrapBoolean = ThisApplication.context().applications()
 							.postQuery(effectivePerson.getDebugger(), app, "message", message)
@@ -327,7 +327,6 @@ class ActionCreate extends BaseAction {
 		private String invalidparty;
 		private String invalidtag;
 
-	 
 		public String getErrmsg() {
 			return errmsg;
 		}

+ 33 - 9
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ActionUpdate.java

@@ -2,25 +2,27 @@ package com.x.processplatform.assemble.surface.jaxrs.applicationdict;
 
 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;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.entity.annotation.CheckPersistType;
+import com.x.base.core.project.annotation.FieldDescribe;
 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.base.core.project.http.WrapOutId;
+import com.x.base.core.project.jaxrs.WoId;
 import com.x.processplatform.assemble.surface.Business;
-import com.x.processplatform.assemble.surface.wrapin.element.WrapInApplicationDict;
 import com.x.processplatform.core.entity.element.Application;
 import com.x.processplatform.core.entity.element.ApplicationDict;
 
 class ActionUpdate extends BaseAction {
 
-	ActionResult<WrapOutId> execute(EffectivePerson effectivePerson, String applicationDictFlag, String applicationFlag,
-			WrapInApplicationDict wrapIn) throws Exception {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String applicationDictFlag, String applicationFlag,
+			JsonElement jsonElement) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<WrapOutId> result = new ActionResult<>();
+			ActionResult<Wo> result = new ActionResult<>();
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 			Business business = new Business(emc);
 			Application application = business.application().pick(applicationFlag);
 			if (null == application) {
@@ -36,16 +38,38 @@ class ActionUpdate extends BaseAction {
 				throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());
 			}
 			emc.beginTransaction(ApplicationDict.class);
-			wrapIn.copyTo(dict, JpaObject.id_FIELDNAME, JpaObject.distributeFactor_FIELDNAME, "application");
+			wi.copyTo(dict, JpaObject.id_FIELDNAME, JpaObject.distributeFactor_FIELDNAME,
+					ApplicationDict.application_FIELDNAME);
 			emc.check(dict, CheckPersistType.all);
-			this.update(business, dict, wrapIn.getData());
+			this.update(business, dict, wi.getData());
 			emc.commit();
 			/* 这个Action是更新ApplicationDict需要刷新缓存 */
 			ApplicationCache.notify(ApplicationDict.class);
-			WrapOutId wrap = new WrapOutId(dict.getId());
-			result.setData(wrap);
+			Wo wo = new Wo();
+			wo.setId(dict.getId());
+			result.setData(wo);
 			return result;
 		}
 	}
 
+	public static class Wo extends WoId {
+
+	}
+
+	public class Wi extends ApplicationDict {
+
+		private static final long serialVersionUID = 6419951244780354684L;
+
+		@FieldDescribe("写入数据")
+		private JsonElement data;
+
+		public JsonElement getData() {
+			return data;
+		}
+
+		public void setData(JsonElement data) {
+			this.data = data;
+		}
+	}
+
 }

+ 4 - 7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/applicationdict/ApplicationDictAction.java

@@ -15,7 +15,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.google.gson.JsonElement;
 import com.x.base.core.project.annotation.JaxrsDescribe;
@@ -29,7 +28,6 @@ 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 com.x.processplatform.assemble.surface.wrapin.element.WrapInApplicationDict;
 import com.x.processplatform.assemble.surface.wrapout.element.WrapOutApplicationDict;
 
 @JaxrsDescribe("数据字典操作")
@@ -66,11 +64,11 @@ public class ApplicationDictAction extends StandardJaxrsAction {
 	public void update(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("数据字典标识") @PathParam("applicationDictFlag") String applicationDictFlag,
 			@JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag,
-			WrapInApplicationDict wrapIn) {
-		ActionResult<WrapOutId> result = new ActionResult<>();
+			JsonElement jsonElement) {
+		ActionResult<ActionUpdate.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionUpdate().execute(effectivePerson, applicationDictFlag, applicationFlag, wrapIn);
+			result = new ActionUpdate().execute(effectivePerson, applicationDictFlag, applicationFlag, jsonElement);
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
@@ -83,8 +81,7 @@ public class ApplicationDictAction extends StandardJaxrsAction {
 	@Path("list/application/{applicationFlag}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
 	@Consumes(MediaType.APPLICATION_JSON)
-	public void listWithApplication(@Suspended final AsyncResponse asyncResponse,
-			@Context HttpServletRequest request,
+	public void listWithApplication(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag) {
 		ActionResult<List<WrapOutApplicationDict>> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);

+ 84 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionEditText.java

@@ -0,0 +1,84 @@
+package com.x.processplatform.assemble.surface.jaxrs.attachment;
+
+import java.util.Arrays;
+
+import org.apache.commons.lang3.BooleanUtils;
+
+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.annotation.CheckPersistType;
+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.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WoId;
+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.assemble.surface.WorkControl;
+import com.x.processplatform.core.entity.content.Attachment;
+import com.x.processplatform.core.entity.content.Work;
+import com.x.processplatform.core.entity.element.Application;
+import com.x.processplatform.core.entity.element.Process;
+
+class ActionEditText extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionEditText.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String workId, JsonElement jsonElement)
+			throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			logger.debug("receive id:{}, jsonElement:{}.", id, jsonElement);
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			Work work = emc.find(workId, Work.class);
+			/** 判断work是否存在 */
+			if (null == work) {
+				throw new ExceptionWorkNotExist(workId);
+			}
+			Attachment attachment = emc.find(id, Attachment.class);
+			if (null == attachment) {
+				throw new ExceptionAttachmentNotExist(id);
+			}
+//			WoControl control = business.getControl(effectivePerson, work, WoControl.class);
+//			if (BooleanUtils.isNotTrue(control.getAllowSave())) {
+//				throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(),
+//						work.getId());
+//			}
+//			Application application = business.application().pick(work.getApplication());
+//			Process process = business.process().pick(work.getProcess());
+//			if (business.controllerable(business, effectivePerson, application, process, attachment)) {
+//				throw new ExceptionAccessDenied(effectivePerson, attachment);
+//			}
+			emc.beginTransaction(Attachment.class);
+			Wi.copier.copy(wi, attachment);
+			emc.check(attachment, CheckPersistType.all);
+			emc.commit();
+			Wo wo = new Wo();
+			wo.setId(attachment.getId());
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wi extends Attachment {
+
+		private static final long serialVersionUID = 4243967432624425952L;
+
+		static WrapCopier<Wi, Attachment> copier = WrapCopierFactory.wi(Wi.class, Attachment.class,
+				Arrays.asList(Attachment.text_FIELDNAME), null);
+
+	}
+
+	public static class Wo extends WoId {
+
+	}
+
+	public static class WoControl extends WorkControl {
+
+	}
+
+}

+ 64 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionGetText.java

@@ -0,0 +1,64 @@
+package com.x.processplatform.assemble.surface.jaxrs.attachment;
+
+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.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+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.tools.ListTools;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.assemble.surface.WorkControl;
+import com.x.processplatform.core.entity.content.Attachment;
+import com.x.processplatform.core.entity.content.Work;
+
+class ActionGetText extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionGetText.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String workId) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Work work = emc.find(workId, Work.class);
+			/** 判断work是否存在 */
+			if (null == work) {
+				throw new ExceptionWorkNotExist(workId);
+			}
+			Attachment attachment = emc.find(id, Attachment.class);
+			if (null == attachment) {
+				throw new ExceptionAttachmentNotExist(id);
+			}
+			WoControl control = business.getControl(effectivePerson, work, WoControl.class);
+			if (BooleanUtils.isNotTrue(control.getAllowSave())) {
+				throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(),
+						work.getId());
+			}
+//			Application application = business.application().pick(work.getApplication());
+//			Process process = business.process().pick(work.getProcess());
+//			if (business.controllerable(business, effectivePerson, application, process, attachment)) {
+//				throw new ExceptionAccessDenied(effectivePerson, attachment);
+//			}
+			Wo wo = Wo.copier.copy(attachment);
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends Attachment {
+
+		private static final long serialVersionUID = 8721106091399412376L;
+		static WrapCopier<Attachment, Wo> copier = WrapCopierFactory.wo(Attachment.class, Wo.class,
+				ListTools.toList(Attachment.text_FIELDNAME), null);
+
+	}
+
+	public static class WoControl extends WorkControl {
+
+	}
+
+}

+ 57 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/AttachmentAction.java

@@ -475,4 +475,61 @@ public class AttachmentAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
 	}
 
+	@JaxrsMethodDescribe(value = "更新附件.", action = ActionEdit.class)
+	@PUT
+	@Path("edit/{id}/work/{workId}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void edit(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id,
+			@JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, JsonElement jsonElement) {
+		ActionResult<ActionEdit.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionEdit().execute(effectivePerson, id, workId, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
+	@JaxrsMethodDescribe(value = "更新附件文本.", action = ActionEditText.class)
+	@PUT
+	@Path("edit/{id}/work/{workId}/text")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void exitText(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id,
+			@JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId, JsonElement jsonElement) {
+		ActionResult<ActionEditText.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionEditText().execute(effectivePerson, id, workId, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
+	@JaxrsMethodDescribe(value = "获取附件文本.", action = ActionGetText.class)
+	@GET
+	@Path("{id}/work/{workId}/text")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getText(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("附件标识") @PathParam("id") String id,
+			@JaxrsParameterDescribe("工作标识") @PathParam("workId") String workId) {
+		ActionResult<ActionGetText.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetText().execute(effectivePerson, id, workId);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
 }

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

@@ -8,12 +8,14 @@ import org.apache.commons.lang3.math.NumberUtils;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
 import com.x.base.core.entity.dataitem.DataItemConverter;
 import com.x.base.core.entity.dataitem.ItemCategory;
 import com.x.base.core.entity.dataitem.ItemType;
 import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.jaxrs.StandardJaxrsAction;
 import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.content.Data;
 import com.x.processplatform.core.entity.content.Read;
 import com.x.processplatform.core.entity.content.ReadCompleted;
 import com.x.processplatform.core.entity.content.Review;
@@ -100,6 +102,16 @@ abstract class BaseAction extends StandardJaxrsAction {
 	}
 
 	void updateData(Business business, Work work, JsonElement jsonElement, String... paths) throws Exception {
+		if (jsonElement.isJsonObject()) {
+			JsonObject jsonObject = jsonElement.getAsJsonObject();
+			if (jsonObject.has(Data.WORK_PROPERTY)) {
+				jsonObject.remove(Data.WORK_PROPERTY);
+			}
+			if (jsonObject.has(Data.ATTACHMENTLIST_PROPERTY)) {
+				jsonObject.remove(Data.ATTACHMENTLIST_PROPERTY);
+			}
+			jsonElement = jsonObject;
+		}
 		DataItemConverter<Item> converter = new DataItemConverter<>(Item.class);
 		List<Item> exists = business.item().listWithJobWithPath(work.getJob(), paths);
 		List<Item> currents = converter.disassemble(jsonElement, paths);
@@ -124,6 +136,16 @@ abstract class BaseAction extends StandardJaxrsAction {
 
 	void updateData(Business business, WorkCompleted workCompleted, JsonElement jsonElement, String... paths)
 			throws Exception {
+		if (jsonElement.isJsonObject()) {
+			JsonObject jsonObject = jsonElement.getAsJsonObject();
+			if (jsonObject.has(Data.WORK_PROPERTY)) {
+				jsonObject.remove(Data.WORK_PROPERTY);
+			}
+			if (jsonObject.has(Data.ATTACHMENTLIST_PROPERTY)) {
+				jsonObject.remove(Data.ATTACHMENTLIST_PROPERTY);
+			}
+			jsonElement = jsonObject;
+		}
 		DataItemConverter<Item> converter = new DataItemConverter<>(Item.class);
 		List<Item> exists = business.item().listWithJobWithPath(workCompleted.getJob(), paths);
 		List<Item> currents = converter.disassemble(jsonElement, paths);
@@ -146,6 +168,16 @@ abstract class BaseAction extends StandardJaxrsAction {
 	}
 
 	void createData(Business business, Work work, JsonElement jsonElement, String... paths) throws Exception {
+		if (jsonElement.isJsonObject()) {
+			JsonObject jsonObject = jsonElement.getAsJsonObject();
+			if (jsonObject.has(Data.WORK_PROPERTY)) {
+				jsonObject.remove(Data.WORK_PROPERTY);
+			}
+			if (jsonObject.has(Data.ATTACHMENTLIST_PROPERTY)) {
+				jsonObject.remove(Data.ATTACHMENTLIST_PROPERTY);
+			}
+			jsonElement = jsonObject;
+		}
 		String[] parentPaths = new String[] { "", "", "", "", "", "", "", "" };
 		String[] cursorPaths = new String[] { "", "", "", "", "", "", "", "" };
 		for (int i = 0; i < paths.length - 1; i++) {

+ 28 - 7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionGet.java

@@ -2,16 +2,19 @@ package com.x.processplatform.assemble.surface.jaxrs.serialnumber;
 
 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.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.processplatform.assemble.surface.Business;
-import com.x.processplatform.assemble.surface.wrapout.content.WrapOutSerialNumber;
 import com.x.processplatform.core.entity.content.SerialNumber;
 import com.x.processplatform.core.entity.element.Application;
 
- class ActionGet extends BaseAction {
-	ActionResult<WrapOutSerialNumber> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		ActionResult<WrapOutSerialNumber> result = new ActionResult<>();
+class ActionGet extends BaseAction {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			SerialNumber o = emc.find(id, SerialNumber.class);
@@ -25,10 +28,28 @@ import com.x.processplatform.core.entity.element.Application;
 			if (!business.application().allowControl(effectivePerson, application)) {
 				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getId());
 			}
-			WrapOutSerialNumber wrap = outCopier.copy(o);
-			this.fillProcessName(business, wrap);
-			result.setData(wrap);
+			Wo wo = Wo.copier.copy(o);
+			wo.setProcessName(business.process().pick(wo.getProcess()).getName());
+			result.setData(wo);
 		}
 		return result;
 	}
+
+	public static class Wo extends SerialNumber {
+
+		private static final long serialVersionUID = -8477113306530730090L;
+		static WrapCopier<SerialNumber, Wo> copier = WrapCopierFactory.wo(SerialNumber.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
+
+		@FieldDescribe("流程名称")
+		private String processName;
+
+		public String getProcessName() {
+			return processName;
+		}
+
+		public void setProcessName(String processName) {
+			this.processName = processName;
+		}
+	}
 }

+ 38 - 10
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionList.java

@@ -1,22 +1,26 @@
 package com.x.processplatform.assemble.surface.jaxrs.serialnumber;
 
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 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.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.EqualsTerms;
 import com.x.base.core.project.tools.SortTools;
 import com.x.processplatform.assemble.surface.Business;
-import com.x.processplatform.assemble.surface.wrapout.content.WrapOutSerialNumber;
 import com.x.processplatform.core.entity.content.SerialNumber;
 import com.x.processplatform.core.entity.element.Application;
 
- class ActionList extends BaseAction {
-	ActionResult<List<WrapOutSerialNumber>> execute(EffectivePerson effectivePerson, String applicationFlag)
-			throws Exception {
-		ActionResult<List<WrapOutSerialNumber>> result = new ActionResult<>();
+class ActionList extends BaseAction {
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String applicationFlag) throws Exception {
+		ActionResult<List<Wo>> result = new ActionResult<>();
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			EqualsTerms equals = new EqualsTerms();
@@ -26,15 +30,39 @@ import com.x.processplatform.core.entity.element.Application;
 			}
 			equals.put("application", application.getId());
 			if (!business.application().allowControl(effectivePerson, application)) {
-				throw new Exception("person{name:" + effectivePerson.getDistinguishedName() + "} has insufficient permissions.");
+				throw new Exception(
+						"person{name:" + effectivePerson.getDistinguishedName() + "} has insufficient permissions.");
 			}
 			List<String> ids = business.serialNumber().listWithApplication(application);
-			List<WrapOutSerialNumber> wraps = outCopier.copy(emc.list(SerialNumber.class, ids));
-			this.fillProcessName(business, wraps);
-			SortTools.asc(wraps, false, "processName", "name");
-			result.setData(wraps);
+			List<Wo> wos = Wo.copier.copy(emc.list(SerialNumber.class, ids));
+			for (Wo wo : wos) {
+				wo.setProcessName(business.process().pick(wo.getProcess()).getName());
+			}
+			wos = wos.stream()
+					.sorted(Comparator.comparing(Wo::getProcessName, Comparator.nullsLast(String::compareTo))
+							.thenComparing(Wo::getProcess, Comparator.nullsLast(String::compareTo)))
+					.collect(Collectors.toList());
+			result.setData(wos);
 		}
 		return result;
 	}
 
+	public static class Wo extends SerialNumber {
+
+		private static final long serialVersionUID = -8477113306530730090L;
+		static WrapCopier<SerialNumber, Wo> copier = WrapCopierFactory.wo(SerialNumber.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
+
+		@FieldDescribe("流程名称")
+		private String processName;
+
+		public String getProcessName() {
+			return processName;
+		}
+
+		public void setProcessName(String processName) {
+			this.processName = processName;
+		}
+	}
+
 }

+ 10 - 6
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionRemove.java

@@ -5,14 +5,14 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.annotation.CheckRemoveType;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutId;
+import com.x.base.core.project.jaxrs.WoId;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.SerialNumber;
 import com.x.processplatform.core.entity.element.Application;
 
- class ActionRemove extends BaseAction {
-	ActionResult<WrapOutId> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		ActionResult<WrapOutId> result = new ActionResult<>();
+class ActionRemove extends BaseAction {
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			SerialNumber o = emc.find(id, SerialNumber.class);
@@ -29,9 +29,13 @@ import com.x.processplatform.core.entity.element.Application;
 			emc.beginTransaction(SerialNumber.class);
 			emc.remove(o, CheckRemoveType.all);
 			emc.commit();
-			WrapOutId wrap = new WrapOutId(id);
-			result.setData(wrap);
+			Wo wo = new Wo();
+			wo.setId(o.getId());
+			result.setData(wo);
 		}
 		return result;
 	}
+
+	public static class Wo extends WoId {
+	}
 }

+ 22 - 9
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/ActionUpdate.java

@@ -3,20 +3,22 @@ package com.x.processplatform.assemble.surface.jaxrs.serialnumber;
 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.annotation.CheckPersistType;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.http.WrapOutId;
+import com.x.base.core.project.jaxrs.WoId;
+import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
-import com.x.processplatform.assemble.surface.wrapin.content.WrapInSerialNumber;
 import com.x.processplatform.core.entity.content.SerialNumber;
 import com.x.processplatform.core.entity.element.Application;
 
 class ActionUpdate extends BaseAction {
-	ActionResult<WrapOutId> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement)
-			throws Exception {
-		ActionResult<WrapOutId> result = new ActionResult<>();
-		WrapInSerialNumber wrapIn = this.convertToWrapIn(jsonElement, WrapInSerialNumber.class);
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+		ActionResult<Wo> result = new ActionResult<>();
+		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			SerialNumber o = emc.find(id, SerialNumber.class);
@@ -31,12 +33,23 @@ class ActionUpdate extends BaseAction {
 				throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getId());
 			}
 			emc.beginTransaction(SerialNumber.class);
-			inCopier.copy(wrapIn, o);
+			Wi.copier.copy(wi, o);
 			emc.check(o, CheckPersistType.all);
 			emc.commit();
-			WrapOutId wrap = new WrapOutId(id);
-			result.setData(wrap);
+			Wo wo = new Wo();
+			wo.setId(o.getId());
+			result.setData(wo);
 		}
 		return result;
 	}
+
+	public static class Wi extends SerialNumber {
+
+		private static final long serialVersionUID = -3037178659768770946L;
+		static WrapCopier<Wi, SerialNumber> copier = WrapCopierFactory.wi(Wi.class, SerialNumber.class, null,
+				ListTools.toList(JpaObject.FieldsUnmodify, SerialNumber.name_FIELDNAME));
+	}
+
+	public static class Wo extends WoId {
+	}
 }

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

@@ -1,36 +1,7 @@
 package com.x.processplatform.assemble.surface.jaxrs.serialnumber;
 
-import java.util.List;
-
-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.jaxrs.StandardJaxrsAction;
-import com.x.processplatform.assemble.surface.Business;
-import com.x.processplatform.assemble.surface.wrapin.content.WrapInSerialNumber;
-import com.x.processplatform.assemble.surface.wrapout.content.WrapOutSerialNumber;
-import com.x.processplatform.core.entity.content.SerialNumber;
-import com.x.processplatform.core.entity.element.Process;
 
 abstract class BaseAction extends StandardJaxrsAction {
 
-	static WrapCopier<SerialNumber, WrapOutSerialNumber> outCopier = WrapCopierFactory.wo(SerialNumber.class,
-			WrapOutSerialNumber.class, null, WrapOutSerialNumber.Excludes);
-
-	static WrapCopier<WrapInSerialNumber, SerialNumber> inCopier = WrapCopierFactory.wi(WrapInSerialNumber.class,
-			SerialNumber.class, null, JpaObject.FieldsUnmodify);
-
-	void fillProcessName(Business business, WrapOutSerialNumber wrap) throws Exception {
-		Process process = business.process().pick(wrap.getProcess());
-		if (null != process) {
-			wrap.setProcessName(process.getName());
-		}
-	}
-
-	void fillProcessName(Business business, List<WrapOutSerialNumber> wraps) throws Exception {
-		for (WrapOutSerialNumber o : wraps) {
-			this.fillProcessName(business, o);
-		}
-	}
-
 }

+ 4 - 7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/serialnumber/SerialNumberAction.java

@@ -14,7 +14,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.google.gson.JsonElement;
 import com.x.base.core.project.annotation.JaxrsDescribe;
@@ -23,12 +22,10 @@ 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;
-import com.x.base.core.project.http.WrapOutId;
 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 com.x.processplatform.assemble.surface.wrapout.content.WrapOutSerialNumber;
 
 @Path("serialnumber")
 @JaxrsDescribe("流水号操作")
@@ -43,7 +40,7 @@ public class SerialNumberAction extends StandardJaxrsAction {
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void list(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("应用标识") @PathParam("applicationFlag") String applicationFlag) {
-		ActionResult<List<WrapOutSerialNumber>> result = new ActionResult<>();
+		ActionResult<List<ActionList.Wo>> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
 			result = new ActionList().execute(effectivePerson, applicationFlag);
@@ -61,7 +58,7 @@ public class SerialNumberAction extends StandardJaxrsAction {
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void get(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<WrapOutSerialNumber> result = new ActionResult<>();
+		ActionResult<ActionGet.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
 			result = new ActionGet().execute(effectivePerson, id);
@@ -79,7 +76,7 @@ public class SerialNumberAction extends StandardJaxrsAction {
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void update(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("标识") @PathParam("id") String id, JsonElement jsonElement) {
-		ActionResult<WrapOutId> result = new ActionResult<>();
+		ActionResult<ActionUpdate.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
 			result = new ActionUpdate().execute(effectivePerson, id, jsonElement);
@@ -97,7 +94,7 @@ public class SerialNumberAction extends StandardJaxrsAction {
 	@Consumes(MediaType.APPLICATION_JSON)
 	public void delete(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
 			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<WrapOutId> result = new ActionResult<>();
+		ActionResult<ActionRemove.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
 			result = new ActionRemove().execute(effectivePerson, id);

+ 18 - 13
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java

@@ -2,7 +2,6 @@ package com.x.processplatform.assemble.surface.jaxrs.task;
 
 import java.net.URLEncoder;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -44,7 +43,8 @@ class ActionProcessing extends BaseAction {
 			if (null == task) {
 				throw new ExceptionEntityNotExist(id, Task.class);
 			}
-			Map<String, Object> requestAttributes = new HashMap<String, Object>();
+			ProcessingRequest processingRequest = new ProcessingRequest();
+			processingRequest.setRouteData(wi.getRouteData());
 			if (!StringUtils.equalsIgnoreCase(task.getPerson(), effectivePerson.getDistinguishedName())) {
 				throw new ExceptionAccessDenied(effectivePerson, task);
 			}
@@ -61,16 +61,7 @@ class ActionProcessing extends BaseAction {
 			emc.commit();
 			/* processing task */
 			ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class,
-					"task/" + URLEncoder.encode(task.getId(), DefaultCharset.name) + "/processing", requestAttributes);
-			/** 流程处理完毕,开始组装返回信息 */
-			// List<WorkLog> os = emc.list(WorkLog.class,
-			// business.workLog().listWithFromActivityTokenForwardNotConnected(task.getActivityToken()));
-			// List<Wo> wos = Wo.copier.copy(os);
-			// wos = business.workLog().sort(wos);
-			// for (Wo wo : wos) {
-			// wo.setTaskList(WoTask.copier.copy(business.task().listTask(wo)));
-			// wo.setTaskCompletedList(WoTaskCompleted.copier.copy(business.taskCompleted().listTaskCompleted(wo)));
-			// }
+					"task/" + URLEncoder.encode(task.getId(), DefaultCharset.name) + "/processing", processingRequest);
 			List<Wo> wos = this.referenceWorkLog(business, task);
 			result.setData(wos);
 			return result;
@@ -163,6 +154,20 @@ class ActionProcessing extends BaseAction {
 
 	}
 
+	public static class ProcessingRequest extends GsonPropertyObject {
+
+		private JsonElement routeData;
+
+		public JsonElement getRouteData() {
+			return routeData;
+		}
+
+		public void setRouteData(JsonElement routeData) {
+			this.routeData = routeData;
+		}
+
+	}
+
 	public static class Wi extends GsonPropertyObject {
 
 		@FieldDescribe("路由名称")
@@ -174,7 +179,7 @@ class ActionProcessing extends BaseAction {
 		@FieldDescribe("多媒体意见")
 		private String mediaOpinion;
 
-		@FieldDescribe("多媒体意见")
+		@FieldDescribe("路由数据")
 		private JsonElement routeData;
 
 		public String getRouteName() {

+ 47 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/warp/ActionGetWorkOrWorkCompleted.java

@@ -0,0 +1,47 @@
+package com.x.processplatform.assemble.surface.jaxrs.warp;
+
+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.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;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.content.Task;
+
+class ActionGetWorkOrWorkCompleted extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionGetWorkOrWorkCompleted.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Task task = emc.find(id, Task.class);
+			if (null == task) {
+				throw new ExceptionEntityNotExist(id, Task.class);
+			}
+			if (!business.readable(effectivePerson, task)) {
+				throw new ExceptionAccessDenied(effectivePerson, task);
+			}
+			Wo wo = Wo.copier.copy(task);
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	public static class Wo extends Task {
+
+		private static final long serialVersionUID = 2279846765261247910L;
+
+		static WrapCopier<Task, Wo> copier = WrapCopierFactory.wo(Task.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
+
+	}
+
+}

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

@@ -0,0 +1,10 @@
+package com.x.processplatform.assemble.surface.jaxrs.warp;
+
+import com.x.base.core.project.jaxrs.StandardJaxrsAction;
+
+abstract class BaseAction extends StandardJaxrsAction {
+ 
+	
+	
+
+}

+ 49 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/warp/WrapAction.java

@@ -0,0 +1,49 @@
+package com.x.processplatform.assemble.surface.jaxrs.warp;
+
+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.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;
+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;
+
+@Path("wrap")
+@JaxrsDescribe("包装接口")
+public class WrapAction extends StandardJaxrsAction {
+
+	private static Logger logger = LoggerFactory.getLogger(WrapAction.class);
+
+	@JaxrsMethodDescribe(value = "列示指定流程当前用户的Task对象,上一页.", action = ActionGetWorkOrWorkCompleted.class)
+	@GET
+	@Path("work/or/workcompleted/{flag}")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void getWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
+			@Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("flag") String flag) {
+		ActionResult<ActionGetWorkOrWorkCompleted.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionGetWorkOrWorkCompleted().execute(effectivePerson, flag);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
+}

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

@@ -0,0 +1,104 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import java.util.List;
+
+import org.apache.commons.lang3.BooleanUtils;
+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;
+import com.x.base.core.project.Applications;
+import com.x.base.core.project.x_processplatform_service_processing;
+import com.x.base.core.project.annotation.FieldDescribe;
+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;
+import com.x.base.core.project.jaxrs.WoId;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.assemble.surface.ThisApplication;
+import com.x.processplatform.core.entity.content.TaskCompleted;
+import com.x.processplatform.core.entity.content.Work;
+import com.x.processplatform.core.entity.content.WorkLog;
+import com.x.processplatform.core.entity.element.ActivityType;
+import com.x.processplatform.core.entity.element.Manual;
+import com.x.processplatform.core.entity.element.util.WorkLogTree;
+
+class ActionAddSplit extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			/* 校验work是否存在 */
+			Work work = emc.find(id, Work.class);
+			if (null == work) {
+				throw new ExceptionEntityNotExist(id, Work.class);
+			}
+			if (StringUtils.isEmpty(wi.getSplitValue())) {
+				throw new ExceptionEmptySplitValue(work.getId());
+			}
+			Manual manual = business.manual().pick(work.getActivity());
+			if (null == manual || BooleanUtils.isFalse(manual.getAllowAddSplit())
+					|| (!BooleanUtils.isTrue(work.getSplitting()))) {
+				throw new ExceptionCannotAddSplit(work.getId());
+			}
+			List<WorkLog> workLogs = emc.listEqual(WorkLog.class, WorkLog.job_FIELDNAME, work.getJob());
+			WorkLog currentWorkLog = workLogs.stream()
+					.filter(o -> StringUtils.equals(o.getFromActivityToken(), work.getActivityToken())).findFirst()
+					.orElse(null);
+			if (null == currentWorkLog) {
+				throw new ExceptionCurrentWorkLogNotFound(work.getId());
+			}
+			WorkLogTree tree = new WorkLogTree(workLogs);
+			WorkLogTree.Node currentNode = tree.find(currentWorkLog);
+			WorkLogTree.Node upSplitNode = currentNode.upTo(ActivityType.split, ActivityType.message,
+					ActivityType.condition, ActivityType.invoke, ActivityType.embed);
+			if (null == upSplitNode) {
+				throw new ExceptionUpSplitNotFound(work.getId());
+			}
+
+			WorkLogTree.Node upManualNode = upSplitNode.upTo(ActivityType.manual, ActivityType.message,
+					ActivityType.condition, ActivityType.invoke, ActivityType.embed);
+			if (null == upManualNode) {
+				throw new ExceptionUpManualNotFound(work.getId());
+			}
+
+			if (emc.countEqualAndEqual(TaskCompleted.class, TaskCompleted.person_FIELDNAME,
+					effectivePerson.getDistinguishedName(), TaskCompleted.activityToken_FIELDNAME,
+					upManualNode.getWorkLog().getFromActivityToken()) < 1) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
+
+			Wo wo = ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class,
+					Applications.joinQueryUri("work", work.getId(), "add", "split"), wi).getData(Wo.class);
+
+			result.setData(wo);
+			return result;
+
+		}
+	}
+
+	public static class Wi extends GsonPropertyObject {
+
+		@FieldDescribe("添加的拆分值.")
+		private String splitValue;
+
+		public String getSplitValue() {
+			return splitValue;
+		}
+
+		public void setSplitValue(String splitValue) {
+			this.splitValue = splitValue;
+		}
+
+	}
+
+	public static class Wo extends WoId {
+	}
+
+}

+ 0 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionComplex.java

@@ -8,7 +8,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.assemble.surface.Business;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.element.Form;

+ 12 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionCannotAddSplit.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionCannotAddSplit extends PromptException {
+
+	private static final long serialVersionUID = -3439770681867963457L;
+
+	ExceptionCannotAddSplit(String id) {
+		super("工作: {}, 当前状态不可增加分支.", id);
+	}
+}

+ 13 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionCurrentWorkLogNotFound.java

@@ -0,0 +1,13 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionCurrentWorkLogNotFound extends PromptException {
+
+	private static final long serialVersionUID = -7038279889683420366L;
+
+	ExceptionCurrentWorkLogNotFound(String id) {
+		super("无法找到工作:{}, 的当前工作日志.", id);
+	}
+
+}

+ 12 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionEmptySplitValue.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionEmptySplitValue extends PromptException {
+
+	private static final long serialVersionUID = 1040883405179987063L;
+
+	ExceptionEmptySplitValue(String id) {
+		super("工作: {},拆分值不能为空.", id);
+	}
+}

+ 13 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionUpManualNotFound.java

@@ -0,0 +1,13 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionUpManualNotFound extends PromptException {
+
+	private static final long serialVersionUID = -7038279889683420366L;
+
+	ExceptionUpManualNotFound(String id) {
+		super("无法找到工作:{}, 的上级人工活动.", id);
+	}
+
+}

+ 13 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ExceptionUpSplitNotFound.java

@@ -0,0 +1,13 @@
+package com.x.processplatform.assemble.surface.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionUpSplitNotFound extends PromptException {
+
+	private static final long serialVersionUID = -7038279889683420366L;
+
+	ExceptionUpSplitNotFound(String id) {
+		super("无法找到工作:{}, 的上级拆分活动.", id);
+	}
+
+}

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

@@ -15,7 +15,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.google.gson.JsonElement;
 import com.x.base.core.project.annotation.JaxrsDescribe;
@@ -450,6 +449,24 @@ public class WorkAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
 	}
 
+	@JaxrsMethodDescribe(value = "增加一个会签分支", action = ActionAddSplit.class)
+	@PUT
+	@Path("{id}/add/split")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void addSplit(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) {
+		ActionResult<ActionAddSplit.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionAddSplit().execute(effectivePerson, id, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, jsonElement);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
 	@JaxrsMethodDescribe(value = "将工作召回。", action = ActionReroute.class)
 	@PUT
 	@Path("{id}/reroute/activity/{activityId}/activitytype/{activityType}")

+ 22 - 27
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionListNextWithFilter.java

@@ -20,7 +20,6 @@ import com.x.base.core.project.jaxrs.LikeTerms;
 import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.WorkCompletedControl;
-import com.x.processplatform.assemble.surface.wrapin.content.WrapInFilter;
 import com.x.processplatform.core.entity.content.WorkCompleted;
 import com.x.processplatform.core.entity.element.Application;
 
@@ -29,7 +28,7 @@ class ActionListNextWithFilter extends BaseAction {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String id, Integer count, String applicationFlag,
 			JsonElement jsonElement) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			WrapInFilter wrapIn = this.convertToWrapIn(jsonElement, WrapInFilter.class);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 			Business business = new Business(emc);
 			ActionResult<List<Wo>> result = new ActionResult<>();
 			EqualsTerms equals = new EqualsTerms();
@@ -40,17 +39,17 @@ class ActionListNextWithFilter extends BaseAction {
 			String applicationId = null == application ? applicationFlag : application.getId();
 			equals.put("creatorPerson", effectivePerson.getDistinguishedName());
 			equals.put("application", applicationId);
-			if (ListTools.isNotEmpty(wrapIn.getProcessList())) {
-				ins.put("process", wrapIn.getProcessList());
+			if (ListTools.isNotEmpty(wi.getProcessList())) {
+				ins.put("process", wi.getProcessList());
 			}
-			if (ListTools.isNotEmpty(wrapIn.getStartTimeMonthList())) {
-				ins.put("startTimeMonth", wrapIn.getStartTimeMonthList());
+			if (ListTools.isNotEmpty(wi.getStartTimeMonthList())) {
+				ins.put("startTimeMonth", wi.getStartTimeMonthList());
 			}
-			if (ListTools.isNotEmpty(wrapIn.getCompletedTimeMonthList())) {
-				ins.put("completedTimeMonth", wrapIn.getCompletedTimeMonthList());
+			if (ListTools.isNotEmpty(wi.getCompletedTimeMonthList())) {
+				ins.put("completedTimeMonth", wi.getCompletedTimeMonthList());
 			}
-			if (StringUtils.isNotEmpty(wrapIn.getKey())) {
-				String key = StringUtils.trim(StringUtils.replace(wrapIn.getKey(), "\u3000", " "));
+			if (StringUtils.isNotEmpty(wi.getKey())) {
+				String key = StringUtils.trim(StringUtils.replace(wi.getKey(), "\u3000", " "));
 				if (StringUtils.isNotEmpty(key)) {
 					likes.put("title", key);
 					likes.put("serial", key);
@@ -58,8 +57,8 @@ class ActionListNextWithFilter extends BaseAction {
 					likes.put("creatorUnit", key);
 				}
 			}
-			result = this.standardListNext(Wo.copier, id, count,  JpaObject.sequence_FIELDNAME, equals, null, likes, ins, null, null, null,
-					null, true, DESC);
+			result = this.standardListNext(Wo.copier, id, count, JpaObject.sequence_FIELDNAME, equals, null, likes, ins,
+					null, null, null, null, true, DESC);
 			/* 添加权限 */
 			if (null != result.getData()) {
 				for (Wo wo : result.getData()) {
@@ -72,18 +71,14 @@ class ActionListNextWithFilter extends BaseAction {
 		}
 	}
 
-	public static class Wi extends GsonPropertyObject {
+	public class Wi extends GsonPropertyObject {
 
-		@FieldDescribe("流程")
 		private List<String> processList;
 
-		@FieldDescribe("启动月份")
-		private List<String> startTimeMonthList;
-
-		@FieldDescribe("完成月份")
 		private List<String> completedTimeMonthList;
 
-		@FieldDescribe("关键字")
+		private List<String> startTimeMonthList;
+
 		private String key;
 
 		public List<String> getProcessList() {
@@ -94,6 +89,14 @@ class ActionListNextWithFilter extends BaseAction {
 			this.processList = processList;
 		}
 
+		public List<String> getCompletedTimeMonthList() {
+			return completedTimeMonthList;
+		}
+
+		public void setCompletedTimeMonthList(List<String> completedTimeMonthList) {
+			this.completedTimeMonthList = completedTimeMonthList;
+		}
+
 		public List<String> getStartTimeMonthList() {
 			return startTimeMonthList;
 		}
@@ -110,14 +113,6 @@ class ActionListNextWithFilter extends BaseAction {
 			this.key = key;
 		}
 
-		public List<String> getCompletedTimeMonthList() {
-			return completedTimeMonthList;
-		}
-
-		public void setCompletedTimeMonthList(List<String> completedTimeMonthList) {
-			this.completedTimeMonthList = completedTimeMonthList;
-		}
-
 	}
 
 	public static class Wo extends WorkCompleted {

+ 22 - 28
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionListPrevWithFilter.java

@@ -20,8 +20,6 @@ import com.x.base.core.project.jaxrs.LikeTerms;
 import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.WorkCompletedControl;
-import com.x.processplatform.assemble.surface.WorkControl;
-import com.x.processplatform.assemble.surface.wrapin.content.WrapInFilter;
 import com.x.processplatform.core.entity.content.WorkCompleted;
 import com.x.processplatform.core.entity.element.Application;
 
@@ -30,7 +28,7 @@ class ActionListPrevWithFilter extends BaseAction {
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String id, Integer count, String applicationFlag,
 			JsonElement jsonElement) throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			WrapInFilter wrapIn = this.convertToWrapIn(jsonElement, WrapInFilter.class);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 			Business business = new Business(emc);
 			ActionResult<List<Wo>> result = new ActionResult<>();
 			EqualsTerms equals = new EqualsTerms();
@@ -41,17 +39,17 @@ class ActionListPrevWithFilter extends BaseAction {
 			String applicationId = null == application ? applicationFlag : application.getId();
 			equals.put("creatorPerson", effectivePerson.getDistinguishedName());
 			equals.put("application", applicationId);
-			if (ListTools.isNotEmpty(wrapIn.getProcessList())) {
-				ins.put("process", wrapIn.getProcessList());
+			if (ListTools.isNotEmpty(wi.getProcessList())) {
+				ins.put("process", wi.getProcessList());
 			}
-			if (ListTools.isNotEmpty(wrapIn.getStartTimeMonthList())) {
-				ins.put("startTimeMonth", wrapIn.getStartTimeMonthList());
+			if (ListTools.isNotEmpty(wi.getStartTimeMonthList())) {
+				ins.put("startTimeMonth", wi.getStartTimeMonthList());
 			}
-			if (ListTools.isNotEmpty(wrapIn.getCompletedTimeMonthList())) {
-				ins.put("completedTimeMonth", wrapIn.getCompletedTimeMonthList());
+			if (ListTools.isNotEmpty(wi.getCompletedTimeMonthList())) {
+				ins.put("completedTimeMonth", wi.getCompletedTimeMonthList());
 			}
-			if (StringUtils.isNotEmpty(wrapIn.getKey())) {
-				String key = StringUtils.trim(StringUtils.replace(wrapIn.getKey(), "\u3000", " "));
+			if (StringUtils.isNotEmpty(wi.getKey())) {
+				String key = StringUtils.trim(StringUtils.replace(wi.getKey(), "\u3000", " "));
 				if (StringUtils.isNotEmpty(key)) {
 					likes.put("title", key);
 					likes.put("serial", key);
@@ -59,8 +57,8 @@ class ActionListPrevWithFilter extends BaseAction {
 					likes.put("creatorUnit", key);
 				}
 			}
-			result = this.standardListPrev(Wo.copier, id, count,  JpaObject.sequence_FIELDNAME, equals, null, likes, ins, null, null, null,
-					null, true, DESC);
+			result = this.standardListPrev(Wo.copier, id, count, JpaObject.sequence_FIELDNAME, equals, null, likes, ins,
+					null, null, null, null, true, DESC);
 			/* 添加权限 */
 			if (null != result.getData()) {
 				for (Wo wo : result.getData()) {
@@ -73,18 +71,14 @@ class ActionListPrevWithFilter extends BaseAction {
 		}
 	}
 
-	public static class Wi extends GsonPropertyObject {
+	public class Wi extends GsonPropertyObject {
 
-		@FieldDescribe("流程")
 		private List<String> processList;
 
-		@FieldDescribe("启动月份")
-		private List<String> startTimeMonthList;
-
-		@FieldDescribe("完成月份")
 		private List<String> completedTimeMonthList;
 
-		@FieldDescribe("关键字")
+		private List<String> startTimeMonthList;
+
 		private String key;
 
 		public List<String> getProcessList() {
@@ -95,6 +89,14 @@ class ActionListPrevWithFilter extends BaseAction {
 			this.processList = processList;
 		}
 
+		public List<String> getCompletedTimeMonthList() {
+			return completedTimeMonthList;
+		}
+
+		public void setCompletedTimeMonthList(List<String> completedTimeMonthList) {
+			this.completedTimeMonthList = completedTimeMonthList;
+		}
+
 		public List<String> getStartTimeMonthList() {
 			return startTimeMonthList;
 		}
@@ -111,14 +113,6 @@ class ActionListPrevWithFilter extends BaseAction {
 			this.key = key;
 		}
 
-		public List<String> getCompletedTimeMonthList() {
-			return completedTimeMonthList;
-		}
-
-		public void setCompletedTimeMonthList(List<String> completedTimeMonthList) {
-			this.completedTimeMonthList = completedTimeMonthList;
-		}
-
 	}
 
 	public static class Wo extends WorkCompleted {

+ 0 - 90
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInFilter.java

@@ -1,90 +0,0 @@
-package com.x.processplatform.assemble.surface.wrapin.content;
-
-import java.util.List;
-
-import com.x.base.core.project.gson.GsonPropertyObject;
-import com.x.processplatform.core.entity.content.WorkStatus;
-
-public class WrapInFilter extends GsonPropertyObject {
-
-	private List<String> applicationList;
-
-	private List<String> processList;
-
-	private List<String> creatorUnitList;
-
-	private List<String> completedTimeMonthList;
-
-	private List<String> startTimeMonthList;
-
-	private List<String> activityNameList;
-
-	private List<WorkStatus> workStatusList;
-
-	private String key;
-
-	public List<String> getApplicationList() {
-		return applicationList;
-	}
-
-	public void setApplicationList(List<String> applicationList) {
-		this.applicationList = applicationList;
-	}
-
-	public List<String> getProcessList() {
-		return processList;
-	}
-
-	public void setProcessList(List<String> processList) {
-		this.processList = processList;
-	}
-
-	public List<String> getCompletedTimeMonthList() {
-		return completedTimeMonthList;
-	}
-
-	public void setCompletedTimeMonthList(List<String> completedTimeMonthList) {
-		this.completedTimeMonthList = completedTimeMonthList;
-	}
-
-	public List<String> getStartTimeMonthList() {
-		return startTimeMonthList;
-	}
-
-	public void setStartTimeMonthList(List<String> startTimeMonthList) {
-		this.startTimeMonthList = startTimeMonthList;
-	}
-
-	public List<String> getActivityNameList() {
-		return activityNameList;
-	}
-
-	public void setActivityNameList(List<String> activityNameList) {
-		this.activityNameList = activityNameList;
-	}
-
-	public List<WorkStatus> getWorkStatusList() {
-		return workStatusList;
-	}
-
-	public void setWorkStatusList(List<WorkStatus> workStatusList) {
-		this.workStatusList = workStatusList;
-	}
-
-	public String getKey() {
-		return key;
-	}
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-	public List<String> getCreatorUnitList() {
-		return creatorUnitList;
-	}
-
-	public void setCreatorUnitList(List<String> creatorUnitList) {
-		this.creatorUnitList = creatorUnitList;
-	}
-
-}

+ 0 - 18
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInSerialNumber.java

@@ -1,18 +0,0 @@
-package com.x.processplatform.assemble.surface.wrapin.content;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.x.base.core.entity.JpaObject;
-import com.x.processplatform.core.entity.content.SerialNumber;
-
-public class WrapInSerialNumber extends SerialNumber {
-
-	private static final long serialVersionUID = -3037178659768770946L;
-	public static List<String> Excludes = new ArrayList<>(JpaObject.FieldsUnmodify);
-
-	static {
-		Excludes.add("name");
-	}
-
-}

+ 0 - 38
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/wrapin/content/WrapInWork.java

@@ -1,38 +0,0 @@
-package com.x.processplatform.assemble.surface.wrapin.content;
-
-import com.google.gson.JsonElement;
-import com.x.base.core.project.gson.GsonPropertyObject;
-
-public class WrapInWork extends GsonPropertyObject {
-
-	private String title;
-
-	private String identity;
-
-	private JsonElement data;
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(String identity) {
-		this.identity = identity;
-	}
-
-	public JsonElement getData() {
-		return data;
-	}
-
-	public void setData(JsonElement data) {
-		this.data = data;
-	}
-
-}

+ 2 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java

@@ -359,7 +359,7 @@ public class Attachment extends StorageObject {
 	private List<String> editUnitList;
 
 	public static final String controllerIdentityList_FIELDNAME = "controllerIdentityList";
-	@FieldDescribe("可以修改的用户.")
+	@FieldDescribe("可以管理的用户.")
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ controllerIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
@@ -371,7 +371,7 @@ public class Attachment extends StorageObject {
 	private List<String> controllerIdentityList;
 
 	public static final String controllerUnitList_FIELDNAME = "controllerUnitList";
-	@FieldDescribe("可以修改的组织.")
+	@FieldDescribe("可以管理的组织.")
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ controllerUnitList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle

+ 0 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Hint.java

@@ -1,7 +1,5 @@
 package com.x.processplatform.core.entity.content;
 
-import java.util.Date;
-
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;

+ 3 - 2
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Work.java

@@ -26,12 +26,12 @@ import org.apache.openjpa.persistence.jdbc.ElementColumn;
 import org.apache.openjpa.persistence.jdbc.ElementIndex;
 import org.apache.openjpa.persistence.jdbc.Index;
 
-import com.x.base.core.entity.AbstractPersistenceProperties;
 import com.x.base.core.entity.JpaObject;
 import com.x.base.core.entity.SliceJpaObject;
 import com.x.base.core.entity.annotation.CheckPersist;
 import com.x.base.core.entity.annotation.ContainerEntity;
 import com.x.base.core.project.annotation.FieldDescribe;
+import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.tools.DateTools;
 import com.x.base.core.project.tools.StringTools;
 import com.x.processplatform.core.entity.PersistenceProperties;
@@ -80,7 +80,8 @@ public class Work extends SliceJpaObject {
 	}
 
 	public Work(Work work) throws Exception {
-		work.copyTo(this, JpaObject.id_FIELDNAME);
+		Work copy = XGsonBuilder.convert(work, Work.class);
+		copy.copyTo(this, JpaObject.id_FIELDNAME);
 	}
 
 	public void setTitle(String title) {

+ 11 - 1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkLog.java

@@ -26,6 +26,7 @@ import com.x.base.core.entity.SliceJpaObject;
 import com.x.base.core.entity.annotation.CheckPersist;
 import com.x.base.core.entity.annotation.ContainerEntity;
 import com.x.base.core.project.annotation.FieldDescribe;
+import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.processplatform.core.entity.PersistenceProperties;
 import com.x.processplatform.core.entity.element.ActivityType;
 
@@ -62,6 +63,15 @@ public class WorkLog extends SliceJpaObject {
 
 	/* 更新运行方法 */
 
+	public WorkLog() {
+
+	}
+
+	public WorkLog(WorkLog workLog) throws Exception {
+		WorkLog copy = XGsonBuilder.convert(workLog, WorkLog.class);
+		copy.copyTo(this, JpaObject.id_FIELDNAME);
+	}
+
 	public static final String job_FIELDNAME = "job";
 	@FieldDescribe("任务标识")
 	@Column(length = JpaObject.length_id, name = ColumnNamePrefix + job_FIELDNAME)
@@ -279,7 +289,7 @@ public class WorkLog extends SliceJpaObject {
 	public static final String splitTokenList_FIELDNAME = "splitTokenList";
 	@FieldDescribe("拆分工作产生的Token")
 	@PersistentCollection(fetch = FetchType.EAGER)
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + splitTokenList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + splitTokenList_FIELDNAME + JoinIndexNameSuffix))
 	@ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + splitTokenList_FIELDNAME)

+ 27 - 14
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Manual.java

@@ -116,7 +116,7 @@ public class Manual extends Activity {
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ readIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + readIdentityList_FIELDNAME
 					+ JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + readIdentityList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + readIdentityList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -126,7 +126,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + readUnitList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + readUnitList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + readUnitList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + readUnitList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -136,7 +136,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + readGroupList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + readGroupList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + readGroupList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + readGroupList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -167,7 +167,7 @@ public class Manual extends Activity {
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ readDataPathList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + readDataPathList_FIELDNAME
 					+ JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = JpaObject.length_255B, name = ColumnNamePrefix + readDataPathList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + readDataPathList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -178,7 +178,7 @@ public class Manual extends Activity {
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ reviewIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
 					+ reviewIdentityList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + reviewIdentityList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + reviewIdentityList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -188,7 +188,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + reviewUnitList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + reviewUnitList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + reviewUnitList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + reviewUnitList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -198,7 +198,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + reviewGroupList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + reviewGroupList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + reviewGroupList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + reviewGroupList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -229,7 +229,7 @@ public class Manual extends Activity {
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ reviewDataPathList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
 					+ reviewDataPathList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = JpaObject.length_255B, name = ColumnNamePrefix + reviewDataPathList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + reviewDataPathList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -331,7 +331,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + routeList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + routeList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + routeList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + routeList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -343,7 +343,7 @@ public class Manual extends Activity {
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle
 			+ taskIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + taskIdentityList_FIELDNAME
 					+ JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + taskIdentityList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + taskIdentityList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -354,7 +354,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + taskUnitList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + taskUnitList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + taskUnitList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + taskUnitList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -365,7 +365,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + ContainerTableNameMiddle + taskGroupList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + taskGroupList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = length_255B, name = ColumnNamePrefix + taskGroupList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + taskGroupList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -440,7 +440,7 @@ public class Manual extends Activity {
 	@PersistentCollection(fetch = FetchType.EAGER)
 	@ContainerTable(name = TABLE + IndexNameMiddle + taskDataPathList_FIELDNAME, joinIndex = @Index(name = TABLE
 			+ IndexNameMiddle + taskDataPathList_FIELDNAME + JoinIndexNameSuffix))
-	@OrderColumn(name =  ORDERCOLUMNCOLUMN)
+	@OrderColumn(name = ORDERCOLUMNCOLUMN)
 	@ElementColumn(length = JpaObject.length_255B, name = ColumnNamePrefix + taskDataPathList_FIELDNAME)
 	@ElementIndex(name = TABLE + IndexNameMiddle + taskDataPathList_FIELDNAME + ElementIndexNameSuffix)
 	@CheckPersist(allowEmpty = true)
@@ -484,6 +484,12 @@ public class Manual extends Activity {
 	@Column(name = ColumnNamePrefix + allowRapid_FIELDNAME)
 	private Boolean allowRapid;
 
+	public static final String allowAddSplit_FIELDNAME = "allowAddSplit";
+	@FieldDescribe("允许在会签拆分状态下增加会签分支.")
+	@CheckPersist(allowEmpty = true)
+	@Column(name = ColumnNamePrefix + allowAddSplit_FIELDNAME)
+	private Boolean allowAddSplit;
+
 	public static final String group_FIELDNAME = "group";
 	@FieldDescribe("分组")
 	@CheckPersist(allowEmpty = true)
@@ -492,7 +498,6 @@ public class Manual extends Activity {
 
 	public static final String resetRange_FIELDNAME = "resetRange";
 	@FieldDescribe("重置范围.")
-	// @Enumerated(EnumType.STRING)
 	@CheckPersist(allowEmpty = true)
 	@Column(length = JpaObject.length_16B, name = ColumnNamePrefix + resetRange_FIELDNAME)
 	private String resetRange;
@@ -1099,4 +1104,12 @@ public class Manual extends Activity {
 		this.taskGroupList = taskGroupList;
 	}
 
+	public Boolean getAllowAddSplit() {
+		return allowAddSplit;
+	}
+
+	public void setAllowAddSplit(Boolean allowAddSplit) {
+		this.allowAddSplit = allowAddSplit;
+	}
+
 }

+ 12 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/util/ExceptionBeginNotFound.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.core.entity.element.util;
+
+import com.x.base.core.project.exception.PromptException;
+
+public class ExceptionBeginNotFound extends PromptException {
+
+	private static final long serialVersionUID = 4132300948670472899L;
+
+	ExceptionBeginNotFound(Integer count) {
+		super("没有找到开始节点,开始节点数量:{}.", count);
+	}
+}

+ 59 - 16
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/util/WorkLogTree.java

@@ -7,10 +7,13 @@ import java.util.stream.Collectors;
 
 import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.collections4.list.TreeList;
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 
+import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.core.entity.content.WorkLog;
+import com.x.processplatform.core.entity.element.ActivityType;
 
 public class WorkLogTree {
 
@@ -18,19 +21,32 @@ public class WorkLogTree {
 
 	List<WorkLog> list;
 
-	List<Node> nodes = new TreeList<>();
+	Nodes nodes = new Nodes();
 
 	public WorkLogTree(List<WorkLog> list) throws Exception {
 		this.list = new ArrayList<WorkLog>(list);
 		List<String> froms = ListTools.extractProperty(list, WorkLog.fromActivityToken_FIELDNAME, String.class, true,
 				true);
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!A");
+		System.out.println(XGsonBuilder.toJson(froms));
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!A");
 		List<String> arriveds = ListTools.extractProperty(list, WorkLog.arrivedActivityToken_FIELDNAME, String.class,
 				true, true);
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!b");
+		System.out.println(XGsonBuilder.toJson(arriveds));
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Ab");
 		List<String> values = ListUtils.subtract(froms, arriveds);
-		List<WorkLog> begins = list.stream().filter(o -> values.contains(o.getFromActivityToken()))
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!bc");
+		System.out.println(XGsonBuilder.toJson(values));
+		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Abc");
+		List<WorkLog> begins = list.stream()
+				.filter(o -> BooleanUtils.isTrue(o.getConnected()) && values.contains(o.getFromActivityToken()))
 				.collect(Collectors.toList());
 		if (begins.size() != 1) {
-			throw new Exception();
+			System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+			System.out.println(XGsonBuilder.toJson(begins));
+			System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+			throw new ExceptionBeginNotFound(begins.size());
 		}
 		root = new Node();
 		root.workLog = begins.get(0);
@@ -40,7 +56,7 @@ public class WorkLogTree {
 	}
 
 	private void sub(Node node) {
-		node.children = new ArrayList<>();
+		node.children = new Nodes();
 		List<WorkLog> os = list.stream()
 				.filter(o -> StringUtils.equals(node.workLog.getArrivedActivityToken(), o.getFromActivityToken()))
 				.collect(Collectors.toList());
@@ -57,10 +73,37 @@ public class WorkLogTree {
 		}
 	}
 
+	public static class Nodes extends TreeList<Node> {
+
+		public boolean onlyManual() {
+			return true;
+		}
+
+	}
+
 	public static class Node {
+
 		private WorkLog workLog;
 		private Node parent;
-		private List<Node> children;
+		private Nodes children = new Nodes();
+
+		public Node upTo(ActivityType activityType, ActivityType... pass) {
+			Node p = this.parent;
+			List<ActivityType> passActivityTypes = ListTools.toList(pass);
+			while ((p != null) && (!Objects.equals(p.workLog.getArrivedActivityType(), activityType))
+					&& ListTools.contains(passActivityTypes, p.workLog.getFromActivityType())) {
+				System.out.println("!!!!!!!!!!!!!!!!!!!!!!!");
+				System.out.println(p);
+				System.out.println("!!!!!!!!!!!!!!!!!!!!!!!");
+				p = p.parent;
+			}
+			return p;
+		}
+
+		public WorkLog getWorkLog() {
+			return workLog;
+		}
+
 	}
 
 	public WorkLog root() {
@@ -101,24 +144,24 @@ public class WorkLogTree {
 		return os;
 	}
 
-	private List<Node> down(Node node) {
-		List<Node> os = new ArrayList<>();
+	public Nodes down(Node node) {
+		Nodes nodes = new Nodes();
 		for (Node o : node.children) {
-			os.add(o);
+			nodes.add(o);
 		}
 		for (Node o : node.children) {
-			os.addAll(down(o));
+			nodes.addAll(down(o));
 		}
-		return os;
+		return nodes;
 	}
 
-	private List<Node> up(Node node) {
-		List<Node> os = new ArrayList<>();
+	public Nodes up(Node node) {
+		Nodes nodes = new Nodes();
 		if (null != node.parent) {
-			os.add(node.parent);
-			os.addAll(up(node.parent));
+			nodes.add(node.parent);
+			nodes.addAll(up(node.parent));
 		}
-		return os;
+		return nodes;
 	}
 
 	public Node find(WorkLog workLog) {
@@ -132,7 +175,7 @@ public class WorkLogTree {
 		return node;
 	}
 
-	public List<Node> nodes() {
+	public Nodes nodes() {
 		return nodes;
 	}
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 37
o2server/x_processplatform_core_entity/src/test/resources/a.json


+ 60 - 57
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/Processing.java

@@ -18,25 +18,25 @@ public class Processing extends BaseProcessing {
 
 	private int loop = 0;
 
-	protected ProcessingAttributes attributes;
+	protected ProcessingAttributes processingAttributes;
 
 	public EntityManagerContainer entityManagerContainer() {
 		return this.entityManagerContainer;
 	}
 
-	public Processing(ProcessingAttributes attributes) throws Exception {
-		if (null == attributes) {
-			this.attributes = new ProcessingAttributes();
+	public Processing(ProcessingAttributes processingAttributes) throws Exception {
+		if (null == processingAttributes) {
+			this.processingAttributes = new ProcessingAttributes();
 		} else {
-			this.attributes = attributes;
+			this.processingAttributes = processingAttributes;
 		}
 		this.entityManagerContainer = EntityManagerContainerFactory.instance().create();
 	}
 
-	public Processing(Integer loop, ProcessingAttributes attributes, EntityManagerContainer entityManagerContainer)
-			throws Exception {
+	public Processing(Integer loop, ProcessingAttributes processingAttributes,
+			EntityManagerContainer entityManagerContainer) throws Exception {
 		this.loop = ++loop;
-		this.attributes = attributes;
+		this.processingAttributes = processingAttributes;
 		this.entityManagerContainer = entityManagerContainer;
 		if (this.loop > 32) {
 			throw new Exception("processing too many.");
@@ -54,7 +54,7 @@ public class Processing extends BaseProcessing {
 			if (null != work) {
 				switch (work.getWorkStatus()) {
 				case start:
-					workId = this.begin().arrive(workId, processingConfigurator, attributes);
+					workId = this.begin().arrive(workId, processingConfigurator, processingAttributes);
 					break;
 				case hanging:
 					workId = null;
@@ -70,24 +70,24 @@ public class Processing extends BaseProcessing {
 			List<String> nextLoops = SetUniqueList.setUniqueList(new ArrayList<String>());
 			/* 强制从arrived开始 */
 			if (!processingConfigurator.getJoinAtExecute()) {
-				workId = this.arrive(workId, processingConfigurator);
+				workId = this.arrive(workId, processingConfigurator, processingAttributes);
 			}
 			if (StringUtils.isEmpty(workId)) {
 				return;
 			}
-			List<String> executed = this.execute(workId, processingConfigurator);
+			List<String> executed = this.execute(workId, processingConfigurator, processingAttributes);
 			for (String str : executed) {
 				if (StringUtils.isNotEmpty(str)) {
-					List<String> inquired = inquire(str, processingConfigurator);
+					List<String> inquired = inquire(str, processingConfigurator, processingAttributes);
 					for (String o : inquired) {
-						nextLoops.add(arrive(o, processingConfigurator));
+						nextLoops.add(arrive(o, processingConfigurator, processingAttributes));
 					}
 				}
 			}
 			for (String str : nextLoops) {
 				if (StringUtils.isNotEmpty(str)) {
 					if (processingConfigurator.getContinueLoop()) {
-						new Processing(this.loop, attributes, this.entityManagerContainer()).processing(str);
+						new Processing(this.loop, processingAttributes, this.entityManagerContainer()).processing(str);
 					}
 				}
 			}
@@ -98,7 +98,8 @@ public class Processing extends BaseProcessing {
 		}
 	}
 
-	private String arrive(String workId, ProcessingConfigurator processingConfigurator) throws Exception {
+	private String arrive(String workId, ProcessingConfigurator processingConfigurator,
+			ProcessingAttributes processingAttributes) throws Exception {
 		try {
 			Work work = null;
 			work = this.entityManagerContainer().fetch(workId, Work.class,
@@ -109,46 +110,46 @@ public class Processing extends BaseProcessing {
 			String id = null;
 			switch (work.getDestinationActivityType()) {
 			case agent:
-				id = this.agent().arrive(workId, processingConfigurator, attributes);
+				id = this.agent().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case begin:
-				id = this.begin().arrive(workId, processingConfigurator, attributes);
+				id = this.begin().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case cancel:
-				id = this.cancel().arrive(workId, processingConfigurator, attributes);
+				id = this.cancel().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case choice:
-				id = this.choice().arrive(workId, processingConfigurator, attributes);
+				id = this.choice().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case delay:
-				id = this.delay().arrive(workId, processingConfigurator, attributes);
+				id = this.delay().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case embed:
-				id = this.embed().arrive(workId, processingConfigurator, attributes);
+				id = this.embed().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case end:
-				id = this.end().arrive(workId, processingConfigurator, attributes);
+				id = this.end().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case invoke:
-				id = this.invoke().arrive(workId, processingConfigurator, attributes);
+				id = this.invoke().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case manual:
-				id = this.manual().arrive(workId, processingConfigurator, attributes);
+				id = this.manual().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case merge:
-				id = this.merge().arrive(workId, processingConfigurator, attributes);
+				id = this.merge().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case message:
-				id = this.message().arrive(workId, processingConfigurator, attributes);
+				id = this.message().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case parallel:
-				id = this.parallel().arrive(workId, processingConfigurator, attributes);
+				id = this.parallel().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case service:
-				id = this.service().arrive(workId, processingConfigurator, attributes);
+				id = this.service().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			case split:
-				id = this.split().arrive(workId, processingConfigurator, attributes);
+				id = this.split().arrive(workId, processingConfigurator, processingAttributes);
 				break;
 			default:
 				break;
@@ -161,7 +162,8 @@ public class Processing extends BaseProcessing {
 		}
 	}
 
-	private List<String> execute(String workId, ProcessingConfigurator processingConfigurator) throws Exception {
+	private List<String> execute(String workId, ProcessingConfigurator processingConfigurator,
+			ProcessingAttributes processingAttributes) throws Exception {
 		List<String> executed = new ArrayList<>();
 		try {
 			Work work = null;
@@ -172,46 +174,46 @@ public class Processing extends BaseProcessing {
 			}
 			switch (work.getActivityType()) {
 			case agent:
-				executed.addAll(this.agent().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.agent().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case begin:
-				executed.addAll(this.begin().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.begin().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case cancel:
-				this.cancel().execute(workId, processingConfigurator, attributes);
+				this.cancel().execute(workId, processingConfigurator, processingAttributes);
 				break;
 			case choice:
-				executed.addAll(this.choice().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.choice().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case delay:
-				executed.addAll(this.delay().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.delay().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case embed:
-				executed.addAll(this.embed().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.embed().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case end:
-				this.end().execute(workId, processingConfigurator, attributes);
+				this.end().execute(workId, processingConfigurator, processingAttributes);
 				break;
 			case invoke:
-				executed.addAll(this.invoke().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.invoke().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case manual:
-				executed.addAll(this.manual().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.manual().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case merge:
-				executed.addAll(this.merge().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.merge().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case message:
-				executed.addAll(this.message().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.message().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case parallel:
-				executed.addAll(this.parallel().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.parallel().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case service:
-				executed.addAll(this.service().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.service().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			case split:
-				executed.addAll(this.split().execute(workId, processingConfigurator, attributes));
+				executed.addAll(this.split().execute(workId, processingConfigurator, processingAttributes));
 				break;
 			default:
 				break;
@@ -224,7 +226,8 @@ public class Processing extends BaseProcessing {
 		}
 	}
 
-	private List<String> inquire(String workId, ProcessingConfigurator processingConfigurator) throws Exception {
+	private List<String> inquire(String workId, ProcessingConfigurator processingConfigurator,
+			ProcessingAttributes processingAttributes) throws Exception {
 		try {
 			List<String> inquired = new ArrayList<>();
 			Work work = null;
@@ -235,44 +238,44 @@ public class Processing extends BaseProcessing {
 			}
 			switch (work.getActivityType()) {
 			case agent:
-				inquired.addAll(this.agent().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.agent().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case begin:
-				inquired.addAll(this.begin().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.begin().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case cancel:
 				break;
 			case choice:
-				inquired.addAll(this.choice().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.choice().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case delay:
-				inquired.addAll(this.delay().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.delay().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case embed:
-				inquired.addAll(this.embed().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.embed().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case end:
 				break;
 			case invoke:
-				inquired.addAll(this.invoke().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.invoke().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case manual:
-				inquired.addAll(this.manual().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.manual().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case merge:
-				inquired.addAll(this.merge().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.merge().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case message:
-				inquired.addAll(this.message().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.message().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case parallel:
-				inquired.addAll(this.parallel().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.parallel().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case service:
-				inquired.addAll(this.service().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.service().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			case split:
-				inquired.addAll(this.split().inquire(workId, processingConfigurator, attributes));
+				inquired.addAll(this.split().inquire(workId, processingConfigurator, processingAttributes));
 				break;
 			default:
 				break;

+ 11 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ProcessingAttributes.java

@@ -1,11 +1,14 @@
 package com.x.processplatform.service.processing;
 
+import com.google.gson.JsonElement;
 import com.x.base.core.project.gson.GsonPropertyObject;
 
 public class ProcessingAttributes extends GsonPropertyObject {
 
 	private Boolean debugger = false;
 
+	private JsonElement routeData;
+
 	public Boolean getDebugger() {
 		return debugger;
 	}
@@ -14,4 +17,12 @@ public class ProcessingAttributes extends GsonPropertyObject {
 		this.debugger = debugger;
 	}
 
+	public JsonElement getRouteData() {
+		return routeData;
+	}
+
+	public void setRouteData(JsonElement routeData) {
+		this.routeData = routeData;
+	}
+
 }

+ 40 - 32
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ScriptHelperFactory.java

@@ -4,6 +4,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import com.x.base.core.project.gson.XGsonBuilder;
+import com.x.base.core.project.scripting.ScriptingEngine;
 import com.x.base.core.project.webservices.WebservicesClient;
 import com.x.organization.core.express.Organization;
 import com.x.processplatform.core.entity.content.Data;
@@ -17,25 +18,32 @@ public class ScriptHelperFactory {
 
 	public static String initialScriptText;
 
-	private static final String data_binding_name = "data";
-	private static final String workContext_binding_name = "workContext";
-	private static final String organization_binding_name = "organization";
-	private static final String webservicesClient_binding_name = "webservicesClient";
-	private static final String dictionary_binding_name = "dictionary";
-	private static final String lookup_binding_name = "lookup";
-	private static final String applications_binding_name = "applications";
+//	private static final String data_binding_name = "data";
+//	private static final String workContext_binding_name = "workContext";
+//	private static final String organization_binding_name = "organization";
+//	private static final String webservicesClient_binding_name = "webservicesClient";
+//	private static final String dictionary_binding_name = "dictionary";
+//	private static final String lookup_binding_name = "lookup";
+//	private static final String applications_binding_name = "applications";
 
 	public static ScriptHelper create(AeiObjects aeiObjects, BindingPair... bindingPairs) throws Exception {
 		WorkContext workContext = new WorkContext(aeiObjects);
 		Map<String, Object> map = new HashMap<>();
-		map.put(workContext_binding_name, workContext);
-		map.put("gson", XGsonBuilder.instance());
-		map.put(data_binding_name, aeiObjects.getData());
-		map.put(organization_binding_name, new Organization(ThisApplication.context()));
-		map.put(webservicesClient_binding_name, new WebservicesClient());
-		map.put(dictionary_binding_name,
+		map.put(ScriptingEngine.BINDINGNAME_WORKCONTEXT, workContext);
+		map.put(ScriptingEngine.BINDINGNAME_GSON, XGsonBuilder.instance());
+		map.put(ScriptingEngine.BINDINGNAME_DATA, aeiObjects.getData());
+		map.put(ScriptingEngine.BINDINGNAME_ORGANIZATION, new Organization(ThisApplication.context()));
+		map.put(ScriptingEngine.BINDINGNAME_WEBSERVICESCLIENT, new WebservicesClient());
+		map.put(ScriptingEngine.BINDINGNAME_DICTIONARY,
 				new ApplicationDictHelper(aeiObjects.entityManagerContainer(), aeiObjects.getWork().getApplication()));
-		map.put(applications_binding_name, ThisApplication.context().applications());
+		map.put(ScriptingEngine.BINDINGNAME_APPLICATIONS, ThisApplication.context().applications());
+		if ((null != aeiObjects.getProcessingAttributes())
+				&& (null != aeiObjects.getProcessingAttributes().getRouteData())) {
+			map.put(ScriptingEngine.BINDINGNAME_ROUTEDATA,
+					aeiObjects.getProcessingAttributes().getRouteData().toString());
+		} else {
+			map.put(ScriptingEngine.BINDINGNAME_ROUTEDATA, "");
+		}
 		for (BindingPair o : bindingPairs) {
 			map.put(o.getName(), o.getValue());
 		}
@@ -59,13 +67,13 @@ public class ScriptHelperFactory {
 			BindingPair... bindingPairs) throws Exception {
 		WorkContext workContext = new WorkContext(business, work, activity);
 		Map<String, Object> map = new HashMap<>();
-		map.put(workContext_binding_name, workContext);
-		map.put(data_binding_name, data);
-		map.put(organization_binding_name, new Organization(ThisApplication.context()));
-		map.put(webservicesClient_binding_name, new WebservicesClient());
-		map.put(dictionary_binding_name,
+		map.put(ScriptingEngine.BINDINGNAME_WORKCONTEXT, workContext);
+		map.put(ScriptingEngine.BINDINGNAME_DATA, data);
+		map.put(ScriptingEngine.BINDINGNAME_ORGANIZATION, new Organization(ThisApplication.context()));
+		map.put(ScriptingEngine.BINDINGNAME_WEBSERVICESCLIENT, new WebservicesClient());
+		map.put(ScriptingEngine.BINDINGNAME_DICTIONARY,
 				new ApplicationDictHelper(business.entityManagerContainer(), work.getApplication()));
-		map.put(applications_binding_name, ThisApplication.context().applications());
+		map.put(ScriptingEngine.BINDINGNAME_APPLICATIONS, ThisApplication.context().applications());
 		for (BindingPair o : bindingPairs) {
 			map.put(o.getName(), o.getValue());
 		}
@@ -77,13 +85,13 @@ public class ScriptHelperFactory {
 			BindingPair... bindingPairs) throws Exception {
 		WorkContext workContext = new WorkContext(business, work, activity, task);
 		Map<String, Object> map = new HashMap<>();
-		map.put(workContext_binding_name, workContext);
-		map.put(data_binding_name, data);
-		map.put(organization_binding_name, new Organization(ThisApplication.context()));
-		map.put(webservicesClient_binding_name, new WebservicesClient());
-		map.put(dictionary_binding_name,
+		map.put(ScriptingEngine.BINDINGNAME_WORKCONTEXT, workContext);
+		map.put(ScriptingEngine.BINDINGNAME_DATA, data);
+		map.put(ScriptingEngine.BINDINGNAME_ORGANIZATION, new Organization(ThisApplication.context()));
+		map.put(ScriptingEngine.BINDINGNAME_WEBSERVICESCLIENT, new WebservicesClient());
+		map.put(ScriptingEngine.BINDINGNAME_DICTIONARY,
 				new ApplicationDictHelper(business.entityManagerContainer(), work.getApplication()));
-		map.put(applications_binding_name, ThisApplication.context().applications());
+		map.put(ScriptingEngine.BINDINGNAME_APPLICATIONS, ThisApplication.context().applications());
 		for (BindingPair o : bindingPairs) {
 			map.put(o.getName(), o.getValue());
 		}
@@ -95,13 +103,13 @@ public class ScriptHelperFactory {
 			TaskCompleted taskCompleted, BindingPair... bindingPairs) throws Exception {
 		WorkContext workContext = new WorkContext(business, work, activity, taskCompleted);
 		Map<String, Object> map = new HashMap<>();
-		map.put(workContext_binding_name, workContext);
-		map.put(data_binding_name, data);
-		map.put(organization_binding_name, new Organization(ThisApplication.context()));
-		map.put(webservicesClient_binding_name, new WebservicesClient());
-		map.put(dictionary_binding_name,
+		map.put(ScriptingEngine.BINDINGNAME_WORKCONTEXT, workContext);
+		map.put(ScriptingEngine.BINDINGNAME_DATA, data);
+		map.put(ScriptingEngine.BINDINGNAME_ORGANIZATION, new Organization(ThisApplication.context()));
+		map.put(ScriptingEngine.BINDINGNAME_WEBSERVICESCLIENT, new WebservicesClient());
+		map.put(ScriptingEngine.BINDINGNAME_DICTIONARY,
 				new ApplicationDictHelper(business.entityManagerContainer(), work.getApplication()));
-		map.put(applications_binding_name, ThisApplication.context().applications());
+		map.put(ScriptingEngine.BINDINGNAME_APPLICATIONS, ThisApplication.context().applications());
 		for (BindingPair o : bindingPairs) {
 			map.put(o.getName(), o.getValue());
 		}

+ 11 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java

@@ -134,6 +134,9 @@ class ActionProcessing extends BaseAction {
 		@FieldDescribe("最后是否触发work的流转,默认流转.")
 		private Boolean finallyProcessingWork;
 
+		@FieldDescribe("路由数据.")
+		private JsonElement routeData;
+
 		public ProcessingType getProcessingType() {
 			return processingType;
 		}
@@ -150,6 +153,14 @@ class ActionProcessing extends BaseAction {
 			this.finallyProcessingWork = finallyProcessingWork;
 		}
 
+		public JsonElement getRouteData() {
+			return routeData;
+		}
+
+		public void setRouteData(JsonElement routeData) {
+			this.routeData = routeData;
+		}
+
 	}
 
 }

+ 110 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAddSplit.java

@@ -0,0 +1,110 @@
+package com.x.processplatform.service.processing.jaxrs.work;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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;
+import com.x.base.core.entity.annotation.CheckPersistType;
+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.jaxrs.WoId;
+import com.x.base.core.project.tools.StringTools;
+import com.x.processplatform.core.entity.content.Work;
+import com.x.processplatform.core.entity.content.WorkLog;
+import com.x.processplatform.service.processing.Business;
+import com.x.processplatform.service.processing.Processing;
+import com.x.processplatform.service.processing.ProcessingAttributes;
+
+/*
+ * 
+ */
+class ActionAddSplit extends BaseAction {
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<Wo> result = new ActionResult<>();
+			Business business = new Business(emc);
+			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+			/* 校验work是否存在 */
+			Work work = emc.find(id, Work.class);
+			if (null == work) {
+				throw new ExceptionEntityNotExist(id, Work.class);
+			}
+			if (!work.getSplitting()) {
+				throw new ExceptionNotSplit(work.getId());
+			}
+			if (StringUtils.isEmpty(wi.getSplitValue())) {
+				throw new ExceptionEmptySplitValue(work.getId());
+			}
+			WorkLog workLog = this.getWorkLogTemplate(business, work);
+			emc.beginTransaction(Work.class);
+			emc.beginTransaction(WorkLog.class);
+			Work workCopy = new Work(work);
+			WorkLog workLogCopy = new WorkLog(workLog);
+			List<String> tokens = new ArrayList<>();
+			String token = StringTools.uniqueToken();
+			for (String str : workCopy.getSplitTokenList()) {
+				if (StringUtils.equals(str, workCopy.getSplitToken())) {
+					tokens.add(token);
+				} else {
+					tokens.add(str);
+				}
+			}
+			workCopy.setSplitValue(wi.getSplitValue());
+			workCopy.setSplitTokenList(tokens);
+			workCopy.setSplitToken(token);
+			workLogCopy.setSplitValue(wi.getSplitValue());
+			workLogCopy.setSplitTokenList(tokens);
+			workLogCopy.setSplitToken(token);
+			/* 重置到达值 */
+			String activityToken = StringTools.uniqueToken();
+			workCopy.setActivityToken(activityToken);
+			workLogCopy.setArrivedActivityToken(activityToken);
+			/* 清空处理人会导致重新计算当前环节处理人 */
+			workCopy.getManualTaskIdentityList().clear();
+			emc.persist(workCopy, CheckPersistType.all);
+			emc.persist(workLogCopy, CheckPersistType.all);
+			emc.commit();
+			Processing processing = new Processing(wi);
+			processing.processing(workCopy.getId());
+			Wo wo = new Wo();
+			wo.setId(workCopy.getId());
+			result.setData(wo);
+			return result;
+		}
+	}
+
+	private WorkLog getWorkLogTemplate(Business business, Work work) throws Exception {
+		List<WorkLog> os = business.entityManagerContainer().listEqual(WorkLog.class,
+				WorkLog.arrivedActivityToken_FIELDNAME, work.getActivityToken());
+		if (os.size() != 1) {
+			throw new ExceptionInvalidWorkLog(work.getActivityToken(), os.size());
+		} else {
+			return os.get(0);
+		}
+	}
+
+	public static class Wi extends ProcessingAttributes {
+
+		private String splitValue;
+
+		public String getSplitValue() {
+			return splitValue;
+		}
+
+		public void setSplitValue(String splitValue) {
+			this.splitValue = splitValue;
+		}
+
+	}
+
+	public static class Wo extends WoId {
+	}
+
+}

+ 12 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionEmptySplitValue.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.service.processing.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionEmptySplitValue extends PromptException {
+
+	private static final long serialVersionUID = 1040883405179987063L;
+
+	ExceptionEmptySplitValue(String id) {
+		super("工作: {},拆分值不能为空.", id);
+	}
+}

+ 12 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionInvalidWorkLog.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.service.processing.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionInvalidWorkLog extends PromptException {
+
+	private static final long serialVersionUID = -3439770681867963457L;
+
+	ExceptionInvalidWorkLog(String activityToken,Integer count) {
+		super("无效工作日志,activityToken:{}, count:{}.", activityToken,count);
+	}
+}

+ 12 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ExceptionNotSplit.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.service.processing.jaxrs.work;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionNotSplit extends PromptException {
+
+	private static final long serialVersionUID = -3439770681867963457L;
+
+	ExceptionNotSplit(String id) {
+		super("work id:{}, not split.", id);
+	}
+}

+ 19 - 1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/WorkAction.java

@@ -113,7 +113,7 @@ public class WorkAction extends StandardJaxrsAction {
 		ActionResult<ActionReroute.Wo> result = new ActionResult<>();
 		EffectivePerson effectivePerson = this.effectivePerson(request);
 		try {
-			result = new ActionReroute().execute(effectivePerson, id, activityId,jsonElement);
+			result = new ActionReroute().execute(effectivePerson, id, activityId, jsonElement);
 		} catch (Exception e) {
 			logger.error(e, effectivePerson, request, null);
 			result.error(e);
@@ -140,4 +140,22 @@ public class WorkAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
 	}
 
+	@JaxrsMethodDescribe(value = "指定文件增加一个副本.", action = ActionAddSplit.class)
+	@PUT
+	@Path("{id}/add/split")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void addSplit(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
+			@JaxrsParameterDescribe("工作标识") @PathParam("id") String id, JsonElement jsonElement) {
+		ActionResult<ActionAddSplit.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionAddSplit().execute(effectivePerson, id, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, null);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getDefaultActionResultResponse(result));
+	}
+
 }

+ 0 - 1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractProcessor.java

@@ -1,6 +1,5 @@
 package com.x.processplatform.service.processing.processor;
 
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;

+ 4 - 4
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/invoke/InvokeProcessor.java

@@ -128,7 +128,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
 			body = this.jaxrsEvalBody(aeiObjects, invoke);
 			if (BooleanUtils.isTrue(invoke.getAsync())) {
 				JaxrsObject jaxrsObject = new JaxrsObject();
-				Application application = ThisApplication.context().applications().randomWithWeight(clz);
+				Application application = ThisApplication.context().applications().randomWithWeight(clz.getName());
 				jaxrsObject
 						.setAddress(StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
 				jaxrsObject.setBody(body);
@@ -144,7 +144,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
 			body = this.jaxrsEvalBody(aeiObjects, invoke);
 			if (BooleanUtils.isTrue(invoke.getAsync())) {
 				JaxrsObject jaxrsObject = new JaxrsObject();
-				Application application = ThisApplication.context().applications().randomWithWeight(clz);
+				Application application = ThisApplication.context().applications().randomWithWeight(clz.getName());
 				jaxrsObject
 						.setAddress(StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
 				jaxrsObject.setBody(body);
@@ -159,7 +159,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
 		case "get":
 			if (BooleanUtils.isTrue(invoke.getAsync())) {
 				JaxrsObject jaxrsObject = new JaxrsObject();
-				Application application = ThisApplication.context().applications().randomWithWeight(clz);
+				Application application = ThisApplication.context().applications().randomWithWeight(clz.getName());
 				jaxrsObject
 						.setAddress(StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
 				jaxrsObject.setInternal(invoke.getInternal());
@@ -173,7 +173,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
 		case "delete":
 			if (BooleanUtils.isTrue(invoke.getAsync())) {
 				JaxrsObject jaxrsObject = new JaxrsObject();
-				Application application = ThisApplication.context().applications().randomWithWeight(clz);
+				Application application = ThisApplication.context().applications().randomWithWeight(clz.getName());
 				jaxrsObject
 						.setAddress(StringTools.JoinUrl(application.getUrlRoot() + CipherConnectionAction.trim(uri)));
 				jaxrsObject.setInternal(invoke.getInternal());

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

@@ -151,8 +151,6 @@ public class ManualProcessor extends AbstractManualProcessor {
 	protected List<Work> executing(AeiObjects aeiObjects, Manual manual) throws Exception {
 		List<Work> results = new ArrayList<>();
 		boolean passThrough = false;
-		// List<String> identities = TranslateTaskIdentityTools.translate(aeiObjects,
-		// manual);
 		/*
 		 * 如果采用List<String> identities =
 		 * TranslateTaskIdentityTools.translate(aeiObjects, manual)
@@ -161,9 +159,9 @@ public class ManualProcessor extends AbstractManualProcessor {
 		List<String> identities = aeiObjects.business().organization().identity()
 				.list(aeiObjects.getWork().getManualTaskIdentityList());
 		if (identities.isEmpty()) {
-			logger.info("工作设置的处理人已经全部无效,重新计算当前环节所有处理人进行处理,标题:{}, id:{}, 设置的处理人:{}.", aeiObjects.getWork().getTitle(),
-					aeiObjects.getWork().getTitle(), aeiObjects.getWork().getManualTaskIdentityList());
 			identities = TranslateTaskIdentityTools.translate(aeiObjects, manual);
+			logger.info("工作设置的处理人已经全部无效,重新计算当前环节所有处理人进行处理,标题:{}, id:{}, 设置的处理人:{}.", aeiObjects.getWork().getTitle(),
+					aeiObjects.getWork().getId(), identities);
 		}
 		if (identities.isEmpty()) {
 			/* 如果活动没有找到任何可用的处理人,那么强制设置处理人为文档创建者,或者配置的 maintenanceIdentity */
@@ -254,7 +252,7 @@ public class ManualProcessor extends AbstractManualProcessor {
 					os.add(o.getRouteName());
 				});
 		/* 进行独占路由的判断 */
-		Route soleRoute = routes.stream().filter(o -> BooleanUtils.isTrue(o.getSole())).findFirst().orElseGet(null);
+		Route soleRoute = routes.stream().filter(o -> BooleanUtils.isTrue(o.getSole())).findFirst().orElse(null);
 		if (null != soleRoute) {
 			result = soleRoute.getName();
 		} else {

+ 7 - 7
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/split/SplitProcessor.java

@@ -62,16 +62,16 @@ public class SplitProcessor extends AbstractSplitProcessor {
 		aeiObjects.getUpdateWorkLogs().add(mainWorkLog);
 		/* 产生后续的拆分文档并标记拆分值 */
 		for (int i = 1; i < splitValues.size(); i++) {
-			Work splitWork = new Work();
+			Work splitWork = new Work(aeiObjects.getWork());
 			/* 将文档存放在一起 */
-			String activityToken = StringTools.uniqueToken();
-			aeiObjects.getWork().copyTo(splitWork, JpaObject.id_FIELDNAME);
-			splitWork.setActivityToken(activityToken);
+			// aeiObjects.getWork().copyTo(splitWork, JpaObject.id_FIELDNAME);
 			splitWork.setSplitValue(splitValues.get(i));
 			aeiObjects.getCreateWorks().add(splitWork);
-			WorkLog splitWorkLog = new WorkLog();
-			mainWorkLog.copyTo(splitWorkLog, JpaObject.id_FIELDNAME);
-			splitWorkLog.setFromActivityToken(activityToken);
+			WorkLog splitWorkLog = new WorkLog(mainWorkLog);
+			splitWorkLog.setWork(splitWork.getId());
+			//splitWork.setActivityToken(StringTools.uniqueToken());
+			// mainWorkLog.copyTo(splitWorkLog, JpaObject.id_FIELDNAME);
+			// splitWorkLog.setFromActivityToken(activityToken);
 			splitWorkLog.setSplitValue(splitValues.get(i));
 			aeiObjects.getCreateWorkLogs().add(splitWorkLog);
 			results.add(splitWork);

+ 1 - 1
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/ActionApplication.java

@@ -50,8 +50,8 @@ public class ActionApplication extends AbstractActionApplication {
 		classes.add(StorageMappingsAction.class);
 		classes.add(UnexpectedErrorLogAction.class);
 		classes.add(WarnLogAction.class);
-		classes.add(JestAction.class);
 		classes.add(TestAction.class);
+		classes.add(JestAction.class);
 		classes.add(ModuleAction.class);
 		classes.add(PmsAction.class);
 		classes.add(AgentAction.class);

+ 1 - 1
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/authentication/ActionWho.java

@@ -26,7 +26,7 @@ class ActionWho extends BaseAction {
 		ActionResult<JsonElement> result = new ActionResult<>();
 		String token = effectivePerson.getToken();
 		Application app = ThisApplication.context().applications()
-				.randomWithWeight(x_organization_assemble_authentication.class);
+				.randomWithWeight(x_organization_assemble_authentication.class.getName());
 		if (app != null) {
 			List<NameValuePair> heads = new ArrayList<>();
 			heads.add(new NameValuePair(HttpToken.X_Token, token));

+ 27 - 40
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/distribute/BaseAction.java

@@ -146,85 +146,72 @@ abstract class BaseAction extends StandardJaxrsAction {
 
 	private Map<String, WoAssemble> getRandomAssemblesFrom(HttpServletRequest request, String source) throws Exception {
 		Map<String, WoAssemble> map = new HashMap<>();
-		for (Class<? extends AssembleA> o : listAssemble()) {
+		for (String str : ThisApplication.context().applications().keySet()) {
 			WoAssemble wrap = new WoAssemble();
-			Application application = ThisApplication.context().applications().randomWithWeight(o);
+			Application application = ThisApplication.context().applications().randomWithWeight(str);
 			if (null != application) {
 				wrap.setContext(application.getContextPath());
 				wrap.setHost(StringUtils.isNotEmpty(source) ? source : this.getHost(request));
 				wrap.setPort(application.getPort());
 				wrap.setName(application.getName());
 			}
-			map.put(o.getSimpleName(), wrap);
+			map.put(StringUtils.substringAfterLast(str, "."), wrap);
 		}
 		return map;
 	}
 
 	private Map<String, WoAssemble> getRandomAssemblesProxy() throws Exception {
 		Map<String, WoAssemble> map = new HashMap<>();
-		for (Class<? extends AssembleA> o : listAssemble()) {
+		for (String str : ThisApplication.context().applications().keySet()) {
 			WoAssemble wrap = new WoAssemble();
-			Application application = ThisApplication.context().applications().randomWithWeight(o);
+			Application application = ThisApplication.context().applications().randomWithWeight(str);
 			if (null != application) {
 				wrap.setContext(application.getContextPath());
 				wrap.setHost(application.getProxyHost());
 				wrap.setPort(application.getProxyPort());
 				wrap.setName(application.getName());
 			}
-			map.put(o.getSimpleName(), wrap);
+			map.put(StringUtils.substringAfterLast(str, "."), wrap);
 		}
 		return map;
 	}
 
 	private Map<String, WoAssemble> getRandomAssemblesNode() throws Exception {
 		Map<String, WoAssemble> map = new HashMap<>();
-		for (Class<? extends AssembleA> o : listAssemble()) {
+		for (String str : ThisApplication.context().applications().keySet()) {
 			WoAssemble wrap = new WoAssemble();
-			Application application = ThisApplication.context().applications().randomWithWeight(o);
+			Application application = ThisApplication.context().applications().randomWithWeight(str);
 			if (null != application) {
 				wrap.setContext(application.getContextPath());
 				wrap.setHost(application.getNode());
 				wrap.setPort(application.getPort());
 				wrap.setName(application.getName());
 			}
-			map.put(o.getSimpleName(), wrap);
+			map.put(StringUtils.substringAfterLast(str, "."), wrap);
 		}
 		return map;
 	}
 
-	@SuppressWarnings("unchecked")
-	private List<Class<? extends AssembleA>> listAssemble() throws Exception {
-		if (null == assembles) {
-			synchronized (BaseAction.class) {
-				if (null == assembles) {
-					try (ScanResult scanResult = new ClassGraph().enableAllInfo().scan()) {
-						assembles = new CopyOnWriteArrayList<Class<? extends AssembleA>>();
-						List<ClassInfo> list = new ArrayList<>();
-						list.addAll(scanResult.getSubclasses(AssembleA.class.getName()));
-						list = list.stream().sorted(Comparator.comparing(ClassInfo::getName))
-								.collect(Collectors.toList());
-						for (ClassInfo info : list) {
-							assembles.add((Class<AssembleA>) Class.forName(info.getName()));
-						}
-					}
-//					ScanResult scanResult = new FastClasspathScanner(Packages.PREFIX).scan();
-//					List<String> assembleList = scanResult.getNamesOfSubclassesOf(AssembleA.class);
-//					List<String> list = new ArrayList<>();
-//					list.addAll(assembleList);
-//					Collections.sort(list, new Comparator<String>() {
-//						public int compare(String s1, String s2) {
-//							return s1.compareTo(s2);
+//	@SuppressWarnings("unchecked")
+//	private List<Class<? extends AssembleA>> listAssemble() throws Exception {
+//		if (null == assembles) {
+//			synchronized (BaseAction.class) {
+//				if (null == assembles) {
+//					try (ScanResult scanResult = new ClassGraph().enableAllInfo().scan()) {
+//						assembles = new CopyOnWriteArrayList<Class<? extends AssembleA>>();
+//						List<ClassInfo> list = new ArrayList<>();
+//						list.addAll(scanResult.getSubclasses(AssembleA.class.getName()));
+//						list = list.stream().sorted(Comparator.comparing(ClassInfo::getName))
+//								.collect(Collectors.toList());
+//						for (ClassInfo info : list) {
+//							assembles.add((Class<AssembleA>) Class.forName(info.getName()));
 //						}
-//					});
-//					assembles = new CopyOnWriteArrayList<Class<? extends AssembleA>>();
-//					for (String str : list) {
-//						assembles.add((Class<AssembleA>) Class.forName(str));
 //					}
-				}
-			}
-		}
-		return assembles;
-	}
+//				}
+//			}
+//		}
+//		return assembles;
+//	}
 
 	public static class WoAssemble extends GsonPropertyObject {
 

+ 2 - 2
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/jest/BaseAction.java

@@ -127,7 +127,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 		Map<String, WoAssemble> map = new HashMap<>();
 		for (Class<? extends AssembleA> o : listAssemble()) {
 			WoAssemble wrap = new WoAssemble();
-			Application application = ThisApplication.context().applications().randomWithWeight(o);
+			Application application = ThisApplication.context().applications().randomWithWeight(o.getName());
 			if (null != application) {
 				wrap.setContext(application.getContextPath());
 				if (this.isUndefindHost(application.getNode())) {
@@ -147,7 +147,7 @@ abstract class BaseAction extends StandardJaxrsAction {
 		Map<String, WoAssemble> map = new HashMap<>();
 		for (Class<? extends AssembleA> o : listAssemble()) {
 			WoAssemble wrap = new WoAssemble();
-			Application application = ThisApplication.context().applications().randomWithWeight(o);
+			Application application = ThisApplication.context().applications().randomWithWeight(o.getName());
 			if (null != application) {
 				wrap.setContext(application.getContextPath());
 				if (this.isUndefindHost(application.getProxyHost())) {

+ 1 - 2
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/schedule/ActionFire.java

@@ -67,8 +67,7 @@ class ActionFire extends BaseAction {
 			o.setFireTime(date);
 		});
 		emc.commit();
-		Class<?> clz = Class.forName(schedule.getApplication());
-		Application app = ThisApplication.context().applications().randomWithWeight(clz);
+		Application app = ThisApplication.context().applications().randomWithWeight(schedule.getApplication());
 		if (null != app) {
 			String url = app.getUrlRoot()
 					+ Applications.joinQueryUri("fireschedule", "classname", schedule.getClassName());

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác