use of com.kendy.entity.TeamInfo in project financial by greatkendy123.
the class MoneyService method fillTableCurrentMoneyInfo2.
/**
* 将前一次的实时金额数据备份到第01表=== 非2017-01-01
* @param table
* @param userInfoList
*/
public static void fillTableCurrentMoneyInfo2(TableView<TeamInfo> tableTeam, TableView<CurrentMoneyInfo> table, TableView<ZijinInfo> tableZijin, TableView<ProfitInfo> tableProfit, TableView<KaixiaoInfo> tableKaixiao, Label LMLabel) {
Map<String, String> map = DataConstans.preDataMap;
/**
********************************************** 团队回水表 *************
*/
tableTeam.setItems(null);
ObservableList<TeamInfo> obList = FXCollections.observableArrayList();
List<TeamInfo> teamList = JSON.parseObject(DataConstans.preDataMap.get("团队回水"), new TypeReference<List<TeamInfo>>() {
});
for (TeamInfo info : teamList) {
obList.add(info);
}
tableTeam.setItems(obList);
/**
********************************************** 实时金额表 *************
*/
// 1清空 表数据
table.setItems(null);
// 2获取InfoList
ObservableList<CurrentMoneyInfo> obListCurrentMoney = FXCollections.observableArrayList();
List<CurrentMoneyInfo> cmList = JSON.parseObject(DataConstans.preDataMap.get("实时金额"), new TypeReference<List<CurrentMoneyInfo>>() {
});
for (CurrentMoneyInfo info : cmList) {
obListCurrentMoney.add(info);
}
table.setItems(obListCurrentMoney);
table.refresh();
// 合并ID操作
flush_SSJE_table();
/**
********************************************** 资金表 *************
*/
// 1清空 表数据
tableZijin.setItems(null);
// 2获取InfoList
ObservableList<ZijinInfo> obListZijin = FXCollections.observableArrayList();
List<ZijinInfo> zijinList = JSON.parseObject(DataConstans.preDataMap.get("资金"), new TypeReference<List<ZijinInfo>>() {
});
for (ZijinInfo info : zijinList) {
obListZijin.add(info);
}
tableZijin.setItems(obListZijin);
/**
********************************************** 利润表 *************
*/
// 1清空 表数据
tableProfit.setItems(null);
// 2获取InfoList
ObservableList<ProfitInfo> obListProfit = FXCollections.observableArrayList();
List<ProfitInfo> profitList = JSON.parseObject(DataConstans.preDataMap.get("利润"), new TypeReference<List<ProfitInfo>>() {
});
for (ProfitInfo info : profitList) {
obListProfit.add(info);
}
tableProfit.setItems(obListProfit);
/**
********************************************** 实时开销表 *************
*/
tableKaixiao.setItems(null);
// 2获取InfoList
ObservableList<KaixiaoInfo> obListKaixiao = FXCollections.observableArrayList();
List<KaixiaoInfo> kaixiaoList = JSON.parseObject(DataConstans.preDataMap.get("实时开销"), new TypeReference<List<KaixiaoInfo>>() {
});
for (KaixiaoInfo info : kaixiaoList) {
obListKaixiao.add(info);
}
// add 注释掉:新一天的统计中实时开销为空
tableKaixiao.setItems(obListKaixiao);
// 缓存一一场的实时开销总和
DataConstans.SumMap.put("上场开销", getSumOfTableKaixiao(tableKaixiao));
/**
********************************************** 联盟对帐 *************
*/
String lm = DataConstans.preDataMap.get("联盟对帐");
// LMLabel.setText(LMLabel.getText());//注意这里是{联盟对帐={联盟对帐=3000}}
// 注意这里是{联盟对帐={联盟对帐=3000}}
LMLabel.setText(lm);
}
use of com.kendy.entity.TeamInfo in project financial by greatkendy123.
the class MoneyService method lock10Tables.
/**
* 缓存十个表数据
* @param tableTeamHuishui
* @return
*/
public static Map<String, String> lock10Tables(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) throws Exception {
/**
********************************************** 战绩表 *************
*/
ObservableList<TotalInfo> TotalInfoObservableList = tableTotal.getItems();
List<TotalInfo> TotalInfoList = new LinkedList<>();
for (TotalInfo info : TotalInfoObservableList) {
TotalInfoList.add(info);
}
/**
********************************************** 玩家表 *************
*/
ObservableList<WanjiaInfo> WanjiaInfoObservableList = tableWanjia.getItems();
if (WanjiaInfoObservableList == null) {
WanjiaInfoObservableList = FXCollections.observableArrayList();
}
List<WanjiaInfo> WanjiaInfoList = new LinkedList<>();
for (WanjiaInfo info : WanjiaInfoObservableList) {
WanjiaInfoList.add(info);
}
/**
********************************************** 团队回水表 *************
*/
ObservableList<TeamInfo> TeamInfoInfoObservableList = tableTeam.getItems();
List<TeamInfo> TeamInfoList = new LinkedList<>();
for (TeamInfo info : TeamInfoInfoObservableList) {
// 对于已结算过的不再记录
String hasJiesuaned = info.getHasJiesuaned();
if ("".equals(hasJiesuaned) || "0".equals(hasJiesuaned)) {
TeamInfoList.add(info);
}
}
String sumOfTeam = tableTeam.getColumns().get(4).getText();
/**
********************************************** 实时金额表 *************
*/
ObservableList<CurrentMoneyInfo> ObservableList = tableCurrentMoney.getItems();
List<CurrentMoneyInfo> list = new LinkedList<>();
for (CurrentMoneyInfo info : ObservableList) {
list.add(info);
}
String sumOfCurrentMoney = tableCurrentMoney.getColumns().get(2).getText();
/**
********************************************** 资金表 *************
*/
ObservableList<ZijinInfo> ZijinInfoObservableList = tableZijin.getItems();
List<ZijinInfo> listZijinInfo = new LinkedList<>();
for (ZijinInfo info : ZijinInfoObservableList) {
listZijinInfo.add(info);
}
String sumOfZijin = tableZijin.getColumns().get(1).getText();
/**
********************************************** 利润表 *************
*/
ObservableList<ProfitInfo> ProfitInfoObservableList = tableProfit.getItems();
List<ProfitInfo> listProfitInfo = new LinkedList<>();
for (ProfitInfo info : ProfitInfoObservableList) {
listProfitInfo.add(info);
}
String sumOfProfit = tableProfit.getColumns().get(1).getText();
/**
********************************************** 实时开销表 *************
*/
ObservableList<KaixiaoInfo> KaixiaoInfoObservableList = tableKaixiao.getItems();
List<KaixiaoInfo> listKaixiaoInfo = new LinkedList<>();
for (KaixiaoInfo info : KaixiaoInfoObservableList) {
log.info(info.getKaixiaoType());
listKaixiaoInfo.add(info);
}
String sumOfKaixiao = tableKaixiao.getColumns().get(1).getText();
/**
********************************************** 当局表 *************
*/
ObservableList<DangjuInfo> DangjuInfoObservableList = tableDangju.getItems();
List<DangjuInfo> listDangjuInfo = new LinkedList<>();
for (DangjuInfo info : DangjuInfoObservableList) {
listDangjuInfo.add(info);
}
String sumOfDangjuInfo = tableDangju.getColumns().get(1).getText();
/**
********************************************** 交收表 *************
*/
ObservableList<JiaoshouInfo> JiaoshouInfoObservableList = tableJiaoshou.getItems();
List<JiaoshouInfo> listJiaoshouInfo = new LinkedList<>();
for (JiaoshouInfo info : JiaoshouInfoObservableList) {
listJiaoshouInfo.add(info);
}
String sumOfJiaoshouInfo = tableJiaoshou.getColumns().get(1).getText();
/**
********************************************** 平帐表 *************
*/
ObservableList<PingzhangInfo> PingzhangInfoObservableList = tablePingzhang.getItems();
List<PingzhangInfo> listPingzhangInfo = new LinkedList<>();
for (PingzhangInfo info : PingzhangInfoObservableList) {
listPingzhangInfo.add(info);
}
String sumOfPingzhangInfo = tablePingzhang.getColumns().get(1).getText();
// 汇总信息
Map<String, String> map = new HashMap<>();
map.put("战绩", JSON.toJSONString(TotalInfoList));
map.put("玩家", JSON.toJSONString(WanjiaInfoList));
map.put("团队回水", JSON.toJSONString(TeamInfoList));
map.put("团队回水总和", sumOfTeam);
map.put("实时金额", JSON.toJSONString(list));
map.put("实时金额总和", sumOfCurrentMoney);
map.put("资金", JSON.toJSONString(listZijinInfo));
map.put("资金总和", sumOfZijin);
map.put("利润", JSON.toJSONString(listProfitInfo));
map.put("利润总和", sumOfProfit);
map.put("实时开销", JSON.toJSONString(listKaixiaoInfo));
map.put("实时开销总和", sumOfKaixiao);
map.put("当局", JSON.toJSONString(listDangjuInfo));
map.put("当局总和", sumOfDangjuInfo);
map.put("交收", JSON.toJSONString(listJiaoshouInfo));
map.put("交收总和", sumOfJiaoshouInfo);
map.put("平帐", JSON.toJSONString(listPingzhangInfo));
map.put("平帐总和", sumOfPingzhangInfo);
map.put("联盟对帐", getLMLabelText(LMLabel));
return map;
}
use of com.kendy.entity.TeamInfo in project financial by greatkendy123.
the class WaizhaiService method get_SSJE_Gudong_Map.
/**
* 获取每个股东的实时金额
* 包括个人和存在于左边的团队
* @time 2017年12月27日
* @param tableCurrentMoneyInfo
* @param tableTeam
* @return
*/
public static Map<String, List<CurrentMoneyInfo>> get_SSJE_Gudong_Map(TableView<CurrentMoneyInfo> tableCurrentMoneyInfo, TableView<TeamInfo> tableTeam) {
int pageIndex = DataConstans.Index_Table_Id_Map.size();
if (pageIndex < 0) {
return new HashMap<>();
}
// 获取实时金额数据
Map<String, String> map = DataConstans.All_Locked_Data_Map.get(pageIndex + "");
List<CurrentMoneyInfo> CurrentMoneyInfoList = null;
List<TeamInfo> teamInfoList = null;
// 情况1:从最新的表中获取数据
if (tableTeam != null && tableTeam.getItems() != null) {
CurrentMoneyInfoList = new ArrayList<>();
for (CurrentMoneyInfo infos : tableCurrentMoneyInfo.getItems()) {
CurrentMoneyInfoList.add(infos);
}
teamInfoList = new ArrayList<>();
for (TeamInfo infos : tableTeam.getItems()) {
teamInfoList.add(infos);
}
} else // 情况2:从最新的锁定表中获取数据
{
CurrentMoneyInfoList = JSON.parseObject(MoneyService.getJsonString(map, "实时金额"), new TypeReference<List<CurrentMoneyInfo>>() {
});
teamInfoList = JSON.parseObject(MoneyService.getJsonString(map, "团队回水"), new TypeReference<List<TeamInfo>>() {
});
}
List<CurrentMoneyInfo> SSJE_obList = new LinkedList<>();
for (CurrentMoneyInfo infos : CurrentMoneyInfoList) {
if (!StringUtil.isBlank(infos.getWanjiaId()) && !StringUtil.isBlank(infos.getMingzi())) {
SSJE_obList.add(infos);
}
}
// 获取每个股东的实时金额数据
List<String> gudongList = DataConstans.gudongList;
int gudongSize = gudongList.size();
List<CurrentMoneyInfo> eachGudongList = null;
Map<String, List<CurrentMoneyInfo>> gudongMap = new HashMap<>();
String playerId;
Player player;
// 步骤1:添加玩家
for (CurrentMoneyInfo infos : SSJE_obList) {
boolean isSuperId = DataConstans.Combine_Super_Id_Map.containsKey(infos.getWanjiaId());
if (!isSuperId) {
// 为解决联合ID的问题,在这里把父节点信息加了进来,后面会把父节点的联合额度为0或空的清除掉,问题:能否在此处就过滤过??
if (StringUtil.isBlank(infos.getShishiJine()) || "0".equals(infos.getShishiJine()) || !infos.getShishiJine().contains("-")) {
continue;
}
}
// if(StringUtil.isBlank(infos.getShishiJine())
// || "0".equals(infos.getShishiJine())
// || !infos.getShishiJine().contains("-")) {
// continue;
// }
playerId = infos.getWanjiaId();
if (!StringUtil.isBlank(playerId)) {
player = DataConstans.membersMap.get(playerId);
if (player == null) {
ShowUtil.show("名单列表中匹配不到该玩家!玩家名称:" + infos.getMingzi() + " ID是" + infos.getWanjiaId());
continue;
}
if (gudongList.contains(player.getGudong())) {
for (String gudong : gudongList) {
if (gudong.equals(player.getGudong())) {
if (gudongMap.get(gudong) == null) {
eachGudongList = new ArrayList<>();
// eachGudongList.add(infos);
} else {
eachGudongList = gudongMap.get(gudong);
// eachGudongList.add(infos);
}
/**
***2018-01-01 add***
*/
CurrentMoneyInfo tempInfo = copyCurrentMoneyInfo(infos);
eachGudongList.add(tempInfo);
/**
******
*/
gudongMap.put(gudong, eachGudongList);
break;
}
}
} else {
ShowUtil.show("玩家的股东不存在于股东表中!玩家名称:" + infos.getMingzi() + " ID是" + infos.getWanjiaId());
break;
}
} else {
ShowUtil.show("玩家ID为空!玩家名称:" + infos.getMingzi() + " ID是" + infos.getWanjiaId());
}
}
// 步骤2:处理个人外债和有联合额度的外债
Map<String, CurrentMoneyInfo> ssje_map = get_SSJE_Map(SSJE_obList);
handlePersonWaizhai(gudongMap, ssje_map);
System.out.println("===============================================以上外债信息为:处理个人外债和有联合额度的外债finishes");
// 步骤3:添加团队
for (TeamInfo infos : teamInfoList) {
String teamId = infos.getTeamID();
Huishui hsInfo = DataConstans.huishuiMap.get(teamId);
if (hsInfo == null) {
ErrorUtil.err("外债信息:添加负数团队时检测到缓存中没有该团队信息,团队ID:" + teamId);
continue;
}
String isManaged = hsInfo.getZjManaged();
String gudong = hsInfo.getGudong();
String hasJiesuan = infos.getHasJiesuaned();
String zhanji = infos.getTeamZJ();
if (// 战绩非管理的团队
!"是".equals(isManaged) && // 未结算的团队
!"1".equals(hasJiesuan) && zhanji.contains("-")) {
// 战绩为负数的团队
CurrentMoneyInfo cmi = new CurrentMoneyInfo();
cmi.setMingzi("团队" + teamId);
cmi.setShishiJine(infos.getTeamZJ());
if (gudongMap.get(gudong) == null) {
eachGudongList = new ArrayList<>();
eachGudongList.add(cmi);
} else {
eachGudongList = gudongMap.get(gudong);
eachGudongList.add(cmi);
}
gudongMap.put(gudong, eachGudongList);
}
}
/*
* A、负数个人(若其父节点的联合额度为正则不显示 )
* B、公司(不显示团队;若其父节点的联合额度为正则不显示,否则不显示子ID,只显示联合额度;其他节点不变
* C、非公司团队(全部累加到相应团队;若其父节点的联合额度为正则只累加联合额度;其他节点累加实时金额)
*/
if (MapUtil.isHavaValue(gudongMap)) {
// LMController.allClubMap.keySet().forEach(clubID -> log.info(LMController.allClubMap.keySet()));
Iterator<Map.Entry<String, List<CurrentMoneyInfo>>> it = gudongMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, List<CurrentMoneyInfo>> entry = it.next();
String gudongName = entry.getKey();
// if(!"B".equals(gudongName)) continue;//只测试股东B
List<CurrentMoneyInfo> eachList = entry.getValue();
// 深层复制
List<CurrentMoneyInfo> tempEachList = copyListCurrentMoneyInfo(eachList);
List<CurrentMoneyInfo> tempSuperList = new ArrayList<>();
// 过滤掉没有负数团队的股东,过滤掉没有联合ID的股东
if (CollectUtil.isNullOrEmpty(eachList))
continue;
// if(eachList.stream().filter(cmi->cmi.getMingzi().startsWith("团队")).count() == 0) continue;
if (eachList.stream().filter(cmi -> DataConstans.Combine_Super_Id_Map.containsKey(cmi.getWanjiaId())).count() == 0)
continue;
// 处理包含有负数团队的股东(既有联合ID,又有负数团队)
ListIterator<CurrentMoneyInfo> ite = eachList.listIterator();
while (ite.hasNext()) {
CurrentMoneyInfo cmi = ite.next();
String pId = cmi.getWanjiaId();
// TODO 对下面的特殊情况进行分析
if (pId == null && cmi.getMingzi() != null && cmi.getMingzi().startsWith("团队")) {
continue;
}
boolean isSuperId = DataConstans.Combine_Super_Id_Map.containsKey(pId);
// 1528833636
Player _player = DataConstans.membersMap.get(pId);
// 如ST,公司
String teamID = _player.getTeamName();
// 将联合ID的金额设置到对应的团队里
if (isSuperId) {
String playerName = DataConstans.membersMap.get(pId).getPlayerName();
if ("公司".equals(teamID)) {
final String _cmSuperIdSum = cmi.getCmSuperIdSum();
cmi.setShishiJine(_cmSuperIdSum);
log.info(String.format("外债:股东%s--属于公司的父节点%s(%s)设置联合额度%s为实时金额", gudongName, playerName, pId, _cmSuperIdSum));
continue;
}
final String _teamId = "团队" + DataConstans.membersMap.get(pId).getTeamName();
Optional<CurrentMoneyInfo> teamInfoOpt = eachList.stream().filter(info -> info.getMingzi().equals(_teamId)).findFirst();
if (teamInfoOpt.isPresent()) {
CurrentMoneyInfo teamInfo = teamInfoOpt.get();
teamInfo.setShishiJine(NumUtil.getSum(teamInfo.getShishiJine(), cmi.getShishiJine()));
ite.remove();
log.info(String.format("外债:股东%s--有联合ID的父节点%s(%s)将%s转移到%s,并删除父节点", gudongName, playerName, pId, cmi.getShishiJine(), teamInfo.getMingzi()));
} else {
// 新增一个所属团队信息
ite.remove();
CurrentMoneyInfo cmiInfo = new CurrentMoneyInfo(_teamId, cmi.getCmSuperIdSum(), "", "");
ite.add(cmiInfo);
log.info(String.format("外债:股东%s--根据父点(%s)新建团队外债信息(%s),联合额度(团队的实时金额)为%s,并删除父节点", gudongName, playerName, _teamId, cmi.getCmSuperIdSum()));
}
} else // 非公司团队,非父节点,累加进其所属的团队中
if (!"公司".equals(teamID)) {
String playerName = DataConstans.membersMap.get(pId).getPlayerName();
final String _teamId = "团队" + DataConstans.membersMap.get(pId).getTeamName();
Optional<CurrentMoneyInfo> teamInfoOpt = eachList.stream().filter(info -> info.getMingzi().equals(_teamId)).findFirst();
if (teamInfoOpt.isPresent()) {
CurrentMoneyInfo teamInfo = teamInfoOpt.get();
teamInfo.setShishiJine(NumUtil.getSum(teamInfo.getShishiJine(), cmi.getShishiJine()));
ite.remove();
log.info(String.format("外债:股东%s--非父节点%s(%s)将%s转移到%s,并删除非父节点", gudongName, playerName, pId, cmi.getShishiJine(), teamInfo.getMingzi()));
} else {
// 新增一个所属团队信息
ite.remove();
CurrentMoneyInfo cmiInfo = new CurrentMoneyInfo(_teamId, cmi.getShishiJine(), "", "");
ite.add(cmiInfo);
log.info(String.format("外债:股东%s--根据非父点(%s)新建团队外债信息(%s),联合额度(团队的实时金额)为%s,并删除非父节点", gudongName, playerName, _teamId, cmi.getShishiJine()));
}
}
}
}
}
return gudongMap;
}
use of com.kendy.entity.TeamInfo in project financial by greatkendy123.
the class MyController method initialize.
/**
* 节点加载完后需要进行的一些初始化操作
* Initializes the controller class. This method is automatically called
* after the fxml file has been loaded.
*/
@SuppressWarnings("unchecked")
@Override
public void initialize(URL location, ResourceBundle resources) {
table_Profit = this.tableProfit;
// 第一次打开主窗口时设置当前俱乐部ID值
String clubIdValue = PropertiesUtil.readProperty("clubId");
currentClubId = lable_currentClubId;
if (clubIdValue != null)
lable_currentClubId.setText(clubIdValue);
// 第一次打开主窗口时显示所有股东
// //股东
String gudongs = PropertiesUtil.readProperty("gudong");
DataConstans.gudongList = new ArrayList<>();
if (!StringUtil.isBlank(gudongs)) {
for (String gudong : gudongs.split(",")) {
DataConstans.gudongList.add(gudong);
}
}
for (String gd : DataConstans.gudongList) gudongListView.getItems().add(gd);
// 模拟初始化第一个tableView
// kendy:绑定数据域
// 支付按钮
pay.setCellFactory(cellFactory);
// 绑定玩家信息表
bindCellValue(tuan, wanjiaId, wanjia, jifen, shishou, baoxian, chuHuishui, baohui, shuihouxian, heLirun, shouHuishui);
jifen.setCellFactory(getColorCellFactory(new TotalInfo()));
shishou.setCellFactory(getColorCellFactory(new TotalInfo()));
baoxian.setCellFactory(getColorCellFactory(new TotalInfo()));
shuihouxian.setCellFactory(getColorCellFactory(new TotalInfo()));
chuHuishui.setCellFactory(getColorCellFactory(new TotalInfo()));
// 绑定牌局表
bindCellValue(paiju, wanjiaName, zhangji, yicunJifen, heji);
// 支付按钮:单独出来
pay.setCellFactory(cellFactory);
pay.setStyle("-fx-alignment: CENTER;");
// 复制按钮:单独出来
copy.setCellFactory(cellFactoryCopy);
copy.setStyle("-fx-alignment: CENTER;");
zhangji.setCellFactory(getColorCellFactory(new WanjiaInfo()));
yicunJifen.setCellFactory(getColorCellFactory(new WanjiaInfo()));
heji.setCellFactory(getColorCellFactory(new WanjiaInfo()));
// 绑定实时金额表
tableCurrentMoneyInfo.setEditable(true);
bindCellValue(cmSuperIdSum, mingzi, shishiJine, cmiEdu);
cmSuperIdSum.setStyle("-fx-alignment: CENTER;-fx-font-weight: bold;");
shishiJine.setCellFactory(TextFieldTableCell.forTableColumn());
// shishiJine.setCellFactory(redAndEditCellFactory);
shishiJine.setOnEditCommit(new EventHandler<CellEditEvent<CurrentMoneyInfo, String>>() {
@Override
public void handle(CellEditEvent<CurrentMoneyInfo, String> t) {
String oldValue = t.getOldValue();
// 修改原值
CurrentMoneyInfo cmInfo = (CurrentMoneyInfo) t.getTableView().getItems().get(t.getTablePosition().getRow());
if (cmInfo != null && !StringUtil.isBlank(cmInfo.getMingzi())) {
// 更新到已存积分
boolean isChangedOK = MoneyService.changeYicunJifen(tablePaiju, cmInfo.getMingzi(), t.getNewValue());
if (isChangedOK) {
cmInfo.setShishiJine(t.getNewValue());
} else {
cmInfo.setShishiJine(t.getOldValue());
String ss = t.getTableView().getItems().get(t.getTablePosition().getRow()).getShishiJine();
tableCurrentMoneyInfo.refresh();
}
// 最后刷新实时金额表
MoneyService.flush_SSJE_table();
} else if (cmInfo != null) {
cmInfo.setShishiJine(null);
ShowUtil.show("空行不能输入", 1);
tableCurrentMoneyInfo.refresh();
}
}
});
// 绑定资金表
tableZijin.setEditable(true);
bindCellValue(zijinType, zijinAccount);
// zijinAccount.setCellFactory(TextFieldTableCell.forTableColumn());
zijinType.setCellFactory(zijinCellFactory);
zijinAccount.setCellFactory(getColorCellFactory(new ZijinInfo()));
// 绑定利润表
bindCellValue(profitType, profitAccount);
profitAccount.setCellFactory(getColorCellFactory(new ProfitInfo()));
// 绑定实时开销表
bindCellValue(kaixiaoType, kaixiaoMoney);
kaixiaoMoney.setCellFactory(getColorCellFactory(new KaixiaoInfo()));
// 绑定实时当局表
bindCellValue(type, money);
money.setCellFactory(getColorCellFactory(new DangjuInfo()));
// 绑定交收表
bindCellValue(jiaoshouType, jiaoshouMoney);
jiaoshouMoney.setCellFactory(getColorCellFactory(new JiaoshouInfo()));
// 绑定平帐表
bindCellValue(pingzhangType, pingzhangMoney);
pingzhangMoney.setCellFactory(getColorCellFactory(new PingzhangInfo()));
// 绑定团队表
bindCellValue(teamID, teamZJ, teamHS, teamBS, teamSum);
teamJiesuan.setCellFactory(cellFactoryJiesuan);
teamJiesuan.setStyle("-fx-alignment: CENTER;");
teamZJ.setCellFactory(getColorCellFactory(new TeamInfo()));
teamBS.setCellFactory(getColorCellFactory(new TeamInfo()));
teamHS.setCellFactory(getColorCellFactory(new TeamInfo()));
teamSum.setCellFactory(getColorCellFactory(new TeamInfo()));
// 绑定代理查询表(团队当天查询)
bindCellValue(proxyPlayerId, proxyPlayerName, proxyYSZJ, proxyZJ, proxyBaoxian, proxyHuishui, proxyHuiBao, proxyTableId);
proxyYSZJ.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
proxyZJ.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
proxyBaoxian.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
// 绑定代理查询中的合计表
bindCellValue(proxySumType, proxySum);
proxySum.setCellFactory(getColorCellFactory(new ProxySumInfo()));
// 绑定汇总信息表(当天每一局的团队汇总查询)
bindCellValue(zonghuiTabelId, zonghuiFuwufei, zonghuiBaoxian, zonghuiHuishui, zonghuiHuiBao);
zonghuiBaoxian.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
zonghuiHuishui.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
zonghuiHuiBao.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
// 绑定汇总查询中的当天汇总表
bindCellValue(huizongType, huizongMoney);
huizongMoney.setCellFactory(getColorCellFactory(new DangtianHuizongInfo()));
// 绑定汇总查询中的开销表表
bindCellValue(zonghuiKaixiaoType, zonghuiKaixiaoMoney);
zonghuiKaixiaoMoney.setCellFactory(getColorCellFactory(new ZonghuiKaixiaoInfo()));
// 绑定会员查询中的会员当天战绩表
bindCellValue(memberJu, memberZJ);
memberZJ.setCellFactory(getColorCellFactory(new MemberZJInfo()));
// 绑定实时上码表
// ,shangmaShishou,shangmaJu
bindCellValue(shangmaLianheEdu, shangmaName, shangmaEdu, shangmaAvailableEdu, shangmaYCJF, shangmaYiSM, shangmaSumOfZJ, shangmaPlayerId);
tableShangma.setRowFactory(new Callback<TableView<ShangmaInfo>, TableRow<ShangmaInfo>>() {
@Override
public TableRow<ShangmaInfo> call(TableView<ShangmaInfo> param) {
return new TableRowControl(tableShangma);
}
});
// shangmaPlayerId.setCellFactory(shangmaLeftNameCellFactory);
// shangmaName.setCellFactory(shangmaLeftNameCellFactory);
// shangmaEdu.setCellFactory(shangmaLeftNameCellFactory);
// shangmaSumOfZJ.setCellFactory(shangmaLeftNameCellFactory);
// shangmaYiSM.setCellFactory(shangmaLeftNameCellFactory);
// shangmaYCJF.setCellFactory(shangmaLeftNameCellFactory);
shangmaLianheEdu.setCellFactory(getColorCellFactory(new ShangmaInfo()));
// red_NotEdit_CellFactory
shangmaAvailableEdu.setCellFactory(getColorCellFactory(new ShangmaInfo()));
shangmaYCJF.setCellFactory(getColorCellFactory(new ShangmaInfo()));
// 绑定外债信息表
bindCellValue(waizhaiType, waizhaiMoney);
waizhaiMoney.setCellFactory(getColorCellFactory(new WaizhaiInfo()));
// 绑定上码个人信息表
tableShangmaDetail.setEditable(true);
bindCellValue(shangmaDetailName, shangmaJu, shangmaSM, shangmaShishou);
shangmaDetailName.setCellFactory(ShangmaNameCellFactory);
shangmaJu.setCellFactory(ShangmaNameCellFactory);
shangmaSM.setCellFactory(ShangmaNameCellFactory);
shangmaShishou.setCellFactory(ShangmaNameCellFactory);
tableShangma.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue, Object newValue) {
ShangmaInfo smInfo = (ShangmaInfo) newValue;
// 加载右边的个人详情
if (smInfo != null) {
String playerId = smInfo.getShangmaPlayerId();
if (!StringUtil.isBlank(playerId)) {
ShangmaService.loadSMDetailTable(playerId);
ShangmaService.loadSMNextDayTable(playerId);
}
} else
tableShangmaDetail.setItems(null);
}
});
// 绑定次日信息表
shangmaNextDayName.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaDetailName"));
shangmaNextDayName.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDayName.setStyle("-fx-alignment: CENTER;");
shangmaNextDayJu.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaJu"));
shangmaNextDayJu.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDayJu.setStyle("-fx-alignment: CENTER;");
shangmaNextDaySM.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaSM"));
shangmaNextDaySM.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDaySM.setStyle("-fx-alignment: CENTER;");
// 绑定积查询表
bindCellValue(jfRank, jfPlayerName, jfValue);
// ////初始化实时金额表
MoneyService.iniitMoneyInfo(tableCurrentMoneyInfo);
// tableTotalInfo.setItems(tableTotalInfoList);
// tableKaixiao.setItems(FXCollections.observableArrayList(
// new KaixiaoInfo("测试列","12")
// ));
// //////////////////总汇表中的初始化
juTypeListView.getItems().add("合局");
LMLabel.setTextFill(Color.web("#CD3700"));
// 设置Label 的文本颜色。
indexLabel.setTextFill(Color.web("#0076a3"));
indexLabel.setFont(new Font("Arial", 30));
// //////////////////代理查询中的团队回水选择
TeamProxyService.initTeamProxy(tableProxyTeam, proxySumHBox, teamIDCombox, isZjManage, proxyDateLabel, tableProxySum, proxyHSRate, proxyHBRate, proxyFWF, hasTeamBaoxian);
// //////////////////代理查询中的团队回水选择
TeamProxyService.initTeamSelectAction(teamIDCombox, isZjManage, tableProxyTeam, proxySumHBox);
// //////////////////会员服务类
MemberService.initMemberQuery(memberListView, tableMemberZJ, memberDateStr, memberPlayerId, memberPlayerName, memberSumOfZJ, memberTotalZJ);
tabsAction();
// //////////////////实时上马系统
initShanagma();
// /////////////合并ID
CombineIDController.initCombineIdController(tableCurrentMoneyInfo);
// //////////积分查询
JifenService.initJifenService(jfTeamIDCombox);
// 是否启动测试模式
initAutoTestMode();
// 选择导入白名单的版本
initWhiteVersion();
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/LM_Tab_Fram.fxml").openStream());
// loader.setController(lmController);
lmController = loader.getController();
Tab tab1 = new Tab();
tab1.setText("联盟对账");
tab1.setClosable(false);
tab1.setContent(root);
tabs.getTabs().add(tab1);
} catch (IOException e) {
ErrorUtil.err("联盟tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/Quota_Tab_Fram.fxml").openStream());
loader.setController(new QuotaController());
Tab quotaTab = new Tab();
quotaTab.setText("联盟配账");
quotaTab.setClosable(false);
quotaTab.setContent(root);
tabs.getTabs().add(quotaTab);
} catch (IOException e) {
ErrorUtil.err("联盟配账tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/gudong_contribution.fxml").openStream());
loader.setController(new GDController());
Tab gdTab = new Tab();
gdTab.setText("股东贡献值");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
} catch (IOException e) {
ErrorUtil.err("股东贡献值tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/TG_toolaa.fxml").openStream());
Tab gdTab = new Tab();
gdTab.setText("托管工具");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
tgController = (TGController) loader.getController();
} catch (IOException e) {
ErrorUtil.err("托管小工具tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/SM_Auto.fxml").openStream());
Tab gdTab = new Tab();
gdTab.setText("自动上码配置");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
smAutoController = (SMAutoController) loader.getController();
} catch (IOException e) {
ErrorUtil.err("托管小工具tab加载失败", e);
}
}
use of com.kendy.entity.TeamInfo 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, "联盟对帐"));
}
Aggregations