|
@@ -133,8 +133,11 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
|
|
|
BeanUtils.copyProperties(vo, station);
|
|
BeanUtils.copyProperties(vo, station);
|
|
|
stationList.add(station);
|
|
stationList.add(station);
|
|
|
});
|
|
});
|
|
|
- saveBatch(stationList);
|
|
|
|
|
- equipmentInfoService.saveBatch(equipmentList);
|
|
|
|
|
|
|
+ // 查询已存在的站点,只更新新增的站点和设备
|
|
|
|
|
+ var stations = list().stream().map(Station::getStationId).toList();
|
|
|
|
|
+ var equipments = equipmentInfoService.list().stream().map(EquipmentInfo::getEquipmentId).toList();
|
|
|
|
|
+ saveBatch(stationList.stream().filter(station -> !stations.contains(station.getStationId())).toList());
|
|
|
|
|
+ equipmentInfoService.saveBatch(equipmentList.stream().filter(equipmentInfo -> !equipments.contains(equipmentInfo.getEquipmentId())).toList());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|