Search in sources :

Example 6 with WanjiaInfo

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

the class MyController method payedAllAction.

/**
 * 支付全部(有空再去实现吧)
 *
 * @time 2017年11月11日
 * @param event
 */
public void payedAllAction(ActionEvent event) {
    if (tablePaiju != null && tablePaiju.getItems() != null) {
        TableColumn<WanjiaInfo, ?> col = tablePaiju.getColumns().get(tablePaiju.getColumns().size() - 1);
        ObservableList<TableColumn<WanjiaInfo, ?>> columns = tablePaiju.getColumns();
        for (WanjiaInfo info : tablePaiju.getItems()) {
            System.out.println(info.toString());
        }
    } else {
        ShowUtil.show("全支付失败:因为牌局表为空!");
    }
}
Also used : WanjiaInfo(com.kendy.entity.WanjiaInfo) TableColumn(javafx.scene.control.TableColumn)

Example 7 with WanjiaInfo

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

the class MyController method openCancelAlertAction.

/**
 * 撤销当局信息
 */
public void openCancelAlertAction(ActionEvent event) {
    Alert alert = new Alert(AlertType.CONFIRMATION);
    alert.setTitle("提示");
    alert.setHeaderText(null);
    alert.setContentText("\r\n你确定要撤销本局所有操作吗?");
    Optional<ButtonType> result = alert.showAndWait();
    if (result.get() == ButtonType.OK) {
        importZJBtn.setDisable(false);
        log.debug("确定撤销本局所有操作");
        // 备份到01场次
        try {
            // 如果以下三个有没有数据则可判断还没导入最新的Excel
            ObservableList<TotalInfo> obListTotal = tableTotalInfo.getItems();
            ObservableList<WanjiaInfo> obListPaiju = tablePaiju.getItems();
            selected_LM_type = "";
            if (tableTotalInfo.getItems() == null || tablePaiju.getItems() == null || tableTotalInfo.getItems().size() == 0 || tablePaiju.getItems().size() == 0) {
                ShowUtil.show("您还没有导入数据", 1);
                return;
            }
            // 当局已结算的团队服务费之和  要置为0
            current_Jiesuaned_team_fwf_sum = 0d;
            if (DataConstans.Index_Table_Id_Map.size() == 0) {
                LMLabel.setText(getLMValFirstTime());
                // MoneyService.fillTableCurrentMoneyInfo(tableCurrentMoneyInfo, tableZijin, tableProfit,tableKaixiao,LMLabel);
                fillTables(tableCurrentMoneyInfo, tableZijin, tableProfit, tableKaixiao, LMLabel);
                // 清空相关表数据(保留类似昨日留底的表数据)
                // 这里不缓存团队回水了,直接清空
                DataConstans.SumMap = new LinkedHashMap<>();
                DataConstans.Team_Huishui_Map = new LinkedHashMap<>();
                DataConstans.Total_Team_Huishui_Map = new LinkedHashMap<>();
                DataConstans.Dangju_Team_Huishui_List = new LinkedList<>();
                clearData(tableTotalInfo, tablePaiju, tableTeam, tableDangju, tableJiaoshou, tablePingzhang);
                // 获取第一次加载的上码表的个人详情{玩家ID=List<ShangmaDetailInfo>}
                ConsUtil.refresh_SM_Detail_Map();
                return;
            }
            // 情况二:锁定后再撤销
            // 加载前一场数据
            int pageIndex = DataConstans.Index_Table_Id_Map.size();
            // 撤销的代码
            cancelDangju();
            log.debug("=====================缓存中的数据恢复成功!");
            ShowUtil.show("撤销成功", 1);
        } catch (Exception e) {
            ShowUtil.show("撤销失败!!!", 1);
            e.printStackTrace();
        }
    } else {
        log.debug("取消撤销本局所有操作");
    }
}
Also used : WanjiaInfo(com.kendy.entity.WanjiaInfo) TotalInfo(com.kendy.entity.TotalInfo) Alert(javafx.scene.control.Alert) ButtonType(javafx.scene.control.ButtonType) IOException(java.io.IOException)

Example 8 with WanjiaInfo

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

the class MoneyService method fillTablePaiju.

