Search in sources :

Example 1 with InputDialog

use of com.kendy.util.InputDialog in project financial by greatkendy123.

the class TGController method AddTGTeamRateBtnAction.

/**
 * 添加托管团队
 */
public void AddTGTeamRateBtnAction(ActionEvent event) {
    InputDialog dialog = new InputDialog("添加托管团队", "托管团队", "团队比例");
    Optional<Pair<String, String>> result = dialog.getResult();
    if (result.isPresent()) {
        try {
            Pair<String, String> map = result.get();
            String teamId = map.getKey().trim();
            String teamRate = map.getValue().trim();
            // 是否重复
            List<TypeValueInfo> tableTGTeams = getTableTGTeams();
            boolean repeatTeamId = tableTGTeams.stream().anyMatch(info -> teamId.equals(info.getType()));
            if (repeatTeamId) {
                ShowUtil.show(teamId + "团队已经存在!");
                return;
            }
            if (!teamRate.endsWith("%")) {
                ShowUtil.show("比例必须包含百分比符号%");
                return;
            }
            // 添加
            tableTGTeams.add(new TypeValueInfo(teamId, teamRate));
            String teamsJson = JSON.toJSONString(tableTGTeams);
            DBUtil.saveOrUpdateOthers(TG_TEAM_RATE_DB_KEY, teamsJson);
            // 刷新当前表(战绩) TODO
            refreshTableTGTeam();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : InputDialog(com.kendy.util.InputDialog) TypeValueInfo(com.kendy.entity.TypeValueInfo) Pair(javafx.util.Pair)

Example 2 with InputDialog

use of com.kendy.util.InputDialog 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 InputDialog

use of com.kendy.util.InputDialog in project financial by greatkendy123.

the class MyController method updateTeamHsRateAction.

/**
 * 修改团队回水
 *
 * @time 2017年11月17日
 * @param event
 */
public void updateTeamHsRateAction(ActionEvent event) {
    InputDialog inputDlg = new InputDialog("修改", "待修改的团队ID:", "团队新回水比例:");
    Optional<Pair<String, String>> result = inputDlg.getResult();
    result.ifPresent(teamId_and_hsRate -> {
        // 获取到原始的有效的团队ID及团队回水率
        String teamID = teamId_and_hsRate.getKey();
        String teamHsRate = teamId_and_hsRate.getValue();
        if (StringUtil.isBlank(teamID) || StringUtil.isBlank(teamHsRate)) {
            ShowUtil.show("修改失败!原因:团队ID或团队回水不能为空!!");
            return;
        }
        teamID = teamID.trim().toUpperCase();
        teamHsRate = teamHsRate.trim();
        // 判断是否有此团队
        Huishui hs = DataConstans.huishuiMap.get(teamID);
        if (hs == null) {
            ShowUtil.show("修改失败!原因:不存在此团队ID,请检查!");
            return;
        }
        if (!teamHsRate.endsWith("%")) {
            ShowUtil.show("修改失败!原因:团队回水必须中有百分号!");
            return;
        }
        // 开始修改
        // 1修改数据库
        Double _hsRate = NumUtil.getNumByPercent(teamHsRate);
        int size = (_hsRate + "").length();
        if (size > 6) {
            _hsRate = NumUtil.getNum(NumUtil.digit4(_hsRate.toString()));
        }
        if (!DBUtil.updateTeamHsRate(teamID, _hsRate + "")) {
            return;
        }
        // 2修改缓存
        // 地址引用,会修改值
        hs.setHuishuiRate(NumUtil.getNumByPercent(teamHsRate) + "");
        ShowUtil.show("修改成功!", 2);
    });
}
Also used : Huishui(com.kendy.entity.Huishui) TextInputDialog(javafx.scene.control.TextInputDialog) InputDialog(com.kendy.util.InputDialog) Pair(javafx.util.Pair)

Example 4 with InputDialog

use of com.kendy.util.InputDialog in project financial by greatkendy123.

the class MyController method updateTeamHsBaoxianRateAction.

/**
 * 修改团队保险比例
 *
 * @time 2018年2月8日
 * @param event
 */
public void updateTeamHsBaoxianRateAction(ActionEvent event) {
    InputDialog inputDlg = new InputDialog("修改团队保险比例", "待修改的团队ID:", "团队新保险比例:");
    Optional<Pair<String, String>> result = inputDlg.getResult();
    result.ifPresent(teamId_and_hsRate -> {
        // 获取到原始的有效的团队ID及团队回水率
        String teamID = teamId_and_hsRate.getKey();
        String teamHsRate = teamId_and_hsRate.getValue();
        if (StringUtil.isBlank(teamID) || StringUtil.isBlank(teamHsRate)) {
            ShowUtil.show("修改失败!原因:团队ID或团队回水不能为空!!");
            return;
        }
        teamID = teamID.trim().toUpperCase();
        teamHsRate = teamHsRate.trim();
        // 判断是否有此团队
        Huishui hs = DataConstans.huishuiMap.get(teamID);
        if (hs == null) {
            ShowUtil.show("修改失败!原因:不存在此团队ID,请检查!");
            return;
        }
        if (!teamHsRate.endsWith("%")) {
            ShowUtil.show("修改失败!原因:团队保险必须中有百分号!");
            return;
        }
        // 开始修改
        // 1修改数据库
        Double _hsRate = NumUtil.getNumByPercent(teamHsRate);
        int size = (_hsRate + "").length();
        if (size > 6) {
            _hsRate = NumUtil.getNum(NumUtil.digit4(_hsRate.toString()));
        }
        if (!DBUtil.updateTeamHsBaoxianRate(teamID, _hsRate + "")) {
            return;
        }
        // 2修改缓存
        // 地址引用,会修改值
        hs.setInsuranceRate(NumUtil.getNumByPercent(teamHsRate) + "");
        ShowUtil.show("修改成功!", 2);
    });
}
Also used : Huishui(com.kendy.entity.Huishui) TextInputDialog(javafx.scene.control.TextInputDialog) InputDialog(com.kendy.util.InputDialog) Pair(javafx.util.Pair)

Example 5 with InputDialog

use of com.kendy.util.InputDialog in project financial by greatkendy123.

the class MyController method updateTeamHsGudongAction.

/**
 * 修改团队股东
 *
 * @param event
 */
public void updateTeamHsGudongAction(ActionEvent event) {
    InputDialog inputDlg = new InputDialog("修改团队股东", "待修改的团队ID:", "团队新股东:");
    Optional<Pair<String, String>> result = inputDlg.getResult();
    result.ifPresent(teamId_and_teamGD -> {
        // 获取到原始的有效的团队ID及团队回水率
        String teamID = teamId_and_teamGD.getKey();
        String teamGD = teamId_and_teamGD.getValue();
        if (StringUtil.isBlank(teamID) || StringUtil.isBlank(teamGD)) {
            ShowUtil.show("修改失败!原因:团队ID或团队股东不能为空!!");
            return;
        }
        teamID = teamID.trim().toUpperCase();
        teamGD = teamGD.trim();
        // 判断是否有此团队
        Huishui hs = DataConstans.huishuiMap.get(teamID);
        if (hs == null) {
            ShowUtil.show("修改失败!原因:不存在此团队ID,请检查!");
            return;
        }
        // 1修改数据库
        if (!DBUtil.updateTeamHsGudong(teamID, teamGD)) {
            ShowUtil.show("修改失败");
            return;
        }
        // 2修改缓存
        // 地址引用,会修改值
        hs.setGudong(teamGD);
        ShowUtil.show("修改成功!", 2);
    });
}
Also used : Huishui(com.kendy.entity.Huishui) TextInputDialog(javafx.scene.control.TextInputDialog) InputDialog(com.kendy.util.InputDialog) Pair(javafx.util.Pair)

Aggregations

InputDialog (com.kendy.util.InputDialog)10 Pair (javafx.util.Pair)5 Club (com.kendy.entity.Club)4 Huishui (com.kendy.entity.Huishui)3 TextInputDialog (javafx.scene.control.TextInputDialog)3 ClubBankModel (com.kendy.entity.ClubBankModel)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 ClubBankInfo (com.kendy.entity.ClubBankInfo)1 TypeValueInfo (com.kendy.entity.TypeValueInfo)1