From 81208354b4504bf041f638b5ded55d13e264aee5 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 13 Mar 2024 17:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=A1=B9=E6=9B=B4=E6=96=B0=E5=A4=B1=E8=B4=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/service/impl/CarCheckRecordServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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);