|
|
|
@ -120,6 +120,15 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceMapper, Device> imp |
|
|
|
newSave.forEach(maintenance -> maintenance.setDeviceId(device.getId())); |
|
|
|
newSave.forEach(maintenance -> maintenance.setDeviceId(device.getId())); |
|
|
|
maintenanceService.saveBatch(newSave); |
|
|
|
maintenanceService.saveBatch(newSave); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 需要更新的巡检
|
|
|
|
|
|
|
|
List<DeviceMaintenance> toUpdate = maintenances.stream() |
|
|
|
|
|
|
|
.filter(maintenance -> maintenance.getId() != null && !newSave.contains(maintenance)) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量更新需要更新的巡检
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(toUpdate)) { |
|
|
|
|
|
|
|
maintenanceService.updateBatchById(toUpdate); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return this.updateById(device); |
|
|
|
return this.updateById(device); |
|
|
|
} |
|
|
|
} |
|
|
|
|