Search in sources :

Example 1 with ExportQuotaPayExcel

use of com.kendy.excel.ExportQuotaPayExcel in project financial by greatkendy123.

the class QuotaController method exportClubPayExcel.

/**
 ********************************************************************************
 *
 *                                     导出Excel
 *
 **********************************************************************************
 */
public void exportClubPayExcel(ActionEvent event) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
    // 标题
    String title = currentLMLabels.getText() + "俱乐部结账单-" + sdf.format(new Date());
    // 列名
    String[] rowName = new String[] { "付款方", "收款方", "转账", "支付类型", "联系人", "手机", "银行卡信息" };
    ;
    // 输出
    String out = "D:/" + title + System.currentTimeMillis();
    // 数据
    ObservableList<QuotaMoneyInfo> obList = tableQuotaPay.getItems();
    if (CollectUtil.isNullOrEmpty(obList)) {
        ShowUtil.show("没有需要导出的数据!");
        return;
    }
    List<Object[]> dataList = new ArrayList<Object[]>();
    Object[] objs = null;
    String clubId = "";
    for (QuotaMoneyInfo info : obList) {
        ClubBankModel model = allClubBankModels.get(info.getQuotaMoneyClubId());
        objs = new Object[rowName.length];
        objs[0] = info.getQuotaMoneyPaytor();
        objs[1] = info.getQuotaMoneyGather();
        objs[2] = "转" + info.getQuotaMoney() + "到";
        objs[3] = model.getMobilePayType();
        objs[4] = model.getPersonName();
        objs[5] = model.getPhoneNumber();
        objs[6] = model.getBankAccountInfo();
        dataList.add(objs);
    }
    ExportQuotaPayExcel excel = new ExportQuotaPayExcel(title, rowName, dataList, out);
    try {
        excel.export();
        log.info("导出单个联盟俱乐部结账单完成!");
    } catch (Exception e) {
        ErrorUtil.err("导出单个联盟俱乐部结账单失败", e);
    }
}
Also used : ExportQuotaPayExcel(com.kendy.excel.ExportQuotaPayExcel) QuotaMoneyInfo(com.kendy.entity.QuotaMoneyInfo) ArrayList(java.util.ArrayList) Date(java.util.Date) ClubBankModel(com.kendy.entity.ClubBankModel) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

ClubBankModel (com.kendy.entity.ClubBankModel)1 QuotaMoneyInfo (com.kendy.entity.QuotaMoneyInfo)1 ExportQuotaPayExcel (com.kendy.excel.ExportQuotaPayExcel)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1