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

实体数据导入

上级 fdd3455d
......@@ -12,7 +12,7 @@ public interface ${de.codeName}${item.codeName} {
<#if item.getPSDEDataImportItems?? && item.getPSDEDataImportItems()??>
@Mappings({
<#list de.getPSDEDataImportItems as importItem>
<#list item.getPSDEDataImportItems as importItem>
<#if importItem.getPSDEField()??>
<#assign deFieldName = srfcaseformat(importItem.getPSDEField().getCodeName(),'l_u2lC') >
@Mapping(target = "${deFieldName}",source = "${deFieldName}"),
......
......@@ -96,6 +96,7 @@ import ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?low
import ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.I${de.getCodeName()}Service;
import ${pub.getPKGCodeName()}.util.helper.CachedBeanCopier;
import ${pub.getPKGCodeName()}.util.helper.DEFieldCacheMap;
<#comment>SQL存储-Mybatis</#comment>
<#if de.getStorageMode()==1>
......@@ -2443,7 +2444,7 @@ ${deaction.getRender().code}
/**
* 上传数据检查
* @param entities
* @param mode
* @param isIgnoreError
* @return
*/
private JSONObject testImportData(List<${de.codeName}> entities,boolean isIgnoreError) {
......@@ -2490,17 +2491,18 @@ ${deaction.getRender().code}
<#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()??>
<#assign MajorKeyFieldCodeName =srfcaseformat(MinorPSDER.getPSPickupDEField().codeName,'l_u2lC')?cap_first>
<#assign MajorEntity=MinorPSDER.getMajorPSDataEntity()>
<#assign MajorEntityCodeName=MinorPSDER.getMajorPSDataEntity().codeName>
<#assign MajorEntityService=srfcaseformat(MinorPSDER.getMajorPSDataEntity().getCodeName(),'l_u2lC')+"Service">
//实体关系[${MinorPSDER.name}]
if(!ObjectUtils.isEmpty(et.get${MajorKeyFieldCodeName}())){
${MajorEntityCodeName} fkEntity=${MajorEntityService}.getById(et.get${MajorKeyFieldCodeName}());
if(!ObjectUtils.isEmpty(entity.get${MajorKeyFieldCodeName}())){
${pub.getPKGCodeName()}.core.${MajorEntity.getPSSystemModule().getCodeName()?lower_case}.domain.${MajorEntityCodeName} fkEntity=${MajorEntityService}.getById(entity.get${MajorKeyFieldCodeName}());
if(ObjectUtils.isEmpty(fkEntity)){
Integer lineNum = i + 1;
errorLines.add(lineNum);
errorMsgs.add(String.format("第" + lineNum + "行:[%s]父数据有误。",et.get${MajorKeyFieldCodeName}()));
errorMsgs.add(String.format("第" + lineNum + "行:[%s]父数据有误。",entity.get${MajorKeyFieldCodeName}()));
if(isIgnoreError){
et.set${MajorKeyFieldCodeName}(null);
entity.set${MajorKeyFieldCodeName}(null);
continue;
}
else{
......@@ -2532,7 +2534,7 @@ ${deaction.getRender().code}
* 实体数据导入
* @param entities
* @param batchSize
* @param mode
* @param isIgnoreError
* @return
*/
@Override
......
......@@ -645,7 +645,7 @@ public class ${itemCodeName}Resource {
}
<#else>
else if(config.equals("${deImport.codeName}")){
rs=${deCodeNameLC}Service.importData(${deImport.codeName?lower_case}ImpMapping.toDomain(dtos),${deImport.getBatchSize()},${deImport.isIgnoreError()?c});
rs=${deCodeNameLC}Service.importData(${deImport.codeName?lower_case}ImpMapping.toDomain(dtos),${deImport.getBatchSize()?c},${deImport.isIgnoreError()?c});
}
</#if>
</#list>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册