use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class MoneyService method scrolByName.
/**
* 滚动到指定行(根据玩家名称)
*/
public static boolean scrolByName(String playerName) {
// 检查该玩家是否存在
boolean isExist = false;
if (isTableNotNull() && playerName != null) {
playerName = playerName.trim().toUpperCase();
ObservableList<CurrentMoneyInfo> list = tableCurrentMoneyInfo.getItems();
String tempName = "";
for (CurrentMoneyInfo moneyInfo : list) {
tempName = moneyInfo.getMingzi();
if (StringUtil.isBlank(tempName)) {
continue;
} else {
tempName = tempName.trim().toUpperCase();
}
if (playerName.equals(tempName)) {
int index = list.indexOf(moneyInfo);
tableCurrentMoneyInfo.scrollTo(index);
// table.getSelectionModel().focus(index);
tableCurrentMoneyInfo.getSelectionModel().select(index);
isExist = true;
break;
}
}
}
return isExist;
}
use of com.kendy.entity.CurrentMoneyInfo 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.CurrentMoneyInfo in project financial by greatkendy123.
the class MoneyService method saveOrUpdate.
// ***************************************** 刷新实时金额表新方案 ************************************
// 1 更新实时金额表的具体记录
// A:操作类型(增,删,改)
// 2 更新实时金额表的所有记录
// A:合并ID总和及上下空行
// B:滚动到那一条记录(无则不选)
// ***************************************** 刷新实时金额表新方案 ************************************
/**
* 增加 and 修改实时金额
*
* @time 2017年10月31日
* @param cmiInfo
*/
public static void saveOrUpdate(CurrentMoneyInfo cmiInfo) {
if (cmiInfo == null)
return;
String playerId = cmiInfo.getWanjiaId();
CurrentMoneyInfo info = getInfoById(playerId);
if (info == null) {
// 添加一条实时金额信息
addInfo(cmiInfo);
} else {
// 修改
info = cmiInfo;
}
refreshRecord();
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class ShangmaService method getDataAfterloadShangmaTable.
/**
********************************************************************************************************
*
* 自动上码部分
*
*********************************************************************************************************
*/
/**
* 获取加载上码主表后的数据
*
* @param teamId
* @param tableShangma
*/
public static SMResultModel getDataAfterloadShangmaTable(String teamId, String playerID) {
SMResultModel resultModel = new SMResultModel();
double teamSumYiSM, teamSumZJ;
try {
ObservableList<ShangmaInfo> obList = FXCollections.observableArrayList();
List<String> wanjiaIdList = teamIdAndPlayerIdMap.get(teamId);
String playerName, edu, yicunJifen, sumAvailableEdu, sumYiSM, sumZJ;
teamSumYiSM = 0d;
teamSumZJ = 0d;
if (wanjiaIdList != null) {
// if(cmiMap == null)
// 加载cmiMap估计
refresh_cmiMap_if_null();
ShangmaInfo smInfo;
for (String playerId : wanjiaIdList) {
// 根据玩家ID找名称和额度和已存积分
CurrentMoneyInfo cmiInfo = cmiMap.get(playerId);
if (cmiInfo == null) {
Player player = DataConstans.membersMap.get(playerId);
if (player == null) {
int a = 0;
}
playerName = player.getPlayerName();
edu = player.getEdu();
// 最关键的区别
yicunJifen = "";
} else {
playerName = cmiInfo.getMingzi();
edu = cmiInfo.getCmiEdu();
// 实时金额就是已存积分
yicunJifen = cmiInfo.getShishiJine();
}
// 根据玩家ID找个人详情
Double[] sumArr = getSumDetail(playerId, edu, yicunJifen);
sumAvailableEdu = MoneyService.digit0(sumArr[0]);
sumYiSM = MoneyService.digit0(sumArr[1]);
sumZJ = MoneyService.digit0(sumArr[2]);
// 组装实体
smInfo = new ShangmaInfo(playerName, edu, sumAvailableEdu, sumYiSM, sumZJ, playerId, yicunJifen, "");
obList.add(smInfo);
// 设置团队总和
teamSumYiSM += sumArr[1];
teamSumZJ += sumArr[2];
}
}
// 重新加载合并ID进去
LinkedList<ShangmaInfo> combineSMDataList = getCombineSMDataList(obList);
resultModel.setSmList(combineSMDataList);
resultModel.setPlayerId(playerID);
resultModel.setTeamId(teamId);
setSelectedSMInfo(resultModel, playerID, combineSMDataList);
// 赋新值
// 获取团队信息
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs != null) {
String _teamYajin = hs.getTeamYajin();
String _teamEdu = hs.getTeamEdu();
// 计算团队可上码
// 计算公式: 团队可上码= 押金 + 额度 + 团队战绩 - 团队已上码
Double teamSMAvailable = NumUtil.getNum(NumUtil.getSum(_teamYajin, _teamEdu, MoneyService.digit0(teamSumZJ))) - NumUtil.getNum(MoneyService.digit0(teamSumYiSM));
resultModel.setTeamTotalAvailabel(teamSMAvailable.intValue() + "");
}
} catch (Exception e1) {
ErrorUtil.err("自动上码:加载上码主表失败", e1);
}
return resultModel;
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class TgWaizhaiService method getSum.
/**
* 计算每个股东的外债总和
* @param tgTeamIdMap
* @return
*/
public static Map<String, String> getSum(Map<String, List<CurrentMoneyInfo>> tgTeamIdMap) {
final Map<String, String> map = new HashMap<>();
if (tgTeamIdMap != null && tgTeamIdMap.size() > 0) {
for (Map.Entry<String, List<CurrentMoneyInfo>> entry : tgTeamIdMap.entrySet()) {
Double sum = 0d;
for (CurrentMoneyInfo info : entry.getValue()) {
sum += NumUtil.getNum(info.getShishiJine());
}
map.put(entry.getKey(), NumUtil.digit0(sum));
}
}
return map;
}
Aggregations