瀏覽代碼

流程引擎

4.0
郑根木 2 年之前
父節點
當前提交
543d02b88b
共有 5 個檔案被更改,包括 32 行新增20 行删除
  1. +7
    -4
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java
  2. +8
    -11
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java
  3. +12
    -0
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowListener.java
  4. +1
    -1
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/dev/EnumComboService.java
  5. +4
    -4
      smtweb-framework/bpm/src/main/resources/config/application.yaml

+ 7
- 4
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java 查看文件

@@ -520,13 +520,16 @@ public class ModelFormHelper {
col.put("editor", dtb != null ? dtb.editor: SwEnum.EditorType.INPUT.value);

if (field.getLink() == 0L) return;
Set<ModelForm> set = ModelFormCache.getInstance().getListByTable(table.getId(), SwEnum.FormType.WIDGET.value);
Set<ModelForm> set = ModelFormCache.getInstance().getListByTable(field.getLink(), SwEnum.FormType.WIDGET.value);
if (set == null || set.isEmpty()) return;
ModelForm form = set.iterator().next();
if (form == null) return;
col.put("widget", form.getId());
col.put("widgetText", form.getTitle());
SwMap widget = new SwMap();
col.put("widget", widget);

widget.put("widgetId", form.getId());
widget.put("widgetId_text", form.getTitle());
SwMap opts = form.getOpts();
if (opts != null) {
col.put("editor", SwEnum.WidgetType.getEditor(opts.readString("widgetType")));


+ 8
- 11
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowInstance.java 查看文件

@@ -23,6 +23,7 @@ import cc.smtweb.system.bpm.web.sys.user.user.UserCache;
import cc.smtweb.system.bpm.web.sys.user.userGroup.UserGroupHelper;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.lang.NonNull;

import java.util.*;

@@ -52,8 +53,10 @@ public class FlowInstance {
private List<Map<String, String>> tasks = new ArrayList<>();
//数据提供者
private FlowProvider provider = new FlowProvider();
private FlowListener listener;

public FlowInstance(UserSession us) {
public FlowInstance(@NonNull FlowListener listener, UserSession us) {
this.listener = listener;
this.us = us;
}

@@ -74,16 +77,10 @@ public class FlowInstance {
*/
public boolean execTrans(String expr) {
if (StringUtils.isBlank(expr)) return true;
Map<String, Object> mapVar = new HashMap<>();
/*mapVar.putAll(billEntity.getData());
mapVar.put("party_code", PartyEntityBuffer.getInstance().getCodeById(billEntity.getPartyId()));
mapVar.put("party_name", PartyEntityBuffer.getInstance().getNameById(billEntity.getPartyId()));
mapVar.put("dept_code", DepartmentEntityBuffer.getInstance().getCodeById(billEntity.getDeptId()));
mapVar.put("dept_name", DepartmentEntityBuffer.getInstance().getNameById(billEntity.getDeptId()));
mapVar.put("bill_user_code", UserBaseEntityBuffer.getInstance().getCodeById(billEntity.getBillUser()));
mapVar.put("bill_user_name", UserBaseEntityBuffer.getInstance().getNameById(billEntity.getBillUser()));
localBuildExecTrans(mapVar);*/
Object o = NumberUtil.calcExprMapObject(expr, mapVar);
SwMap params = new SwMap();
params.putAll(procInst.getData());
listener.setExprParam(params);
Object o = NumberUtil.calcExprMapObject(expr, params);
return o != null && (Boolean) o;
}



+ 12
- 0
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowListener.java 查看文件

@@ -0,0 +1,12 @@
package cc.smtweb.system.bpm.web.engine.flow;

import cc.smtweb.framework.core.common.SwMap;

/**
* Created by Akmm at 2022-08-20 16:12
* 流程流转监听
*/
public class FlowListener {
//设置条件计算参数
public void setExprParam(SwMap param){}
}

+ 1
- 1
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/dev/EnumComboService.java 查看文件

@@ -46,7 +46,7 @@ public class EnumComboService extends DynPageService {
tempClass = Class.forName(cls);
wantClass = tempClass;
}catch (Exception e){
e.printStackTrace();
// e.printStackTrace();
//
int lIndex = cls.lastIndexOf(".");
if (lIndex > 0) {


+ 4
- 4
smtweb-framework/bpm/src/main/resources/config/application.yaml 查看文件

@@ -45,11 +45,11 @@ spring:
password:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://139.9.38.43:6032/smt?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/smt?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://139.9.38.43:6032/smt?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://127.0.0.1:3306/smt?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
username: root
# password: Ncmz@2022_jjkj
password: ssqsoft
password: Ncmz@2022_jjkj
# password: ssqsoft
servlet:
multipart:
max-file-size: 104857600000


Loading…
取消
儲存