|
|
@@ -135,11 +135,14 @@ public class IsSopServiceImpl extends ServiceImpl<IsSopMapper, IsSop> implements
|
|
|
// 2.开始检查隔离点有没有变更
|
|
|
Long[] pointIds = Convert.toLongArray(dto.getPointIds());
|
|
|
List<IsSopPoints> isSopPoints = iIsSopPointsService.list(Wrappers.<IsSopPoints>lambdaQuery()
|
|
|
- .eq(IsSopPoints::getSopId, dto.getSopId())
|
|
|
- .in(IsSopPoints::getPointId, pointIds));
|
|
|
+ .eq(IsSopPoints::getSopId, dto.getSopId()));
|
|
|
// 2.1如果查出来变更了,开始执行删除,重新增加一轮
|
|
|
if (pointIds.length != isSopPoints.size()) {
|
|
|
- iIsSopPointsService.remove(Wrappers.<IsSopPoints>lambdaQuery().eq(IsSopPoints::getSopId, dto.getSopId()));
|
|
|
+ Set<Long> recordIds = isSopPoints.stream().map(IsSopPoints::getRecordId).collect(Collectors.toSet());
|
|
|
+ if (!recordIds.isEmpty()) {
|
|
|
+ String rids = StringUtils.join(recordIds.toArray(), ",");
|
|
|
+ iIsSopPointsService.deleteIsSopPointsByRecordIds(rids);
|
|
|
+ }
|
|
|
// TODO 批量新增
|
|
|
for (Long pointId : pointIds) {
|
|
|
IsSopPoints newSopPoints = new IsSopPoints();
|