提交 3b1ada61 编写于 作者: ibiz4j's avatar ibiz4j

修改dm

上级 447b5d98
......@@ -244,16 +244,20 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
});
});
int batchsize=500;
if ("dameng".equals(dstype)||"dm".equals(dstype)) {
List<List<EntityObj>> splist=LiteDataService.splitList(list, 100);
batchsize=100;
}
if(list.size()>batchsize)
{
List<List<EntityObj>> splist=LiteDataService.splitList(list, batchsize);
splist.forEach(array->{
baseMapper.saveBatchDm(entityModel, array);
baseMapper.saveBatch(entityModel, array);
});
}
else
{
baseMapper.saveBatch(entityModel, list);
}
return true;
......
......@@ -57,23 +57,15 @@ public class LiteDataService {
}
public boolean saveBatch(EntityModel entityModel, String dsName, List<EntityObj> list) {
List<List<EntityObj>> splist=splitList(list, 500);
for(List<EntityObj> objs:splist)
{
if(!getEntityService(StringUtils.isEmpty(dsName)?entityModel.getDsName():dsName).saveBatch(dsName,entityModel,objs))
return false;
}
if(!getEntityService(StringUtils.isEmpty(dsName)?entityModel.getDsName():dsName).saveBatch(dsName,entityModel,list))
return false;
return true;
}
public boolean saveBatch(String systemId, String entityName, String dsName, List<EntityObj> list) {
EntityModel entityModel = liteModelService.getEntityModel(systemId,entityName);
List<List<EntityObj>> splist=splitList(list, 500);
for(List<EntityObj> objs:splist)
{
if(!getEntityService(StringUtils.isEmpty(dsName)?entityModel.getDsName():dsName).saveBatch(dsName,entityModel,objs))
return false;
}
if(!getEntityService(StringUtils.isEmpty(dsName)?entityModel.getDsName():dsName).saveBatch(dsName,entityModel,list))
return false;
return true;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册