From 56abda737888aed71a9e7f2c5a4e12545903fa1b Mon Sep 17 00:00:00 2001
From: "1437892690@qq.com" <1437892690@qq.com>
Date: Mon, 14 Oct 2024 17:52:38 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=B7=A5=E5=8D=95?=
=?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=87=AA=E5=8A=A8=E5=8C=96=E8=A1=A8=E5=8D=95?=
=?UTF-8?q?=E5=80=BC=E8=8E=B7=E5=8F=96=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
关联 #[1264572214771712]工单流程自动化表单值获取代码优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1264572214771712
---
.../script/paramtype/IScriptParamType.java | 8 +
.../script/paramtype/ScriptParamTypeBase.java | 403 ++++++++++++++++++
2 files changed, 411 insertions(+)
diff --git a/src/main/java/neatlogic/framework/autoexec/script/paramtype/IScriptParamType.java b/src/main/java/neatlogic/framework/autoexec/script/paramtype/IScriptParamType.java
index 15a69bc9..bb394daf 100644
--- a/src/main/java/neatlogic/framework/autoexec/script/paramtype/IScriptParamType.java
+++ b/src/main/java/neatlogic/framework/autoexec/script/paramtype/IScriptParamType.java
@@ -15,6 +15,7 @@ along with this program. If not, see .*/
package neatlogic.framework.autoexec.script.paramtype;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
/**
@@ -74,4 +75,11 @@ public interface IScriptParamType {
* @return param
*/
Object getExchangeParamByValue(Object value);
+
+ /**
+ * 流程自动化节点,把表单表格组件中某列数据集合转换成作业参数对应的数据
+ * @param jsonArray
+ * @return
+ */
+ Object convertDataForProcessComponent(JSONArray jsonArray);
}
diff --git a/src/main/java/neatlogic/framework/autoexec/script/paramtype/ScriptParamTypeBase.java b/src/main/java/neatlogic/framework/autoexec/script/paramtype/ScriptParamTypeBase.java
index ebd9d2d5..c8bf04d6 100755
--- a/src/main/java/neatlogic/framework/autoexec/script/paramtype/ScriptParamTypeBase.java
+++ b/src/main/java/neatlogic/framework/autoexec/script/paramtype/ScriptParamTypeBase.java
@@ -15,7 +15,22 @@ along with this program. If not, see .*/
package neatlogic.framework.autoexec.script.paramtype;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
+import neatlogic.framework.autoexec.dto.node.AutoexecNodeVo;
+import neatlogic.framework.cmdb.crossover.IResourceAccountCrossoverMapper;
+import neatlogic.framework.cmdb.dto.resourcecenter.AccountVo;
+import neatlogic.framework.common.constvalue.GroupSearch;
+import neatlogic.framework.crossover.CrossoverServiceFactory;
+import neatlogic.framework.crossover.IFileCrossoverService;
+import neatlogic.framework.file.dto.FileVo;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
/**
* @author lvzk
@@ -72,4 +87,392 @@ public abstract class ScriptParamTypeBase implements IScriptParamType{
protected Object getMyExchangeParamByValue(Object value){
return value;
}
+
+ protected List getStringList(JSONArray jsonArray) {
+ List resultList = new ArrayList<>();
+ for (Object obj : jsonArray) {
+ if (obj == null) {
+ continue;
+ }
+ if (obj instanceof JSONArray) {
+ JSONArray array = (JSONArray) obj;
+ resultList.addAll(getStringList(array));
+ } else {
+ resultList.add(obj.toString());
+ }
+ }
+ return resultList;
+ }
+
+ protected List