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

索引实体

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