use of javafx.collections.ObservableList in project financial by greatkendy123.
the class TeamProxyService method refresh_TableTeamProxy_TableProxySum.
/**
* 刷新两个表,共用代码(选择团下拉框和点击刷新按钮时共用的代码)
*
* @param newValue teamID
*/
public static void refresh_TableTeamProxy_TableProxySum(Object newValue) {
if (newValue == null)
return;
Huishui hs = DataConstans.huishuiMap.get(newValue);
if (hs != null) {
if ("否".equals(hs.getZjManaged())) {
isZjManage.setSelected(false);
} else {
isZjManage.setSelected(true);
}
} else {
// add 2018-01-20
return;
}
// 加载数据{teamId={}}
double sumYSZJ = 0d;
double sumZJ = 0d;
double sumHS = 0d;
double sumHB = 0d;
double sumBX = 0d;
int sumRC = 0;
// Map<String,List<TeamHuishuiInfo>> teamMap = DataConstans.Total_Team_Huishui_Map;//锁定就保留信息,不减
Map<String, List<TeamHuishuiInfo>> teamMap = getTotalTeamHuishuiMap();
if (teamMap != null && teamMap.size() == 0) {
// 这个有问题,后期再看
log.error("----------------");
}
List<TeamHuishuiInfo> teamList = teamMap.get(newValue.toString().toUpperCase());
ObservableList<ProxyTeamInfo> obList = FXCollections.observableArrayList();
if (teamList != null) {
for (TeamHuishuiInfo info : teamList) {
obList.add(new ProxyTeamInfo(info.getTuan(), info.getWanjiaId(), info.getWanjia(), // yszj
info.getZj(), info.getShishou(), // 出回水是否等于回水
MoneyService.getNum(info.getChuHuishui()) * (-1) + "", // 保险是否等于回保
info.getHuibao(), info.getTableId(), // 保险
info.getBaoxian()));
sumYSZJ += MoneyService.getNum(info.getZj());
sumZJ += MoneyService.getNum(info.getShishou());
sumBX += MoneyService.getNum(info.getBaoxian());
sumHS += (MoneyService.getNum(info.getChuHuishui())) * (-1);
sumHB += MoneyService.getNum(info.getHuibao());
sumRC += 1;
}
}
tableProxyTeam.setItems(obList);
tableProxyTeam.refresh();
ObservableList<Node> sumHBox = proxySumHBox.getChildren();
for (Node node : sumHBox) {
Label label = (Label) node;
String labelId = label.getId();
switch(labelId) {
case "sumYSZJ":
label.setText(MoneyService.digit0(sumYSZJ));
break;
case "sumZJ":
label.setText(MoneyService.digit0(sumZJ));
break;
case "sumBX":
label.setText(MoneyService.digit0(sumBX));
break;
case "sumHS":
label.setText(MoneyService.digit1(sumHS + ""));
break;
case "sumHB":
label.setText(sumHB + "");
break;
case "sumRC":
label.setText(sumRC + "");
break;
}
}
// add by kendy 添加总回保比例,总回水比例,服务费和合计
proxyHSRate.setText(hs.getProxyHSRate());
proxyHBRate.setText(hs.getProxyHBRate());
proxyFWF.setText(hs.getProxyFWF());
double HSRate = getNumByPercent(hs.getProxyHSRate());
double HBRate = getNumByPercent(hs.getProxyHBRate());
// 服务费有效值
double FWFValid = NumUtil.getNum(hs.getProxyFWF());
// 计算服务费
double proxyFWFVal = calculateProxSumFWF(sumHS, HSRate, sumHB, HBRate, FWFValid);
// 计算合计
double proxyHeji = sumZJ + sumHS + sumHB - proxyFWFVal;
// 初始化合计表
tableProxySum.setItems(null);
ObservableList<ProxySumInfo> ob_Heji_List = FXCollections.observableArrayList();
ob_Heji_List.addAll(new ProxySumInfo("总战绩", NumUtil.digit0(sumZJ)), new ProxySumInfo("总回水", NumUtil.digit1(sumHS + "")), new ProxySumInfo("总回保", NumUtil.digit1(sumHB + "")), new ProxySumInfo("服务费", NumUtil.digit1(proxyFWFVal + "")), new ProxySumInfo("总人次", sumRC + ""));
tableProxySum.setItems(ob_Heji_List);
tableProxySum.getColumns().get(1).setText(NumUtil.digit1(proxyHeji + ""));
tableProxySum.refresh();
}
use of javafx.collections.ObservableList 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);
}
use of javafx.collections.ObservableList in project financial by greatkendy123.
the class ZonghuiService method refreHuizongTable.
/**
* 刷新汇总信息表
*/
public static void refreHuizongTable(TableView<ZonghuiInfo> tableZonghui, TableView<DangtianHuizongInfo> tableDangtianHuizong, TableView<ZonghuiKaixiaoInfo> tableZonghuiKaixiao, TableView<ProfitInfo> tableProfit) {
Map<String, Map<String, String>> lockedMap = DataConstans.All_Locked_Data_Map;
ZonghuiInfo zonghuiInfo = new ZonghuiInfo();
ObservableList<ZonghuiInfo> obList = FXCollections.observableArrayList();
ObservableList<DangtianHuizongInfo> obSumList = FXCollections.observableArrayList();
String fuwufei, baoxiao, teamHuishui, teamHuibao;
double sumOfFuwufei = 0d, sumOfBaoxian = 0d, sumOfTeamHuishui = 0d, sumOfTeamHuibao = 0d, sumOfTotal = 0d;
if (lockedMap.size() > 0) {
// 主表复值
for (Map.Entry<String, Map<String, String>> entry : lockedMap.entrySet()) {
// 页数第几局
String keyOfJu = entry.getKey();
String tableId = DataConstans.Index_Table_Id_Map.get(keyOfJu) + "";
Map<String, String> valueMap = entry.getValue();
String jsonString = valueMap.get("当局");
// [{"money":"37.1","type":"服务费"},{"money":"295.4","type":"保险"},{"money":"-18.0","type":"团队回水"},{"money":"-0.0","type":"团队回保"}]
List<DangjuInfo> dangjuList = JSON.parseObject(jsonString, new TypeReference<List<DangjuInfo>>() {
});
// 服务费
fuwufei = dangjuList.get(0).getMoney();
// 保险
baoxiao = dangjuList.get(1).getMoney();
// 团队回水
teamHuishui = dangjuList.get(2).getMoney();
// 团队回保
teamHuibao = dangjuList.get(3).getMoney();
// 累计求和
sumOfFuwufei += MoneyService.getNum(fuwufei);
sumOfBaoxian += MoneyService.getNum(baoxiao);
sumOfTeamHuishui += MoneyService.getNum(teamHuishui);
sumOfTeamHuibao += MoneyService.getNum(teamHuibao);
// 创建实体1
zonghuiInfo = new ZonghuiInfo(tableId, fuwufei, baoxiao, teamHuishui, teamHuibao);
obList.add(zonghuiInfo);
}
// 开销表赋值并返回总值
String sumOfKaixiao = initTableKaixiaoAndGetSum(tableZonghuiKaixiao);
// 添加总团队服务费
Double teamSumFWF = getTeamSumFWF(tableProfit);
// 计算总和
sumOfTotal = sumOfFuwufei + sumOfBaoxian + sumOfTeamHuishui + sumOfTeamHuibao + Double.valueOf(sumOfKaixiao) + teamSumFWF;
// 创建实体2(当天汇总)
obSumList.addAll(new DangtianHuizongInfo("总服务费", NumUtil.digit1(sumOfFuwufei + "")), new DangtianHuizongInfo("总保险", NumUtil.digit1(sumOfBaoxian + "")), new DangtianHuizongInfo("总团队回水", NumUtil.digit1(sumOfTeamHuishui + "")), new DangtianHuizongInfo("总团队回保", NumUtil.digit1(sumOfTeamHuibao + "")), new DangtianHuizongInfo("总开销", sumOfKaixiao), new DangtianHuizongInfo("总团队服务费", NumUtil.digit0(teamSumFWF)));
ShowUtil.show("刷新成功", 1);
} else {
ShowUtil.show("查无数据", 1);
}
tableZonghui.setItems(obList);
tableZonghui.refresh();
// 当天汇总表复值
tableDangtianHuizong.setItems(obSumList);
tableDangtianHuizong.getColumns().get(1).setText(MoneyService.digit2(sumOfTotal + ""));
tableDangtianHuizong.refresh();
}
use of javafx.collections.ObservableList in project placar-eletronico by GeovaniNieswald.
the class GerUsuarioController method updateList.
private void updateList(String msg) {
try {
Date d = new Date();
String resp = PlacarClient.enviarComandoResp(Comando.CADASTRO_USUARIO, "get", "all");
String[] users = resp.split(",");
ObservableList data = FXCollections.observableArrayList();
for (String s : users) {
data.add(s);
}
jfxList.setItems(data);
if (msg == null) {
jfxlStatus.setText("Lista atualizada: " + d);
} else {
jfxlStatus.setText(msg);
}
} catch (IOException ex) {
jfxlStatus.setText("Erro: " + ex.getMessage());
}
}
use of javafx.collections.ObservableList in project MiscellaneousStudy by mikoto2000.
the class AddPanelController method initialize.
@Override
public void initialize(URL location, ResourceBundle resources) {
// add ボタンクリックで Text 追加
add.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent e) {
System.out.println("Fire add event.");
Text t = new Text();
t.setText(String.format("Added %d.", count++));
target.getChildren().add(t);
}
});
// delete ボタンクリックで Text 追加
delete.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent e) {
System.out.println("Fire delete event.");
ObservableList<Node> targetChild = target.getChildren();
{
int size = targetChild.size();
if (size > 0) {
targetChild.remove(size - 1);
}
}
}
});
}
Aggregations