From 676d74ab4c35c4f6bca3742916b132a1673d0aff Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Tue, 19 Dec 2023 19:52:09 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1049841239556096]通知策略翻译 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1049841239556096 --- .../api/combop/AutoexecCombopImportApi.java | 34 +++++++++---------- .../AutoexecCombopNotifyPolicyHandler.java | 12 +++---- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopImportApi.java b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopImportApi.java index d69f4fa0..9494b16c 100644 --- a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopImportApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopImportApi.java @@ -16,12 +16,18 @@ package neatlogic.module.autoexec.api.combop; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import neatlogic.framework.asynchronization.threadlocal.UserContext; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.autoexec.auth.AUTOEXEC_COMBOP_ADD; import neatlogic.framework.autoexec.constvalue.CombopOperationType; import neatlogic.framework.autoexec.constvalue.ParamMappingMode; -import neatlogic.framework.autoexec.dto.AutoexecParamVo; +import neatlogic.framework.autoexec.dao.mapper.AutoexecCombopMapper; +import neatlogic.framework.autoexec.dao.mapper.AutoexecScriptMapper; +import neatlogic.framework.autoexec.dao.mapper.AutoexecToolMapper; +import neatlogic.framework.autoexec.dao.mapper.AutoexecTypeMapper; import neatlogic.framework.autoexec.dto.AutoexecToolVo; import neatlogic.framework.autoexec.dto.combop.*; import neatlogic.framework.autoexec.dto.global.param.AutoexecGlobalParamVo; @@ -41,23 +47,16 @@ import neatlogic.framework.notify.core.INotifyPolicyHandler; import neatlogic.framework.notify.core.NotifyPolicyHandlerFactory; import neatlogic.framework.notify.dao.mapper.NotifyMapper; import neatlogic.framework.notify.dto.InvokeNotifyPolicyConfigVo; -import neatlogic.framework.notify.dto.NotifyPolicyHandlerVo; import neatlogic.framework.notify.dto.NotifyPolicyVo; import neatlogic.framework.notify.exception.NotifyPolicyHandlerNotFoundException; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateBinaryStreamApiComponentBase; -import neatlogic.framework.autoexec.dao.mapper.AutoexecCombopMapper; -import neatlogic.framework.autoexec.dao.mapper.AutoexecScriptMapper; -import neatlogic.framework.autoexec.dao.mapper.AutoexecToolMapper; -import neatlogic.framework.autoexec.dao.mapper.AutoexecTypeMapper; +import neatlogic.framework.util.$; import neatlogic.module.autoexec.dao.mapper.AutoexecCombopVersionMapper; import neatlogic.module.autoexec.dao.mapper.AutoexecGlobalParamMapper; import neatlogic.module.autoexec.dao.mapper.AutoexecProfileMapper; import neatlogic.module.autoexec.dao.mapper.AutoexecScenarioMapper; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.TypeReference; import neatlogic.module.autoexec.service.AutoexecCombopService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -280,17 +279,16 @@ public class AutoexecCombopImportApi extends PrivateBinaryStreamApiComponentBase if (notifyPolicyHandler == null) { throw new NotifyPolicyHandlerNotFoundException(notifyPolicyVo.getHandler()); } + String moduleGroup = NotifyPolicyHandlerFactory.getModuleGroupIdByHandler(notifyPolicyVo.getHandler()); + if (moduleGroup == null) { + throw new NotifyPolicyHandlerNotFoundException(notifyPolicyVo.getHandler()); + } String moduleGroupName = ""; - List notifyPolicyHandlerList = NotifyPolicyHandlerFactory.getNotifyPolicyHandlerList(); - for (NotifyPolicyHandlerVo notifyPolicyHandlerVo : notifyPolicyHandlerList) { - if (Objects.equals(notifyPolicyHandlerVo.getHandler(), notifyPolicyVo.getHandler())) { - ModuleGroupVo moduleGroupVo = ModuleUtil.getModuleGroup(notifyPolicyHandlerVo.getModuleGroup()); - if (moduleGroupVo != null) { - moduleGroupName = moduleGroupVo.getGroupName(); - } - } + ModuleGroupVo moduleGroupVo = ModuleUtil.getModuleGroup(moduleGroup); + if (moduleGroupVo != null) { + moduleGroupName = moduleGroupVo.getGroupName(); } - String handlerName = notifyPolicyHandler.getName(); + String handlerName = $.t(notifyPolicyHandler.getName()); notifyPolicyConfigVo.setPolicyPath(moduleGroupName + "/" + handlerName + "/" + notifyPolicyVo.getName()); notifyPolicyConfigVo.setPolicyId(notifyPolicyVo.getId()); } diff --git a/src/main/java/neatlogic/module/autoexec/notify/handler/AutoexecCombopNotifyPolicyHandler.java b/src/main/java/neatlogic/module/autoexec/notify/handler/AutoexecCombopNotifyPolicyHandler.java index 61b87de1..6e51d91f 100644 --- a/src/main/java/neatlogic/module/autoexec/notify/handler/AutoexecCombopNotifyPolicyHandler.java +++ b/src/main/java/neatlogic/module/autoexec/notify/handler/AutoexecCombopNotifyPolicyHandler.java @@ -21,12 +21,10 @@ import neatlogic.framework.autoexec.auth.AUTOEXEC_COMBOP_ADD; import neatlogic.framework.autoexec.constvalue.AutoexecJobNotifyParam; import neatlogic.framework.autoexec.constvalue.AutoexecJobNotifyTriggerType; import neatlogic.framework.dto.ConditionParamVo; -import neatlogic.framework.notify.core.INotifyPolicyHandlerGroup; import neatlogic.framework.notify.core.NotifyHandlerType; import neatlogic.framework.notify.core.NotifyPolicyHandlerBase; import neatlogic.framework.notify.dto.NotifyTriggerTemplateVo; import neatlogic.framework.notify.dto.NotifyTriggerVo; -import neatlogic.framework.util.I18nUtils; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -40,7 +38,7 @@ import java.util.List; public class AutoexecCombopNotifyPolicyHandler extends NotifyPolicyHandlerBase { @Override public String getName() { - return "组合工具"; + return "term.autoexec.combop"; } /** @@ -51,10 +49,10 @@ public class AutoexecCombopNotifyPolicyHandler extends NotifyPolicyHandlerBase { return AUTOEXEC_COMBOP_ADD.class.getSimpleName(); } - @Override - public INotifyPolicyHandlerGroup getGroup() { - return null; - } +// @Override +// public INotifyPolicyHandlerGroup getGroup() { +// return null; +// } @Override protected List myNotifyTriggerList() { -- Gitee