diff --git a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java index 819b778f34478980b2a42da6ac2ac82936be73ee..24d30b2f1216274360c86414de49b3d1cd046dbd 100644 --- a/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java +++ b/o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java @@ -1,7 +1,9 @@ package com.x.processplatform.service.processing.jaxrs.task; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; @@ -10,6 +12,8 @@ import javax.script.CompiledScript; import javax.script.ScriptContext; import javax.script.SimpleScriptContext; +import com.x.base.core.project.logger.Logger; +import com.x.base.core.project.logger.LoggerFactory; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -45,6 +49,8 @@ import com.x.processplatform.service.processing.processor.manual.TaskIdentity; class ActionAppend extends BaseAction { + private static Logger logger = LoggerFactory.getLogger(ActionAppend.class); + ActionResult execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception { final Wi wi = this.convertToWrapIn(jsonElement, Wi.class); @@ -65,6 +71,7 @@ class ActionAppend extends BaseAction { public ActionResult call() throws Exception { ActionResult result = new ActionResult<>(); Wo wo = new Wo(); + String workId = ""; try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { Business business = new Business(emc); Task task = emc.find(id, Task.class); @@ -75,6 +82,7 @@ class ActionAppend extends BaseAction { if (null == work) { throw new ExceptionEntityNotExist(task.getWork(), Work.class); } + workId = work.getId(); Manual manual = (Manual) business.element().get(task.getActivity(), ActivityType.manual); Route route = getRoute(business, task, manual); List identities = new ArrayList<>(); @@ -141,6 +149,10 @@ class ActionAppend extends BaseAction { taskIdentity.getFromIdentity()); } } + //properties中的集合对象需要重新new对象set进去,这样jpa才会更新数据 + Map manualEmpowerMap = new LinkedHashMap(); + manualEmpowerMap.putAll(work.getProperties().getManualEmpowerMap()); + work.getProperties().setManualEmpowerMap(manualEmpowerMap); // 转派后设置过期为空 // emc.beginTransaction(Task.class); // task.setExpired(false); @@ -197,4 +209,4 @@ class ActionAppend extends BaseAction { } -} \ No newline at end of file +}