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

索引实体

上级 88a123d3
...@@ -4,13 +4,23 @@ TARGET=PSDATAENTITY ...@@ -4,13 +4,23 @@ TARGET=PSDATAENTITY
<#comment>索引从实体</#comment> <#comment>索引从实体</#comment>
<#assign isIndexSubDE=false> <#assign isIndexSubDE=false>
<#if de.getMinorPSDERs()??> <#if de.getMinorPSDERs()??>
<#list de.getMinorPSDERs() as MinorPSDER> <#comment>判断当前实体是否为索引子实体</#comment>
<#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX"> <#assign isIndexSubDE=false>
<#assign isIndexSubDE=true> <#if de.getMinorPSDERs()??>
<#assign indexPSDER=MinorPSDER> <#list de.getMinorPSDERs() as MinorPSDER>
<#break> <#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX">
</#if> <#comment>索引主实体是否建立分组属性</#comment>
</#list> <#if MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getMajorPSDataEntity().getIndexTypePSDEField()??>
<#assign isIndexSubDE=true>
<#assign indexPSDER=MinorPSDER>
<#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()>
<#assign majorIndexDECodeName=indexPSDER.getMajorPSDataEntity().codeName>
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first>
<#break>
</#if>
</#if>
</#list>
</#if>
<#if isIndexSubDE && indexPSDER??> <#if isIndexSubDE && indexPSDER??>
<#comment>索引主实体</#comment> <#comment>索引主实体</#comment>
......
...@@ -28,12 +28,15 @@ TARGET=PSDATAENTITY ...@@ -28,12 +28,15 @@ TARGET=PSDATAENTITY
<#if de.getMinorPSDERs()??> <#if de.getMinorPSDERs()??>
<#list de.getMinorPSDERs() as MinorPSDER> <#list de.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX"> <#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX">
<#assign isIndexSubDE=true> <#comment>索引主实体是否建立分组属性</#comment>
<#assign indexPSDER=MinorPSDER> <#if MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getMajorPSDataEntity().getIndexTypePSDEField()??>
<#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()> <#assign isIndexSubDE=true>
<#assign majorIndexDECodeName=indexPSDER.getMajorPSDataEntity().codeName> <#assign indexPSDER=MinorPSDER>
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first> <#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()>
<#break> <#assign majorIndexDECodeName=indexPSDER.getMajorPSDataEntity().codeName>
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first>
<#break>
</#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -624,15 +627,11 @@ ${deaction.getRender().code} ...@@ -624,15 +627,11 @@ ${deaction.getRender().code}
* @param et * @param et
*/ */
private void createIndexMajorEntityData(${de.codeName} et){ private void createIndexMajorEntityData(${de.codeName} et){
<#if majorIndexDE.getIndexTypePSDEField()??>
if(ObjectUtils.isEmpty(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}())) if(ObjectUtils.isEmpty(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()))
et.set${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}((${srfjavatype(keyfield.stdDataType)})et.getDefaultKey(true)); et.set${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}((${srfjavatype(keyfield.stdDataType)})et.getDefaultKey(true));
${pub.getPKGCodeName()}.core.${majorIndexDE.getPSSystemModule().getCodeName()?lower_case}.domain.${majorIndexDECodeName} ${majorIndexDECodeName?lower_case} =${de.codeName?lower_case}InheritMapping.to${majorIndexDECodeNameCamel}(et); ${pub.getPKGCodeName()}.core.${majorIndexDE.getPSSystemModule().getCodeName()?lower_case}.domain.${majorIndexDECodeName} ${majorIndexDECodeName?lower_case} =${de.codeName?lower_case}InheritMapping.to${majorIndexDECodeNameCamel}(et);
${majorIndexDECodeName?lower_case}.set("${majorIndexDE.getIndexTypePSDEField().codeName?lower_case}","${indexPSDER.getTypeValue()}"); ${majorIndexDECodeName?lower_case}.set("${majorIndexDE.getIndexTypePSDEField().codeName?lower_case}","${indexPSDER.getTypeValue()}");
${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.create(${majorIndexDECodeName?lower_case}); ${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.create(${majorIndexDECodeName?lower_case});
<#else>
throw new ${pub.getPKGCodeName()}.util.errors.BadRequestAlertException("实体[${de.getLogicName()}]未配置分组属性","${de.codeName}","createIndexMajorEntityData");
</#if>
} }
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册