diff --git a/src/main/java/neatlogic/framework/notify/core/INotifyTriggerType.java b/src/main/java/neatlogic/framework/notify/core/INotifyTriggerType.java index cea851b430c88f8050df184d9f7325abb6b731ce..df60923e6146e4f320c4117e7607c44764867617 100644 --- a/src/main/java/neatlogic/framework/notify/core/INotifyTriggerType.java +++ b/src/main/java/neatlogic/framework/notify/core/INotifyTriggerType.java @@ -15,6 +15,9 @@ along with this program. If not, see .*/ package neatlogic.framework.notify.core; +import java.util.ArrayList; +import java.util.List; + public interface INotifyTriggerType { String getTrigger(); @@ -22,4 +25,20 @@ public interface INotifyTriggerType { String getText(); String getDescription(); + + /** + * 触发点额外包含的通知对象选项 + * @return + */ + default List getIncludeList() { + return new ArrayList<>(); + } + + /** + * 触发点额外排除的通知对象选项 + * @return + */ + default List getExcludeList() { + return new ArrayList<>(); + } } diff --git a/src/main/java/neatlogic/framework/notify/dto/NotifyTriggerVo.java b/src/main/java/neatlogic/framework/notify/dto/NotifyTriggerVo.java index 63b79b0e7c78648900fcd9700375cb3988146e4e..06f304a6ec786b09b1ce879757da82a7aadb2485 100644 --- a/src/main/java/neatlogic/framework/notify/dto/NotifyTriggerVo.java +++ b/src/main/java/neatlogic/framework/notify/dto/NotifyTriggerVo.java @@ -10,6 +10,8 @@ public class NotifyTriggerVo { private String trigger; private String triggerName; private String description; + private List includeList = new ArrayList<>(); + private List excludeList = new ArrayList<>(); private List notifyList = new ArrayList<>(); public NotifyTriggerVo() {} @@ -24,6 +26,14 @@ public class NotifyTriggerVo { this.trigger = notifyTriggerType.getTrigger(); this.triggerName = notifyTriggerType.getText(); this.description = notifyTriggerType.getDescription(); + List _includeList = notifyTriggerType.getIncludeList(); + if (_includeList != null) { + this.includeList.addAll(_includeList); + } + List _excludeList = notifyTriggerType.getExcludeList(); + if (_excludeList != null) { + this.excludeList.addAll(_excludeList); + } } public String getTrigger() { @@ -61,4 +71,20 @@ public class NotifyTriggerVo { public void clearNotifyList() { this.notifyList.clear(); } + + public List getIncludeList() { + return includeList; + } + + public void setIncludeList(List includeList) { + this.includeList = includeList; + } + + public List getExcludeList() { + return excludeList; + } + + public void setExcludeList(List excludeList) { + this.excludeList = excludeList; + } } diff --git a/src/main/java/neatlogic/module/framework/notify/exception/ExceptionNotifyPolicyHandler.java b/src/main/java/neatlogic/module/framework/notify/exception/ExceptionNotifyPolicyHandler.java index a0d344e6fa1e15d472b5191b029b277b8ca39ec4..54c0de1087f345bf17f172b82de683c05cd28328 100644 --- a/src/main/java/neatlogic/module/framework/notify/exception/ExceptionNotifyPolicyHandler.java +++ b/src/main/java/neatlogic/module/framework/notify/exception/ExceptionNotifyPolicyHandler.java @@ -62,14 +62,7 @@ public class ExceptionNotifyPolicyHandler extends NotifyPolicyHandlerBase { protected List mySystemParamList() { List notifyPolicyParamList = new ArrayList<>(); for (ExceptionNotifyParam param : ExceptionNotifyParam.values()) { - ConditionParamVo paramVo = new ConditionParamVo(); - paramVo.setName(param.getValue()); - paramVo.setLabel(param.getText()); - paramVo.setParamType(param.getParamType().getName()); - paramVo.setParamTypeName(param.getParamType().getText()); - paramVo.setFreemarkerTemplate(param.getFreemarkerTemplate()); - paramVo.setIsEditable(0); - notifyPolicyParamList.add(paramVo); + notifyPolicyParamList.add(createConditionParam(param)); } return notifyPolicyParamList; }