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

填充外键值数据

上级 cc46e9a2
...@@ -450,7 +450,14 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -450,7 +450,14 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#comment>为当前实体填充父数据(外键值文本、外键值附加数据)</#comment> <#comment>为当前实体填充父数据(外键值文本、外键值附加数据)</#comment>
<#assign hasMinorPSDERs=0>
<#if item.getMinorPSDERs?? && item.getMinorPSDERs()??> <#if item.getMinorPSDERs?? && item.getMinorPSDERs()??>
<#list item.getMinorPSDERs() as MinorPSDER>
<#assign hasMinorPSDERs=hasMinorPSDERs+1>
<#break>
</#list>
</#if>
<#if hasMinorPSDERs gt 0>
/** /**
* 为当前实体填充父数据(外键值文本、外键值附加数据) * 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et * @param et
...@@ -467,15 +474,15 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -467,15 +474,15 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
if(!ObjectUtils.isEmpty(et.get${MajorKeyFieldCodeName}())){ if(!ObjectUtils.isEmpty(et.get${MajorKeyFieldCodeName}())){
${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} ${MajorEntityName}=et.get${MajorEntityName?cap_first}(); ${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} ${MajorEntityName}=et.get${MajorEntityName?cap_first}();
if(ObjectUtils.isEmpty(${MajorEntityName})){ if(ObjectUtils.isEmpty(${MajorEntityName})){
${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} majorEntity=${MajorEntityService}.get(et.get${MajorKeyFieldCodeName}()); ${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} majorEntity=${MajorEntityService}.get(et.get${MajorKeyFieldCodeName}());
et.set${MajorEntityName?cap_first}(majorEntity); et.set${MajorEntityName?cap_first}(majorEntity);
} }
<#comment>找出当前关系的外键值文本及附加数据字段</#comment> <#comment>找出当前关系的外键值文本及附加数据字段</#comment>
<#list de.getAllPSDEFields() as defield> <#list de.getAllPSDEFields() as defield>
<#if defield.getPSDER1N?? && defield.getPSDER1N()?? && defield.getPSDER1N().name==MinorPSDER.name && (((defield.getDataType())!'')!='PICKUP')> <#if defield.getPSDER1N?? && defield.getPSDER1N()?? && defield.getPSDER1N().name==MinorPSDER.name && (((defield.getDataType())!'')!='PICKUP')>
<#assign minorFieldCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC')?cap_first > <#assign minorFieldCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC')?cap_first >
<#assign majorFieldCodeName = srfcaseformat(defield.getRelatedPSDEField().getCodeName(),'l_u2lC')?cap_first > <#assign majorFieldCodeName = srfcaseformat(defield.getRelatedPSDEField().getCodeName(),'l_u2lC')?cap_first >
et.set${minorFieldCodeName}(${MajorEntityName}.get${majorFieldCodeName}()); et.set${minorFieldCodeName}(${MajorEntityName}.get${majorFieldCodeName}());
</#if> </#if>
</#list> </#list>
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册