Search in sources :

Example 66 with ObservableList

use of javafx.collections.ObservableList in project financial by greatkendy123.

the class TGController method refreshProfitTab.

/**
 * 刷新月利润表
 * @time 2018年3月17日
 */
public void refreshProfitTab() {
    String tgCompany = currentTGCompanyLabel.getText();
    if (StringUtil.isBlank(tgCompany)) {
        ShowUtil.show("请先选择托管公司!");
        return;
    }
    System.out.println("===========================刷新月利润表");
    List<TGLirunInfo> list = new ArrayList<>();
    TGLirunInfo lirun = new TGLirunInfo();
    // 获取数据库的历史日利润表 TODO
    List<TGLirunInfo> liruns = DBUtil.get_all_tg_lirun(tgCompany);
    if (CollectUtil.isHaveValue(liruns)) {
        // liruns = liruns.stream()
        // .filter(info->tgCompany.equals(info.getTgLirunCompanyName())) // 获取当前托管公司的数据,但剔除今天已经保存过的数据,因为下面会重新计算
        // .filter(info-> !(TimeUtil.getDateString().equals(info.getTgLirunDate()) && tgCompany.equals(info.getTgLirunCompanyName())))
        // .collect(Collectors.toList());
        list.addAll(liruns);
        String today = getDateString();
        boolean isTodayContains = list.stream().anyMatch(info -> today.equals(info.getTgLirunDate()));
        if (isTodayContains) {
            log.info("刷新月利润表时已经存在了今天" + today + "的数据了!所以不重复计算");
            tableTGLirun.setItems(FXCollections.observableArrayList(list));
            return;
        }
    }
    // 刷新服务费
    refreshFwfTab();
    // 获取日期(日期与当前托管公司为主键)
    String dateString = getDateString();
    lirun.setTgLirunDate(dateString);
    lirun.setTgLirunCompanyName(tgCompany);
    // 获取总利润(即服务费明细中的总利润)
    ObservableList<TypeValueInfo> fwfList = tableTGFwfSum.getItems();
    String tgLirunTotalProfit = fwfList.stream().filter(info -> "总利润".equals(info.getType())).map(TypeValueInfo::getValue).findFirst().orElse("0");
    lirun.setTgLirunTotalProfit(tgLirunTotalProfit);
    // 获取总开销
    List<TGKaixiaoInfo> allTGKaixiaos = DBUtil.get_all_tg_kaixiao();
    double sumOfKaixiao = allTGKaixiaos.stream().filter(info -> tgCompany.equals(info.getTgKaixiaoCompany())).map(TGKaixiaoInfo::getTgKaixiaoMoney).mapToDouble(NumUtil::getNum).sum();
    lirun.setTgLirunTotalKaixiao(NumUtil.digit0(sumOfKaixiao + ""));
    // 设置Rest合计
    lirun.setTgLirunRestHeji(NumUtil.digit2(NumUtil.getSum(tgLirunTotalProfit, sumOfKaixiao + "")));
    // 设置公司占股
    TGCompanyModel companyModel = DBUtil.get_tg_company_by_id(tgCompany);
    String companyRate = companyModel.getCompanyRate();
    companyRate = companyRate.endsWith("%") ? NumUtil.getNumByPercent(companyRate) + "" : NumUtil.getNum(companyRate) / 100.0 + "";
    Double atmCompanyProfit = NumUtil.getNumTimes(lirun.getTgLirunRestHeji(), companyRate);
    lirun.setTgLirunATMCompany(NumUtil.digit2(atmCompanyProfit + ""));
    // 设置托管公司占股
    String tgCompanyRate = StringUtil.nvl(companyModel.getTgCompanyRate(), "0%");
    tgCompanyRate = tgCompanyRate.endsWith("%") ? NumUtil.getNumByPercent(tgCompanyRate) + "" : NumUtil.getNum(tgCompanyRate) / 100.0 + "";
    Double tgCompanyProfit = NumUtil.getNumTimes(lirun.getTgLirunRestHeji(), tgCompanyRate);
    lirun.setTgLirunTGCompany(NumUtil.digit2(tgCompanyProfit + ""));
    // 设置团队服务费 TODO
    Double tgCompanyProxy = 0.0d;
    List<TGTeamModel> tgTeamInfos = DBUtil.get_all_tg_team();
    Set<String> proxyTeamSet = tgTeamInfos.stream().filter(info -> "1".equals(info.getTgTeamProxy())).map(TGTeamModel::getTgTeamId).collect(Collectors.toSet());
    tgCompanyProxy = tableTGFwf.getItems().stream().filter(info -> proxyTeamSet.contains(info.getTgFwfTeamId())).mapToDouble(info -> NumUtil.getNum(info.getTgFwfFanshui()) + NumUtil.getNum(info.getTgFwfFanbao())).sum();
    lirun.setTgLirunTeamProfit(NumUtil.digit2(tgCompanyProxy + ""));
    // 设置托管公司合计 = 托管公司占股 + 托管公司代理
    Double tgCompanyHeji = tgCompanyProfit + tgCompanyProxy;
    lirun.setTgLirunHeji(NumUtil.digit2(tgCompanyHeji + ""));
    list.add(lirun);
    tableTGLirun.setItems(FXCollections.observableArrayList(list));
}
Also used : EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) Initializable(javafx.fxml.Initializable) Constants(application.Constants) NumUtil(com.kendy.util.NumUtil) URL(java.net.URL) InputDialog(com.kendy.util.InputDialog) Random(java.util.Random) VBox(javafx.scene.layout.VBox) Huishui(com.kendy.entity.Huishui) Logger(org.apache.log4j.Logger) Parent(javafx.scene.Parent) TabPane(javafx.scene.control.TabPane) AlertType(javafx.scene.control.Alert.AlertType) StringUtil(com.kendy.util.StringUtil) Map(java.util.Map) TGTeamModel(com.kendy.entity.TGTeamModel) WindowEvent(javafx.stage.WindowEvent) MyController(application.MyController) TableView(javafx.scene.control.TableView) Alert(javafx.scene.control.Alert) HBox(javafx.scene.layout.HBox) TextField(javafx.scene.control.TextField) Pair(javafx.util.Pair) PropertyValueFactory(javafx.scene.control.cell.PropertyValueFactory) Set(java.util.Set) Collectors(java.util.stream.Collectors) TgWaizhaiService(com.kendy.service.TgWaizhaiService) TGCompanyModel(com.kendy.entity.TGCompanyModel) FXML(javafx.fxml.FXML) List(java.util.List) TypeReference(com.alibaba.fastjson.TypeReference) CollectUtil(com.kendy.util.CollectUtil) ShowUtil(com.kendy.util.ShowUtil) TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) ProxyTeamInfo(com.kendy.entity.ProxyTeamInfo) Optional(java.util.Optional) ObservableList(javafx.collections.ObservableList) Scene(javafx.scene.Scene) TGCommentInfo(com.kendy.entity.TGCommentInfo) TGExportExcelService(com.kendy.service.TGExportExcelService) ListView(javafx.scene.control.ListView) ButtonType(javafx.scene.control.ButtonType) FXCollections(javafx.collections.FXCollections) HashMap(java.util.HashMap) TGFwfService(com.kendy.service.TGFwfService) TypeValueInfo(com.kendy.entity.TypeValueInfo) Function(java.util.function.Function) ArrayList(java.util.ArrayList) TableColumn(javafx.scene.control.TableColumn) ResourceBundle(java.util.ResourceBundle) FXMLLoader(javafx.fxml.FXMLLoader) TableUtil(com.kendy.util.TableUtil) TGLirunInfo(com.kendy.entity.TGLirunInfo) DataConstans(application.DataConstans) DBUtil(com.kendy.db.DBUtil) TGFwfinfo(com.kendy.entity.TGFwfinfo) Label(javafx.scene.control.Label) TGTeamInfo(com.kendy.entity.TGTeamInfo) Node(javafx.scene.Node) CheckBox(javafx.scene.control.CheckBox) TeamProxyService(com.kendy.service.TeamProxyService) Main(application.Main) ActionEvent(javafx.event.ActionEvent) JSON(com.alibaba.fastjson.JSON) Stage(javafx.stage.Stage) ObservableValue(javafx.beans.value.ObservableValue) ChangeListener(javafx.beans.value.ChangeListener) Entity(com.kendy.interfaces.Entity) TypeValueInfo(com.kendy.entity.TypeValueInfo) TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) ArrayList(java.util.ArrayList) TGTeamModel(com.kendy.entity.TGTeamModel) TGLirunInfo(com.kendy.entity.TGLirunInfo) TGCompanyModel(com.kendy.entity.TGCompanyModel)

