Search in sources :

Example 6 with TGKaixiaoInfo

use of com.kendy.entity.TGKaixiaoInfo in project financial by greatkendy123.

the class TGExportExcelService method getKaixiaoExcelModel.

/**
 * 开销ExcelModel
 * @time 2018年3月18日
 * @return
 */
private TGExcelModel getKaixiaoExcelModel() {
    TGExcelModel excelModel = new TGExcelModel();
    List<String> titleList = new LinkedList<>();
    List<Object[]> data = new LinkedList<>();
    List<String> titleSumList = new LinkedList<>();
    List<Object[]> dataSum = new LinkedList<>();
    titleList = new LinkedList<>(Arrays.asList("日期", "玩家名称", "支出项目", "开销金额", "托管公司"));
    ObservableList<TGKaixiaoInfo> items = tgController.tableTGKaixiao.getItems();
    if (CollectUtil.isHaveValue(items)) {
        data = items.stream().map(info -> {
            Object[] obj = new Object[5];
            obj[0] = info.getTgKaixiaoDate();
            obj[1] = info.getTgKaixiaoPlayerName();
            obj[2] = info.getTgKaixiaoPayItem();
            obj[3] = info.getTgKaixiaoMoney();
            obj[4] = info.getTgKaixiaoCompany();
            return obj;
        }).collect(Collectors.toList());
    }
    ObservableList<String> sumItems = tgController.tgKaixiaoSumView.getItems();
    if (CollectUtil.isHaveValue(sumItems)) {
        dataSum = sumItems.stream().map(info -> {
            Object[] obj = new Object[2];
            obj[0] = info.split(":")[0];
            obj[1] = info.split(":")[1];
            return obj;
        }).collect(Collectors.toList());
    }
    excelModel.setColumnList(titleList);
    excelModel.setData(data);
    excelModel.setColumnSumList(titleSumList);
    excelModel.setDataSum(dataSum);
    excelModel.setSheetName("开销");
    return excelModel;
}
Also used : TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) TGExcelModel(com.kendy.entity.TGExcelModel) LinkedList(java.util.LinkedList)

Aggregations

TGKaixiaoInfo (com.kendy.entity.TGKaixiaoInfo)6 ArrayList (java.util.ArrayList)2 Constants (application.Constants)1 DataConstans (application.DataConstans)1 Main (application.Main)1 MyController (application.MyController)1 JSON (com.alibaba.fastjson.JSON)1 TypeReference (com.alibaba.fastjson.TypeReference)1 DBUtil (com.kendy.db.DBUtil)1 Huishui (com.kendy.entity.Huishui)1 ProxyTeamInfo (com.kendy.entity.ProxyTeamInfo)1 TGCommentInfo (com.kendy.entity.TGCommentInfo)1 TGCompanyModel (com.kendy.entity.TGCompanyModel)1 TGExcelModel (com.kendy.entity.TGExcelModel)1 TGFwfinfo (com.kendy.entity.TGFwfinfo)1 TGLirunInfo (com.kendy.entity.TGLirunInfo)1 TGTeamInfo (com.kendy.entity.TGTeamInfo)1 TGTeamModel (com.kendy.entity.TGTeamModel)1 TypeValueInfo (com.kendy.entity.TypeValueInfo)1 Entity (com.kendy.interfaces.Entity)1