Kaynağa Gözat

流程引擎:extra返回

4.0
郑根木 2 yıl önce
ebeveyn
işleme
f634fff6ae
4 değiştirilmiş dosya ile 12 ekleme ve 8 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

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



Yükleniyor…
İptal
Kaydet