From 3ccf4076028e41272fc1e0f5a51e70d4224f4846 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 19 Nov 2024 18:37:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8C=96=E8=A1=A8=E5=8D=95=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?-=E8=87=AA=E5=8A=A8=E5=8C=96=E6=9C=8D=E5=8A=A1=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=AE=B9=E5=99=A8=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1293524304101376]后端-定制化表单控件-自动化服务表单容器控件 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1293524304101376 --- .../handler/AutoexecServiceHandler.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 src/main/java/neatlogic/module/autoexec/formattribute/handler/AutoexecServiceHandler.java diff --git a/src/main/java/neatlogic/module/autoexec/formattribute/handler/AutoexecServiceHandler.java b/src/main/java/neatlogic/module/autoexec/formattribute/handler/AutoexecServiceHandler.java new file mode 100644 index 00000000..c286ee56 --- /dev/null +++ b/src/main/java/neatlogic/module/autoexec/formattribute/handler/AutoexecServiceHandler.java @@ -0,0 +1,119 @@ +/* + * 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.module.autoexec.formattribute.handler; + +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.autoexec.constvalue.AutoexecFormHandler; +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.form.attribute.core.FormHandlerBase; +import neatlogic.framework.form.constvalue.FormConditionModel; +import neatlogic.framework.form.dto.AttributeDataVo; +import neatlogic.framework.form.exception.AttributeValidException; +import org.springframework.stereotype.Component; + +@Component +public class AutoexecServiceHandler extends FormHandlerBase { + @Override + protected JSONObject getMyDetailedData(AttributeDataVo attributeDataVo, JSONObject configObj) { + return null; + } + + @Override + public Object valueConversionText(AttributeDataVo attributeDataVo, JSONObject configObj) { + if (!attributeDataVo.dataIsEmpty()) { + return "已更新"; + } else { + return ""; + } + } + + @Override + public Object dataTransformationForEmail(AttributeDataVo attributeDataVo, JSONObject configObj) { + return null; + } + + @Override + public Object textConversionValue(Object text, JSONObject config) { + return null; + } + + @Override + public Object dataTransformationForExcel(AttributeDataVo attributeDataVo, JSONObject configObj) { + return null; + } + + @Override + public String getHandler() { + return AutoexecFormHandler.FORMRESOURECES.getHandler(); + } + + @Override + public String getHandlerName() { + return AutoexecFormHandler.FORMRESOURECES.getHandlerName(); + } + + @Override + public String getHandlerType(FormConditionModel model) { + return null; + } + + @Override + public ParamType getParamType() { + return null; + } + + @Override + public boolean isAudit() { + return true; + } + + @Override + public boolean isConditionable() { + return false; + } + + @Override + public boolean isProcessTaskBatchSubmissionTemplateParam() { + return false; + } + + @Override + public JSONObject valid(AttributeDataVo attributeDataVo, JSONObject configObj) throws AttributeValidException { + return null; + } + + @Override + public Object conversionDataType(Object source, String attributeLabel) { + if (source == null) { + return null; + } + if (source instanceof JSONObject) { + return source; + } else if (source instanceof String) { + String sourceStr = (String) source; + if (sourceStr.startsWith("{") && sourceStr.endsWith("}")) { + try { + return JSONObject.parseObject(sourceStr); + } catch (Exception e) { + throw new AttributeValidException(attributeLabel); + } + } + } + throw new AttributeValidException(attributeLabel); + } +} -- Gitee