From d6ae3db4f1729b71a64fcc4e589f3aa0d2e80082 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 3 Sep 2024 19:02:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E7=BB=84=E5=90=88=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1237746444632064]后端-组合过滤条件代码优化 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1237746444632064 --- .../component/ConditionProcessComponent.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/neatlogic/module/process/stephandler/component/ConditionProcessComponent.java b/src/main/java/neatlogic/module/process/stephandler/component/ConditionProcessComponent.java index 040c278e..de658e32 100644 --- a/src/main/java/neatlogic/module/process/stephandler/component/ConditionProcessComponent.java +++ b/src/main/java/neatlogic/module/process/stephandler/component/ConditionProcessComponent.java @@ -23,11 +23,9 @@ import neatlogic.framework.asynchronization.threadlocal.UserContext; import neatlogic.framework.common.constvalue.Expression; import neatlogic.framework.common.constvalue.SystemUser; import neatlogic.framework.condition.core.IConditionHandler; -import neatlogic.framework.dto.condition.ConditionConfigVo; -import neatlogic.framework.dto.condition.ConditionGroupVo; -import neatlogic.framework.dto.condition.ConditionVo; import neatlogic.framework.form.dto.FormAttributeVo; import neatlogic.framework.process.condition.core.ProcessTaskConditionFactory; +import neatlogic.framework.process.condition.dto.ConditionConfigVo; import neatlogic.framework.process.constvalue.*; import neatlogic.framework.process.dto.ProcessTaskStepRelVo; import neatlogic.framework.process.dto.ProcessTaskStepVo; @@ -164,7 +162,7 @@ public class ConditionProcessComponent extends ProcessStepHandlerBase { ConditionConfigVo conditionConfigVo = null; try { ConditionParamContext.init(conditionParamData).setTranslate(true); - conditionConfigVo = new ConditionConfigVo(moveonConfig); + conditionConfigVo = moveonConfig.toJavaObject(ConditionConfigVo.class); String script = conditionConfigVo.buildScript(); /* 将参数名称、表达式、值的value翻译成对应text,目前条件步骤生成活动时用到**/ translate(conditionConfigVo, currentProcessTaskStepVo.getProcessTaskId(), formTag); @@ -218,15 +216,15 @@ public class ConditionProcessComponent extends ProcessStepHandlerBase { } private void translate(ConditionConfigVo conditionConfigVo, Long processTaskId, String formTag) { - List conditionGroupList = conditionConfigVo.getConditionGroupList(); + List> conditionGroupList = conditionConfigVo.getConditionGroupList(); if (CollectionUtils.isNotEmpty(conditionGroupList)) { // List formAttributeList = processTaskService.getFormAttributeListByProcessTaskIdAngTag(processTaskId, ConditionProcessComponent.FORM_EXTEND_ATTRIBUTE_TAG); List formAttributeList = processTaskService.getFormAttributeListByProcessTaskIdAngTagNew(processTaskId, formTag); Map formAttributeVoMap = formAttributeList.stream().collect(Collectors.toMap(FormAttributeVo::getUuid, e -> e)); - for (ConditionGroupVo conditionGroup : conditionGroupList) { - List conditionList = conditionGroup.getConditionList(); + for (ConditionConfigVo.ConditionGroupVo conditionGroup : conditionGroupList) { + List conditionList = conditionGroup.getConditionList(); if (CollectionUtils.isNotEmpty(conditionList)) { - for (ConditionVo condition : conditionList) { + for (ConditionConfigVo.ConditionVo condition : conditionList) { if ("common".equals(condition.getType())) { IConditionHandler conditionHandler = ProcessTaskConditionFactory.getHandler(condition.getName()); if (conditionHandler != null) { -- Gitee