Commit 6b830472 by fudahua

企业绑定门店

parent baccac7b
......@@ -131,11 +131,30 @@ public class StoreRangeServiceImpl implements StoreRangeService {
staffClerkRelationService.delBindByStoreIds(null, needUnBindStoreIds, optStaffId, channelCode);
//先删除 后新增
tabHaobanStoreRelationMapper.deleteAllStoreRalation(enterpriseId);
tabHaobanStoreRelationMapper.insertBatch(list);
//批量插入
insertStoreRelationBatch(list);
return true;
}
/**
* 批量插入
*
* @param storeRelations
*/
private void insertStoreRelationBatch(List<TabStoreRelation> storeRelations) {
int batchSize = 500;
int sumSize = storeRelations.size();
int count = (sumSize + 1) / batchSize;
for (int i = 0; i < count; i++) {
int from = i * batchSize;
int subSize = sumSize - from;
int to = (subSize > batchSize) ? from + batchSize : from + subSize;
List<TabStoreRelation> relations = storeRelations.subList(from, to);
tabHaobanStoreRelationMapper.insertBatch(relations);
}
}
/**
* 获取企业下的老的绑定门店
*
* @param enterpriseId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment