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

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

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