Search in sources :

Example 6 with ZijinInfo

use of com.kendy.entity.ZijinInfo in project financial by greatkendy123.

the class MoneyService method openAddZijinDiag.

// 右表:名称鼠标双击事件:打开对话框增加上码值
public static void openAddZijinDiag(TableView<ZijinInfo> tableZijin, ZijinInfo info) {
    if (info != null && info.getZijinType() != null) {
        String oddZijin = StringUtil.isBlank(info.getZijinAccount()) ? "0" : info.getZijinAccount();
        String newSM = "";
        TextInputDialog dialog = new TextInputDialog();
        dialog.setTitle("添加");
        dialog.setHeaderText(null);
        dialog.setContentText("续增" + info.getZijinType() + "值(Enter):");
        Optional<String> result = dialog.showAndWait();
        if (result.isPresent()) {
            try {
                Integer.valueOf(result.get().trim());
            } catch (Exception e) {
                ShowUtil.show("非法数据!");
                return;
            }
            info.setZijinAccount(MoneyService.digit0(MoneyService.getNum(oddZijin) + MoneyService.getNum(result.get().trim())));
        }
        if (tableZijin != null && tableZijin.getItems() != null) {
            for (ZijinInfo zijin : tableZijin.getItems()) {
                if (zijin.getZijinType().equals(info.getZijinType())) {
                    zijin.setZijinAccount(info.getZijinAccount());
                    break;
                }
            }
        }
    }
}
Also used : ZijinInfo(com.kendy.entity.ZijinInfo) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 7 with ZijinInfo

use of com.kendy.entity.ZijinInfo in project financial by greatkendy123.

the class MoneyService method getSumOfTableZijin.

/**
 * 计算资金表的总和
 */
private static Double getSumOfTableZijin(TableView<ZijinInfo> table) {
    // 获取ObserableList
    ObservableList<ZijinInfo> list = table.getItems();
    Double sumOfTable = 0.0;
    if (list == null)
        return sumOfTable;
    // 表中每一行的具体金额
    String tempSingleVal = "";
    for (ZijinInfo moneyInfo : list) {
        tempSingleVal = moneyInfo.getZijinAccount();
        sumOfTable += getNum(tempSingleVal);
    }
    ;
    return sumOfTable;
}
Also used : ZijinInfo(com.kendy.entity.ZijinInfo)

Aggregations

ZijinInfo (com.kendy.entity.ZijinInfo)7 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)5 ProfitInfo (com.kendy.entity.ProfitInfo)5 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)4 TeamInfo (com.kendy.entity.TeamInfo)4 DangjuInfo (com.kendy.entity.DangjuInfo)3 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)3 PingzhangInfo (com.kendy.entity.PingzhangInfo)3 TotalInfo (com.kendy.entity.TotalInfo)3 WanjiaInfo (com.kendy.entity.WanjiaInfo)3 LinkedList (java.util.LinkedList)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 ObservableList (javafx.collections.ObservableList)2 GDController (com.kendy.controller.GDController)1 QuotaController (com.kendy.controller.QuotaController)1 DangtianHuizongInfo (com.kendy.entity.DangtianHuizongInfo)1 MemberZJInfo (com.kendy.entity.MemberZJInfo)1 ProxySumInfo (com.kendy.entity.ProxySumInfo)1