yxk-20260423-增加getJsondatastring方法,在流程中获取jsondata的数据
This commit is contained in:
+32
-1
@@ -1,5 +1,6 @@
|
|||||||
package org.jeecg.modules.extbpm.process.common.expression;
|
package org.jeecg.modules.extbpm.process.common.expression;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
import org.jeecg.common.constant.SymbolConstant;
|
||||||
@@ -9,7 +10,6 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -35,6 +35,37 @@ public class FlowNodeExpression {
|
|||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字段名称取json_data查询对应业务表单的数据
|
||||||
|
* ${flowNodeExpression.getJsondatastring(jsonData,'supDeptleaderid')}
|
||||||
|
* @param jsonData
|
||||||
|
* @param codeName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getJsondatastring(Object jsonData, String codeName){
|
||||||
|
if (jsonData == null || StringUtils.isBlank(codeName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject data;
|
||||||
|
if (jsonData instanceof JSONObject) {
|
||||||
|
data = (JSONObject) jsonData;
|
||||||
|
} else if (jsonData instanceof String) {
|
||||||
|
if (StringUtils.isBlank((String) jsonData)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
data = JSONObject.parseObject((String) jsonData);
|
||||||
|
} else {
|
||||||
|
data = JSONObject.parseObject(JSONObject.toJSONString(jsonData));
|
||||||
|
}
|
||||||
|
return data == null ? null : data.getString(codeName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("getJsondata parse failed, codeName={}, jsonData={}", codeName, jsonData, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找上一级部门负责人
|
* 查找上一级部门负责人
|
||||||
* ${flowNodeExpression.getLevel1DepartLeaders(applyUserId)}
|
* ${flowNodeExpression.getLevel1DepartLeaders(applyUserId)}
|
||||||
|
|||||||
Reference in New Issue
Block a user