import java.time.format.DateTimeFormatter;
import java.util.Collection;
import java.util.stream.Collectors;
import java.util.stream.Stream;
List<OrderAppointmentSales> orderAppointmentSales = obcOrderAppointmentSalesService.getOrderAppointmentSalesList(syncTime);
List<OrderAppointmentSales> orderAppointmentSales2 = obcOrderAppointmentSalesService.getOrderAppointmentSalesListByTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS").format(sas.getUpdateTime()));
//将数据list对象合并去重 使用Stream来帮我们完成操作
List<OrderAppointmentSales> ords = Stream.of(orderAppointmentSales, orderAppointmentSales2)
.flatMap(Collection::stream)
.distinct()
.collect(Collectors.toList());
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/278874.html