public static void fillTablePaiju(TableView<WanjiaInfo> tablePaiju, ObservableList<WanjiaInfo> tableWanjiaInfoList) {
    List<WanjiaInfo> linkedList = new LinkedList<>();
    List<WanjiaInfo> noNeedPayList = new ArrayList<>();
    if (tableWanjiaInfoList != null && tableWanjiaInfoList.size() > 0) {
        for (WanjiaInfo info : tableWanjiaInfoList) {
            linkedList.add(info);
        }
        ListIterator<WanjiaInfo> it = linkedList.listIterator();
        WanjiaInfo wj = null;
        while (it.hasNext()) {
            wj = it.next();
            // //解决不时本应支付确显示成已支付的bug
            // if(!"1".equals(wj.getHasPayed())){
            // btn.setText("支付");
            // }else {
            // btn.setText("已支付");
            // }
            // setGraphic(btn);//小林:这一行解决了支付按钮消失的问题
            // 在此处增加是否要显示该按钮(如果玩家从属于某个非空或非公司的团队,则无需显示按钮)
            // 这个tempTeamId是hasPayed的内容,这里没有公司的人
            String tempTeamId = wj.getHasPayed();
            if (!StringUtil.isBlank(tempTeamId) && !"0".equals(tempTeamId)) {
                // 获取团队信息
                Huishui hs = DataConstans.huishuiMap.get(tempTeamId);
                // 情况一:有从属团队的玩家,再分两种情况
                if (hs != null) {
                    // A:若团队战绩要管理,需要显示支付按钮
                    if ("是".equals(hs.getZjManaged())) {
                    // log.info("====teamId为不为空,要显示,要战绩管理:是");
                    // setGraphic(btn);
                    // B:若团队战绩不要管理,无须显示支付按钮
                    } else {
                        noNeedPayList.add(wj);
                        it.remove();
                    // log.info("hsPayed:====================hs为空:"+hs.getZjManaged());
                    // setGraphic(null);
                    }
                }
            } else {
            // log.info("====teamId为空或为0,要显示+"+DataConstans.membersMap.get(wj.getWanjiaId()).getTeamName());
            // //情况二:对于没有从从属的团队的玩家或者团队是公司的玩家,一定需要需要显示支付按钮
            // setGraphic(btn);
            }
        }
        if (noNeedPayList.size() > 0) {
            for (WanjiaInfo info : noNeedPayList) {
                linkedList.add(info);
            }
        }
        if (noNeedPayList != null && noNeedPayList.size() > 0) {
            tableWanjiaInfoList.clear();
            for (WanjiaInfo info : linkedList) {
                tableWanjiaInfoList.add(info);
            }
        }
        // 刷新牌局表
        tablePaiju.setItems(tableWanjiaInfoList);
        tablePaiju.refresh();
    }
}
Also used : Huishui(com.kendy.entity.Huishui) WanjiaInfo(com.kendy.entity.WanjiaInfo) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList)

Example 9 with WanjiaInfo

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

the class MoneyService method reCovery10TablesByPage.

/**
 * 根据分页自动恢复该页锁定的10个表数据
 */
