提交 71c6b147 编写于 作者: sq3536's avatar sq3536

无存储domain

上级 cd80b722
......@@ -422,7 +422,7 @@ public class ${item.getCodeName()} extends EntityMongo implements Serializable {
}
<#comment>Api存储</#comment>
<#elseif de.getStorageMode()==4 || de.getStorageMode()==0>
<#elseif de.getStorageMode()==4 >
import ${pub.getPKGCodeName()}.util.domain.EntityClient;
/**
......@@ -569,6 +569,136 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable
</#if>
}
<#comment>无存储</#comment>
<#elseif de.getStorageMode()==0>
/**
* [${item.getLogicName()}] 对象
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ${item.getCodeName()} extends EntityBase implements Serializable {
<#if de.getPSDEFields()??>
<#comment>输出实体属性</#comment>
<#list de.getPSDEFields() as defield>
<#assign defDataType = (defield.getDataType())!"">
<#if defDataType!='ONE2MANYDATA'>
<#assign columnname = defield.getName()?lower_case>
<#assign prvateCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC') >
<#assign publicCodeName = prvateCodeName?cap_first >
<#assign jsonfield = defield.getCodeName()?lower_case >
<#if de.getStorageMode()==0><#assign jsonfield = defield.getCodeName()?uncap_first ></#if>
<#assign defieldano = "" >
<#if prvateCodeName?lower_case != columnname>
<#assign defieldano = "name = \""+columnname+"\"">
</#if>
<#if defield.getDefaultValue()?? && defield.getDefaultValue()!=''>
<#assign defieldano = "defaultValue = \""+defield.getDefaultValue()+"\"">
</#if>
<#if defield.getDefaultValueType()?? && defield.getDefaultValueType()!=''>
<#if defieldano?? && defieldano!=''>
<#assign defieldano = defieldano+" , ">
</#if>
<#assign defieldano = defieldano+"defaultValueType = DEFieldDefaultValueType."+defield.getDefaultValueType()?upper_case>
</#if>
<#if defield.isKeyDEField()==true>
<#if defieldano?? && defieldano!=''>
<#assign defieldano = defieldano+" , ">
</#if>
<#assign defieldano = defieldano+"isKeyField=true">
<#elseif defield.getPredefinedType()?? && defield.getPredefinedType()!=''>
<#if defieldano?? && defieldano!=''>
<#assign defieldano = defieldano+" , ">
</#if>
<#assign defieldano = defieldano+"preType = DEPredefinedFieldType."+defield.getPredefinedType()?upper_case>
<#if defield.getPredefinedType()?lower_case =='logicvalid'>
<#if de.getLogicValidPSDEField()?? && de.isLogicValid()==true>
<#assign defieldano = defieldano+", logicval = \""+((item.getValidLogicValue())!'1')+"\" , logicdelval=\""+((item.getInvalidLogicValue())!'0')+"\"">
</#if>
</#if>
</#if>
/**
* ${defield.getLogicName()}
*/
<#comment>属性默认值</#comment>
<#if defieldano?? && defieldano!='' && defield.isPhisicalDEField()==true>
@DEField(${defieldano})
</#if>
<#assign defDataType = (defield.getDataType())!"">
<#if defDataType == "DATETIME" || (defDataType=='PICKUPDATA' && srfdatatype(defield.getStdDataType())== "DATETIME" && defield.getValueFormat()=="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS")>
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "${jsonfield}" , format="yyyy-MM-dd HH:mm:ss")
<#elseif defDataType == "DATE" || (defDataType=='PICKUPDATA' && srfdatatype(defield.getStdDataType())== "DATETIME" && defield.getValueFormat()=="%1$tY-%1$tm-%1$td")>
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "${jsonfield}" , format="yyyy-MM-dd")
<#elseif defDataType == "TIME" || (defDataType=='PICKUPDATA' && srfdatatype(defield.getStdDataType())== "DATETIME" && defield.getValueFormat()=="%1$tH:%1$tM:%1$tS")>
@JsonFormat(pattern="HH:mm", locale = "zh" , timezone="GMT+8")
@JSONField(name = "${jsonfield}" , format="HH:mm")
<#else>
@JSONField(name = "${jsonfield}")
</#if>
@JsonProperty("${jsonfield}")
private ${srfjavatype(defield.getStdDataType())} ${prvateCodeName};
</#if>
</#list>
<#comment>创建1N关系实体-输出主实体</#comment>
<#if item.getMinorPSDERs?? && item.getMinorPSDERs()??>
<#list item.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER?? && MinorPSDER.getDERType()=='DER1N'>
<#if MinorPSDER.getMajorPSDataEntity?? && MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getCodeName?? && MinorPSDER.getCodeName()??>
<#assign MajorEntity = MinorPSDER.getMajorPSDataEntity()>
<#if MajorEntity.getCodeName?? && MinorPSDER.getCodeName()?? >
/**
* ${MinorPSDER.getLogicName()}
*/
@JSONField(name = "${srfcaseformat(MinorPSDER.getCodeName(),'l_u2lC')?lower_case}")
@JsonProperty("${srfcaseformat(MinorPSDER.getCodeName(),'l_u2lC')?lower_case}")
private ${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} ${srfcaseformat(MinorPSDER.getCodeName(),'l_u2lC')};
</#if>
</#if>
</#if>
</#list>
</#if>
<#comment>输出关系数据(子实体)</#comment>
<#if de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as der>
<#if der.getDERType() =='DER1N' >
<#assign listcode=(der.getMinorCodeName()!der.getMinorPSDataEntity().getCodeName())>
<#if listcode?? && listcode==''><#assign listcode=der.getMinorPSDataEntity().getCodeName()></#if>
<#assign subDTOs = srfpluralize(listcode)?lower_case >
<#assign nested=der.isNestedRS()>
<#if nested == false && der.getMinorPSDataEntity().getAllPSDEServiceAPIs()??>
<#list der.getMinorPSDataEntity().getAllPSDEServiceAPIs() as api>
<#if api.isNested()>
<#assign nested=true>
</#if>
</#list>
</#if>
<#if nested>
/**
* ${der.getMinorPSDataEntity().getLogicName()}
*/
@JSONField(name = "${subDTOs}")
@JsonProperty("${subDTOs}")
private List<${pub.getPKGCodeName()}.core.${der.getMinorPSDataEntity().getPSSystemModule().getCodeName()?lower_case}.domain.${der.getMinorPSDataEntity().getCodeName()}> ${srfcaseformat(listcode,'l_u2lC')};
</#if>
</#if>
</#list>
</#if>
</#if>
}
</#if>
<#comment>获取联合主键:返回值 String.format("%s||%s",this.getHumanid(),this.getHumanname() </#comment>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册