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

填充外键值数据

上级 b5380308
......@@ -57,7 +57,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#assign keyfield=de.getKeyPSDEField()>
<#comment>引入关联依赖</#comment>
<#comment>引入关联依赖-从关系</#comment>
<#if de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as der>
<#if der.getDERType() =='DER1N' && (der.getMinorPSDataEntity().getStorageMode()==1||der.getMinorPSDataEntity().getStorageMode()==2||der.getMinorPSDataEntity().getStorageMode()==4)>
......@@ -69,6 +69,20 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
</#if>
</#list>
</#if>
<#comment>引入关联依赖-主关系</#comment>
<#if de.getMinorPSDERs()??>
<#list de.getMinorPSDERs() as der>
<#if der.getDERType() =='DER1N' && (der.getMajorPSDataEntity().getStorageMode()==1||der.getMajorPSDataEntity().getStorageMode()==2||der.getMajorPSDataEntity().getStorageMode()==4)>
<#if !P.exists('DEMajorPSDataEntity',der.getMajorPSDataEntity().getCodeName())>
@Autowired
@Lazy
private ${pub.getPKGCodeName()}.core.${der.getMajorPSDataEntity().getPSSystemModule().getCodeName()?lower_case}.service.I${der.getMajorPSDataEntity().getCodeName()}Service ${srfcaseformat(der.getMajorPSDataEntity().getCodeName(),'l_u2lC')}Service;
</#if>
</#if>
</#list>
</#if>
private int batchSize = 500;
<#comment>输出实体行为</#comment>
......@@ -433,6 +447,8 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
}
</#if>
<#comment>为当前实体填充父数据(外键值文本、外键值附加数据)</#comment>
<#if item.getMinorPSDERs?? && item.getMinorPSDERs()??>
/**
......@@ -446,27 +462,22 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#assign MajorEntity = MinorPSDER.getMajorPSDataEntity()>
<#assign MajorEntityName=srfcaseformat(MinorPSDER.getCodeName(),'l_u2lC')>
<#assign MajorKeyFieldCodeName =srfcaseformat(MinorPSDER.getPSPickupDEField().codeName,'l_u2lC')?cap_first>
//实体关系[${MinorPSDER.getLogicName()}]
<#assign MajorEntityService=srfcaseformat(der.getMajorPSDataEntity().getCodeName(),'l_u2lC')+"Service">
//实体关系[${MinorPSDER.name()}]
if(!ObjectUtils.isEmpty(et.get${MajorKeyFieldCodeName}())){
${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} ${MajorEntityName}=et.get${MajorEntityName?cap_first}();
if(!ObjectUtils.isEmpty(${MajorEntityName})){
<#comment>找出当前关系的外键值文本及附加数据字段</#comment>
<#--<#list de.getPSDEFieldsByDER(MinorPSDER.name) as defield >-->
<#--<#if (((defield.getDataType())!'')!='PICKUP')>-->
<#--<#assign minorFieldCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC')?cap_first >-->
<#--<#assign majorFieldCodeName = srfcaseformat(defield.getRelatedPSDEField().getCodeName(),'l_u2lC')?cap_first >-->
<#--//test-->
<#--et.set${minorFieldCodeName}(${MajorEntityName}.get${majorFieldCodeName}());-->
<#--</#if>-->
<#--</#list>-->
<#list de.getAllPSDEFields() as defield>
<#if defield.getPSDER1N?? && defield.getPSDER1N()?? && defield.getPSDER1N().name==MinorPSDER.name && (((defield.getDataType())!'')!='PICKUP')>
<#assign minorFieldCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC')?cap_first >
<#assign majorFieldCodeName = srfcaseformat(defield.getRelatedPSDEField().getCodeName(),'l_u2lC')?cap_first >
et.set${minorFieldCodeName}(${MajorEntityName}.get${majorFieldCodeName}());
</#if>
</#list>
if(ObjectUtils.isEmpty(${MajorEntityName})){
${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntity.getCodeName()} majorEntity=${MajorEntityService}.get(et.get${MajorKeyFieldCodeName}());
et.set${MajorEntityName?cap_first}(majorEntity);
}
<#comment>找出当前关系的外键值文本及附加数据字段</#comment>
<#list de.getAllPSDEFields() as defield>
<#if defield.getPSDER1N?? && defield.getPSDER1N()?? && defield.getPSDER1N().name==MinorPSDER.name && (((defield.getDataType())!'')!='PICKUP')>
<#assign minorFieldCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC')?cap_first >
<#assign majorFieldCodeName = srfcaseformat(defield.getRelatedPSDEField().getCodeName(),'l_u2lC')?cap_first >
et.set${minorFieldCodeName}(${MajorEntityName}.get${majorFieldCodeName}());
</#if>
</#list>
}
</#if>
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册