Parcourir la source

脚本预编译

roo00 il y a 6 ans
Parent
commit
2b31351421
20 fichiers modifiés avec 639 ajouts et 155 suppressions
  1. 5 8
      o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerListPaging.java
  2. 2 4
      o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empowerlog/ActionManagerListPaging.java
  3. 12 0
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEdit.java
  4. 1 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDeleteWithWorkCompleted.java
  5. 49 22
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java
  6. 1 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java
  7. 10 29
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java
  8. 1 1
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
  9. 17 16
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/worklog/ActionListWithWorkOrWorkCompleted.java
  10. 334 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/worklog/ActionListWithWorkOrWorkCompleted2.java
  11. 1 1
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Task.java
  12. 17 2
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/TaskCompleted.java
  13. 52 0
      o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
  14. 3 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/Business.java
  15. 26 2
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java
  16. 13 33
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java
  17. 1 1
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
  18. 73 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/taskcompleted/ActionUpdateNextTaskIdentityListText.java
  19. 21 0
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/taskcompleted/TaskCompletedAction.java
  20. 0 34
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest1.java

+ 5 - 8
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empower/ActionManagerListPaging.java

@@ -11,8 +11,8 @@ 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.tools.DateTools;
+import com.x.base.core.project.tools.StringTools;
 import com.x.organization.assemble.personal.Business;
-import com.x.organization.core.entity.Person;
 import com.x.organization.core.entity.accredit.Empower;
 import com.x.organization.core.entity.accredit.Empower_;
 import org.apache.commons.lang3.StringUtils;
