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

proxyService优化

上级 29f9d373
...@@ -452,7 +452,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -452,7 +452,7 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
if (null == et) { if (null == et) {
return false; return false;
} else { } else {
return checkKey(et) ? proxyService.update(et) : proxyService.create(et); return checkKey(et) ? getProxyService().update(et) : getProxyService().create(et);
} }
} }
...@@ -647,11 +647,11 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -647,11 +647,11 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
_create.add(sub); _create.add(sub);
} }
if(_update.size()>0) if(_update.size()>0)
proxyService.updateBatch(_update); getProxyService().updateBatch(_update);
if(_create.size()>0) if(_create.size()>0)
proxyService.createBatch(_create); getProxyService().createBatch(_create);
if(delIds.size()>0) if(delIds.size()>0)
proxyService.removeBatch(delIds); getProxyService().removeBatch(delIds);
} }
</#if> </#if>
...@@ -1415,11 +1415,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -1415,11 +1415,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
_create.add(sub); _create.add(sub);
} }
if(_update.size()>0) if(_update.size()>0)
proxyService.updateBatch(_update); getProxyService().updateBatch(_update);
if(_create.size()>0) if(_create.size()>0)
proxyService.createBatch(_create); getProxyService().createBatch(_create);
if(delIds.size()>0) if(delIds.size()>0)
proxyService.removeBatch(delIds); getProxyService().removeBatch(delIds);
} }
</#if> </#if>
...@@ -1957,11 +1957,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -1957,11 +1957,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
_create.add(sub); _create.add(sub);
} }
if(_update.size()>0) if(_update.size()>0)
proxyService.updateBatch(_update); getProxyService().updateBatch(_update);
if(_create.size()>0) if(_create.size()>0)
proxyService.createBatch(_create); getProxyService().createBatch(_create);
if(delIds.size()>0) if(delIds.size()>0)
proxyService.removeBatch(delIds); getProxyService().removeBatch(delIds);
} }
</#if> </#if>
...@@ -2282,11 +2282,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2282,11 +2282,11 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
_create.add(sub); _create.add(sub);
} }
if(_update.size()>0) if(_update.size()>0)
proxyService.updateBatch(_update); getProxyService().updateBatch(_update);
if(_create.size()>0) if(_create.size()>0)
proxyService.createBatch(_create); getProxyService().createBatch(_create);
if(delIds.size()>0) if(delIds.size()>0)
proxyService.removeBatch(delIds); getProxyService().removeBatch(delIds);
} }
</#if> </#if>
...@@ -2673,9 +2673,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2673,9 +2673,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#comment>注入代理行为</#comment> <#comment>注入代理行为</#comment>
<#macro autowiredProxyService> <#macro autowiredProxyService>
<#if !P.exists(de.codeName,'proxyService')> <#if !P.exists(de.codeName,'proxyService')>
@Autowired public I${de.getCodeName()}Service getProxyService() {
@Lazy return ${pub.getPKGCodeName()}.util.security.SpringContextHolder.getBean(this.getClass());
I${de.codeName}Service proxyService; }
</#if> </#if>
</#macro> </#macro>
...@@ -2796,7 +2796,7 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2796,7 +2796,7 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
@Transactional @Transactional
public JSONObject importData(List<${de.codeName}> entities, int batchSize ,boolean isIgnoreError) { public JSONObject importData(List<${de.codeName}> entities, int batchSize ,boolean isIgnoreError) {
if(entities.size()>syncImportLimit){ if(entities.size()>syncImportLimit){
proxyService.asyncImportData(entities,batchSize,isIgnoreError); getProxyService().asyncImportData(entities,batchSize,isIgnoreError);
JSONObject rs=new JSONObject(); JSONObject rs=new JSONObject();
rs.put("rst", 0); rs.put("rst", 0);
rs.put("msg",String.format("当前导入数据已超过同步导入数量上限[%s],系统正在进行异步导入,请稍后!",syncImportLimit)); rs.put("msg",String.format("当前导入数据已超过同步导入数量上限[%s],系统正在进行异步导入,请稍后!",syncImportLimit));
...@@ -2872,10 +2872,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2872,10 +2872,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
} }
} }
if(_update.size()>0) { if(_update.size()>0) {
proxyService.updateBatch(_update); getProxyService().updateBatch(_update);
} }
if(_create.size()>0) { if(_create.size()>0) {
proxyService.createBatch(_create); getProxyService().createBatch(_create);
} }
} }
</#if> </#if>
...@@ -3083,10 +3083,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -3083,10 +3083,10 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
} }
} }
if (create.size() > 0) { if (create.size() > 0) {
proxyService.createBatch(create); getProxyService().createBatch(create);
} }
if (update.size() > 0) { if (update.size() > 0) {
proxyService.updateBatch(update); getProxyService().updateBatch(update);
} }
</#macro> </#macro>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册