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

proxyService优化

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