From be57d46d8d4c59c75d234fdf51a8d9f7ede65381 Mon Sep 17 00:00:00 2001 From: zhenggm Date: Wed, 7 Sep 2022 10:29:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=EF=BC=9A=E5=A2=9E=E5=8A=A0se?= =?UTF-8?q?lTaskId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/smtweb/system/bpm/web/design/flow/ModelProcService.java | 8 +++++++- .../java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java | 1 + .../cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java | 7 +++++++ .../engine/model/flow/listcard/single/FlowSingleLoadHandler.java | 5 +++-- .../engine/model/flow/listcard/single/FlowSingleSaveHandler.java | 2 +- .../web/engine/model/flow/listcard/single/FlowTransHandler.java | 3 ++- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java index be6679a..91dfb3c 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java @@ -62,7 +62,13 @@ public class ModelProcService extends AbstractCompService { ModelFormHelper.buildFieldInfo(table, field, col); ret.add(col); } - + SwMap col = new SwMap(); + col.put("name", "selTaskId"); + col.put("dataType", SwEnum.DataType.ID.value); + col.put("title", "选中的任务id"); + col.put("table", table.getId()); + col.put("table_text", table.getTitle()); + ret.add(col); return R.success(ret); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java index 13f83cd..500244e 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java @@ -318,6 +318,7 @@ public class FlowInstance { * 返回页面前的设置 */ public void setPageRetExtra(SwMap ret) { + procInst.setSelTaskId(actInst.getId()); SwMap extra = ret.computeMapIfAbsent("extra", k -> new SwMap()); List listTask = adjustTasks(); diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java index 9d9defc..c982958 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java @@ -232,4 +232,11 @@ public class ProcInst extends DefaultEntity { public void setUrl(String pri_url) { put("pri_url", pri_url); } + + /** + * 当前选择的任务 + */ + public void setSelTaskId(long selTaskId) { + put("selTaskId", selTaskId); + } } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java index 6800305..e6d63d9 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java @@ -28,9 +28,10 @@ public class FlowSingleLoadHandler extends LCSingleLoad bean.setEntityId(flowInstance.getProcInst().getId()); ret.put(cardDataset.name, DynRetBean.createBean(bean)); + + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); } @Override @@ -47,9 +48,9 @@ public class FlowSingleLoadHandler extends LCSingleLoad //加载流程信息 flowInstance = FlowInstance.createById(us, this, id, taskId); + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.create(flowInstance.loadComment(), 0))); - flowInstance.setPageRetExtra(ret); afterLoad(ret, bean); return R.success(ret); } diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java index c4c968e..82c05af 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java @@ -55,9 +55,9 @@ public class FlowSingleSaveHandler extends LCSingleSave @Override protected void afterSave(SwMap ret, T bean) { super.afterSave(ret, bean); + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); } //单据编号,新增保存时调用 diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java index d9602e0..0616a41 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java @@ -34,9 +34,10 @@ public class FlowTransHandler extends AbstractDynPageHa private SwMap buildRetData() { SwMap ret = new SwMap(); ret.put(LCSingleHelper.DATASET_NAME_CARD, DynRetBean.createBean(bean)); + + flowInstance.setPageRetExtra(ret); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); - flowInstance.setPageRetExtra(ret); return ret; }