提交 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>
<#assign isIndexSubDE=false>
<#if de.getMinorPSDERs()??>
<#list de.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX"> <#if MinorPSDER.getDERType()?? && MinorPSDER.getDERType()=="DERINDEX">
<#comment>索引主实体是否建立分组属性</#comment>
<#if MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getMajorPSDataEntity().getIndexTypePSDEField()??>
<#assign isIndexSubDE=true> <#assign isIndexSubDE=true>
<#assign indexPSDER=MinorPSDER> <#assign indexPSDER=MinorPSDER>
<#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()>
<#assign majorIndexDECodeName=indexPSDER.getMajorPSDataEntity().codeName>
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first>
<#break> <#break>
</#if> </#if>
</#list> </#if>
</#list>
</#if>
<#if isIndexSubDE && indexPSDER??> <#if isIndexSubDE && indexPSDER??>
<#comment>索引主实体</#comment> <#comment>索引主实体</#comment>
......
...@@ -28,6 +28,8 @@ TARGET=PSDATAENTITY ...@@ -28,6 +28,8 @@ 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">
<#comment>索引主实体是否建立分组属性</#comment>
<#if MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getMajorPSDataEntity().getIndexTypePSDEField()??>
<#assign isIndexSubDE=true> <#assign isIndexSubDE=true>
<#assign indexPSDER=MinorPSDER> <#assign indexPSDER=MinorPSDER>
<#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()> <#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()>
...@@ -35,6 +37,7 @@ TARGET=PSDATAENTITY ...@@ -35,6 +37,7 @@ TARGET=PSDATAENTITY
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first> <#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first>
<#break> <#break>
</#if> </#if>
</#if>
</#list> </#list>
</#if> </#if>
package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl; package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl;
...@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册