From 361d14ef46a56b408234826fd097f59e315e17d3 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Sat, 22 Feb 2025 16:18:38 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81-?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=BE=97=E5=AE=A1=E6=89=B9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=A7=A3=E6=9E=90=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/task/BpmProcessInstanceController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java index 67e7219f1d..128b354533 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java @@ -167,7 +167,10 @@ public class BpmProcessInstanceController { @SuppressWarnings("unchecked") public CommonResult getApprovalDetail(@Valid BpmApprovalDetailReqVO reqVO) { if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) { - reqVO.setProcessVariables(JsonUtils.parseObject(reqVO.getProcessVariablesStr(), Map.class)); + String processVariablesStr = reqVO.getProcessVariablesStr() + .replace("\\\"", "\"") + .replaceAll("^\"|\"$", ""); + reqVO.setProcessVariables(JsonUtils.parseObject(processVariablesStr, Map.class)); } return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO)); } From fe737b7df2ea8872d165959ae759d7fc96bd979e Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 11:17:00 +0800 Subject: [PATCH 2/9] =?UTF-8?q?jar=20=E6=89=93=E5=8C=85=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/pom.xml | 140 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 121 insertions(+), 19 deletions(-) diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index efd53c84a5..55d66c5af5 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -130,24 +130,126 @@ - - - ${project.artifactId} - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - - - repackage - - - - - - + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-jar-plugin + + + + *.properties + *.yml + *.xml + *.txt + + + + true + + + lib/ + + false + + + + + + + ./resources/ + + + ${project.build.directory} + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib/ + + + + + + + + maven-resources-plugin + + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + *.properties + *.yml + *.xml + *.txt + + + + ${project.build.directory}/resources/ + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + yudao + + + + null + null + + + ${project.build.directory} + + + + + repackage + + + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + From 3cbcd56940306993d01063d6e1711b07f0a7ef40 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 11:28:16 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=B8=A4=E6=AC=A1=E5=8F=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/task/BpmProcessInstanceController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java index 128b354533..b5bb499c3b 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java @@ -167,10 +167,9 @@ public class BpmProcessInstanceController { @SuppressWarnings("unchecked") public CommonResult getApprovalDetail(@Valid BpmApprovalDetailReqVO reqVO) { if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) { - String processVariablesStr = reqVO.getProcessVariablesStr() - .replace("\\\"", "\"") - .replaceAll("^\"|\"$", ""); - reqVO.setProcessVariables(JsonUtils.parseObject(processVariablesStr, Map.class)); + // 二次JSON反序列化 + String rawJsonString = JsonUtils.parseObject(reqVO.getProcessVariablesStr(), String.class); + reqVO.setProcessVariables(JsonUtils.parseObject(rawJsonString, Map.class)); } return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO)); } From fc142f491edd574146e33f5c5514f44365bd0c89 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 05:34:13 +0000 Subject: [PATCH 4/9] update yudao-server/pom.xml. Signed-off-by: Lemon <1599456917@qq.com> --- yudao-server/pom.xml | 140 ++++++------------------------------------- 1 file changed, 19 insertions(+), 121 deletions(-) diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 55d66c5af5..efd53c84a5 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -130,126 +130,24 @@ - - ${project.artifactId} - - - - org.apache.maven.plugins - maven-jar-plugin - - - - *.properties - *.yml - *.xml - *.txt - - - - true - - - lib/ - - false - - - - - - - ./resources/ - - - ${project.build.directory} - - + + + ${project.artifactId} + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring.boot.version} + + + + repackage + + + + + + - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory}/lib/ - - - - - - - - maven-resources-plugin - - - - copy-resources - package - - copy-resources - - - - - src/main/resources - - *.properties - *.yml - *.xml - *.txt - - - - ${project.build.directory}/resources/ - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - yudao - - - - null - null - - - ${project.build.directory} - - - - - repackage - - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - From b648750f9764229c37ee96c04c47c07f521295b7 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 13:38:55 +0800 Subject: [PATCH 5/9] =?UTF-8?q?maven=20jar=E5=8C=85=20=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/pom.xml | 141 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 122 insertions(+), 19 deletions(-) diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index efd53c84a5..92c1c1b0e5 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -130,24 +130,127 @@ - - - ${project.artifactId} - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - - - repackage - - - - - - + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-jar-plugin + + + + *.properties + *.yml + *.xml + *.txt + + + + true + + + lib/ + + false + + + + + + + ./resources/ + + + ${project.build.directory} + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib/ + + + + + + + + maven-resources-plugin + + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + *.properties + *.yml + *.xml + *.txt + + + + ${project.build.directory}/resources/ + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + YouDao + + + + null + null + + + ${project.build.directory} + + + + + repackage + + + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + From 92ebcd51ca214c5ad6f011a253ad7a70b98e5823 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 14:05:12 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/pom.xml | 271 ++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 187 deletions(-) diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 92c1c1b0e5..a137073775 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -33,87 +33,87 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + @@ -130,127 +130,24 @@ - - ${project.artifactId} - - - - org.apache.maven.plugins - maven-jar-plugin - - - - *.properties - *.yml - *.xml - *.txt - - - - true - - - lib/ - - false - - - - - - - ./resources/ - - - ${project.build.directory} - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - ${project.build.directory}/lib/ - - - - - - - - maven-resources-plugin - - - - copy-resources - package - - copy-resources - - - - - src/main/resources - - *.properties - *.yml - *.xml - *.txt - - - - ${project.build.directory}/resources/ - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - YouDao - - - - null - null - - - ${project.build.directory} - - - - - repackage - - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - + + + ${project.artifactId} + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring.boot.version} + + + + repackage + + + + + + From 881bdeb5aa10a5431aa99215ca1da3712ad870e5 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 14:06:59 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-server/pom.xml | 130 +++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index a137073775..efd53c84a5 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -33,87 +33,87 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + From 2c86630b36aadc648e2638964ab99dc6ba34d025 Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Tue, 25 Feb 2025 14:15:40 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/task/BpmProcessInstanceController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java index b5bb499c3b..67e7219f1d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java @@ -167,9 +167,7 @@ public class BpmProcessInstanceController { @SuppressWarnings("unchecked") public CommonResult getApprovalDetail(@Valid BpmApprovalDetailReqVO reqVO) { if (StrUtil.isNotEmpty(reqVO.getProcessVariablesStr())) { - // 二次JSON反序列化 - String rawJsonString = JsonUtils.parseObject(reqVO.getProcessVariablesStr(), String.class); - reqVO.setProcessVariables(JsonUtils.parseObject(rawJsonString, Map.class)); + reqVO.setProcessVariables(JsonUtils.parseObject(reqVO.getProcessVariablesStr(), Map.class)); } return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO)); } From d62137b7fcb7170da9445d412c5085736948d87d Mon Sep 17 00:00:00 2001 From: Lemon <1599456917@qq.com> Date: Mon, 3 Mar 2025 16:42:11 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E5=8C=85=E5=90=AB=20=E4=B8=8D=E5=8C=85=E5=90=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/el/ContainsExpressionFunction.java | 46 +++++++++++++++++++ .../flowable/core/util/SimpleModelUtils.java | 9 +++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/el/ContainsExpressionFunction.java diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/el/ContainsExpressionFunction.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/el/ContainsExpressionFunction.java new file mode 100644 index 0000000000..f343336fbd --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/el/ContainsExpressionFunction.java @@ -0,0 +1,46 @@ +package cn.iocoder.yudao.module.bpm.framework.flowable.core.el; + +import org.flowable.common.engine.api.variable.VariableContainer; +import org.flowable.common.engine.impl.el.function.AbstractFlowableVariableExpressionFunction; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class ContainsExpressionFunction extends AbstractFlowableVariableExpressionFunction { + + public ContainsExpressionFunction() { + super("contains"); + } + + public static boolean contains(VariableContainer variableContainer, String variableName, Object paramValue) { + Object variable = variableContainer.getVariable(variableName); + if (variable instanceof List list) { + Object convertedValue = convertParamValue(list, paramValue); + return list.contains(convertedValue); + } + return false; + } + + private static Object convertParamValue(List list, Object paramValue) { + if (list.isEmpty()) { + return paramValue; + } + Object firstElement = list.get(0); + if (firstElement instanceof String) { + return paramValue.toString(); + } else if (firstElement instanceof Number) { + try { + if (firstElement instanceof Integer) { + return Integer.parseInt(paramValue.toString()); + } else if (firstElement instanceof Long) { + return Long.parseLong(paramValue.toString()); + } + // 其他数值类型处理... + } catch (NumberFormatException e) { + return paramValue; // 转换失败,保持原样 + } + } + return paramValue; + } +} \ No newline at end of file diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java index e32d93ceb0..2d783e0063 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java @@ -671,7 +671,14 @@ public class SimpleModelUtils { List list = CollectionUtils.convertList(item.getRules(), (rule) -> { String rightSide = NumberUtil.isNumber(rule.getRightSide()) ? rule.getRightSide() : "\"" + rule.getRightSide() + "\""; // 如果非数值类型加引号 - return String.format(" %s %s var:convertByType(%s,%s)", rule.getLeftSide(), rule.getOpCode(), rule.getLeftSide(), rightSide); + System.out.println(rule.getOpCode()); + if ("contains".equals(rule.getOpCode())) { + return String.format("var:contains(%s, %s)", rule.getLeftSide(), rightSide); + } else if ("notContains".equals(rule.getOpCode())) { + return String.format("!var:contains(%s, %s)", rule.getLeftSide(), rightSide); + } else { + return String.format(" %s %s var:convertByType(%s,%s)", rule.getLeftSide(), rule.getOpCode(), rule.getLeftSide(), rightSide); + } }); // 构造条件组的表达式 Boolean and = item.getAnd();