use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class AddController method add_SSJE_person_Action.
/**
* 增加人员的实时金额
*/
public void add_SSJE_person_Action(ActionEvent event) {
// 先对玩家ID进行判断
String playerId = cmPlayerId.getText();
Player player;
if (StringUtil.isBlank(playerId)) {
ShowUtil.show("操作失败!请详看系统说明!");
return;
} else {
playerId = playerId.trim();
// 从人员表查找相关记录
player = DataConstans.membersMap.get(playerId);
if (player == null) {
ShowUtil.show("操作失败!人员表中无此ID,请先添加该人员!");
return;
}
// 重复判断
if (MoneyService.isExistIn_SSJE_Table_byId(playerId)) {
ShowUtil.show("操作失败!实时金额表中已经存在此ID,请查检!");
return;
}
}
// 添加实时金额
CurrentMoneyInfo tempMoneyInfo = new CurrentMoneyInfo(player.getPlayerName(), cmMoney.getText(), player.getgameId(), player.getEdu());
MoneyService.addInfo(tempMoneyInfo);
ShowUtil.show("添加成功", 2);
MoneyService.flush_SSJE_table();
MoneyService.scrolById(playerId);
// 获取到新增人员窗口的实例
Stage addNewPlayerStage = DataConstans.framesNameMap.get(Constants.ADD_CURRENT_MONEY_FRAME);
DataConstans.framesNameMap.remove(Constants.ADD_CURRENT_MONEY_FRAME);
addNewPlayerStage.close();
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class AddController method add_SSJE_other_Action.
/**
* 增加临时实时金额(非人员金额)
*
* @time 2017年11月9日
* @param event
*/
public void add_SSJE_other_Action(ActionEvent event) {
// 先对名称进行判断
String name = cmName.getText();
if (StringUtil.isBlank(name)) {
ShowUtil.show("操作失败!请详看系统说明!");
return;
}
// 重复判断
if (MoneyService.isExistIn_SSJE_Table_byName(name)) {
ShowUtil.show("操作失败!实时金额表中已经存在此名称,请查检!");
return;
}
// 添加实时金额
CurrentMoneyInfo tempMoneyInfo = new CurrentMoneyInfo(name, cmMoney.getText(), "", "");
MoneyService.addInfo(tempMoneyInfo);
ShowUtil.show("添加成功", 2);
MoneyService.flush_SSJE_table();
MoneyService.scrolByName(name);
// 获取到新增人员窗口的实例
Stage addNewPlayerStage = DataConstans.framesNameMap.get(Constants.ADD_CURRENT_MONEY_FRAME);
DataConstans.framesNameMap.remove(Constants.ADD_CURRENT_MONEY_FRAME);
addNewPlayerStage.close();
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class MoneyService method updatePlayerName.
/**
* 修改玩家名称
*
* @time 2017年10月29日
* @param playerId
* @param oldeName
* @param newName
*/
public static void updatePlayerName(String playerId, String oldeName, String newName) {
ObservableList<CurrentMoneyInfo> obList = tableCurrentMoneyInfo.getItems();
boolean isExist = false;
if (obList != null && obList.size() > 0) {
for (CurrentMoneyInfo info : obList) {
// 先通过ID进行匹配
if (info != null && info.getMingzi() != null && info.getWanjiaId() != null && info.getWanjiaId().equals(playerId)) {
info.setMingzi(newName);
isExist = true;
break;
}
// 再通过名称进行匹配
if (info != null && info.getMingzi() != null && info.getMingzi().trim().equals(oldeName)) {
info.setMingzi(newName);
isExist = true;
break;
}
}
if (isExist) {
tableCurrentMoneyInfo.refresh();
}
}
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class MoneyService method exportSSJEAction.
/**
*********************** 导出实时金额Excel ***********************************
*/
public static void exportSSJEAction(TableView<CurrentMoneyInfo> tableCurrentMoneyInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String title = "实时金额表" + sdf.format(new Date());
log.info("导出实时金额表Excel:" + title);
String[] rowsName = new String[] { "总和", "玩家ID", "名字", "实时金额", "额度" };
List<Object[]> dataList = new ArrayList<Object[]>();
Object[] objs = null;
ObservableList<CurrentMoneyInfo> currentInfoList = tableCurrentMoneyInfo.getItems();
for (CurrentMoneyInfo info : currentInfoList) {
objs = new Object[rowsName.length];
objs[0] = info.getCmSuperIdSum();
objs[1] = info.getWanjiaId();
objs[2] = info.getMingzi();
objs[3] = info.getShishiJine();
objs[4] = info.getCmiEdu();
// objs[4] = info.getWanjiaId();
dataList.add(objs);
}
String out = "D:/" + title;
ExportMembersExcel ex = new ExportMembersExcel(title, rowsName, dataList, out);
try {
ex.export();
log.debug("导出实时金额表Excel成功");
} catch (Exception e) {
ErrorUtil.err("导出实时金额表Excel失败", e);
}
}
use of com.kendy.entity.CurrentMoneyInfo in project financial by greatkendy123.
the class MoneyService method scrolById.
/**
* 滚动到指定行(根据玩家ID)
*/
public static boolean scrolById(String playerId) {
// 检查该玩家是否存在
boolean isExist = false;
if (isTableNotNull() && playerId != null) {
playerId = playerId.trim();
ObservableList<CurrentMoneyInfo> list = tableCurrentMoneyInfo.getItems();
String tempId = "";
for (CurrentMoneyInfo moneyInfo : list) {
tempId = moneyInfo.getWanjiaId();
if (StringUtil.isBlank(tempId)) {
continue;
} else {
tempId = tempId.trim();
}
if (playerId.equals(moneyInfo.getShishiJine())) {
int index = list.indexOf(moneyInfo);
tableCurrentMoneyInfo.scrollTo(index);
// table.getSelectionModel().focus(index);
tableCurrentMoneyInfo.getSelectionModel().select(index);
isExist = true;
break;
}
}
}
return isExist;
}
Aggregations