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

查询模型上下文参数支持格式:${srfdatacontext('cityid')}

上级 aa932dfb
......@@ -196,22 +196,23 @@ TARGET=PSDATAENTITY
<#comment>第二次替换:#{srf.datacontext.field}</#comment>
<#comment>第三次替换: #{srf.datacontext.ORGID} --> #{srf.datacontext.orgid} </#comment>
<#function contextParamConvert contextParam>
<#--<#comment>平台配置格式替换${srfdatacontext('cityid','{"defname":"CITYID","dename":"CITY"}')} &ndash;&gt; #{srf.srfdatacontext.cityid} </#comment>-->
<#--<#assign contextParam=contextParam?replace("\\$\\{(srfdatacontext|srfsessioncontext|srfwebcontext)\\('(\\w+)','(.*)'\\)}","#\{srf.$1.$2}","r")>-->
<#--<#comment>用户配置格式替换${srfdatacontext('cityid')} &ndash;&gt; #{srf.srfdatacontext.cityid} </#comment>-->
<#--<#assign contextParam=contextParam?replace("\\$\\{(srfdatacontext|srfsessioncontext|srfwebcontext)\\('(\\w+)'\\)}","#\{srf.$1.$2}","r")>-->
<#--<#comment>将上下文参数转小写 #{srf.srfdatacontext.SRFORGID} &ndash;&gt; #{srf.srfdatacontext.srforgid}</#comment>-->
<#--<#assign params=contextParam?matches('#\\{srf.[\\S]*}')>-->
<#--<#list params as param>-->
<#--<#assign contextParam=contextParam?replace(param,param?lower_case)>-->
<#--</#list>-->
<#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 params=resultParam?matches('#\\{srf.[\\S]*}')>
<#comment>平台配置格式替换${srfdatacontext('cityid','{"defname":"CITYID","dename":"CITY"}')} --> #{srf.srfdatacontext.cityid} </#comment>
<#assign resultParam=contextParam?replace("\\$\\{(srfdatacontext|srfsessioncontext|srfwebcontext)\\('(\\w+)','(.*?)'\\)}","#\{srf.$1.$2}","r")>
<#comment>用户配置格式替换${srfdatacontext('cityid')} --> #{srf.srfdatacontext.cityid} </#comment>
<#assign resultParam=resultParam?replace("\\$\\{(srfdatacontext|srfsessioncontext|srfwebcontext)\\('(\\w+)'\\)}","#\{srf.$1.$2}","r")>
<#comment>将上下文参数转小写 #{srf.srfdatacontext.SRFORGID} --> #{srf.srfdatacontext.srforgid}</#comment>
<#assign params=resultParam?matches('#\\{srf.(\\w+).(\\w+)}')>
<#list params as param>
<#assign resultParam=resultParam?replace(param,param?lower_case)><#comment>将上下文参数转小写</#comment>
<#assign resultParam=resultParam?replace(param,param?lower_case)>
</#list>
<#--<#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 params=resultParam?matches('#\\{srf.[\\S]*}')>-->
<#--<#list params as param>-->
<#--<#assign resultParam=resultParam?replace(param,param?lower_case)><#comment>将上下文参数转小写</#comment>-->
<#--</#list>-->
<#return resultParam>
</#function>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册