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

实体数据导入

上级 141e2f41
...@@ -2486,7 +2486,6 @@ ${deaction.getRender().code} ...@@ -2486,7 +2486,6 @@ ${deaction.getRender().code}
} }
} }
<#if de.getMajorPSDER1Ns?? && de.getMajorPSDER1Ns()??> <#if de.getMajorPSDER1Ns?? && de.getMajorPSDER1Ns()??>
//外键约束检查
<#list de.getMinorPSDERs() as MinorPSDER> <#list de.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER?? && MinorPSDER.getDERType()=='DER1N' && (MinorPSDER.getMajorPSDataEntity().getStorageMode()==1||MinorPSDER.getMajorPSDataEntity().getStorageMode()==2||MinorPSDER.getMajorPSDataEntity().getStorageMode()==4)> <#if MinorPSDER?? && MinorPSDER.getDERType()=='DER1N' && (MinorPSDER.getMajorPSDataEntity().getStorageMode()==1||MinorPSDER.getMajorPSDataEntity().getStorageMode()==2||MinorPSDER.getMajorPSDataEntity().getStorageMode()==4)>
<#if MinorPSDER.getMajorPSDataEntity?? && MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getCodeName?? && MinorPSDER.getCodeName()??> <#if MinorPSDER.getMajorPSDataEntity?? && MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getCodeName?? && MinorPSDER.getCodeName()??>
...@@ -2546,15 +2545,15 @@ ${deaction.getRender().code} ...@@ -2546,15 +2545,15 @@ ${deaction.getRender().code}
return rs; return rs;
String keyField= DEFieldCacheMap.getDEKeyField(${de.codeName}.class); String keyField= DEFieldCacheMap.getDEKeyField(${de.codeName}.class);
List<${de.codeName}> tempDEList=new ArrayList<>(); List<${de.codeName}> tempDEList=new ArrayList<>();
Set tempIds=new HashSet<>();//主键 Set tempIds=new HashSet<>();
for(int i=0;i<entities.size();i++) { for(int i=0;i<entities.size();i++) {
${de.codeName} entity = entities.get(i); ${de.codeName} entity = entities.get(i);
tempDEList.add(entity); tempDEList.add(entity);
tempIds.add(entity.get(keyField)); Object id=entity.get(keyField);
//分批次提交 if(!ObjectUtils.isEmpty(id))
tempIds.add(id);
if(tempDEList.size()>=batchSize || (tempDEList.size()<batchSize && i==entities.size()-1)){ if(tempDEList.size()>=batchSize || (tempDEList.size()<batchSize && i==entities.size()-1)){
commit(tempDEList,tempIds); commit(tempDEList,tempIds);
tempDEList.clear(); tempDEList.clear();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册