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

优化saveBatch,解决save时et存在id无法填充createdate的问题。

上级 f7d1a3da
...@@ -67,6 +67,9 @@ TARGET=PSDATAENTITY ...@@ -67,6 +67,9 @@ TARGET=PSDATAENTITY
</#list> </#list>
</#if> </#if>
<#assign isDupCheck=isDupCheckEntity(de)> <#assign isDupCheck=isDupCheckEntity(de)>
<#assign keyfield=de.getKeyPSDEField()>
<#assign keyfieldPrivateCodeName = srfcaseformat(keyfield.getCodeName(),'l_u2lC') >
<#assign keyfieldPublicCodeName = keyfieldPrivateCodeName?cap_first >
package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl; package ${pub.getPKGCodeName()}.core.${item.getPSSystemModule().getCodeName()?lower_case}.service.impl;
import java.io.Serializable; import java.io.Serializable;
...@@ -122,10 +125,6 @@ import org.springframework.util.StringUtils; ...@@ -122,10 +125,6 @@ import org.springframework.util.StringUtils;
@Service("${item.getCodeName()}ServiceImpl") @Service("${item.getCodeName()}ServiceImpl")
public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeName()}Mapper, ${de.getCodeName()}> implements I${de.getCodeName()}Service { public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeName()}Mapper, ${de.getCodeName()}> implements I${de.getCodeName()}Service {
<#assign keyfield=de.getKeyPSDEField()>
<#assign keyfieldPrivateCodeName = srfcaseformat(keyfield.getCodeName(),'l_u2lC') >
<#assign keyfieldPublicCodeName = keyfieldPrivateCodeName?cap_first >
<#comment>引入关联依赖-从关系</#comment> <#comment>引入关联依赖-从关系</#comment>
<#if de.getMajorPSDERs()??> <#if de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as der> <#list de.getMajorPSDERs() as der>
...@@ -3077,7 +3076,7 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -3077,7 +3076,7 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
List<${item.getCodeName()}> create = new ArrayList<>(); List<${item.getCodeName()}> create = new ArrayList<>();
List<${item.getCodeName()}> update = new ArrayList<>(); List<${item.getCodeName()}> update = new ArrayList<>();
for (${item.getCodeName()} et : list) { for (${item.getCodeName()} et : list) {
if (ObjectUtils.isEmpty(et.getId()) || ObjectUtils.isEmpty(getById(et.getId()))) { if (ObjectUtils.isEmpty(et.get${keyfieldPublicCodeName}()) || ObjectUtils.isEmpty(getById(et.get${keyfieldPublicCodeName}()))) {
create.add(et); create.add(et);
} else { } else {
update.add(et); update.add(et);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册