Example 67 with ObservableList

use of javafx.collections.ObservableList in project financial by greatkendy123.

the class MoneyService method reCovery10TablesByPage.

/**
 * 根据分页自动恢复该页锁定的10个表数据
 */
public static void reCovery10TablesByPage(TableView<TotalInfo> tableTotal, TableView<WanjiaInfo> tableWanjia, TableView<TeamInfo> tableTeam, TableView<CurrentMoneyInfo> tableCurrentMoney, TableView<ZijinInfo> tableZijin, TableView<KaixiaoInfo> tableKaixiao, TableView<ProfitInfo> tableProfit, TableView<DangjuInfo> tableDangju, TableView<JiaoshouInfo> tableJiaoshou, TableView<PingzhangInfo> tablePingzhang, Label LMLabel, int pageIndex) throws Exception {
    // 获取该页所有数据
    Map<String, String> map = DataConstans.All_Locked_Data_Map.get(pageIndex + "");
    /**
     *****************************************************
     */
    // List<TotalInfo> TotalInfoList = JSON.parseObject(map.get("战绩"), new TypeReference<List<TotalInfo>>() {});
    List<TotalInfo> TotalInfoList = JSON.parseObject(getJsonString(map, "战绩"), new TypeReference<List<TotalInfo>>() {
    });
    ObservableList<TotalInfo> obList = FXCollections.observableArrayList();
    for (TotalInfo infos : TotalInfoList) {
        obList.add(infos);
    }
    tableTotal.setItems(obList);
    tableTotal.refresh();
    /**
     *********************************************************
     */
    List<WanjiaInfo> WanjiaInfoList = JSON.parseObject(getJsonString(map, "玩家"), new TypeReference<List<WanjiaInfo>>() {
    });
    ObservableList<WanjiaInfo> WanjiaInfo_OB_List = FXCollections.observableArrayList();
    for (WanjiaInfo infos : WanjiaInfoList) {
        WanjiaInfo_OB_List.add(infos);
    }
    tableWanjia.setItems(WanjiaInfo_OB_List);
    tableWanjia.refresh();
    /**
     *************************************************************************
     */
    List<TeamInfo> TeamInfoList = JSON.parseObject(getJsonString(map, "团队回水"), new TypeReference<List<TeamInfo>>() {
    });
    ObservableList<TeamInfo> TeamInfo_OB_List = FXCollections.observableArrayList();
    for (TeamInfo infos : TeamInfoList) {
        TeamInfo_OB_List.add(infos);
    }
    tableTeam.setItems(TeamInfo_OB_List);
    tableTeam.getColumns().get(4).setText(getJsonString(map, "团队回水总和"));
    tableTeam.refresh();
    /**
     *************************************************************************
     */
    List<CurrentMoneyInfo> CurrentMoneyInfoList = JSON.parseObject(getJsonString(map, "实时金额"), new TypeReference<List<CurrentMoneyInfo>>() {
    });
    ObservableList<CurrentMoneyInfo> CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
    for (CurrentMoneyInfo infos : CurrentMoneyInfoList) {
        CurrentMoneyInfo_OB_List.add(infos);
    }
    tableCurrentMoney.setItems(CurrentMoneyInfo_OB_List);
    String sumOfCurrentMoney = getJsonString(map, "实时金额总和");
    tableCurrentMoney.getColumns().get(2).setText(sumOfCurrentMoney);
    tableCurrentMoney.refresh();
    /**
     **********************************************************
     */
    List<ZijinInfo> ZijinInfoList = JSON.parseObject(getJsonString(map, "资金"), new TypeReference<List<ZijinInfo>>() {
    });
    ObservableList<ZijinInfo> ZijinInfo_OB_List = FXCollections.observableArrayList();
    for (ZijinInfo infos : ZijinInfoList) {
        ZijinInfo_OB_List.add(infos);
    }
    tableZijin.getColumns().get(1).setText(getJsonString(map, "资金总和"));
    tableZijin.setItems(ZijinInfo_OB_List);
    tableZijin.refresh();
    /**
     ***************************************************************
     */
    List<ProfitInfo> ProfitInfoList = JSON.parseObject(getJsonString(map, "利润"), new TypeReference<List<ProfitInfo>>() {
    });
    ObservableList<ProfitInfo> ProfitInfo_OB_List = FXCollections.observableArrayList();
    for (ProfitInfo infos : ProfitInfoList) {
        ProfitInfo_OB_List.add(infos);
    }
    tableProfit.getColumns().get(1).setText(getJsonString(map, "利润总和"));
    tableProfit.setItems(ProfitInfo_OB_List);
    tableProfit.refresh();
    /**
     **********************************************************
     */
    List<KaixiaoInfo> KaixiaoInfoList = JSON.parseObject(getJsonString(map, "实时开销"), new TypeReference<List<KaixiaoInfo>>() {
    });
    ObservableList<KaixiaoInfo> KaixiaoInfo_OB_List = FXCollections.observableArrayList();
    for (KaixiaoInfo infos : KaixiaoInfoList) {
        KaixiaoInfo_OB_List.add(infos);
    }
    tableKaixiao.getColumns().get(1).setText(getJsonString(map, "实时开销总和"));
    tableKaixiao.setItems(KaixiaoInfo_OB_List);
    tableKaixiao.refresh();
    /**
     ************************************************************
     */
    List<DangjuInfo> DangjuInfoList = JSON.parseObject(getJsonString(map, "当局"), new TypeReference<List<DangjuInfo>>() {
    });
    ObservableList<DangjuInfo> DangjuInfo_OB_List = FXCollections.observableArrayList();
    for (DangjuInfo infos : DangjuInfoList) {
        DangjuInfo_OB_List.add(infos);
    }
    tableDangju.getColumns().get(1).setText(getJsonString(map, "当局总和"));
    tableDangju.setItems(DangjuInfo_OB_List);
    tableDangju.refresh();
    /**
     *************************************************************
     */
    List<JiaoshouInfo> JiaoshouInfoList = JSON.parseObject(getJsonString(map, "交收"), new TypeReference<List<JiaoshouInfo>>() {
    });
    ObservableList<JiaoshouInfo> JiaoshouInfo_OB_List = FXCollections.observableArrayList();
    for (JiaoshouInfo infos : JiaoshouInfoList) {
        JiaoshouInfo_OB_List.add(infos);
    }
    tableJiaoshou.getColumns().get(1).setText(getJsonString(map, "交收总和"));
    tableJiaoshou.setItems(JiaoshouInfo_OB_List);
    tableJiaoshou.refresh();
    /**
     ***************************************************************
     */
    List<PingzhangInfo> PingzhangInfoList = JSON.parseObject(getJsonString(map, "平帐"), new TypeReference<List<PingzhangInfo>>() {
    });
    ObservableList<PingzhangInfo> PingzhangInfo_OB_List = FXCollections.observableArrayList();
    for (PingzhangInfo infos : PingzhangInfoList) {
        PingzhangInfo_OB_List.add(infos);
    }
    tablePingzhang.getColumns().get(1).setText(getJsonString(map, "平帐总和"));
    tablePingzhang.setItems(PingzhangInfo_OB_List);
    tablePingzhang.refresh();
    /**
     ***************************************************************
     */
    LMLabel.setText(getJsonString(map, "联盟对帐"));
}
Also used : JiaoshouInfo(com.kendy.entity.JiaoshouInfo) KaixiaoInfo(com.kendy.entity.KaixiaoInfo) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) ProfitInfo(com.kendy.entity.ProfitInfo) WanjiaInfo(com.kendy.entity.WanjiaInfo) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) PingzhangInfo(com.kendy.entity.PingzhangInfo) DangjuInfo(com.kendy.entity.DangjuInfo) TeamInfo(com.kendy.entity.TeamInfo) ZijinInfo(com.kendy.entity.ZijinInfo) TotalInfo(com.kendy.entity.TotalInfo)

