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);
}
Aggregations