diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index df169669..a6a81580 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java index 29ae85f6..0b23c848 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java @@ -1149,8 +1149,33 @@ public class CoeCooperationAPIManager { } } if (deleteIds.size() > 0){ - // 删除不在小组权限范围内的数据 - rolePermDao.removeDataByTeamAndPalVersionIds(teamId, roleModel.getId(), deleteIds); + if (deleteIds.size() <= 1000){ // 直接删除 + // 删除不在小组权限范围内的数据 + rolePermDao.removeDataByTeamAndPalVersionIds(teamId, roleModel.getId(), deleteIds); + }else { // 分批次删除 + // 每个小集合的大小 + int batchSize = 1000; + + // 计算需要拆分的次数 + int numBatches = (deleteIds.size() + batchSize - 1) / batchSize; + + // 拆分成多个小集合 + List> batches = new ArrayList<>(); + Iterator iterator = deleteIds.iterator(); + for (int i = 0; i < numBatches; i++) { + Set batch = new HashSet<>(); + for (int j = 0; j < batchSize && iterator.hasNext(); j++) { + batch.add(iterator.next()); + } + batches.add(batch); + } + + // 遍历小集合,进行相应的操作 + for (Set batch : batches) { + // 在这里执行你的操作,例如删除操作 + rolePermDao.removeDataByTeamAndPalVersionIds(teamId, roleModel.getId(), batch); + } + } } } }