提交 d5bde3b0 编写于 作者: zhouweidong's avatar zhouweidong

数据查询上下文参数转换

上级 2b9b9954
......@@ -180,7 +180,7 @@ TARGET=PSDATAENTITY
<![CDATA[ ${contextParamConvert(srfjavasqlcode(dedqcode.getQueryCode()))}
<#if dedqcode.getPSDEDataQueryCodeConds()??>
<#list dedqcode.getPSDEDataQueryCodeConds() as dedqfieldcond>
<#if (dedqfieldcond_index==0)> WHERE </#if> <#if (dedqfieldcond_index>0)> AND </#if>${contextParamConvert(srfjavasqlcode(dedqfieldcond.getCustomCond()))?lower_case}
<#if (dedqfieldcond_index==0)> WHERE </#if> <#if (dedqfieldcond_index>0)> AND </#if>${contextParamConvert(srfjavasqlcode(dedqfieldcond.getCustomCond()))}
</#list>
</#if>]]>
</sql>
......@@ -194,10 +194,15 @@ TARGET=PSDATAENTITY
<#comment>上下文参数转换 原字符串:${srfdatacontext('field','{"defname":"PORGNAME","dename":"IBZORG"}')})</#comment>
<#comment>第一次替换:#{srf.datacontext.field','{"defname":"PORGNAME","dename":"IBZORG"}')})</#comment>
<#comment>第二次替换:#{srf.datacontext.field}</#comment>
<#comment>第三次替换: #{srf.datacontext.ORGID} --> #{srf.datacontext.orgid} </#comment>
<#function contextParamConvert contextParam>
<#assign resultParam="">
<#assign resultParam=contextParam?replace('$\{srfdatacontext(\'','#\{srf.datacontext.')?replace("','\\{[\\S]*}'\\)}","\\}","r")><#comment>数据上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfsessioncontext(\'','#\{srf.sessioncontext.')?replace("','\\{[\\S]*}'\\)}","\\}","r")><#comment>用户上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfwebcontext(\'','#\{srf.webcontext.')?replace("','\\{[\\S]*}'\\)}","\\}","r")><#comment>网页请求上下文</#comment>
<#assign contextParams=resultParam.matches("#\\{srf.[\\S]*}")>
<#list contextParams as contextParam>
<#assign resultParam=resultParam?replace(contextParam,contextParam?lower_case)><#comment>将上下文参数转小写</#comment>
</#list>
<#return resultParam>
</#function>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册