- 如果说List集合不为null, 则返回true
// 调用
if (checkStock(order.getOrderItem())) {}
// 如果说List集合不为null, 则返回true
private boolean checkStock(List<OrderItem> orderItems) {
Boolean res = false;
for(OrderItem orderItem : orderItems){
if(orderItem.getRealAmount() != null && orderItem.getOriAmount().compareTo(orderItem.getRealAmount())!=0){
return true;
}
}
return res;
}