diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskActionTriggerUserIdCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskActionTriggerUserIdCondition.java new file mode 100644 index 0000000000000000000000000000000000000000..4032605d2934d6b8bd70302bc5e8e43c43580b29 --- /dev/null +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskActionTriggerUserIdCondition.java @@ -0,0 +1,88 @@ +package neatlogic.module.process.condition.handler; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.asynchronization.threadlocal.UserContext; +import neatlogic.framework.common.constvalue.FormHandlerType; +import neatlogic.framework.common.constvalue.GroupSearch; +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.form.constvalue.FormConditionModel; +import neatlogic.framework.process.condition.core.IProcessTaskCondition; +import neatlogic.framework.process.condition.core.ProcessTaskConditionBase; +import neatlogic.framework.process.constvalue.ConditionConfigType; +import neatlogic.framework.process.constvalue.ProcessFieldType; +import neatlogic.framework.process.dto.ProcessTaskStepVo; +import org.springframework.stereotype.Component; + +@Component +public class ProcessTaskActionTriggerUserIdCondition extends ProcessTaskConditionBase implements IProcessTaskCondition { + + @Override + public String getName() { + return "actiontriggeruserid"; + } + + @Override + public String getDisplayName() { + return "动作触发人用户ID"; + } + + @Override + public String getHandler(FormConditionModel processWorkcenterConditionType) { + return FormHandlerType.USERSELECT.toString(); + } + + @Override + public String getType() { + return ProcessFieldType.COMMON.getValue(); + } + + @Override + public JSONObject getConfig(ConditionConfigType configType) { + JSONObject config = new JSONObject(); + config.put("type", FormHandlerType.USERSELECT.toString()); + config.put("initConfig", new JSONObject() { + { + this.put("excludeList", new JSONArray() {{ + }}); + this.put("groupList", new JSONArray() { + { + this.add(GroupSearch.USER.getValue()); + } + }); + this.put("includeList", new JSONArray() { + { + } + }); + } + }); + config.put("multiple", true); + /** 以下代码是为了兼容旧数据结构,前端有些地方还在用 **/ + config.put("isMultiple", true); + return config; + } + + @Override + public Integer getSort() { + return 12; + } + + @Override + public ParamType getParamType() { + return ParamType.ARRAY; + } + + @Override + public Object valueConversionText(Object value, JSONObject config) { + return null; + } + + @Override + public Object getConditionParamData(ProcessTaskStepVo processTaskStepVo){ + if(UserContext.get() != null){ + return UserContext.get().getUserId(); + } + return null; + } + +}