流程发布,任务加载是获取流程经理

This commit is contained in:
lihongyu 2022-07-29 22:55:30 +08:00
parent 3488433f23
commit 434c3a483a

View File

@ -1,5 +1,7 @@
package com.actionsoft.apps.coe.pal.publisher.event;
import java.sql.Connection;
import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
@ -31,10 +33,16 @@ public class PublishLoadBefore extends ExecuteListener {
String departmentId = me.getUserModel().getDepartmentId();
String allpath = SDK.getORGAPI().getDepartmentById(departmentId).getPathNameOfCache();
String[] patharr = allpath.split("/");
StringBuffer sb = new StringBuffer();
for (String str : patharr) {
sb.append("'").append(str).append("'").append(",");
}
String substring = sb.substring(0, sb.length()-1);
// 可以为boData中的字段进行赋值
String orgname = patharr[0];
String departName = patharr[1];
RowMap data = DBSql.getMap(String.format("select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME='%s' and ORGDEPART='%s'", orgname, departName));
Connection open = DBSql.open();
RowMap data = DBSql.getMap(open,"select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME in ("+substring+")");
open.close();
// RowMap data = DBSql.getMap(String.format("select DEAPRTMNUM,PROCESSMNUMBER from BO_ACT_PROCESSMANAGER where ORGNAME like'%s' and ORGDEPART like'%s'", allpath, allpath));
if(data != null){
boData.set("DEPARTMENT_PROOFREADER", data.getString("DEAPRTMNUM"));
boData.set("PROCESS_MANAGER", data.getString("PROCESSMNUMBER"));