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

代码表中无代码项、数值代码表

上级 f6d6406f
......@@ -19,8 +19,16 @@ public class StaticDict {
<#if sys.getAllPSCodeLists()??>
<#list sys.getAllPSCodeLists() as codeList>
<#if codeList.getCodeListType()=='STATIC'>
<#assign hasCodeItem=calcHasCodeItem(codeList)>
<#if codeList.getCodeListType()=='STATIC' && hasCodeItem>
<#assign codeListName=codeList.codeName>
<#comment>数值代码表int,其余为String</#comment>
<#if codeList.isCodeItemValueNumber()>
<#assign valueType="int">
<#else>
<#assign valueType="String">
</#if>
/**
* 代码表[${codeList.name}]
*/
......@@ -34,13 +42,13 @@ public class StaticDict {
</#list>
</#if>
private String value;
private ${valueType} value;
private String text;
private String valueSeparator="<#if codeList.getValueSeparator()??>${codeList.getValueSeparator()}</#if>";
private String textSeparator="<#if codeList.getTextSeparator()??>${codeList.getTextSeparator()}</#if>";
private String emptyText="<#if codeList.getEmptyText()?? && codeList.getEmptyText()!='未定义'>${codeList.getEmptyText()}</#if>";
${codeListName}(String value , String text) {
${codeListName}(${valueType} value , String text) {
this.value=value;
this.text = text;
}
......@@ -57,3 +65,15 @@ public class StaticDict {
<#assign result=codeItemValue?replace("[^\\w]+","_","r")>
<#return result>
</#function>
<#comment>判断是否含有代码项</#comment>
<#function calcHasCodeItem codeList>
<#assign hasCodeItem=false>
<#if codeList.getAllPSCodeItems()??>
<#list codeList.getAllPSCodeItems() as codeItem>
<#assign hasCodeItem=true>
<#break>
</#list>
</#if>
<#return hasCodeItem>
</#function>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册