From 4259afc4e876eca0dcd86b10aaede351aaf5c1fd Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sat, 29 Mar 2025 10:29:25 +0800 Subject: [PATCH] this is 3.29 update --- .../controller/good/AppointmentDateController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java b/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java index cde9bbb..3e7b380 100644 --- a/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java +++ b/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java @@ -103,7 +103,14 @@ public class AppointmentDateController { // 删除服务类商品待处理记录 QueryWrapper goodQueryWrapper = new QueryWrapper<>(); goodQueryWrapper.eq("appointmentDateId", id); - boolean result = pendingServiceGoodService.remove(goodQueryWrapper); + List pendingServiceGoodList = pendingServiceGoodService.list(goodQueryWrapper); + List pendingServiceOrderList = pendingServiceOrderService.list(); + Map map = new HashMap<>(); + for (PendingServiceOrder pendingServiceOrder : pendingServiceOrderList) { + map.put(pendingServiceOrder.getPendingId(), 1); + } + pendingServiceGoodList = pendingServiceGoodList.stream().filter(pendingServiceGood -> map.get(pendingServiceGood.getId()) == null).toList(); + boolean result = pendingServiceGoodService.removeBatchByIds(pendingServiceGoodList); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "服务类商品待处理记录删除失败"); return ResultUtils.success(true);