private void getSeatRegionInfo(RopLocalplayOrderResponse response,OrderBaseVo vstOrder){
if(vstOrder.getShowTicketBaseInfoVo().getOnlineSelection()!=null){
if("Y".equals(vstOrder.getShowTicketBaseInfoVo().getOnlineSelection())){
List<OrderItemBaseVo> itemList = vstOrder.getOrderItemList();
List<String> seatRegionInfo = new ArrayList<>();
if(vstOrder.getOrderItemList()!=null){
for(OrderItemBaseVo list:itemList){
String seats = list.getShowTicketSeats();
String[] arrStr = seats.split(","); //字符串分割转数组
seatRegionInfo.addAll(Arrays.asList(arrStr)); //Arrays.asList把数组转list,addAll 方法把list 添加到另一个 list
}
}
response.setOnlineSelection("Y");
response.setShowTicketSeatsRegionInfo(seatRegionInfo);
}else{
response.setOnlineSelection("N");
}
} else {
logger.error("主站未能返回是否支持在线选座字段");
}
}
字符串分割转数组——>数组转 list ——>把 list 添加到另一个 list(list.addAll 方法)