refactor(WmsAttendanceScheduleService): 优化批量插入逻辑

- 将循环单条插入改为批量插入方法
- 添加批量插入失败异常处理
- 提升批量插入性能和错误处理能力
This commit is contained in:
2026-05-12 15:23:47 +08:00
parent a314e05e4d
commit d833bbd7fb

View File

@@ -292,8 +292,9 @@ public class WmsAttendanceScheduleServiceImpl implements IWmsAttendanceScheduleS
// 批量插入 // 批量插入
if (!schedules.isEmpty()) { if (!schedules.isEmpty()) {
for (WmsAttendanceSchedule schedule : schedules) { boolean i = baseMapper.insertBatch(schedules);
baseMapper.insert(schedule); if (!i) {
throw new RuntimeException("批量插入倒班排班失败");
} }
} }
} }