Search in sources :

Example 1 with ClubBankModel

use of com.kendy.entity.ClubBankModel 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 ClubBankModel

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

the class QuotaController method addClubBankAction.

/**
 * 添加一个俱乐部银行卡记录
 *
 * @time 2017年12月19日
 * @param event
 */
public void addClubBankAction(ActionEvent event) {
    List<String> list = Arrays.asList("俱乐部ID", "移动类型", "姓名", "手机", "银行类型", "银行信息");
    InputDialog dlg = new InputDialog();
    dlg.InputMultyDialog("新增", list);
    Optional<Map<String, String>> resultMapOpt = dlg.getMultyResult();
    System.out.println(resultMapOpt.toString());
    if (resultMapOpt.isPresent()) {
        Map<String, String> map = resultMapOpt.get();
        String clubID = StringUtil.nvl(map.get(list.get(0)), "");
        String mobileType = StringUtil.nvl(map.get(list.get(1)), "");
        String personName = StringUtil.nvl(map.get(list.get(2)), "");
        String phoneNumber = StringUtil.nvl(map.get(list.get(3)), "");
        String bankType = StringUtil.nvl(map.get(list.get(4)), "");
        String bankAccountInfo = StringUtil.nvl(map.get(list.get(5)), "");
        if (StringUtil.isAnyBlank(clubID)) {
            ShowUtil.show("俱乐部ID不能为空!");
            return;
        }
        // 判断是否有该ID信息
        Club club = allClubMap.get(clubID);
        if (club == null) {
            ShowUtil.show("不存在此俱乐部ID:" + clubID);
            return;
        }
        // 入库操作
        ClubBankModel bank = new ClubBankModel();
        bank.setClubId(clubID);
        bank.setMobilePayType(mobileType);
        bank.setClubName(club.getName());
        bank.setBankType(bankType);
        bank.setPersonName(personName);
        bank.setPhoneNumber(phoneNumber);
        bank.setBankAccountInfo(bankAccountInfo);
        boolean isAdd2DB = DBUtil.addOrUpdateClubBank(bank);
        // 往银行信息表添加一条记录
        addClubBank2Table(bank);
        // 更新缓存
        allClubBankModels.put(clubID, bank);
        ShowUtil.show("添加成功", 2);
    }
}
Also used : InputDialog(com.kendy.util.InputDialog) Club(com.kendy.entity.Club) ClubBankModel(com.kendy.entity.ClubBankModel) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 3 with ClubBankModel

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

the class QuotaController method exportClubPayExcel.

/**
 ********************************************************************************
 *
 *                                     导出Excel
 *
 **********************************************************************************
 */
public void exportClubPayExcel(ActionEvent event) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
    // 标题
    String title = currentLMLabels.getText() + "俱乐部结账单-" + sdf.format(new Date());
    // 列名
    String[] rowName = new String[] { "付款方", "收款方", "转账", "支付类型", "联系人", "手机", "银行卡信息" };
    ;
    // 输出
    String out = "D:/" + title + System.currentTimeMillis();
    // 数据
    ObservableList<QuotaMoneyInfo> obList = tableQuotaPay.getItems();
    if (CollectUtil.isNullOrEmpty(obList)) {
        ShowUtil.show("没有需要导出的数据!");
        return;
    }
    List<Object[]> dataList = new ArrayList<Object[]>();
    Object[] objs = null;
    String clubId = "";
    for (QuotaMoneyInfo info : obList) {
        ClubBankModel model = allClubBankModels.get(info.getQuotaMoneyClubId());
        objs = new Object[rowName.length];
        objs[0] = info.getQuotaMoneyPaytor();
        objs[1] = info.getQuotaMoneyGather();
        objs[2] = "转" + info.getQuotaMoney() + "到";
        objs[3] = model.getMobilePayType();
        objs[4] = model.getPersonName();
        objs[5] = model.getPhoneNumber();
        objs[6] = model.getBankAccountInfo();
        dataList.add(objs);
    }
    ExportQuotaPayExcel excel = new ExportQuotaPayExcel(title, rowName, dataList, out);
    try {
        excel.export();
        log.info("导出单个联盟俱乐部结账单完成!");
    } catch (Exception e) {
        ErrorUtil.err("导出单个联盟俱乐部结账单失败", e);
    }
}
Also used : ExportQuotaPayExcel(com.kendy.excel.ExportQuotaPayExcel) QuotaMoneyInfo(com.kendy.entity.QuotaMoneyInfo) ArrayList(java.util.ArrayList) Date(java.util.Date) ClubBankModel(com.kendy.entity.ClubBankModel) SimpleDateFormat(java.text.SimpleDateFormat)

Example 4 with ClubBankModel

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

the class QuotaController method convert2ClubBankModel.

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

Example 5 with ClubBankModel

use of com.kendy.entity.ClubBankModel 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

ClubBankModel (com.kendy.entity.ClubBankModel)6 HashMap (java.util.HashMap)3 ClubBankInfo (com.kendy.entity.ClubBankInfo)2 InputDialog (com.kendy.util.InputDialog)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Club (com.kendy.entity.Club)1 QuotaMoneyInfo (com.kendy.entity.QuotaMoneyInfo)1 ExportQuotaPayExcel (com.kendy.excel.ExportQuotaPayExcel)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1