Search in sources :

Example 1 with ExportTeamhsExcel

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

the class MoneyService method exportTeamhsExcel.

/**
 ***********************   导出团队回水表Excel   ***********************************
 */
public static void exportTeamhsExcel() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
    String title = "回水表" + sdf.format(new Date());
    log.info("导出团队回水表Excel:" + title);
    String[] rowsName = new String[] { "团队ID", "团队名字", "比例", "保险比例", "股东", "战绩是否代管理", "备注", "回水比例", "回保比例", "服务费判定" };
    List<Object[]> dataList = new ArrayList<Object[]>();
    Object[] objs = null;
    Map<String, Huishui> huishuiMap = DataConstans.huishuiMap;
    String teamId;
    Huishui hs;
    for (Map.Entry<String, Huishui> entry : huishuiMap.entrySet()) {
        teamId = entry.getKey();
        hs = entry.getValue();
        objs = new Object[rowsName.length];
        objs[0] = teamId;
        objs[1] = hs.getTeamName();
        objs[2] = NumUtil.getPercentStr(NumUtil.getNum(NumUtil.digit4(hs.getHuishuiRate())));
        objs[3] = NumUtil.getPercentStr(NumUtil.getNum(NumUtil.digit4(hs.getInsuranceRate())));
        objs[4] = hs.getGudong();
        objs[5] = hs.getZjManaged();
        // "回水比例","回保比例","服务费判定","服务费判定"
        objs[6] = hs.getBeizhu();
        objs[7] = hs.getProxyHSRate();
        objs[8] = hs.getProxyHBRate();
        objs[9] = hs.getProxyFWF();
        dataList.add(objs);
    }
    String out = "D:/" + title;
    ExportTeamhsExcel ex = new ExportTeamhsExcel(title, rowsName, dataList, out);
    try {
        ex.export();
        log.debug("导出回水表Excel成功");
    } catch (Exception e) {
        ErrorUtil.err("导出回水表Excel失败", e);
    }
}
Also used : Huishui(com.kendy.entity.Huishui) ArrayList(java.util.ArrayList) Date(java.util.Date) SimpleDateFormat(java.text.SimpleDateFormat) Map(java.util.Map) HashMap(java.util.HashMap) ExportTeamhsExcel(com.kendy.excel.ExportTeamhsExcel)

Aggregations

Huishui (com.kendy.entity.Huishui)1 ExportTeamhsExcel (com.kendy.excel.ExportTeamhsExcel)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1