Browse Source

流程:增加selTaskId

4.0
郑根木 2 years ago
parent
commit
be57d46d8d
6 changed files with 21 additions and 5 deletions
  1. +7
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java
  2. +1
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java
  3. +7
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java
  4. +3
    -2
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java
  5. +1
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java
  6. +2
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java

+ 7
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/flow/ModelProcService.java View File

@@ -62,7 +62,13 @@ public class ModelProcService extends AbstractCompService {
ModelFormHelper.buildFieldInfo(table, field, col); ModelFormHelper.buildFieldInfo(table, field, col);
ret.add(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); return R.success(ret);
} }




+ 1
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java View File

@@ -318,6 +318,7 @@ public class FlowInstance {
* 返回页面前的设置 * 返回页面前的设置
*/ */
public void setPageRetExtra(SwMap ret) { public void setPageRetExtra(SwMap ret) {
procInst.setSelTaskId(actInst.getId());
SwMap extra = ret.computeMapIfAbsent("extra", k -> new SwMap()); SwMap extra = ret.computeMapIfAbsent("extra", k -> new SwMap());


List<Task> listTask = adjustTasks(); List<Task> listTask = adjustTasks();


+ 7
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/entity/ProcInst.java View File

@@ -232,4 +232,11 @@ public class ProcInst extends DefaultEntity {
public void setUrl(String pri_url) { public void setUrl(String pri_url) {
put("pri_url", pri_url); put("pri_url", pri_url);
} }

/**
* 当前选择的任务
*/
public void setSelTaskId(long selTaskId) {
put("selTaskId", selTaskId);
}
} }

+ 3
- 2
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleLoadHandler.java View File

@@ -28,9 +28,10 @@ public class FlowSingleLoadHandler<T extends DefaultEntity> extends LCSingleLoad
bean.setEntityId(flowInstance.getProcInst().getId()); bean.setEntityId(flowInstance.getProcInst().getId());


ret.put(cardDataset.name, DynRetBean.createBean(bean)); 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_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY));
flowInstance.setPageRetExtra(ret);
} }


@Override @Override
@@ -47,9 +48,9 @@ public class FlowSingleLoadHandler<T extends DefaultEntity> extends LCSingleLoad
//加载流程信息 //加载流程信息
flowInstance = FlowInstance.createById(us, this, id, taskId); 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_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.create(flowInstance.loadComment(), 0))); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.create(flowInstance.loadComment(), 0)));
flowInstance.setPageRetExtra(ret);
afterLoad(ret, bean); afterLoad(ret, bean);
return R.success(ret); return R.success(ret);
} }


+ 1
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowSingleSaveHandler.java View File

@@ -55,9 +55,9 @@ public class FlowSingleSaveHandler<T extends DefaultEntity> extends LCSingleSave
@Override @Override
protected void afterSave(SwMap ret, T bean) { protected void afterSave(SwMap ret, T bean) {
super.afterSave(ret, bean); super.afterSave(ret, bean);
flowInstance.setPageRetExtra(ret);
ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst())); ret.put(FlowHelper.DATASET_NAME_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY));
flowInstance.setPageRetExtra(ret);
} }


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


+ 2
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/flow/listcard/single/FlowTransHandler.java View File

@@ -34,9 +34,10 @@ public class FlowTransHandler<T extends DefaultEntity> extends AbstractDynPageHa
private SwMap buildRetData() { private SwMap buildRetData() {
SwMap ret = new SwMap(); SwMap ret = new SwMap();
ret.put(LCSingleHelper.DATASET_NAME_CARD, DynRetBean.createBean(bean)); 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_FLOW, DynRetBean.createBean(flowInstance.getProcInst()));
ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY)); ret.put(FlowHelper.DATASET_NAME_COMMENT, DynRetBean.createList(SwListData.EMPTY));
flowInstance.setPageRetExtra(ret);
return ret; return ret;
} }




Loading…
Cancel
Save