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

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

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