Example 68 with ObservableList

use of javafx.collections.ObservableList in project financial by greatkendy123.

the class MoneyService method flush_SSJE_table.

/**
 * 刷新最新的实时金额(最重要!!!!)
 * 即添加进合并ID
 *
 * @time 2017年11月1日
 * @throws Exception
 */
public static void flush_SSJE_table() {
    LinkedList<CurrentMoneyInfo> srcList = new LinkedList<>();
    if (!isTableNotNull()) {
        return;
    } else {
        for (CurrentMoneyInfo info : tableCurrentMoneyInfo.getItems()) srcList.add(info);
    }
    // 组装数据为空
    // 对组装的数据列表进行处理,空行直接删除,父ID删除,子ID删除后缓存
    ListIterator<CurrentMoneyInfo> it = srcList.listIterator();
    // 存放父ID那条记录的信息
    Map<String, CurrentMoneyInfo> superIdInfoMap = new HashMap<>();
    // 存放父ID下的所有子记录信息
    Map<String, List<CurrentMoneyInfo>> superIdSubListMap = new HashMap<>();
    String playerId = "";
    while (it.hasNext()) {
        CurrentMoneyInfo item = it.next();
        // 删除空行
        if (StringUtil.isBlank(item.getWanjiaId()) && StringUtil.isBlank(item.getMingzi()) && StringUtil.isBlank(item.getShishiJine())) {
            // 没有玩家ID的就是空行
            it.remove();
            continue;
        }
        // 删除父ID
        playerId = item.getWanjiaId();
        if (DataConstans.Combine_Super_Id_Map.get(playerId) != null) {
            superIdInfoMap.put(playerId, item);
            it.remove();
            continue;
        }
        // 删除子ID
        if (DataConstans.Combine_Sub_Id_Map.get(playerId) != null) {
            // 是子ID节点
            String parentID = DataConstans.Combine_Sub_Id_Map.get(playerId);
            List<CurrentMoneyInfo> childList = superIdSubListMap.get(parentID);
            if (childList == null) {
                childList = new ArrayList<>();
            }
            childList.add(item);
            superIdSubListMap.put(parentID, childList);
            it.remove();
            continue;
        }
    }
    // 添加子ID不在实时金额表中的父ID记录(单条父记录)
    superIdInfoMap.forEach((superId, info) -> {
        if (!superIdSubListMap.containsKey(superId)) {
            info.setCmSuperIdSum("");
            // 添加父记录
            srcList.add(info);
        }
    });
    // 添加父ID不在实时金额表中的子ID记录
    Iterator<Map.Entry<String, List<CurrentMoneyInfo>>> ite = superIdSubListMap.entrySet().iterator();
    while (ite.hasNext()) {
        Map.Entry<String, List<CurrentMoneyInfo>> entry = ite.next();
        String superId = entry.getKey();
        CurrentMoneyInfo superInfo = superIdInfoMap.get(superId);
        if (superInfo == null) {
            for (CurrentMoneyInfo info : entry.getValue()) {
                // 添加子记录
                srcList.add(info);
            }
            // 删除
            ite.remove();
        }
    }
    // 计算总和并填充父子节点和空行
    String superId = "";
    // 空开一行
    srcList.add(new CurrentMoneyInfo());
    for (Map.Entry<String, List<CurrentMoneyInfo>> entry : superIdSubListMap.entrySet()) {
        superId = entry.getKey();
        CurrentMoneyInfo superInfo = superIdInfoMap.get(superId);
        // 计算父节点总和
        List<CurrentMoneyInfo> subInfoList = entry.getValue();
        // 合并ID节点总和
        Double superIdSum = 0d;
        for (CurrentMoneyInfo info : subInfoList) {
            superIdSum += NumUtil.getNum(info.getShishiJine());
        }
        superInfo.setCmSuperIdSum(NumUtil.digit0(superIdSum + NumUtil.getNum(superInfo.getShishiJine())));
        // 添加空行和子节点
        // 先添加父节点
        srcList.add(superInfo);
        for (CurrentMoneyInfo info : subInfoList) {
            // 再添加子节点
            srcList.add(info);
        }
        // 空开一行
        srcList.add(new CurrentMoneyInfo());
    }
    // 更新
    ObservableList<CurrentMoneyInfo> obList = FXCollections.observableArrayList();
    for (CurrentMoneyInfo cmi : srcList) {
        obList.add(cmi);
    }
    tableCurrentMoneyInfo.setItems(obList);
    tableCurrentMoneyInfo.refresh();
}
Also used : HashMap(java.util.HashMap) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) Map(java.util.Map) HashMap(java.util.HashMap)

