//两个list匹配设置值 给list1设置
List list1 = new ArrayList<>();
OrderAppListVo orderAppListVo1 = new OrderAppListVo();
orderAppListVo1.setOrderNo(“123”);
orderAppListVo1.setOrderStatus(1);
OrderAppListVo orderAppListVo2 = new OrderAppListVo();
orderAppListVo2.setOrderNo(“456”);
orderAppListVo2.setOrderStatus(2);
OrderAppListVo orderAppListVo3 = new OrderAppListVo();
orderAppListVo3.setOrderNo(“789”);
orderAppListVo3.setOrderStatus(3);
list1.add(orderAppListVo3);
list1.add(orderAppListVo2);
list1.add(orderAppListVo1);
List<com.tms.ltc.entity.Order> list2 = new ArrayList<>();
com.tms.ltc.entity.Order order1 = new com.tms.ltc.entity.Order();
order1.setOrderNo(“123”);
order1.setPayType(1);
com.tms.ltc.entity.Order order2 = new com.tms.ltc.entity.Order();
order2.setOrderNo(“456”);
com.tms.ltc.entity.Order order3 = new com.tms.ltc.entity.Order();
order3.setOrderNo(“789”);
order3.setPayType(0);
list2.add(order3);
list2.add(order2);
list2.add(order1);
list1= list1.stream().map(o-> list2.stream().filter(c-> o.getOrderNo().equals(c.getOrderNo())).findFirst()
.map(c->{
o.setPayType(c.getPayType());
return o;
}).orElse(o)).collect(Collectors.toList());
System.out.println(list1.toString());