提交 51245404 编写于 作者: R roo00

修复上一环节处理的已办传递到后续环节的问题

上级 381d8291
......@@ -126,14 +126,14 @@ class ActionGetWorkOrWorkCompleted extends BaseAction {
}
}
/* 是否可以召回 */
if (PropertyTools.getOrElse(activity, Manual.allowRetract_FIELDNAME, Boolean.class, false) && this
.canManageApplicationOrProcess(business, effectivePerson, work.getApplication(), work.getProcess())) {
if (PropertyTools.getOrElse(activity, Manual.allowRetract_FIELDNAME, Boolean.class, false)) {
Node node = this.workLogTree(business, work.getJob()).location(work);
if (null != node) {
Nodes ups = node.upTo(ActivityType.manual, ActivityType.agent, ActivityType.choice, ActivityType.delay,
ActivityType.embed, ActivityType.invoke);
for (Node o : ups) {
if (this.hasTaskCompletedWithActivityToken(business, effectivePerson, work.getActivityToken())) {
if (this.hasTaskCompletedWithActivityToken(business, effectivePerson,
o.getWorkLog().getFromActivityToken())) {
wo.setAllowRetract(true);
break;
}
......
package com.x.processplatform.service.processing;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -43,12 +45,12 @@ public class WorkContext {
this.processingAttributes = aeiObjects.getProcessingAttributes();
}
WorkContext(Business business, Work work, Activity activity) throws Exception {
this.business = business;
this.work = work;
this.activity = activity;
this.gson = XGsonBuilder.instance();
}
// WorkContext(Business business, Work work, Activity activity) throws Exception {
// this.business = business;
// this.work = work;
// this.activity = activity;
// this.gson = XGsonBuilder.instance();
// }
WorkContext(Business business, Work work, Activity activity, Task task) throws Exception {
this.business = business;
......@@ -195,9 +197,6 @@ public class WorkContext {
list.addAll(aeiObjects.getTasks());
list.addAll(aeiObjects.getCreateTasks());
}
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
System.out.println(gson.toJson(list));
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
return gson.toJson(list);
} catch (Exception e) {
throw new Exception("getJobTaskList error.", e);
......@@ -273,13 +272,25 @@ public class WorkContext {
}
}
public String getTaskOrTaskCompleted() {
public String getTaskOrTaskCompleted() throws Exception {
if (null != task) {
return gson.toJson(task);
}
if (null != taskCompleted) {
return gson.toJson(taskCompleted);
}
List<TaskCompleted> list = new ArrayList<>();
if (null != this.aeiObjects) {
list.addAll(aeiObjects.getTaskCompleteds());
list.addAll(aeiObjects.getCreateTaskCompleteds());
}
TaskCompleted o = list
.stream().sorted(Comparator
.comparing(TaskCompleted::getCreateTime, Comparator.nullsLast(Date::compareTo)).reversed())
.findFirst().orElse(null);
if (null != o) {
return gson.toJson(o);
}
return "";
}
......
......@@ -67,7 +67,7 @@ class ActionProcessing extends BaseAction {
if (null != work) {
WorkDataHelper workDataHelper = new WorkDataHelper(business.entityManagerContainer(), work);
data = workDataHelper.get();
ScriptHelper sh = ScriptHelperFactory.create(business, work, data, manual, task);
ScriptHelper sh = ScriptHelperFactory.createWithTask(business, work, data, manual, task);
sh.eval(work.getApplication(), manual.getManualBeforeTaskScript(),
manual.getManualBeforeTaskScriptText());
if (workDataHelper.update(data)) {
......@@ -100,7 +100,8 @@ class ActionProcessing extends BaseAction {
if (null != work) {
WorkDataHelper workDataHelper = new WorkDataHelper(business.entityManagerContainer(), work);
data = workDataHelper.get();
ScriptHelper sh = ScriptHelperFactory.create(business, work, data, manual, taskCompleted);
ScriptHelper sh = ScriptHelperFactory.createWithTaskCompleted(business, work, data, manual,
taskCompleted);
sh.eval(work.getApplication(), manual.getManualAfterTaskScript(),
manual.getManualAfterTaskScriptText());
if (workDataHelper.update(data)) {
......
......@@ -41,6 +41,8 @@ public class CollectPerson extends BaseAction {
req.setFooter(Config.collect().getFooter());
req.setName(Config.collect().getName());
req.setPassword(Config.collect().getPassword());
req.setSecret(Config.collect().getSecret());
req.setKey(Config.collect().getKey());
req.setMobileList(mobiles);
req.setCenterProxyHost(Config.centerServer().getProxyHost());
if (StringUtils.isEmpty(req.getCenterProxyHost())) {
......@@ -96,6 +98,10 @@ public class CollectPerson extends BaseAction {
private String httpProtocol;
private String secret;
private String key;
public String getName() {
return name;
}
......@@ -160,6 +166,22 @@ public class CollectPerson extends BaseAction {
this.footer = footer;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
}
private List<String> listMobile(EntityManagerContainer emc) throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册