Example 69 with ObservableList

use of javafx.collections.ObservableList in project financial by greatkendy123.

the class ShangmaService method updateShangDetailMap.

/**
 * 导入战绩时更新上码系统的个人信息
 */
public static void updateShangDetailMap(TableView<WanjiaInfo> table) {
    // final List<TeamHuishuiInfo> list = DataConstans.Dangju_Team_Huishui_List;
    ObservableList<WanjiaInfo> obList = table.getItems();
    Map<String, List<ShangmaDetailInfo>> detailMap = DataConstans.SM_Detail_Map;
    List<ShangmaDetailInfo> detailList = null;
    String playerId = "", preYSM, yiSM, tableId, ju;
    if (obList != null && obList.size() > 0) {
        // 遍历当局
        for (WanjiaInfo info : obList) {
            playerId = info.getWanjiaId();
            detailList = detailMap.get(playerId);
            if (detailList != null) {
                // getRealTableId(info.getPaiju());//不是第X局了,而是X
                tableId = info.getPaiju();
                // 遍历个人信息
                for (ShangmaDetailInfo sdi : detailList) {
                    ju = sdi.getShangmaJu();
                    if (!StringUtil.isBlank(ju) && ju.equals(tableId)) {
                        // 设置原先上码值,以及清空当局上码
                        preYSM = sdi.getShangmaSM();
                        sdi.setShangmaPreSM(preYSM);
                        sdi.setShangmaSM("");
                        // 设置实收
                        sdi.setShangmaShishou(info.getZhangji());
                        // add2017-09-24 加载主表
                        loadShangmaTable(DataConstans.membersMap.get(playerId).getTeamName(), tableSM);
                        // }
                        break;
                    }
                }
                detailMap.put(playerId, detailList);
            }
        }
    }
}
Also used : WanjiaInfo(com.kendy.entity.WanjiaInfo) ShangmaDetailInfo(com.kendy.entity.ShangmaDetailInfo) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList)

