package com.rehome.meetingbook.utils;



import com.rehome.meetingbook.bean.ContactListBean;

import java.util.ArrayList;
import java.util.List;
/**
 * Create By HuangWenFei
 * 创建日期：2022-12-08 15:38
 * 描述：
 */
public class ContactDatas {

    public static List<ContactListBean.RowsBean.OrderlistBean> getContanctList(ContactListBean bean) {

        List<ContactListBean.RowsBean.OrderlistBean> orderlistBeanListEnd = new ArrayList<>();

        List<ContactListBean.RowsBean> rowsBeanList = bean.getRows();

        for (int i = 0; i < rowsBeanList.size(); i++) {

            ContactListBean.RowsBean rowsBean = rowsBeanList.get(i);

            if (rowsBean.getOrderlist() != null) {

                List<ContactListBean.RowsBean.OrderlistBean> orderlistBeanList = rowsBean.getOrderlist();

                if (orderlistBeanList.size() != 0) {

                    orderlistBeanListEnd.add(new ContactListBean.RowsBean.OrderlistBean("", "", "", rowsBean.getDeptName(),"",""));

                    for (ContactListBean.RowsBean.OrderlistBean orderlistBean : orderlistBeanList) {

                        orderlistBean.setGroupName(rowsBean.getDeptName());

                    }

                    orderlistBeanListEnd.addAll(orderlistBeanList);
                }
            }
        }
        return orderlistBeanListEnd;
    }

}