diff --git a/src/main/java/neatlogic/module/event/notify/handler/EventNotifyPolicyHandler.java b/src/main/java/neatlogic/module/event/notify/handler/EventNotifyPolicyHandler.java index de5e60b119508b9489b90b3c107d77f19a8a1a0a..d3be69a0e11804e68c91ec1c17e09deb7e6d5515 100644 --- a/src/main/java/neatlogic/module/event/notify/handler/EventNotifyPolicyHandler.java +++ b/src/main/java/neatlogic/module/event/notify/handler/EventNotifyPolicyHandler.java @@ -1,22 +1,12 @@ package neatlogic.module.event.notify.handler; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import neatlogic.framework.common.constvalue.Expression; -import neatlogic.framework.common.constvalue.ParamType; -import neatlogic.framework.condition.core.IConditionHandler; import neatlogic.framework.dto.ConditionParamVo; -import neatlogic.framework.dto.ExpressionVo; import neatlogic.framework.event.constvalue.EventProcessStepHandlerType; -import neatlogic.framework.form.constvalue.FormConditionModel; -import neatlogic.framework.notify.core.NotifyPolicyHandlerBase; import neatlogic.framework.notify.dto.NotifyTriggerVo; import neatlogic.framework.process.auth.PROCESS_MODIFY; -import neatlogic.framework.process.condition.core.ProcessTaskConditionFactory; -import neatlogic.framework.process.constvalue.ConditionProcessTaskOptions; -import neatlogic.framework.process.constvalue.ProcessTaskGroupSearch; -import neatlogic.framework.process.constvalue.ProcessUserType; -import neatlogic.framework.process.notify.constvalue.*; +import neatlogic.framework.process.notify.constvalue.ProcessTaskStepTaskNotifyParam; +import neatlogic.framework.process.notify.constvalue.ProcessTaskStepTaskNotifyTriggerType; +import neatlogic.framework.process.notify.core.ProcessTaskNotifyHandlerBase; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -31,7 +21,7 @@ import java.util.List; **/ @Component -public class EventNotifyPolicyHandler extends NotifyPolicyHandlerBase { +public class EventNotifyPolicyHandler extends ProcessTaskNotifyHandlerBase { @Override public String getName() { return EventProcessStepHandlerType.EVENT.getName(); @@ -51,11 +41,8 @@ public class EventNotifyPolicyHandler extends NotifyPolicyHandlerBase { // } @Override - protected List myNotifyTriggerList() { + protected List myCustomNotifyTriggerList() { List returnList = new ArrayList<>(); - for (ProcessTaskStepNotifyTriggerType notifyTriggerType : ProcessTaskStepNotifyTriggerType.values()) { - returnList.add(new NotifyTriggerVo(notifyTriggerType)); - } //任务 for (ProcessTaskStepTaskNotifyTriggerType notifyTriggerType : ProcessTaskStepTaskNotifyTriggerType.values()) { returnList.add(new NotifyTriggerVo(notifyTriggerType)); @@ -64,59 +51,11 @@ public class EventNotifyPolicyHandler extends NotifyPolicyHandlerBase { } @Override - protected List mySystemParamList() { + protected List myCustomSystemParamList() { List notifyPolicyParamList = new ArrayList<>(); - for(ProcessTaskNotifyParam param : ProcessTaskNotifyParam.values()) { - notifyPolicyParamList.add(createConditionParam(param)); - } - for(ProcessTaskStepNotifyParam param : ProcessTaskStepNotifyParam.values()) { - notifyPolicyParamList.add(createConditionParam(param)); - } for(ProcessTaskStepTaskNotifyParam param : ProcessTaskStepTaskNotifyParam.values()) { notifyPolicyParamList.add(createConditionParam(param)); } return notifyPolicyParamList; } - - @Override - protected List mySystemConditionOptionList() { - List notifyPolicyParamList = new ArrayList<>(); - for (ConditionProcessTaskOptions option : ConditionProcessTaskOptions.values()) { - IConditionHandler condition = ProcessTaskConditionFactory.getHandler(option.getValue()); - if (condition != null) { - ConditionParamVo param = new ConditionParamVo(); - param.setName(condition.getName()); - param.setLabel(condition.getDisplayName()); - param.setController(condition.getHandler(FormConditionModel.CUSTOM)); - if (condition.getConfig() != null) { - param.setConfig(condition.getConfig().toJSONString()); - } - param.setType(condition.getType()); - ParamType paramType = condition.getParamType(); - if (paramType != null) { - param.setParamType(paramType.getName()); - param.setParamTypeName(paramType.getText()); - param.setDefaultExpression(paramType.getDefaultExpression().getExpression()); - for (Expression expression : paramType.getExpressionList()) { - param.getExpressionList().add(new ExpressionVo(expression.getExpression(), expression.getExpressionName(), expression.getIsShowConditionValue())); - } - } - - param.setIsEditable(0); - notifyPolicyParamList.add(param); - } - } - return notifyPolicyParamList; - } - - @Override - protected void myAuthorityConfig(JSONObject config) { - List groupList = JSON.parseArray(config.getJSONArray("groupList").toJSONString(), String.class); - groupList.add(ProcessTaskGroupSearch.PROCESSUSERTYPE.getValue()); - config.put("groupList", groupList); - List includeList = JSON.parseArray(config.getJSONArray("includeList").toJSONString(), String.class); - includeList.add(ProcessTaskGroupSearch.PROCESSUSERTYPE.getValue() + "#" + ProcessUserType.DEFAULT_WORKER.getValue()); - includeList.add(ProcessTaskGroupSearch.PROCESSUSERTYPE.getValue() + "#" + ProcessUserType.FOCUS_USER.getValue()); - config.put("includeList", includeList); - } }