Search in sources :

Example 21 with CurrentMoneyInfo

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();
}
Also used : Player(com.kendy.entity.Player) Stage(javafx.stage.Stage) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 22 with CurrentMoneyInfo

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();
}
Also used : Stage(javafx.stage.Stage) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 23 with CurrentMoneyInfo

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();
        }
    }
}
Also used : CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 24 with CurrentMoneyInfo

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);
    }
}
Also used : ArrayList(java.util.ArrayList) ExportMembersExcel(com.kendy.excel.ExportMembersExcel) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 25 with CurrentMoneyInfo

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;
}
Also used : CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Aggregations

CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)39 LinkedList (java.util.LinkedList)14 ArrayList (java.util.ArrayList)13 HashMap (java.util.HashMap)13 List (java.util.List)12 ObservableList (javafx.collections.ObservableList)12 Map (java.util.Map)11 Player (com.kendy.entity.Player)10 TeamInfo (com.kendy.entity.TeamInfo)6 ProfitInfo (com.kendy.entity.ProfitInfo)5 Node (javafx.scene.Node)5 MyController (application.MyController)4 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)4 ZijinInfo (com.kendy.entity.ZijinInfo)4 Alert (javafx.scene.control.Alert)4 ButtonType (javafx.scene.control.ButtonType)4 DangjuInfo (com.kendy.entity.DangjuInfo)3 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)3 PingzhangInfo (com.kendy.entity.PingzhangInfo)3 ShangmaInfo (com.kendy.entity.ShangmaInfo)3