refactor(WmsAttendanceScheduleService): 优化批量插入逻辑
- 将循环单条插入改为批量插入方法 - 添加批量插入失败异常处理 - 提升批量插入性能和错误处理能力
This commit is contained in:
@@ -292,8 +292,9 @@ public class WmsAttendanceScheduleServiceImpl implements IWmsAttendanceScheduleS
|
||||
|
||||
// 批量插入
|
||||
if (!schedules.isEmpty()) {
|
||||
for (WmsAttendanceSchedule schedule : schedules) {
|
||||
baseMapper.insert(schedule);
|
||||
boolean i = baseMapper.insertBatch(schedules);
|
||||
if (!i) {
|
||||
throw new RuntimeException("批量插入倒班排班失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user