ソースを参照

流程引擎:extra返回

4.0
郑根木 2年前
コミット
f634fff6ae
4個のファイルの変更12行の追加8行の削除
  1. +8
    -7
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java
  2. +2
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java
  3. +1
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java
  4. +1
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java

+ 8
- 7
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java ファイルの表示

@@ -46,8 +46,6 @@ public class FlowInstance {
//流程执行变量
// public Map<String, String> variables = new HashMap<>();

//当前任务
private List<Map<String, String>> tasks = new ArrayList<>();
//数据提供者
private FlowProvider provider = new FlowProvider();

@@ -342,24 +340,27 @@ public class FlowInstance {
/**
* 返回页面前的设置
*/
public void resetPage() {
public void setPageRetExtra(SwMap ret) {
SwMap extra = ret.computeMapIfAbsent("extra", k->new SwMap());

List<Task> listTask = adjustTasks();
//可选步骤
tasks.clear();
List<SwMap> tasks = new ArrayList<>();
String next_text = procDef.getProcInfo().getActNameById(actInst.getActId());
int index = 0;
for (Task act : listTask) {
Map<String, String> row = new HashMap<>();
SwMap row = new SwMap();
tasks.add(row);
row.put("id", String.valueOf(act.getId()));
row.put("id", act.getId());
if (act.getId() == actInst.getId() && listTask.size() > 1 && index != 0) {
next_text = "待" + next_text;
} else {
next_text = procDef.getProcInfo().getActNameById(act.getActId());
}
row.put("text", next_text);
row.put("label", next_text);
index++;
}
extra.put("tasks", tasks);
resetButtons();
}



+ 2
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java ファイルの表示

@@ -39,6 +39,7 @@ public class FlowSingleLoadHandler<T extends DefaultEntity> extends LCSingleLoad
ret.put(cardDataset.name, DynRetBean.createBean(bean));
ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY));
flowInstance.setPageRetExtra(ret);
}

@Override
@@ -57,7 +58,7 @@ public class FlowSingleLoadHandler<T extends DefaultEntity> extends LCSingleLoad

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);
}


+ 1
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java ファイルの表示

@@ -58,6 +58,7 @@ public class FlowSingleSaveHandler<T extends DefaultEntity> extends LCSingleSave
super.afterSave(ret, bean);
ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY));
flowInstance.setPageRetExtra(ret);
}

//单据编号,新增保存时调用


+ 1
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java ファイルの表示

@@ -33,6 +33,7 @@ public class FlowTransHandler<T extends DefaultEntity> extends AbstractDynPageHa
ret.put(LCSingleHelper.DATASET_NAME_CARD, DynRetBean.createBean(bean));
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;
}



読み込み中…
キャンセル
保存