Search in sources :

Example 11 with TypeValueInfo

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

the class TgWaizhaiService method generateWaizhaiTables.

/**
 * 自动生成外债信息表
 * @param tableWaizhai
 * @param hbox
 * @param tableCurrentMoneyInfo
 * @param tableTeam
 */
@SuppressWarnings("unchecked")
public static void generateWaizhaiTables(TableView<TypeValueInfo> tableWaizhai, HBox hbox, TableView<CurrentMoneyInfo> tableCurrentMoneyInfo, TableView<TeamInfo> tableTeam) {
    // //获取托管团队ID
    // Set<String> tgTeamIdSet = getTGTeamId();
    // 清空数据
    ObservableList<Node> allTables = hbox.getChildren();
    if (allTables != null && allTables.size() > 0)
        hbox.getChildren().remove(0, allTables.size());
    if (DataConstans.Index_Table_Id_Map.size() == 0) {
        ShowUtil.show("你当前还未锁定任意一局,查询没有数据!", 2);
        return;
    }
    ObservableList<CurrentMoneyInfo> CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
    Map<String, List<CurrentMoneyInfo>> tgTeamIdMap = get_SSJE_Gudong_Map(tableCurrentMoneyInfo);
    Map<String, String> sumMap = getSum(tgTeamIdMap);
    int tgTeamIdMapSize = tgTeamIdMap.size();
    if (tgTeamIdMapSize == 0) {
        ShowUtil.show("股东列表为空或实时金额为空!");
        return;
    }
    TableView<CurrentMoneyInfo> table;
    for (Map.Entry<String, List<CurrentMoneyInfo>> entry : tgTeamIdMap.entrySet()) {
        String tgTeamName = entry.getKey();
        List<CurrentMoneyInfo> list = entry.getValue();
        table = new TableView<CurrentMoneyInfo>();
        // 设置列
        TableColumn firstNameCol = new TableColumn("团队" + tgTeamName);
        // 禁止排序
        firstNameCol.setSortable(false);
        firstNameCol.setPrefWidth(80);
        firstNameCol.setCellValueFactory(new PropertyValueFactory<CurrentMoneyInfo, String>("mingzi"));
        TableColumn lastNameCol = new TableColumn(sumMap.get(tgTeamName));
        // 禁止排序
        lastNameCol.setSortable(false);
        lastNameCol.setStyle("-fx-alignment: CENTER;");
        lastNameCol.setPrefWidth(65);
        lastNameCol.setCellValueFactory(new PropertyValueFactory<CurrentMoneyInfo, String>("shishiJine"));
        lastNameCol.setCellFactory(MyController.getColorCellFactory(new CurrentMoneyInfo()));
        table.setPrefWidth(150);
        table.getColumns().addAll(firstNameCol, lastNameCol);
        // 设置数据
        CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
        for (CurrentMoneyInfo info : list) {
            CurrentMoneyInfo_OB_List.add(info);
        }
        table.setItems(CurrentMoneyInfo_OB_List);
        hbox.setSpacing(5);
        hbox.setPadding(new Insets(0, 0, 0, 0));
        hbox.getChildren().addAll(table);
    }
    // 设置债务表
    ObservableList<TypeValueInfo> obList = FXCollections.observableArrayList();
    for (Map.Entry<String, String> entry : sumMap.entrySet()) {
        obList.add(new TypeValueInfo(entry.getKey(), entry.getValue()));
    }
    tableWaizhai.setItems(obList);
    setWaizhaiSum(tableWaizhai);
}
Also used : Insets(javafx.geometry.Insets) TypeValueInfo(com.kendy.entity.TypeValueInfo) Node(javafx.scene.Node) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

TypeValueInfo (com.kendy.entity.TypeValueInfo)11 ArrayList (java.util.ArrayList)6 TGFwfinfo (com.kendy.entity.TGFwfinfo)5 TGTeamInfo (com.kendy.entity.TGTeamInfo)5 List (java.util.List)5 Map (java.util.Map)5 ObservableList (javafx.collections.ObservableList)5 CollectUtil (com.kendy.util.CollectUtil)4 ShowUtil (com.kendy.util.ShowUtil)4 StringUtil (com.kendy.util.StringUtil)4 Collectors (java.util.stream.Collectors)4 TableView (javafx.scene.control.TableView)4 MyController (application.MyController)3 DBUtil (com.kendy.db.DBUtil)3 ProxyTeamInfo (com.kendy.entity.ProxyTeamInfo)3 TGCommentInfo (com.kendy.entity.TGCommentInfo)3 TGCompanyModel (com.kendy.entity.TGCompanyModel)3 TGExcelModel (com.kendy.entity.TGExcelModel)3 TGKaixiaoInfo (com.kendy.entity.TGKaixiaoInfo)3 TGLirunInfo (com.kendy.entity.TGLirunInfo)3