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

填充外键值数据

上级 ff3fe7a1
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
TARGET=PSDATAENTITY TARGET=PSDATAENTITY
</#ibiztemplate> </#ibiztemplate>
<#if de.getStorageMode()==1 || de.getStorageMode()==2 ||de.getStorageMode()==4||de.getStorageMode()==0> <#if de.getStorageMode()==1 || de.getStorageMode()==2 ||de.getStorageMode()==4||de.getStorageMode()==0>
<#comment>判断是否有1N的主关系,用于填充外键值文本、附加数据</#comment>
<#assign hasMinorPSDERs=0>
<#if item.getMinorPSDERs?? && item.getMinorPSDERs()??>
<#list item.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER.getDERType() =='DER1N'>
<#assign hasMinorPSDERs=hasMinorPSDERs+1>
</#if>
<#break>
</#list>
</#if>
package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl; package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl;
import java.io.Serializable; import java.io.Serializable;
...@@ -158,6 +168,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -158,6 +168,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
@Override @Override
@Transactional @Transactional
public boolean create(${item.getCodeName()} et) { public boolean create(${item.getCodeName()} et) {
<#if hasMinorPSDERs gt 0>
fillParentData(et);
</#if>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
...@@ -202,6 +215,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -202,6 +215,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
@Override @Override
@Transactional @Transactional
public boolean update(${item.getCodeName()} et) { public boolean update(${item.getCodeName()} et) {
<#if hasMinorPSDERs gt 0>
fillParentData(et);
</#if>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#if de.getKeyPSDEField()??> <#if de.getKeyPSDEField()??>
...@@ -447,16 +463,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -447,16 +463,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
} }
</#if> </#if>
<#comment>为当前实体填充父数据(外键值文本、外键值附加数据)</#comment> <#comment>为当前实体填充父数据(外键值文本、外键值附加数据)</#comment>
<#assign hasMinorPSDERs=0>
<#if item.getMinorPSDERs?? && item.getMinorPSDERs()??>
<#list item.getMinorPSDERs() as MinorPSDER>
<#assign hasMinorPSDERs=hasMinorPSDERs+1>
<#break>
</#list>
</#if>
<#if hasMinorPSDERs gt 0> <#if hasMinorPSDERs gt 0>
/** /**
* 为当前实体填充父数据(外键值文本、外键值附加数据) * 为当前实体填充父数据(外键值文本、外键值附加数据)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册