Search in sources :

Example 1 with ClubBankInfo

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

the class QuotaController method autoSetBankData.

/**
 * 设置该联盟所有俱乐部的银行卡信息
 *
 * @time 2017年12月19日
 */
private void autoSetBankData() {
    ObservableList<ClubBankInfo> obList = FXCollections.observableArrayList();
    single_LM_map.forEach((clubId, quota) -> {
        ClubBankModel model = allClubBankModels.get(clubId);
        String clubName = quota.getQuotaClubName();
        if (model == null) {
            model = new ClubBankModel();
            model.setClubId(clubId);
            model.setClubName(clubName);
            model.setMobilePayType("支付宝");
            model.setBankType("银行卡");
            allClubBankModels.put(clubId, model);
        }
        ClubBankInfo bank = convert2ClubBankInfo(model);
        obList.add(bank);
    });
    tableQuotaBank.setItems(obList);
}
Also used : ClubBankInfo(com.kendy.entity.ClubBankInfo) ClubBankModel(com.kendy.entity.ClubBankModel)

Example 2 with ClubBankInfo

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

the class QuotaController method convert2ClubBankInfo.

// 转为实体
private ClubBankInfo convert2ClubBankInfo(ClubBankModel model) {
    ClubBankInfo bank = new ClubBankInfo();
    bank.setClubId(model.getClubId());
    bank.setMobilePayType(model.getMobilePayType());
    bank.setClubName(model.getClubName());
    bank.setBankType(model.getBankType());
    bank.setPersonName(model.getPersonName());
    bank.setPhoneNumber(model.getPhoneNumber());
    bank.setBankAccountInfo(model.getBankAccountInfo());
    return bank;
}
Also used : ClubBankInfo(com.kendy.entity.ClubBankInfo)

Example 3 with ClubBankInfo

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

the class QuotaController method addClubBank2Table.

/**
 * 往银行信息表添加一条记录
 * @time 2017年12月19日
 * @param model
 */
private void addClubBank2Table(ClubBankModel model) {
    // 转为实体
    ClubBankInfo bank = convert2ClubBankInfo(model);
    // 加进表中
    ObservableList<ClubBankInfo> obList = tableQuotaBank.getItems();
    if (obList == null) {
        obList = FXCollections.observableArrayList();
    }
    obList.add(bank);
    tableQuotaBank.refresh();
}
Also used : ClubBankInfo(com.kendy.entity.ClubBankInfo)

Example 4 with ClubBankInfo

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

the class QuotaController method updateClubBankAction.

/**
 * 修改俱乐部银行卡记录
 * @time 2017年12月19日
 * @param event
 */
public void updateClubBankAction(ActionEvent event) {
    ClubBankInfo item = getSelectClubBank();
    if (item == null) {
        ShowUtil.show("请先选择要修改的银行卡记录!");
        return;
    }
    Map<String, String> paramMap = new LinkedHashMap<>();
    paramMap.put("俱乐部名称", item.getClubName());
    paramMap.put("移动类型", item.getMobilePayType());
    paramMap.put("姓名", item.getPersonName());
    paramMap.put("手机", item.getPhoneNumber());
    paramMap.put("银行类型", item.getBankType());
    paramMap.put("银行信息", item.getBankAccountInfo());
    InputDialog dlg = new InputDialog();
    dlg.InputMultyDialog("修改", paramMap);
    Optional<Map<String, String>> resultMapOpt = dlg.getMultyResult();
    System.out.println(resultMapOpt.toString());
    if (resultMapOpt.isPresent()) {
        Map<String, String> map = resultMapOpt.get();
        String clubName = StringUtil.nvl(map.get("俱乐部名称"), "");
        String mobileType = StringUtil.nvl(map.get("移动类型"), "");
        String personName = StringUtil.nvl(map.get("姓名"), "");
        String phoneNumber = StringUtil.nvl(map.get("手机"), "");
        String bankType = StringUtil.nvl(map.get("银行类型"), "");
        String bankAccountInfo = StringUtil.nvl(map.get("银行信息"), "");
        if (StringUtil.isAnyBlank(clubName)) {
            ShowUtil.show("俱乐部名称不能为空!");
            return;
        }
        // 修改银行信息表
        ClubBankModel model = new ClubBankModel();
        model.setClubId(item.getClubId());
        model.setMobilePayType(mobileType);
        model.setClubName(clubName);
        model.setBankType(bankType);
        model.setPersonName(personName);
        model.setPhoneNumber(phoneNumber);
        model.setBankAccountInfo(bankAccountInfo);
        boolean isUpdate2DB = DBUtil.addOrUpdateClubBank(model);
        // 更新缓存
        allClubBankModels.put(item.getClubId(), model);
        // 刷新表
        convert2ClubBankInfo(model, item);
        tableQuotaBank.refresh();
        ShowUtil.show("修改成功", 2);
    }
}
Also used : ClubBankInfo(com.kendy.entity.ClubBankInfo) InputDialog(com.kendy.util.InputDialog) ClubBankModel(com.kendy.entity.ClubBankModel) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ClubBankInfo (com.kendy.entity.ClubBankInfo)4 ClubBankModel (com.kendy.entity.ClubBankModel)2 InputDialog (com.kendy.util.InputDialog)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1