import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.stream.Collectors; import java.util.stream.Stream; ListorderAppointmentSales = obcOrderAppointmentSalesService.getOrderAppointmentSalesList(syncTime); List orderAppointmentSales2 = obcOrderAppointmentSalesService.getOrderAppointmentSalesListByTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS").format(sas.getUpdateTime())); //将数据list对象合并去重 使用Stream来帮我们完成操作 List ords = Stream.of(orderAppointmentSales, orderAppointmentSales2) .flatMap(Collection::stream) .distinct() .collect(Collectors.toList());



