协办办理意见被覆盖问题
This commit is contained in:
+15
-1
@@ -9,8 +9,10 @@ import com.budwk.app.flow.engine.util.FlowUtil;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalReplyUnit;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,7 +28,13 @@ import java.util.Set;
|
||||
public class ProposalUnderTakeInfoInterceptor implements FlowInterceptor {
|
||||
private static final Set<String> REPLY_TASK_NAMES = Set.of("master_reply", "slave_reply", "opinion_master_reply");
|
||||
|
||||
/**
|
||||
* 为本次流转涉及的答复任务补充承办单位信息,保留任务已保存的最新表单数据。
|
||||
*
|
||||
* @param execution 当前 WF 执行上下文,包含提案业务编号、当前任务和本次新建任务
|
||||
*/
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void intercept(Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
|
||||
@@ -53,7 +61,13 @@ public class ProposalUnderTakeInfoInterceptor implements FlowInterceptor {
|
||||
throw new BaseException("Proposal undertaking unit is empty, cannot write proposal undertaking unit info.");
|
||||
}
|
||||
|
||||
Dict variable = FlowUtil.variableToDict(task.getVariable());
|
||||
// 完成任务后,执行上下文中的任务仍可能保留提交前的变量。
|
||||
// 必须以数据库中已保存的最新变量补充单位信息,避免覆盖本次办理人和答复内容。
|
||||
ProcessTask savedTask = dao.fetch(ProcessTask.class, task.getId());
|
||||
if (savedTask == null) {
|
||||
throw new BaseException("答复任务不存在,无法补充承办单位信息。");
|
||||
}
|
||||
Dict variable = FlowUtil.variableToDict(savedTask.getVariable());
|
||||
variable.set("underTakeName", replyUnit.getUnitName());
|
||||
variable.set("underTakeId", replyUnit.getUnitId());
|
||||
variable.set("underTakeIsMaster", replyUnit.getIsMaster());
|
||||
|
||||
Reference in New Issue
Block a user