package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.FlowBean;
import com.wd.workoffice.util.MathUtils;

import java.util.List;

/**
 * Created by flexible on 2018/8/13.
 */

public class WorkFlowAdapter extends BaseQuickAdapter<FlowBean.RecordsBean, BaseViewHolder> {
    int type;//1 我的-部门账户 2 其他

    public WorkFlowAdapter(int layoutResId, List data,int type) {
        super(layoutResId, data);
        this.type=type;
    }


    @Override
    protected void convert(BaseViewHolder helper, FlowBean.RecordsBean item) {
//        helper.setText(R.id.tv_price,(TextUtils.equals("支出", item.getTypeName()) ? "-" : "+") +  String.valueOf(item.getMoney()));
        helper.setText(R.id.tv_price, MathUtils.converData(item.getMoney(),3));
        helper.setText(R.id.tv_time, item.getCreatedTime());
        helper.setText(R.id.tv_desc, item.getDisplayTypeName());
        if (type==1){
            helper.setText(R.id.tv_dep, item.getFlowAccountDeptName());
        }else {
            helper.setText(R.id.tv_dep, item.getReceiveDeptName());
        }
    }
}

