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

数据导入外键值检查

上级 553a1ec4
......@@ -2827,10 +2827,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
}
}
}
<#if sys.codeName='Sample'>
<#if sys.codeName='Sample' && MinorPSDER.getPSPickupTextDEField?? && MinorPSDER.getPSPickupTextDEField()??>
<#comment>通过外键值文本填充外键值</#comment>
<#assign foreignkeyId = MajorKeyFieldCodeName>
<#assign foreignkeyField = MajorEntity.getMajorPSDEField()>
<#assign foreignkeyField = MinorPSDER.getPSPickupTextDEField()>
<#assign foreignkeyName = srfcaseformat(foreignkeyField.getCodeName(),'l_u2lC')?cap_first>
<#assign importTag=foreignkeyField.getCodeName()>
<#if ((foreignkeyField.getImportTag())!'')!=''>
......@@ -2839,7 +2839,7 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#assign importTag=foreignkeyField.getLogicName()>
</#if>
if(ObjectUtils.isEmpty(entity.get${foreignkeyId}()) && !ObjectUtils.isEmpty(entity.get${foreignkeyName}())){
QueryWrapper<${MajorEntity.getCodeName()}> ${MinorPSDER.codeName?lower_case}Wrapper = new QueryWrapper<>();
QueryWrapper<${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntityCodeName}> ${MinorPSDER.codeName?lower_case}Wrapper = new QueryWrapper<>();
${MinorPSDER.codeName?lower_case}Wrapper.eq("${foreignkeyField.name?lower_case}",entity.get${foreignkeyName}());
${MajorEntity.getCodeName()} ${MinorPSDER.codeName?lower_case}Entity = ${MajorEntityService}.getOne(${MinorPSDER.codeName?lower_case}Wrapper,false);
if(${MinorPSDER.codeName?lower_case}Entity == null){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册