diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java index 12819bf..6c55284 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java @@ -162,11 +162,17 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckRecordDTO.getItemList(); - boolean updateItem = carCheckItemService.updateBatchById(itemList); - // 若更新检查项成功,则更新车检记录 - if (updateItem) { + itemList.forEach(x -> {x.setCarCheckRecordId(carCheckRecordDTO.getId()); + x.setId(null);}); + boolean b = carCheckItemService.saveBatch(itemList); + if (b) { + // 若更新检查项成功,则更新车检记录 CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity(); BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity); return this.updateById(carCheckRecordEntity);