Example 70 with ObservableList

use of javafx.collections.ObservableList in project financial by greatkendy123.

the class TGExportExcelService method getTGWaizhaiExcelModel.

/**
 * 导出托管公司的团队外债与团队外债明细
 * @return
 */
private TGExcelModel getTGWaizhaiExcelModel() {
    TGExcelModel excelModel = new TGExcelModel();
    List<String> titleList = new LinkedList<>();
    List<Object[]> data = new LinkedList<>();
    List<String> titleSumList = new LinkedList<>();
    List<Object[]> dataSum = new LinkedList<>();
    // 取值
    // 传给Excel的外债数据
    Map<String, List<Object[]>> teamMap = new LinkedHashMap<>();
    ObservableList<Node> items = tgController.tgWZTeamHBox.getChildren();
    // 存放总和表
    ObservableList<TypeValueInfo> sumItems = tgController.tgWZTeam.getItems();
    if (CollectUtil.isHaveValue(sumItems)) {
        List<Object[]> teamList = tgController.tgWZTeam.getItems().stream().map(info -> {
            Object[] obj = new Object[2];
            obj[0] = info.getType();
            obj[1] = info.getValue();
            return obj;
        }).collect(Collectors.toList());
        String key = tgController.tgWZTeam.getColumns().get(0).getText() + "#" + tgController.tgWZTeam.getColumns().get(1).getText();
        teamMap.put(key, teamList);
    }
    // 存放明细表
    if (CollectUtil.isHaveValue(items)) {
        for (Node node : items) {
            TableView<CurrentMoneyInfo> table = (TableView<CurrentMoneyInfo>) node;
            List<Object[]> teamList = table.getItems().stream().map(info -> {
                Object[] obj = new Object[2];
                obj[0] = info.getMingzi();
                obj[1] = info.getShishiJine();
                return obj;
            }).collect(Collectors.toList());
            String key = table.getColumns().get(0).getText() + "#" + table.getColumns().get(1).getText();
            teamMap.put(key, teamList);
        }
    }
    excelModel.setColumnList(titleList);
    excelModel.setData(data);
    excelModel.setColumnSumList(titleSumList);
    excelModel.setDataSum(dataSum);
    excelModel.setSheetName("外债");
    // 设值
    excelModel.setWaiZai(true);
    excelModel.setWaizhaiMap(teamMap);
    return excelModel;
}
Also used : Button(javafx.scene.control.Button) Arrays(java.util.Arrays) TGCommentInfo(com.kendy.entity.TGCommentInfo) HashMap(java.util.HashMap) ExportTGExcel(com.kendy.excel.ExportTGExcel) TypeValueInfo(com.kendy.entity.TypeValueInfo) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) StringUtil(com.kendy.util.StringUtil) Map(java.util.Map) LinkedList(java.util.LinkedList) TGLirunInfo(com.kendy.entity.TGLirunInfo) TableView(javafx.scene.control.TableView) TGFwfinfo(com.kendy.entity.TGFwfinfo) TextField(javafx.scene.control.TextField) Label(javafx.scene.control.Label) TGTeamInfo(com.kendy.entity.TGTeamInfo) Node(javafx.scene.Node) TGController(com.kendy.controller.TGController) Collectors(java.util.stream.Collectors) TGExcelModel(com.kendy.entity.TGExcelModel) FXML(javafx.fxml.FXML) List(java.util.List) CollectUtil(com.kendy.util.CollectUtil) ShowUtil(com.kendy.util.ShowUtil) TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) ObservableList(javafx.collections.ObservableList) ErrorUtil(com.kendy.util.ErrorUtil) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) TypeValueInfo(com.kendy.entity.TypeValueInfo) Node(javafx.scene.Node) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap) TGExcelModel(com.kendy.entity.TGExcelModel) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) TableView(javafx.scene.control.TableView)

Aggregations

ObservableList (javafx.collections.ObservableList)77 List (java.util.List)46 ArrayList (java.util.ArrayList)31 Collectors (java.util.stream.Collectors)29 Map (java.util.Map)28 FXCollections (javafx.collections.FXCollections)28 HashMap (java.util.HashMap)21 Node (javafx.scene.Node)20 TableColumn (javafx.scene.control.TableColumn)20 Label (javafx.scene.control.Label)18 Optional (java.util.Optional)17 ActionEvent (javafx.event.ActionEvent)16 FXML (javafx.fxml.FXML)16 TableView (javafx.scene.control.TableView)16 MouseEvent (javafx.scene.input.MouseEvent)16 Logger (org.slf4j.Logger)16 LoggerFactory (org.slf4j.LoggerFactory)16 Button (javafx.scene.control.Button)15 BorderPane (javafx.scene.layout.BorderPane)15 File (java.io.File)14