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;
}
}
}
}
}
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;
}
Aggregations