diff --git a/src/main/java/neatlogic/framework/process/steptaskhandler/core/IProcessStepTaskHandler.java b/src/main/java/neatlogic/framework/process/steptaskhandler/core/IProcessStepTaskHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..b8c8b97b0090588d1c73a5f4a7df7a3ec9cda951 --- /dev/null +++ b/src/main/java/neatlogic/framework/process/steptaskhandler/core/IProcessStepTaskHandler.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.framework.process.steptaskhandler.core; + +import neatlogic.framework.process.dto.ProcessTaskStepUserVo; +import neatlogic.framework.process.dto.ProcessTaskStepVo; + +import java.util.List; + +public interface IProcessStepTaskHandler { + /** + * 返回控件 + * + * @return 控件名 + */ + List getHandlerList(); + + /** + * 获取协助处理人列表,用于通知接收人 + * @param currentProcessTaskStepVo + * @return + */ + List getMinorUserListForNotifyReceiver(ProcessTaskStepVo currentProcessTaskStepVo); +} diff --git a/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerBase.java b/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerBase.java new file mode 100644 index 0000000000000000000000000000000000000000..bafeb55a35f29f68246f4a66c91c6b804795a26b --- /dev/null +++ b/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerBase.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.framework.process.steptaskhandler.core; + +public abstract class ProcessStepTaskHandlerBase implements IProcessStepTaskHandler { +} diff --git a/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerFactory.java b/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..406609b5489adf74c3cb9c820b3650a5c35887e5 --- /dev/null +++ b/src/main/java/neatlogic/framework/process/steptaskhandler/core/ProcessStepTaskHandlerFactory.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.framework.process.steptaskhandler.core; + +import neatlogic.framework.applicationlistener.core.ModuleInitializedListenerBase; +import neatlogic.framework.bootstrap.NeatLogicWebApplicationContext; +import neatlogic.framework.common.RootComponent; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.core.annotation.Order; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RootComponent +@Order(10) +public class ProcessStepTaskHandlerFactory extends ModuleInitializedListenerBase { + private static final Map componentMap = new HashMap<>(); + + public static IProcessStepTaskHandler getHandler(String handler) { + return componentMap.get(handler); + } + + @Override + protected void onInitialized(NeatLogicWebApplicationContext context) { + Map myMap = context.getBeansOfType(IProcessStepTaskHandler.class); + for (Map.Entry entry : myMap.entrySet()) { + IProcessStepTaskHandler component = entry.getValue(); + List handlerList = component.getHandlerList(); + if (CollectionUtils.isNotEmpty(handlerList)) { + for (String handler : handlerList) { + componentMap.put(handler, component); + } + } + } + } + + @Override + protected void myInit() { + + } +}