数据来源为流程的处理方法实现
@@ -36,12 +37,15 @@ public class WorkflowDataHandler implements IDataSourceHandler { String workflowId = apiRequestMain.getWorkflowType(); String workflowVersionIds = WorkflowVersion.getVersionStringByWfid(workflowId); String workflowTable = mapper.selectWorkflowTableById(workflowVersionIds.split(",")); + if("".equals(apiRequestMain.getRequestId()) || Objects.isNull(apiRequestMain.getRequestId())){ + throw new RuntimeException("数据来源为流程时,流程的requestId为必要参数!"); + } Map自定义SQL处理器
+ *create 2022/1/26 0026 16:30
+ * + * @author EBU7-dev1-ayh + */ + + +public class CustomerSqlRuleHandler implements IParamValueRuleHandler { + private final ParamValueParseMapper mapper = Util.getMapper(ParamValueParseMapper.class); + @Override + public Object getValue(ApiRequestParamDetail paramInfo, Map系统字段值处理
+ *create 2022/1/26 0026 16:25
+ * + * @author EBU7-dev1-ayh + */ + + +public class SystemFieldValueRuleHandle implements IParamValueRuleHandler { + @Override + public Object getValue(ApiRequestParamDetail paramInfo, Map参数值解析查询操作
+ *create 2022/1/26 0026 16:32
+ * + * @author EBU7-dev1-ayh + */ + +@SqlMapper +public interface ParamValueParseMapper { + + /** + * 查询自定义SQL + * @param sql 自定义SQL字符串 + * @param map 参数 + * @return 查询到的数据 + */ + @Select(custom = true) + @CaseConversion(false) + public String selectCustomerSql(@SqlString String sql, Map工具类查询SQL
+ *create 2022/1/27 0027 12:01
+ * + * @author EBU7-dev1-ayh + */ + +@SqlMapper +public interface UtilMapper { + + /** + * 查询日志级别是否开启Debug模式 + * @return 是否开启Debug模式 + */ + @Select("select param_value from uf_cus_dev_config where only_mark = 'enableDebugLog'") + public Boolean selectLogLevel(); + + + /** + * 根据唯一标识查询参数值 + * @param onlyMark 唯一标识 + * @return 参数值 + */ + @Select("select param_value from uf_cus_dev_config where only_mark = #{onlyMark} and enable_param = 1") + public String selectCusConfigParam(@ParamMapper("onlyMark") String onlyMark); +} diff --git a/src/test/java/utilTest/UtilTest.java b/src/test/java/utilTest/UtilTest.java index 4e06fdb..eb0a96c 100644 --- a/src/test/java/utilTest/UtilTest.java +++ b/src/test/java/utilTest/UtilTest.java @@ -16,9 +16,12 @@ import com.drew.metadata.Directory; import com.drew.metadata.Metadata; import com.drew.metadata.Tag; import com.engine.doc.cmd.secCategoryList.DocSecCategoryAddCmd; +import com.weaver.general.GCONST; import entity.ImageInfo; import mybatisTest.mapper.IMapperTest; import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.*; +import org.apache.log4j.spi.Configurator; import org.junit.Before; import org.junit.Test; import utilTest.entity.TestTreeEntity; @@ -493,8 +496,17 @@ public class UtilTest { apiRequestMain.setParamRequestType(2); apiRequestMain.setOnlyMark("onlyMark"); ParamConfigInfo paramConfigInfo = new ParamConfigInfo(); - paramConfigInfo = Util.copyBeanBaseField(apiRequestMain, paramConfigInfo); + Util.copyBeanBaseField(apiRequestMain, paramConfigInfo); System.out.println(paramConfigInfo); } + @Test + public void testLog(){ + Logger log= Util.getLogger(); + log.info("我是info --------------------->"); + log.debug("我是debug---------------------------------->"); + log.error("我是错误---------------->"); + log.warn("我是警告-------------->"); + System.out.println(log.getEffectiveLevel()); + } }