From 77fab501e7db456a5b176902c7d2d727c09b7a9c Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 23 三月 2026 15:36:01 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
---
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
index d8f78b6..a642d24 100644
--- a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
+++ b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
@@ -53,6 +53,7 @@
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
/**
* <p>
@@ -489,8 +490,14 @@
}
}
//批量保存排班明细数据
- if (!schedulingDetails.isEmpty()) {
- this.saveOrUpdateBatch(schedulingDetails);
+
+ //找出需要删除的数据
+ Set<Long> collect = schedulingDetails.stream().filter(s -> s.getId() != null).collect(Collectors.toList()).stream().map(XpSchedulingDetail::getId).collect(Collectors.toSet());
+ List<XpSchedulingDetail> collect1 = list.stream().filter(s -> !collect.contains(s.getId())).collect(Collectors.toList());
+ collect1.forEach(s -> s.setDeleted(true));
+ collect1.addAll(schedulingDetails);
+ if (!collect1.isEmpty()) {
+ this.saveOrUpdateBatch(collect1);
}
//异步处理消息通知数据
pushMessage(pushMessage, notifications);
--
Gitblit v1.7.1