public static void reCovery10TablesByPage(TableView<TotalInfo> tableTotal, TableView<WanjiaInfo> tableWanjia, TableView<TeamInfo> tableTeam, TableView<CurrentMoneyInfo> tableCurrentMoney, TableView<ZijinInfo> tableZijin, TableView<KaixiaoInfo> tableKaixiao, TableView<ProfitInfo> tableProfit, TableView<DangjuInfo> tableDangju, TableView<JiaoshouInfo> tableJiaoshou, TableView<PingzhangInfo> tablePingzhang, Label LMLabel, int pageIndex) throws Exception {
    // 获取该页所有数据
    Map<String, String> map = DataConstans.All_Locked_Data_Map.get(pageIndex + "");
    /**
     *****************************************************
     */
    // List<TotalInfo> TotalInfoList = JSON.parseObject(map.get("战绩"), new TypeReference<List<TotalInfo>>() {});
    List<TotalInfo> TotalInfoList = JSON.parseObject(getJsonString(map, "战绩"), new TypeReference<List<TotalInfo>>() {
    });
    ObservableList<TotalInfo> obList = FXCollections.observableArrayList();
    for (TotalInfo infos : TotalInfoList) {
        obList.add(infos);
    }
    tableTotal.setItems(obList);
    tableTotal.refresh();
    /**
     *********************************************************
     */
    List<WanjiaInfo> WanjiaInfoList = JSON.parseObject(getJsonString(map, "玩家"), new TypeReference<List<WanjiaInfo>>() {
    });
    ObservableList<WanjiaInfo> WanjiaInfo_OB_List = FXCollections.observableArrayList();
    for (WanjiaInfo infos : WanjiaInfoList) {
        WanjiaInfo_OB_List.add(infos);
    }
    tableWanjia.setItems(WanjiaInfo_OB_List);
    tableWanjia.refresh();
    /**
     *************************************************************************
     */
    List<TeamInfo> TeamInfoList = JSON.parseObject(getJsonString(map, "团队回水"), new TypeReference<List<TeamInfo>>() {
    });
    ObservableList<TeamInfo> TeamInfo_OB_List = FXCollections.observableArrayList();
    for (TeamInfo infos : TeamInfoList) {
        TeamInfo_OB_List.add(infos);
    }
    tableTeam.setItems(TeamInfo_OB_List);
    tableTeam.getColumns().get(4).setText(getJsonString(map, "团队回水总和"));
    tableTeam.refresh();
    /**
     *************************************************************************
     */
    List<CurrentMoneyInfo> CurrentMoneyInfoList = JSON.parseObject(getJsonString(map, "实时金额"), new TypeReference<List<CurrentMoneyInfo>>() {
    });
    ObservableList<CurrentMoneyInfo> CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
    for (CurrentMoneyInfo infos : CurrentMoneyInfoList) {
        CurrentMoneyInfo_OB_List.add(infos);
    }
    tableCurrentMoney.setItems(CurrentMoneyInfo_OB_List);
    String sumOfCurrentMoney = getJsonString(map, "实时金额总和");
    tableCurrentMoney.getColumns().get(2).setText(sumOfCurrentMoney);
    tableCurrentMoney.refresh();
    /**
     **********************************************************
     */
    List<ZijinInfo> ZijinInfoList = JSON.parseObject(getJsonString(map, "资金"), new TypeReference<List<ZijinInfo>>() {
    });
    ObservableList<ZijinInfo> ZijinInfo_OB_List = FXCollections.observableArrayList();
    for (ZijinInfo infos : ZijinInfoList) {
        ZijinInfo_OB_List.add(infos);
    }
    tableZijin.getColumns().get(1).setText(getJsonString(map, "资金总和"));
    tableZijin.setItems(ZijinInfo_OB_List);
    tableZijin.refresh();
    /**
     ***************************************************************
     */
    List<ProfitInfo> ProfitInfoList = JSON.parseObject(getJsonString(map, "利润"), new TypeReference<List<ProfitInfo>>() {
    });
    ObservableList<ProfitInfo> ProfitInfo_OB_List = FXCollections.observableArrayList();
    for (ProfitInfo infos : ProfitInfoList) {
        ProfitInfo_OB_List.add(infos);
    }
    tableProfit.getColumns().get(1).setText(getJsonString(map, "利润总和"));
    tableProfit.setItems(ProfitInfo_OB_List);
    tableProfit.refresh();
    /**
     **********************************************************
     */
    List<KaixiaoInfo> KaixiaoInfoList = JSON.parseObject(getJsonString(map, "实时开销"), new TypeReference<List<KaixiaoInfo>>() {
    });
    ObservableList<KaixiaoInfo> KaixiaoInfo_OB_List = FXCollections.observableArrayList();
    for (KaixiaoInfo infos : KaixiaoInfoList) {
        KaixiaoInfo_OB_List.add(infos);
    }
    tableKaixiao.getColumns().get(1).setText(getJsonString(map, "实时开销总和"));
    tableKaixiao.setItems(KaixiaoInfo_OB_List);
    tableKaixiao.refresh();
    /**
     ************************************************************
     */
    List<DangjuInfo> DangjuInfoList = JSON.parseObject(getJsonString(map, "当局"), new TypeReference<List<DangjuInfo>>() {
    });
    ObservableList<DangjuInfo> DangjuInfo_OB_List = FXCollections.observableArrayList();
    for (DangjuInfo infos : DangjuInfoList) {
        DangjuInfo_OB_List.add(infos);
    }
    tableDangju.getColumns().get(1).setText(getJsonString(map, "当局总和"));
    tableDangju.setItems(DangjuInfo_OB_List);
    tableDangju.refresh();
    /**
     *************************************************************
     */
    List<JiaoshouInfo> JiaoshouInfoList = JSON.parseObject(getJsonString(map, "交收"), new TypeReference<List<JiaoshouInfo>>() {
    });
    ObservableList<JiaoshouInfo> JiaoshouInfo_OB_List = FXCollections.observableArrayList();
    for (JiaoshouInfo infos : JiaoshouInfoList) {
        JiaoshouInfo_OB_List.add(infos);
    }
    tableJiaoshou.getColumns().get(1).setText(getJsonString(map, "交收总和"));
    tableJiaoshou.setItems(JiaoshouInfo_OB_List);
    tableJiaoshou.refresh();
    /**
     ***************************************************************
     */
    List<PingzhangInfo> PingzhangInfoList = JSON.parseObject(getJsonString(map, "平帐"), new TypeReference<List<PingzhangInfo>>() {
    });
    ObservableList<PingzhangInfo> PingzhangInfo_OB_List = FXCollections.observableArrayList();
    for (PingzhangInfo infos : PingzhangInfoList) {
        PingzhangInfo_OB_List.add(infos);
    }
    tablePingzhang.getColumns().get(1).setText(getJsonString(map, "平帐总和"));
    tablePingzhang.setItems(PingzhangInfo_OB_List);
    tablePingzhang.refresh();
    /**
     ***************************************************************
     */
    LMLabel.setText(getJsonString(map, "联盟对帐"));
}
Also used : JiaoshouInfo(com.kendy.entity.JiaoshouInfo) KaixiaoInfo(com.kendy.entity.KaixiaoInfo) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) ProfitInfo(com.kendy.entity.ProfitInfo) WanjiaInfo(com.kendy.entity.WanjiaInfo) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) PingzhangInfo(com.kendy.entity.PingzhangInfo) DangjuInfo(com.kendy.entity.DangjuInfo) TeamInfo(com.kendy.entity.TeamInfo) ZijinInfo(com.kendy.entity.ZijinInfo) TotalInfo(com.kendy.entity.TotalInfo)