@@ -31,7 +31,6 @@ class ActionManagerListPaging extends BaseAction {
 			throws Exception {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
-			Business business = new Business(emc);
 			ActionResult<List<Wo>> result = new ActionResult<>();
 			EntityManager em = emc.get(Empower.class);
 			CriteriaBuilder cb = em.getCriteriaBuilder();
@@ -40,10 +39,8 @@ class ActionManagerListPaging extends BaseAction {
 			Predicate p = cb.conjunction();
 			if(effectivePerson.isManager()) {
 				if (StringUtils.isNotEmpty(wi.getFromPerson())) {
-					Person person = business.person().pick(wi.getFromPerson());
-					if (person != null){
-						p = cb.and(p, cb.equal(root.get(Empower_.fromPerson), person.getDistinguishedName()));
-					}
+					String key = "%" + StringTools.escapeSqlLikeKey(wi.getFromPerson()) + "%";
+					p = cb.and(p, cb.like(root.get(Empower_.fromPerson), key, StringTools.SQL_ESCAPE_CHAR));
 				}
 			}else{
 				p = cb.and(p, cb.equal(root.get(Empower_.fromPerson), effectivePerson.getDistinguishedName()));
@@ -67,8 +64,8 @@ class ActionManagerListPaging extends BaseAction {
 
 		private static final long serialVersionUID = 4279205128463146835L;
 
-		static WrapCopier<Empower, Wo> copier = WrapCopierFactory.wi(Empower.class, Wo.class,
-				JpaObject.singularAttributeField(Empower.class, true, true), null);
+		static WrapCopier<Empower, Wo> copier = WrapCopierFactory.wi(Empower.class, Wo.class, null,
+				JpaObject.FieldsInvisible);
 
 	}
 

+ 2 - 4
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/empowerlog/ActionManagerListPaging.java

@@ -41,10 +41,8 @@ class ActionManagerListPaging extends BaseAction {
 			Predicate p = cb.conjunction();
 			if(effectivePerson.isManager()) {
 				if (StringUtils.isNotEmpty(wi.getFromPerson())) {
-					Person person = business.person().pick(wi.getFromPerson());
-					if (person != null){
-						p = cb.and(p, cb.equal(root.get(EmpowerLog_.fromPerson), person.getDistinguishedName()));
-					}
+					String key = "%" + StringTools.escapeSqlLikeKey(wi.getFromPerson()) + "%";
+					p = cb.and(p, cb.like(root.get(EmpowerLog_.fromPerson), key, StringTools.SQL_ESCAPE_CHAR));
 				}
 			}else{
 				p = cb.and(p, cb.equal(root.get(EmpowerLog_.fromPerson), effectivePerson.getDistinguishedName()));

+ 12 - 0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEdit.java

@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.designer.jaxrs.process;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import com.google.gson.JsonElement;
@@ -88,6 +89,7 @@ class ActionEdit extends BaseAction {
 			update_route(business, wrap.getRouteList(), process);
 			update_service(business, wrap.getServiceList(), process);
 			update_split(business, wrap.getSplitList(), process);
+			this.updateEdition(business, process);
 			emc.commit();
 			cacheNotify();
 			/* 保存历史版本 */
@@ -114,4 +116,14 @@ class ActionEdit extends BaseAction {
 			process.setCreatorPerson(name);
 		}
 	}
+
+	private void updateEdition(Business business, Process process) throws Exception {
+		if (StringUtils.isNotEmpty(process.getEdition()) && BooleanUtils.isTrue(process.getEditionEnable())) {
+			for (Process p : business.entityManagerContainer().listEqual(Process.class, Process.edition_FIELDNAME,
+					process.getEdition())) {
+				p.setEditionEnable(false);
+				p.setEditionName(process.getEditionName());
+			}
+		}
+	}
 }

+ 1 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/attachment/ActionDeleteWithWorkCompleted.java

@@ -35,7 +35,7 @@ class ActionDeleteWithWorkCompleted extends BaseAction {
 			if (null == attachment) {
 				throw new ExceptionEntityNotExist(id, Attachment.class);
 			}
-			if (business.canManageApplicationOrProcess(effectivePerson, attachment.getApplication(),
+			if (!business.canManageApplicationOrProcess(effectivePerson, attachment.getApplication(),
 					attachment.getProcess())) {
 				throw new ExceptionAccessDenied(effectivePerson);
 			}

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

@@ -21,6 +21,7 @@ import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WoId;
+import com.x.base.core.project.jaxrs.WrapBoolean;
 import com.x.base.core.project.jaxrs.WrapStringList;
 import com.x.base.core.project.logger.Audit;
 import com.x.base.core.project.logger.Logger;
@@ -30,6 +31,7 @@ import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.ThisApplication;
 import com.x.processplatform.core.entity.content.ProcessingType;
 import com.x.processplatform.core.entity.content.Task;
+import com.x.processplatform.core.entity.content.TaskCompleted;
 import com.x.processplatform.core.entity.content.WorkLog;
 import com.x.processplatform.core.entity.element.Manual;
 import com.x.processplatform.core.entity.element.Route;
@@ -48,6 +50,8 @@ class ActionProcessing extends BaseAction {
 		Audit audit = logger.audit(effectivePerson);
 		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
 		Task task = null;
+		String taskCompletedId = null;
+		String nextTaskIdentityListText = null;
 		boolean appendTask = false;
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
@@ -58,20 +62,22 @@ class ActionProcessing extends BaseAction {
 			if (!StringUtils.equalsIgnoreCase(task.getPerson(), effectivePerson.getDistinguishedName())) {
 				throw new ExceptionAccessDenied(effectivePerson, task);
 			}
-			emc.beginTransaction(Task.class);
-			/* 如果有输入新的路由决策覆盖原有决策 */
-			if (StringUtils.isNotEmpty(wi.getRouteName())) {
-				task.setRouteName(wi.getRouteName());
-			}
-			/* 如果有新的流程意见那么覆盖原有流程意见 */
-			if (StringUtils.isNotEmpty(wi.getOpinion())) {
-				task.setOpinion(wi.getOpinion());
+			if (StringUtils.isNotEmpty(wi.getRouteName()) || StringUtils.isNotEmpty(wi.getOpinion())
+					|| (!StringUtils.equals(task.getMediaOpinion(), wi.getMediaOpinion()))) {
+				emc.beginTransaction(Task.class);
+				/* 如果有输入新的路由决策覆盖原有决策 */
+				if (StringUtils.isNotEmpty(wi.getRouteName())) {
+					task.setRouteName(wi.getRouteName());
+				}
+				/* 如果有新的流程意见那么覆盖原有流程意见 */
+				if (StringUtils.isNotEmpty(wi.getOpinion())) {
+					task.setOpinion(wi.getOpinion());
+				}
+				/* 强制覆盖多媒体意见 */
+				task.setMediaOpinion(wi.getMediaOpinion());
+				emc.commit();
 			}
-			/* 强制覆盖多媒体意见 */
-			task.setMediaOpinion(wi.getMediaOpinion());
-			emc.commit();
-
-			appendTask = this.appendTask(business, task, wi);
+			appendTask = this.ifAppendTask(business, task, wi);
 		}
 		if (appendTask) {
 			ReqAppendTask req = new ReqAppendTask();
@@ -94,6 +100,9 @@ class ActionProcessing extends BaseAction {
 				.getData(WoId.class);
 		if (StringUtils.isBlank(taskProcessingResp.getId())) {
 			throw new ExceptionTaskProcessing(task.getId());
+		} else {
+			/* 获得已办id */
+			taskCompletedId = taskProcessingResp.getId();
 		}
 
 		WoId workProcessingResp = ThisApplication.context().applications()
@@ -119,15 +128,18 @@ class ActionProcessing extends BaseAction {
 				Node node = tree.find(currentWorkLog);
 				if (null != node) {
 					List<WoTask> woTasks = new ArrayList<>();
-					List<String> activityTokens = new ArrayList<>();
-					for (Node n : node.downNextManual()) {
-						activityTokens.add(n.getWorkLog().getFromActivityToken());
+					woTasks.addAll(emc.fetchEqualAndEqual(Task.class, WoTask.copier, Task.job_FIELDNAME, task.getJob(),
+							Task.work_FIELDNAME, node.getWorkLog().getWork()));
+					if (woTasks.isEmpty()) {
+						List<String> activityTokens = new ArrayList<>();
+						for (Node n : node.downNextManual()) {
+							activityTokens.add(n.getWorkLog().getFromActivityToken());
+						}
+						woTasks.addAll(emc.fetchEqualAndIn(Task.class, WoTask.copier, Task.job_FIELDNAME, task.getJob(),
+								Task.activityToken_FIELDNAME, activityTokens));
 					}
-					woTasks.addAll(emc.fetchEqualAndIn(Task.class, WoTask.copier, Task.job_FIELDNAME, task.getJob(),
-							Task.activityToken_FIELDNAME, activityTokens));
-//					woTasks.addAll(emc.fetchEqualAndEqual(Task.class, WoTask.copier, Task.job_FIELDNAME, task.getJob(),
-//							Task.work_FIELDNAME, node.getWorkLog().getWork()));
 					woTasks = ListTools.trim(woTasks, true, true);
+					List<String> identities = new ArrayList<>();
 					for (Entry<String, List<WoTask>> en : woTasks.stream()
 							.collect(Collectors.groupingBy(WoTask::getActivity)).entrySet()) {
 						Wo wo = new Wo();
@@ -135,16 +147,31 @@ class ActionProcessing extends BaseAction {
 						wo.setActivityName(en.getValue().get(0).getActivityName());
 						wo.setTaskList(en.getValue());
 						wos.add(wo);
+						for (WoTask o : en.getValue()) {
+							identities.add(o.getIdentity());
+						}
 					}
+					nextTaskIdentityListText = StringUtils.join(ListTools.trim(identities, true, true), ",");
 				}
 			}
 			result.setData(wos);
 		}
+		/* 记录下一处理人信息 */
+		if (StringUtils.isNotEmpty(taskCompletedId) && StringUtils.isNotEmpty(nextTaskIdentityListText)) {
+			TaskCompleted taskCompletedUdateReq = new TaskCompleted();
+			taskCompletedUdateReq.setNextTaskIdentityListText(nextTaskIdentityListText);
+			ThisApplication.context().applications()
+					.putQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class,
+							Applications.joinQueryUri("taskcompleted", taskCompletedId, "nexttaskidentitylisttext"),
+							taskCompletedUdateReq, task.getJob())
+					.getData(WrapBoolean.class);
+		}
+
 		audit.log(null, "审批");
 		return result;
 	}
 
-	private boolean appendTask(Business business, Task task, Wi wi) throws Exception {
+	private boolean ifAppendTask(Business business, Task task, Wi wi) throws Exception {
 		Manual manual = business.manual().pick(task.getActivity());
 		if (null != manual) {
 			Route route = null;
@@ -201,7 +228,7 @@ class ActionProcessing extends BaseAction {
 
 		static WrapCopier<Task, WoTask> copier = WrapCopierFactory.wo(Task.class, WoTask.class,
 				ListTools.toList(Task.id_FIELDNAME, Task.activity_FIELDNAME, Task.activityName_FIELDNAME,
-						Task.person_FIELDNAME, Task.unit_FIELDNAME),
+						Task.person_FIELDNAME, Task.identity_FIELDNAME, Task.unit_FIELDNAME),
 				null);
 
 	}

+ 1 - 1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/taskcompleted/TaskCompletedAction.java

@@ -371,7 +371,7 @@ public class TaskCompletedAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
-	@JaxrsMethodDescribe(value = "获取定人员的已办数量,没有权限限制.", action = ActionCountWithPerson.class)
+	@JaxrsMethodDescribe(value = "获取定人员的已办数量,没有权限限制.", action = ActionCountWithPerson.class)
 	@GET
 	@Path("count/{credential}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)

+ 10 - 29
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java

@@ -1,7 +1,5 @@
 package com.x.processplatform.assemble.surface.jaxrs.work;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Objects;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -17,7 +15,6 @@ import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WrapBoolean;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.ThisApplication;
-import com.x.processplatform.core.entity.content.Task;
 import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.element.ActivityType;
 import com.x.processplatform.core.entity.element.Process;
@@ -34,9 +31,17 @@ class ActionCloseCheck extends BaseAction {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			Business business = new Business(emc);
 			work = emc.find(id, Work.class);
-			process = business.process().pick(work.getProcess());
+			if (null != work) {
+				process = business.process().pick(work.getProcess());
+			}
+		}
+		if (null != work && null != process) {
+			wo.setDraft(this.draft(effectivePerson, work, process));
+		} else {
+			WoDraft woDraft = new WoDraft();
+			woDraft.setValue(false);
+			wo.setDraft(woDraft);
 		}
-		wo.setDraft(this.draft(effectivePerson, work, process));
 		result.setData(wo);
 		return result;
 	}
@@ -109,28 +114,4 @@ class ActionCloseCheck extends BaseAction {
 
 	}
 
-	public static class WoGrabRelease extends GsonPropertyObject {
-
-		private List<Task> taskList = new ArrayList<>();
-
-		private Boolean release = false;
-
-		public List<Task> getTaskList() {
-			return taskList;
-		}
-
-		public void setTaskList(List<Task> taskList) {
-			this.taskList = taskList;
-		}
-
-		public Boolean getRelease() {
-			return release;
-		}
-
-		public void setRelease(Boolean release) {
-			this.release = release;
-		}
-
-	}
-
 }

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

@@ -560,7 +560,7 @@ public class WorkAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
-	@JaxrsMethodDescribe(value = "将工作召回。", action = ActionReroute.class)
+	@JaxrsMethodDescribe(value = "将工作调度。", action = ActionReroute.class)
 	@PUT
 	@Path("{id}/reroute/activity/{activityId}/activitytype/{activityType}")
 	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)

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

@@ -76,6 +76,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 			List<WoRead> reads = future_reads.get();
 			List<WoReadCompleted> readCompleteds = future_readCompleteds.get();
 			List<WorkLog> workLogs = future_workLogs.get();
+
 			WorkLogTree tree = new WorkLogTree(workLogs);
 
 			List<Wo> wos = new ArrayList<>();
@@ -103,21 +104,20 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 						for (Node n : nodes) {
 							tasks.stream().filter(t -> StringUtils.equals(t.getActivityToken(),
 									n.getWorkLog().getFromActivityToken())).forEach(t -> {
-										wo.getNextManualTaskIdentityList().add(t.getIdentity());
+										wo.getNextTaskIdentityList().add(t.getIdentity());
 									});
 							taskCompleteds.stream()
 									.filter(t -> BooleanUtils.isTrue(t.getJoinInquire()) && StringUtils
 											.equals(t.getActivityToken(), n.getWorkLog().getFromActivityToken()))
 									.forEach(t -> {
-										wo.getNextManualTaskCompletedIdentityList().add(t.getIdentity());
+										wo.getNextTaskCompletedIdentityList().add(t.getIdentity());
 									});
 						}
 					}
 				}
 				/* 下一环节处理人可能是重复处理导致重复的,去重 */
-				wo.setNextManualTaskIdentityList(ListTools.trim(wo.getNextManualTaskIdentityList(), true, true));
-				wo.setNextManualTaskCompletedIdentityList(
-						ListTools.trim(wo.getNextManualTaskCompletedIdentityList(), true, true));
+				wo.setNextTaskIdentityList(ListTools.trim(wo.getNextTaskIdentityList(), true, true));
+				wo.setNextTaskCompletedIdentityList(ListTools.trim(wo.getNextTaskCompletedIdentityList(), true, true));
 				wos.add(wo);
 			}
 			ListTools.groupStick(wos, tasks, WorkLog.fromActivityToken_FIELDNAME, Task.activityToken_FIELDNAME,
@@ -223,9 +223,9 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 
 		private List<WoReadCompleted> readCompletedList = new ArrayList<>();
 
-		private List<String> nextManualTaskIdentityList = new ArrayList<>();
+		private List<String> nextTaskIdentityList = new ArrayList<>();
 
-		private List<String> nextManualTaskCompletedIdentityList = new ArrayList<>();
+		private List<String> nextTaskCompletedIdentityList = new ArrayList<>();
 
 		public List<WoTask> getTaskList() {
 			return taskList;
@@ -259,20 +259,20 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 			this.readCompletedList = readCompletedList;
 		}
 
-		public List<String> getNextManualTaskIdentityList() {
-			return nextManualTaskIdentityList;
+		public List<String> getNextTaskIdentityList() {
+			return nextTaskIdentityList;
 		}
 
-		public void setNextManualTaskIdentityList(List<String> nextManualTaskIdentityList) {
-			this.nextManualTaskIdentityList = nextManualTaskIdentityList;
+		public void setNextTaskIdentityList(List<String> nextTaskIdentityList) {
+			this.nextTaskIdentityList = nextTaskIdentityList;
 		}
 
-		public List<String> getNextManualTaskCompletedIdentityList() {
-			return nextManualTaskCompletedIdentityList;
+		public List<String> getNextTaskCompletedIdentityList() {
+			return nextTaskCompletedIdentityList;
 		}
 
-		public void setNextManualTaskCompletedIdentityList(List<String> nextManualTaskCompletedIdentityList) {
-			this.nextManualTaskCompletedIdentityList = nextManualTaskCompletedIdentityList;
+		public void setNextTaskCompletedIdentityList(List<String> nextTaskCompletedIdentityList) {
+			this.nextTaskCompletedIdentityList = nextTaskCompletedIdentityList;
 		}
 
 	}
@@ -302,7 +302,8 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
 						TaskCompleted.activityName_FIELDNAME, TaskCompleted.completedTime_FIELDNAME,
 						TaskCompleted.activityToken_FIELDNAME, TaskCompleted.mediaOpinion_FIELDNAME,
 						TaskCompleted.processingType_FIELDNAME, TaskCompleted.empowerToIdentity_FIELDNAME,
-						TaskCompleted.joinInquire_FIELDNAME),
+						TaskCompleted.empowerFromIdentity_FIELDNAME, TaskCompleted.joinInquire_FIELDNAME,
+						TaskCompleted.nextTaskIdentityListText_FIELDNAME),
 				null);
 	}
 

+ 334 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/worklog/ActionListWithWorkOrWorkCompleted2.java

@@ -0,0 +1,334 @@
+package com.x.processplatform.assemble.surface.jaxrs.worklog;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import com.x.base.core.container.EntityManagerContainer;
+import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.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.base.core.project.tools.ListTools;
+import com.x.processplatform.assemble.surface.Business;
+import com.x.processplatform.core.entity.content.Read;
+import com.x.processplatform.core.entity.content.ReadCompleted;
+import com.x.processplatform.core.entity.content.Task;
+import com.x.processplatform.core.entity.content.TaskCompleted;
+import com.x.processplatform.core.entity.content.WorkLog;
+import com.x.processplatform.core.entity.element.ActivityType;
+import com.x.processplatform.core.entity.element.util.WorkLogTree;
+import com.x.processplatform.core.entity.element.util.WorkLogTree.Node;
+import com.x.processplatform.core.entity.element.util.WorkLogTree.Nodes;
+
+class ActionListWithWorkOrWorkCompleted2 extends BaseAction {
+
+	private static Logger logger = LoggerFactory.getLogger(ActionListWithWorkOrWorkCompleted2.class);
+
+	private final static String taskList_FIELDNAME = "taskList";
+	private final static String taskCompletedList_FIELDNAME = "taskCompletedList";
+	private final static String readList_FIELDNAME = "readList";
+	private final static String readCompletedList_FIELDNAME = "readCompletedList";
+
+	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workOrWorkCompleted) throws Exception {
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			ActionResult<List<Wo>> result = new ActionResult<>();
+
+			Business business = new Business(emc);
+
+			if (!business.readableWithWorkOrWorkCompleted(effectivePerson, workOrWorkCompleted,
+					new ExceptionEntityNotExist(workOrWorkCompleted))) {
+				throw new ExceptionAccessDenied(effectivePerson);
+			}
+
+			final String job = business.job().findWithWorkOrWorkCompleted(workOrWorkCompleted);
+
+			CompletableFuture<List<WoTask>> future_tasks = CompletableFuture.supplyAsync(() -> {
+				return this.tasks(business, job);
+			});
+			CompletableFuture<List<WoTaskCompleted>> future_taskCompleteds = CompletableFuture.supplyAsync(() -> {
+				return this.taskCompleteds(business, job);
+			});
+			CompletableFuture<List<WoRead>> future_reads = CompletableFuture.supplyAsync(() -> {
+				return this.reads(business, job);
+			});
+			CompletableFuture<List<WoReadCompleted>> future_readCompleteds = CompletableFuture.supplyAsync(() -> {
+				return this.readCompleteds(business, job);
+			});
+			CompletableFuture<List<WorkLog>> future_workLogs = CompletableFuture.supplyAsync(() -> {
+				return this.workLogs(business, job);
+			});
+			List<WoTask> tasks = future_tasks.get();
+			List<WoTaskCompleted> taskCompleteds = future_taskCompleteds.get();
+			List<WoRead> reads = future_reads.get();
+			List<WoReadCompleted> readCompleteds = future_readCompleteds.get();
+			List<WorkLog> workLogs = future_workLogs.get();
+			WorkLogTree tree = new WorkLogTree(workLogs);
+
+			List<Wo> wos = new ArrayList<>();
+			for (WorkLog o : workLogs.stream().filter(o -> Objects.equals(ActivityType.manual, o.getFromActivityType()))
+					.collect(Collectors.toList())) {
+				Wo wo = Wo.copier.copy(o);
+				Node node = tree.find(o);
+				if (null != node) {
+					Nodes nodes = node.downNextManual();
+					if (nodes.isEmpty()) {
+						/* 如果没有找到后面的人工节点,那么有多种可能,有一种是已经删除,工作合并到其他分支了,那么找其他分支的下一步 */
+						WorkLog otherWorkLog = workLogs.stream()
+								.filter(g -> (g != o)
+										&& StringUtils.equals(g.getArrivedActivity(), o.getArrivedActivity())
+										&& StringUtils.equals(g.getSplitToken(), o.getSplitToken()))
+								.findFirst().orElse(null);
+						if (null != otherWorkLog) {
+							node = tree.find(otherWorkLog);
+							if (null != node) {
+								nodes = node.downNextManual();
+							}
+						}
+					}
+					if (!nodes.isEmpty()) {
+						for (Node n : nodes) {
+							tasks.stream().filter(t -> StringUtils.equals(t.getActivityToken(),
+									n.getWorkLog().getFromActivityToken())).forEach(t -> {
+										wo.getNextManualTaskIdentityList().add(t.getIdentity());
+									});
+							taskCompleteds.stream()
+									.filter(t -> BooleanUtils.isTrue(t.getJoinInquire()) && StringUtils
+											.equals(t.getActivityToken(), n.getWorkLog().getFromActivityToken()))
+									.forEach(t -> {
+										wo.getNextManualTaskCompletedIdentityList().add(t.getIdentity());
+									});
+						}
+					}
+				}
+				/* 下一环节处理人可能是重复处理导致重复的,去重 */
+				wo.setNextManualTaskIdentityList(ListTools.trim(wo.getNextManualTaskIdentityList(), true, true));
+				wo.setNextManualTaskCompletedIdentityList(
+						ListTools.trim(wo.getNextManualTaskCompletedIdentityList(), true, true));
+				wos.add(wo);
+			}
+			ListTools.groupStick(wos, tasks, WorkLog.fromActivityToken_FIELDNAME, Task.activityToken_FIELDNAME,
+					taskList_FIELDNAME);
+			ListTools.groupStick(wos, taskCompleteds, WorkLog.fromActivityToken_FIELDNAME,
+					TaskCompleted.activityToken_FIELDNAME, taskCompletedList_FIELDNAME);
+			ListTools.groupStick(wos, reads, WorkLog.fromActivityToken_FIELDNAME, Read.activityToken_FIELDNAME,
+					readList_FIELDNAME);
+			ListTools.groupStick(wos, readCompleteds, WorkLog.fromActivityToken_FIELDNAME,
+					ReadCompleted.activityToken_FIELDNAME, readCompletedList_FIELDNAME);
+			result.setData(wos);
+			result.setData(wos);
+			return result;
+		}
+	}
+
+	private List<WoTask> tasks(Business business, String job) {
+		List<WoTask> os = new ArrayList<>();
+		try {
+			os = business.entityManagerContainer().fetchEqual(Task.class, WoTask.copier, WoTask.job_FIELDNAME, job)
+					.stream().sorted(Comparator.comparing(Task::getStartTime, Comparator.nullsLast(Date::compareTo)))
+					.collect(Collectors.toList());
+		} catch (Exception e) {
+			logger.error(e);
+		}
+		return os;
+	}
+
+	private List<WoTaskCompleted> taskCompleteds(Business business, String job) {
+		List<WoTaskCompleted> os = new ArrayList<>();
+		try {
+			os = business.entityManagerContainer()
+					.fetchEqual(TaskCompleted.class, WoTaskCompleted.copier, TaskCompleted.job_FIELDNAME, job).stream()
+					.sorted(Comparator.comparing(TaskCompleted::getStartTime, Comparator.nullsLast(Date::compareTo)))
+					.collect(Collectors.toList());
+		} catch (Exception e) {
+			logger.error(e);
+		}
+		return os;
+	}
+
+	private List<WoRead> reads(Business business, String job) {
+		List<WoRead> os = new ArrayList<>();
+		try {
+			os = business.entityManagerContainer().fetchEqual(Read.class, WoRead.copier, Read.job_FIELDNAME, job)
+					.stream().sorted(Comparator.comparing(Read::getStartTime, Comparator.nullsLast(Date::compareTo)))
+					.collect(Collectors.toList());
+		} catch (Exception e) {
+			logger.error(e);
+		}
+		return os;
+	}
+
+	private List<WoReadCompleted> readCompleteds(Business business, String job) {
+		List<WoReadCompleted> os = new ArrayList<>();
+		try {
+			os = business.entityManagerContainer()
+					.fetchEqual(ReadCompleted.class, WoReadCompleted.copier, ReadCompleted.job_FIELDNAME, job).stream()
+					.sorted(Comparator.comparing(ReadCompleted::getStartTime, Comparator.nullsLast(Date::compareTo)))
+					.collect(Collectors.toList());
+		} catch (Exception e) {
+			logger.error(e);
+		}
+		return os;
+	}
+
+	private List<WorkLog> workLogs(Business business, String job) {
+		List<WorkLog> os = new ArrayList<>();
+		try {
+			os = business.entityManagerContainer().listEqual(WorkLog.class, WorkLog.job_FIELDNAME, job);
+			return os.stream()
+					.sorted(Comparator.comparing(WorkLog::getFromTime, Comparator.nullsLast(Date::compareTo))
+							.thenComparing(WorkLog::getArrivedTime, Comparator.nullsLast(Date::compareTo)))
+					.collect(Collectors.toList());
+		} catch (Exception e) {
+			logger.error(e);
+		}
+		return os;
+	}
+
+	public static class Wo extends WorkLog {
+
+		private static final long serialVersionUID = -7666329770246726197L;
+
+		static WrapCopier<WorkLog, Wo> copier = WrapCopierFactory.wo(WorkLog.class, Wo.class,
+				ListTools.toList(WorkLog.id_FIELDNAME, WorkLog.fromActivity_FIELDNAME,
+						WorkLog.fromActivityType_FIELDNAME, WorkLog.fromActivityName_FIELDNAME,
+						WorkLog.fromActivityAlias_FIELDNAME, WorkLog.fromActivityToken_FIELDNAME,
+						WorkLog.fromTime_FIELDNAME, WorkLog.arrivedActivity_FIELDNAME,
+						WorkLog.arrivedActivityType_FIELDNAME, WorkLog.arrivedActivityName_FIELDNAME,
+						WorkLog.arrivedActivityAlias_FIELDNAME, WorkLog.arrivedActivityToken_FIELDNAME,
+						WorkLog.arrivedTime_FIELDNAME, WorkLog.routeName_FIELDNAME, WorkLog.route_FIELDNAME,
+						WorkLog.connected_FIELDNAME, WorkLog.splitting_FIELDNAME, WorkLog.fromGroup_FIELDNAME,
+						WorkLog.arrivedGroup_FIELDNAME, WorkLog.fromOpinionGroup_FIELDNAME,
+						WorkLog.arrivedOpinionGroup_FIELDNAME),
+				JpaObject.FieldsInvisible);
+
+		private List<WoTask> taskList = new ArrayList<>();
+
+		private List<WoTaskCompleted> taskCompletedList = new ArrayList<>();
+
+		private List<WoRead> readList = new ArrayList<>();
+
+		private List<WoReadCompleted> readCompletedList = new ArrayList<>();
+
+		private List<String> nextManualTaskIdentityList = new ArrayList<>();
+
+		private List<String> nextManualTaskCompletedIdentityList = new ArrayList<>();
+
+		public List<WoTask> getTaskList() {
+			return taskList;
+		}
+
+		public void setTaskList(List<WoTask> taskList) {
+			this.taskList = taskList;
+		}
+
+		public List<WoTaskCompleted> getTaskCompletedList() {
+			return taskCompletedList;
+		}
+
+		public void setTaskCompletedList(List<WoTaskCompleted> taskCompletedList) {
+			this.taskCompletedList = taskCompletedList;
+		}
+
+		public List<WoRead> getReadList() {
+			return readList;
+		}
+
+		public void setReadList(List<WoRead> readList) {
+			this.readList = readList;
+		}
+
+		public List<WoReadCompleted> getReadCompletedList() {
+			return readCompletedList;
+		}
+
+		public void setReadCompletedList(List<WoReadCompleted> readCompletedList) {
+			this.readCompletedList = readCompletedList;
+		}
+
+		public List<String> getNextManualTaskIdentityList() {
+			return nextManualTaskIdentityList;
+		}
+
+		public void setNextManualTaskIdentityList(List<String> nextManualTaskIdentityList) {
+			this.nextManualTaskIdentityList = nextManualTaskIdentityList;
+		}
+
+		public List<String> getNextManualTaskCompletedIdentityList() {
+			return nextManualTaskCompletedIdentityList;
+		}
+
+		public void setNextManualTaskCompletedIdentityList(List<String> nextManualTaskCompletedIdentityList) {
+			this.nextManualTaskCompletedIdentityList = nextManualTaskCompletedIdentityList;
+		}
+
+	}
+
+	public static class WoTask extends Task {
+
+		private static final long serialVersionUID = 293599148568443301L;
+
+		static WrapCopier<Task, WoTask> copier = WrapCopierFactory.wo(Task.class, WoTask.class,
+				ListTools.toList(Task.id_FIELDNAME, Task.person_FIELDNAME, Task.identity_FIELDNAME, Task.unit_FIELDNAME,
+						Task.routeName_FIELDNAME, Task.opinion_FIELDNAME, Task.opinionLob_FIELDNAME,
+						Task.startTime_FIELDNAME, Task.activityName_FIELDNAME, Task.activityToken_FIELDNAME,
+						Task.empowerFromIdentity_FIELDNAME),
+				null);
+	}
+
+	public static class WoTaskCompleted extends TaskCompleted {
+
+		private static final long serialVersionUID = -4432508672641778924L;
+
+		static WrapCopier<TaskCompleted, WoTaskCompleted> copier = WrapCopierFactory.wo(TaskCompleted.class,
+				WoTaskCompleted.class,
+				ListTools.toList(TaskCompleted.id_FIELDNAME, TaskCompleted.person_FIELDNAME,
+						TaskCompleted.identity_FIELDNAME, TaskCompleted.unit_FIELDNAME,
+						TaskCompleted.routeName_FIELDNAME, TaskCompleted.opinion_FIELDNAME,
+						TaskCompleted.opinionLob_FIELDNAME, TaskCompleted.startTime_FIELDNAME,
+						TaskCompleted.activityName_FIELDNAME, TaskCompleted.completedTime_FIELDNAME,
+						TaskCompleted.activityToken_FIELDNAME, TaskCompleted.mediaOpinion_FIELDNAME,
+						TaskCompleted.processingType_FIELDNAME, TaskCompleted.empowerToIdentity_FIELDNAME,
+						TaskCompleted.joinInquire_FIELDNAME),
+				null);
+	}
+
+	public static class WoRead extends Read {
+
+		private static final long serialVersionUID = -7243683008987722267L;
+
+		static WrapCopier<Read, WoRead> copier = WrapCopierFactory.wo(Read.class, WoRead.class,
+				ListTools.toList(Read.id_FIELDNAME, Read.person_FIELDNAME, Read.identity_FIELDNAME, Read.unit_FIELDNAME,
+						Read.opinion_FIELDNAME, Read.opinionLob_FIELDNAME, Read.startTime_FIELDNAME,
+						Read.activityName_FIELDNAME, Read.activityToken_FIELDNAME),
+				null);
+	}
+
+	public static class WoReadCompleted extends ReadCompleted {
+
+		private static final long serialVersionUID = -7086077858353505033L;
+
+		static WrapCopier<ReadCompleted, WoReadCompleted> copier = WrapCopierFactory.wo(ReadCompleted.class,
+				WoReadCompleted.class,
+				ListTools.toList(ReadCompleted.id_FIELDNAME, ReadCompleted.person_FIELDNAME,
+						ReadCompleted.identity_FIELDNAME, ReadCompleted.unit_FIELDNAME, ReadCompleted.opinion_FIELDNAME,
+						ReadCompleted.opinionLob_FIELDNAME, ReadCompleted.startTime_FIELDNAME,
+						ReadCompleted.activityName_FIELDNAME, ReadCompleted.completedTime_FIELDNAME,
+						ReadCompleted.activityToken_FIELDNAME),
+				null);
+	}
+
+}

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

@@ -454,7 +454,7 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
 	private Boolean first;
 
 	public static final String workCreateType_FIELDNAME = "workCreateType";
-	@FieldDescribe("工作创建类型,surface,assgin")
+	@FieldDescribe("工作创建类型,surface,assign")
 	@Column(length = JpaObject.length_16B, name = ColumnNamePrefix + workCreateType_FIELDNAME)
 	@Index(name = TABLE + IndexNameMiddle + workCreateType_FIELDNAME)
 	@CheckPersist(allowEmpty = true)

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

@@ -210,8 +210,7 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
 		this.opinion = "";
 		this.task = "";
 		this.duration = 0L;
-		// this.manualMode = manual.getManualMode();
-		this.processingType = ProcessingType.sameTarget;
+		// this.processingType = ProcessingType.sameTarget;
 		this.retractTime = null;
 		this.latest = true;
 		this.copyProjectionFields(work);
@@ -596,6 +595,14 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
 	@CheckPersist(allowEmpty = true)
 	private Boolean joinInquire;
 
+	public static final String nextTaskIdentityListText_FIELDNAME = "nextTaskIdentityListText";
+	@FieldDescribe("下一环节处理人记录,记录前台处理待办产生的提示.")
+	@Lob
+	@Basic(fetch = FetchType.EAGER)
+	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + nextTaskIdentityListText_FIELDNAME)
+	@CheckPersist(allowEmpty = true)
+	private String nextTaskIdentityListText;
+
 	public static final String stringValue01_FIELDNAME = "stringValue01";
 	@FieldDescribe("业务数据String值01.")
 	@Column(length = length_255B, name = ColumnNamePrefix + stringValue01_FIELDNAME)
@@ -1426,4 +1433,12 @@ public class TaskCompleted extends SliceJpaObject implements ProjectionInterface
 		this.empowerFromIdentity = empowerFromIdentity;
 	}
 
+	public String getNextTaskIdentityListText() {
+		return nextTaskIdentityListText;
+	}
+
+	public void setNextTaskIdentityListText(String nextTaskIdentityListText) {
+		this.nextTaskIdentityListText = nextTaskIdentityListText;
+	}
+
 }

+ 52 - 0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java

@@ -465,6 +465,26 @@ public class Process extends SliceJpaObject {
 	@CheckPersist(allowEmpty = true)
 	private String afterInquireScriptText;
 
+	public static final String edition_FIELDNAME = "edition";
+	@FieldDescribe("版本,唯一编码.")
+	@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + edition_FIELDNAME)
+	private String edition;
+
+	public static final String editionName_FIELDNAME = "editionName";
+	@FieldDescribe("版本名")
+	@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + editionName_FIELDNAME)
+	private String editionName;
+
+	public static final String editionEnable_FIELDNAME = "editionEnable";
+	@FieldDescribe("启用版本")
+	@Column(name = ColumnNamePrefix + editionEnable_FIELDNAME)
+	private Boolean editionEnable;
+
+	public static final String editionNumber_FIELDNAME = "editionNumber";
+	@FieldDescribe("版本名")
+	@Column(name = ColumnNamePrefix + editionNumber_FIELDNAME)
+	private Double editionNumber;
+
 	/* flag标志位 */
 
 	public String getName() {
@@ -763,4 +783,36 @@ public class Process extends SliceJpaObject {
 		this.afterInquireScriptText = afterInquireScriptText;
 	}
 
+	public String getEdition() {
+		return edition;
+	}
+
+	public void setEdition(String edition) {
+		this.edition = edition;
+	}
+
+	public String getEditionName() {
+		return editionName;
+	}
+
+	public void setEditionName(String editionName) {
+		this.editionName = editionName;
+	}
+
+	public Boolean getEditionEnable() {
+		return editionEnable;
+	}
+
+	public void setEditionEnable(Boolean editionEnable) {
+		this.editionEnable = editionEnable;
+	}
+
+	public Double getEditionNumber() {
+		return editionNumber;
+	}
+
+	public void setEditionNumber(Double editionNumber) {
+		this.editionNumber = editionNumber;
+	}
+
 }

+ 3 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/Business.java

@@ -49,6 +49,9 @@ public class Business {
 	public static final String EVENT_PROCESSAFTEREND = "processAfterEnd";
 	public static final String EVENT_PROCESSEXPIRE = "processExpire";
 	public static final String EVENT_SPLIT = "split";
+	public static final String EVENT_TASKDUTY = "taskDuty";
+	public static final String EVENT_READDUTY = "readDuty";
+	public static final String EVENT_REVIEWDUTY = "reviewDuty";
 
 	private EntityManagerContainer emc;
 

+ 26 - 2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java

@@ -488,7 +488,7 @@ public class ElementFactory extends AbstractFactory {
 
 	public CompiledScript getCompiledScript(String applicationId, Activity o, String event) throws Exception {
 		String cacheKey = ApplicationCache.concreteCacheKey(o.getId(), event);
-		Ehcache cache = ApplicationCache.instance().getCache(Process.class);
+		Ehcache cache = ApplicationCache.instance().getCache(o.getClass());
 		Element element = cache.get(cacheKey);
 		CompiledScript compiledScript = null;
 		if (null != element && null != element.getObjectValue()) {
@@ -633,7 +633,7 @@ public class ElementFactory extends AbstractFactory {
 
 	public CompiledScript getCompiledScript(String applicationId, Route o, String event) throws Exception {
 		String cacheKey = ApplicationCache.concreteCacheKey(o.getId(), event);
-		Ehcache cache = ApplicationCache.instance().getCache(Process.class);
+		Ehcache cache = ApplicationCache.instance().getCache(Route.class);
 		Element element = cache.get(cacheKey);
 		CompiledScript compiledScript = null;
 		if (null != element && null != element.getObjectValue()) {
@@ -747,4 +747,28 @@ public class ElementFactory extends AbstractFactory {
 		}
 		return compiledScript;
 	}
+
+	public CompiledScript getCompiledScript(Activity activity, String event, String name, String code) {
+		String cacheKey = ApplicationCache.concreteCacheKey(activity.getId(), event, name, code);
+		Ehcache cache = ApplicationCache.instance().getCache(activity.getClass());
+		Element element = cache.get(cacheKey);
+		CompiledScript compiledScript = null;
+		if (null != element && null != element.getObjectValue()) {
+			compiledScript = (CompiledScript) element.getObjectValue();
+		} else {
+			StringBuffer sb = new StringBuffer();
+			try {
+				sb.append("(function(){").append(System.lineSeparator());
+				if (StringUtils.isNotEmpty(code)) {
+					sb.append(code).append(System.lineSeparator());
+				}
+				sb.append("}).apply(bind);");
+				compiledScript = ScriptFactory.compile(sb.toString());
+				cache.put(new Element(cacheKey, compiledScript));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		}
+		return compiledScript;
+	}
 }

+ 13 - 33
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java

@@ -97,7 +97,7 @@ class ActionAppend extends BaseAction {
 
 								Object objectValue = compiledScript.eval(scriptContext);
 
-								List<String> os = ScriptFactory.extrectDistinguishedNameList(objectValue);
+								List<String> os = ScriptFactory.asDistinguishedNameList(objectValue);
 
 								if (ListTools.isNotEmpty(os)) {
 									identities.addAll(os);
@@ -120,22 +120,20 @@ class ActionAppend extends BaseAction {
 								o.setProcessingType(ProcessingType.beAppendedTask);
 							}
 						}
-					}
-					/* 后面还要合并,clone一个新实例 */
-					wo.getValueList().addAll(new ArrayList<>(identities));
-					identities = ListUtils.sum(
-							ListUtils.subtract(work.getManualTaskIdentityList(), ListTools.toList(task.getIdentity())),
-							identities);
-					identities = business.organization().identity().list(ListTools.trim(identities, true, true));
-					emc.beginTransaction(Work.class);
-					for (TaskIdentity o : taskIdentities) {
-						if (StringUtils.isNotEmpty(o.getFromIdentity())) {
-							work.getManualEmpowerMap().put(task.getIdentity(), o.getFromIdentity());
+						/* 后面还要合并,clone一个新实例 */
+						wo.getValueList().addAll(new ArrayList<>(identities));
+						identities = ListUtils.sum(ListUtils.subtract(work.getManualTaskIdentityList(),
+								ListTools.toList(task.getIdentity())), identities);
+						identities = business.organization().identity().list(ListTools.trim(identities, true, true));
+						emc.beginTransaction(Work.class);
+						for (TaskIdentity o : taskIdentities) {
+							if (StringUtils.isNotEmpty(o.getFromIdentity())) {
+								work.getManualEmpowerMap().put(o.getIdentity(), o.getFromIdentity());
+							}
 						}
+						work.setManualTaskIdentityList(identities);
+						emc.commit();
 					}
-					work.setManualTaskIdentityList(identities);
-					emc.commit();
-
 					result.setData(wo);
 				}
 				return result;
@@ -161,24 +159,6 @@ class ActionAppend extends BaseAction {
 		return scriptContext;
 	}
 
-//	public static ScriptHelper createWithTask(Business business, Work work, Data data, Activity activity, Task task,
-//			BindingPair... bindingPairs) throws Exception {
-//		WorkContext workContext = new WorkContext(business, work, activity, task);
-//		Map<String, Object> map = new HashMap<>();
-//		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(ScriptingEngine.BINDINGNAME_APPLICATIONS, ThisApplication.context().applications());
-//		for (BindingPair o : bindingPairs) {
-//			map.put(o.getName(), o.getValue());
-//		}
-//		ScriptHelper sh = new ScriptHelper(business, map, initialScriptText);
-//		return sh;
-//	}
-
 	private TaskIdentities empower(Business business, Task task, List<String> identities) throws Exception {
 		TaskIdentities taskIdentities = new TaskIdentities();
 		taskIdentities.addIdentities(identities);

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

@@ -156,7 +156,7 @@ class ActionProcessing extends BaseAction {
 						}
 					}
 					MessageFactory.task_to_taskCompleted(taskCompleted);
-					wo.setId(task.getId());
+					wo.setId(taskCompleted.getId());
 				}
 				result.setData(wo);
 				return result;

+ 73 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/taskcompleted/ActionUpdateNextTaskIdentityListText.java

@@ -0,0 +1,73 @@
+package com.x.processplatform.service.processing.jaxrs.taskcompleted;
+
+import java.util.concurrent.Callable;
+
+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.annotation.ActionLogger;
+import com.x.base.core.project.bean.WrapCopier;
+import com.x.base.core.project.bean.WrapCopierFactory;
+import com.x.base.core.project.exception.ExceptionEntityNotExist;
+import com.x.base.core.project.executor.ProcessPlatformExecutorFactory;
+import com.x.base.core.project.http.ActionResult;
+import com.x.base.core.project.http.EffectivePerson;
+import com.x.base.core.project.jaxrs.WrapBoolean;
+import com.x.base.core.project.logger.Logger;
+import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.tools.ListTools;
+import com.x.processplatform.core.entity.content.TaskCompleted;
+
+class ActionUpdateNextTaskIdentityListText extends BaseAction {
+
+	@ActionLogger
+	private static Logger logger = LoggerFactory.getLogger(ActionUpdateNextTaskIdentityListText.class);
+
+	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {
+
+		Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
+		String executorSeed = null;
+
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			TaskCompleted taskCompleted = emc.fetch(id, TaskCompleted.class,
+					ListTools.toList(TaskCompleted.job_FIELDNAME));
+			if (null == taskCompleted) {
+				throw new ExceptionEntityNotExist(id, TaskCompleted.class);
+			}
+			executorSeed = taskCompleted.getJob();
+		}
+
+		Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
+			public ActionResult<Wo> call() throws Exception {
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					TaskCompleted taskCompleted = emc.find(id, TaskCompleted.class);
+					if (null == taskCompleted) {
+						throw new ExceptionEntityNotExist(id, TaskCompleted.class);
+					}
+					emc.beginTransaction(TaskCompleted.class);
+					taskCompleted.setNextTaskIdentityListText(wi.getNextTaskIdentityListText());
+					emc.commit();
+				}
+				ActionResult<Wo> result = new ActionResult<>();
+				Wo wo = new Wo();
+				wo.setValue(true);
+				result.setData(wo);
+				return result;
+			}
+		};
+
+		return ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).get();
+
+	}
+
+	public static class Wo extends WrapBoolean {
+	}
+
+	public static class Wi extends TaskCompleted {
+		private static final long serialVersionUID = -856825389708370355L;
+		static WrapCopier<Wi, TaskCompleted> copier = WrapCopierFactory.wi(Wi.class, TaskCompleted.class,
+				ListTools.toList(TaskCompleted.nextTaskIdentityListText_FIELDNAME), null);
+
+	}
+
+}

+ 21 - 0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/taskcompleted/TaskCompletedAction.java

@@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
@@ -12,6 +13,7 @@ import javax.ws.rs.container.Suspended;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 
+import com.google.gson.JsonElement;
 import com.x.base.core.project.annotation.JaxrsMethodDescribe;
 import com.x.base.core.project.annotation.JaxrsParameterDescribe;
 import com.x.base.core.project.http.ActionResult;
@@ -63,4 +65,23 @@ public class TaskCompletedAction extends StandardJaxrsAction {
 		}
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
+
+	@JaxrsMethodDescribe(value = "更新已办中的下一处理人记录值.", action = ActionUpdateNextTaskIdentityListText.class)
+	@PUT
+	@Path("{id}/nexttaskidentitylisttext")
+	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
+	@Consumes(MediaType.APPLICATION_JSON)
+	public void updateNextTaskIdentityListText(@Suspended final AsyncResponse asyncResponse,
+			@Context HttpServletRequest request, @JaxrsParameterDescribe("标识") @PathParam("id") String id,
+			JsonElement jsonElement) {
+		ActionResult<ActionUpdateNextTaskIdentityListText.Wo> result = new ActionResult<>();
+		EffectivePerson effectivePerson = this.effectivePerson(request);
+		try {
+			result = new ActionUpdateNextTaskIdentityListText().execute(effectivePerson, id, jsonElement);
+		} catch (Exception e) {
+			logger.error(e, effectivePerson, request, jsonElement);
+			result.error(e);
+		}
+		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
+	}
 }

+ 0 - 34
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest1.java

@@ -1,34 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import org.eclipse.jetty.http.MimeTypes;
-
-import com.x.base.core.container.EntityManagerContainer;
-import com.x.base.core.container.factory.EntityManagerContainerFactory;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-
-class ActionTest1 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			ActionResult<Wo> result = new ActionResult<>();
-			System.out.println(this.getClass().getClassLoader());
-			System.out.println(Thread.currentThread().getContextClassLoader());
-			System.out.println(MimeTypes.class.getClassLoader());
-			System.out.println(org.glassfish.jersey.server.ApplicationHandler.class.getClassLoader());
-			System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-			ClassLoader cl = this.getClass().getClassLoader();
-			while (null != cl) {
-				System.out.println("!!!!!!!!!:" + cl);
-				cl = cl.getParent();
-			}
-			return result;
-		}
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-
-}