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

copyTo格式化

上级 5c20fa60
......@@ -353,7 +353,6 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable {
return IdWorker.getId();
}
</#if>
<#comment>判断是否有拷贝重置属性</#comment>
<#if de.getPSDEFields()??>
<#comment>输出实体属性</#comment>
......@@ -364,8 +363,13 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable {
</#if>
</#list>
</#if>
<#if hasResetField>
/**
* 复制当前对象数据到目标对象
* @param targetEntity
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity) {
<#list de.getPSDEFields() as defield>
......@@ -729,7 +733,34 @@ public class ${item.getCodeName()} extends EntityClient implements Serializable
</#if>
</#if>
</#list>
<#comment>判断是否有拷贝重置属性</#comment>
<#if de.getPSDEFields()??>
<#comment>输出实体属性</#comment>
<#list de.getPSDEFields() as defield>
<#if defield.isPasteReset()==true>
<#assign hasResetField=true>
<#break>
</#if>
</#list>
</#if>
<#if hasResetField>
/**
* 复制当前对象数据到目标对象
* @param targetEntity
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity) {
<#list de.getPSDEFields() as defield>
<#if defield.isPasteReset()==true>
<#assign columnname = defield.getName()?lower_case>
this.reset("${columnname}");
</#if>
</#list>
return super.copyTo(targetEntity);
}
</#if>
</#if>
}
......
......@@ -2665,12 +2665,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
@Transactional
public JSONObject executeImportData(List<${de.codeName}> entities, int batchSize ,boolean isIgnoreError) {
JSONObject rs=testImportData(entities,isIgnoreError);
if(rs.getInteger("rst")==1 && !isIgnoreError)
return rs;
String keyField= DEFieldCacheMap.getDEKeyField(${de.codeName}.class);
List<${de.codeName}> tempDEList=new ArrayList<>();
Set tempIds=new HashSet<>();
......@@ -2698,8 +2695,6 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
*/
@Transactional
public void commit(List<${de.codeName}> entities, Set ids){
String keyField= DEFieldCacheMap.getDEKeyField(${de.codeName}.class);
List<${de.codeName}> _create=new ArrayList<>();
List<${de.codeName}> _update=new ArrayList<>();
Set oldIds=new HashSet<>();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册