Example 10 with WanjiaInfo

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

the class ShangmaService method updateShangDetailMap.

/**
 * 导入战绩时更新上码系统的个人信息
 */
public static void updateShangDetailMap(TableView<WanjiaInfo> table) {
    // final List<TeamHuishuiInfo> list = DataConstans.Dangju_Team_Huishui_List;
    ObservableList<WanjiaInfo> obList = table.getItems();
    Map<String, List<ShangmaDetailInfo>> detailMap = DataConstans.SM_Detail_Map;
    List<ShangmaDetailInfo> detailList = null;
    String playerId = "", preYSM, yiSM, tableId, ju;
    if (obList != null && obList.size() > 0) {
        // 遍历当局
        for (WanjiaInfo info : obList) {
            playerId = info.getWanjiaId();
            detailList = detailMap.get(playerId);
            if (detailList != null) {
                // getRealTableId(info.getPaiju());//不是第X局了,而是X
                tableId = info.getPaiju();
                // 遍历个人信息
                for (ShangmaDetailInfo sdi : detailList) {
                    ju = sdi.getShangmaJu();
                    if (!StringUtil.isBlank(ju) && ju.equals(tableId)) {
                        // 设置原先上码值,以及清空当局上码
                        preYSM = sdi.getShangmaSM();
                        sdi.setShangmaPreSM(preYSM);
                        sdi.setShangmaSM("");
                        // 设置实收
                        sdi.setShangmaShishou(info.getZhangji());
                        // add2017-09-24 加载主表
                        loadShangmaTable(DataConstans.membersMap.get(playerId).getTeamName(), tableSM);
                        // }
                        break;
                    }
                }
                detailMap.put(playerId, detailList);
            }
        }
    }
}
Also used : WanjiaInfo(com.kendy.entity.WanjiaInfo) ShangmaDetailInfo(com.kendy.entity.ShangmaDetailInfo) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList)

Aggregations

WanjiaInfo (com.kendy.entity.WanjiaInfo)11 TotalInfo (com.kendy.entity.TotalInfo)5 LinkedList (java.util.LinkedList)4 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)3 DangjuInfo (com.kendy.entity.DangjuInfo)3 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)3 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)3 PingzhangInfo (com.kendy.entity.PingzhangInfo)3 ProfitInfo (com.kendy.entity.ProfitInfo)3 TeamInfo (com.kendy.entity.TeamInfo)3 ZijinInfo (com.kendy.entity.ZijinInfo)3 ArrayList (java.util.ArrayList)3 ShangmaDetailInfo (com.kendy.entity.ShangmaDetailInfo)2 IOException (java.io.IOException)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 Huishui (com.kendy.entity.Huishui)1