Search in sources :

Example 31 with CurrentMoneyInfo

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

the class ShangmaService method loadShangmaTable.

/**
 * 加载上码主表
 *
 * @param teamId
 * @param tableShangma
 */
public static void loadShangmaTable(String teamId, TableView<ShangmaInfo> tableShangma) {
    double teamSumYiSM, teamSumZJ;
    try {
        ObservableList<ShangmaInfo> obList = FXCollections.observableArrayList();
        List<String> wanjiaIdList = teamIdAndPlayerIdMap.get(teamId);
        String playerName, edu, yicunJifen, sumAvailableEdu, sumYiSM, sumZJ;
        teamSumYiSM = 0d;
        teamSumZJ = 0d;
        if (wanjiaIdList != null) {
            if (cmiMap == null)
                // 加载cmiMap估计
                refresh_cmiMap_if_null();
            ShangmaInfo smInfo;
            for (String playerId : wanjiaIdList) {
                // 根据玩家ID找名称和额度和已存积分
                CurrentMoneyInfo cmiInfo = cmiMap.get(playerId);
                if (cmiInfo == null) {
                    Player player = DataConstans.membersMap.get(playerId);
                    if (player == null) {
                        int a = 0;
                    }
                    playerName = player.getPlayerName();
                    edu = player.getEdu();
                    // 最关键的区别
                    yicunJifen = "";
                } else {
                    playerName = cmiInfo.getMingzi();
                    edu = cmiInfo.getCmiEdu();
                    // 实时金额就是已存积分
                    yicunJifen = cmiInfo.getShishiJine();
                }
                // 根据玩家ID找个人详情
                Double[] sumArr = getSumDetail(playerId, edu, yicunJifen);
                sumAvailableEdu = MoneyService.digit0(sumArr[0]);
                sumYiSM = MoneyService.digit0(sumArr[1]);
                sumZJ = MoneyService.digit0(sumArr[2]);
                // 组装实体
                smInfo = new ShangmaInfo(playerName, edu, sumAvailableEdu, sumYiSM, sumZJ, playerId, yicunJifen, "");
                obList.add(smInfo);
                // 设置团队总和
                teamSumYiSM += sumArr[1];
                teamSumZJ += sumArr[2];
            }
        }
        // 刷新表
        tableShangma.setItems(obList);
        tableShangma.refresh();
        // 重新加载合并ID进去
        render_Shangma_info_talbe_0();
        // 设置团队总和
        labelZSM.setText(MoneyService.digit0(teamSumYiSM));
        labelZZJ.setText(MoneyService.digit0(teamSumZJ));
        // add 2018-2-19 设置团队押金与团队额度
        resetTeamYajinAndEdu();
    // System.out.println("设置团队押金与团队额度"+TimeUtil.getTime());
    } catch (Exception e1) {
        ErrorUtil.err("加载上码主表", e1);
    }
}
Also used : ShangmaInfo(com.kendy.entity.ShangmaInfo) Player(com.kendy.entity.Player) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 32 with CurrentMoneyInfo

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

the class TGExportExcelService method getTGWaizhaiExcelModel.

/**
 * 导出托管公司的团队外债与团队外债明细
 * @return
 */
private TGExcelModel getTGWaizhaiExcelModel() {
    TGExcelModel excelModel = new TGExcelModel();
    List<String> titleList = new LinkedList<>();
    List<Object[]> data = new LinkedList<>();
    List<String> titleSumList = new LinkedList<>();
    List<Object[]> dataSum = new LinkedList<>();
    // 取值
    // 传给Excel的外债数据
    Map<String, List<Object[]>> teamMap = new LinkedHashMap<>();
    ObservableList<Node> items = tgController.tgWZTeamHBox.getChildren();
    // 存放总和表
    ObservableList<TypeValueInfo> sumItems = tgController.tgWZTeam.getItems();
    if (CollectUtil.isHaveValue(sumItems)) {
        List<Object[]> teamList = tgController.tgWZTeam.getItems().stream().map(info -> {
            Object[] obj = new Object[2];
            obj[0] = info.getType();
            obj[1] = info.getValue();
            return obj;
        }).collect(Collectors.toList());
        String key = tgController.tgWZTeam.getColumns().get(0).getText() + "#" + tgController.tgWZTeam.getColumns().get(1).getText();
        teamMap.put(key, teamList);
    }
    // 存放明细表
    if (CollectUtil.isHaveValue(items)) {
        for (Node node : items) {
            TableView<CurrentMoneyInfo> table = (TableView<CurrentMoneyInfo>) node;
            List<Object[]> teamList = table.getItems().stream().map(info -> {
                Object[] obj = new Object[2];
                obj[0] = info.getMingzi();
                obj[1] = info.getShishiJine();
                return obj;
            }).collect(Collectors.toList());
            String key = table.getColumns().get(0).getText() + "#" + table.getColumns().get(1).getText();
            teamMap.put(key, teamList);
        }
    }
    excelModel.setColumnList(titleList);
    excelModel.setData(data);
    excelModel.setColumnSumList(titleSumList);
    excelModel.setDataSum(dataSum);
    excelModel.setSheetName("外债");
    // 设值
    excelModel.setWaiZai(true);
    excelModel.setWaizhaiMap(teamMap);
    return excelModel;
}
Also used : Button(javafx.scene.control.Button) Arrays(java.util.Arrays) TGCommentInfo(com.kendy.entity.TGCommentInfo) HashMap(java.util.HashMap) ExportTGExcel(com.kendy.excel.ExportTGExcel) TypeValueInfo(com.kendy.entity.TypeValueInfo) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) StringUtil(com.kendy.util.StringUtil) Map(java.util.Map) LinkedList(java.util.LinkedList) TGLirunInfo(com.kendy.entity.TGLirunInfo) TableView(javafx.scene.control.TableView) TGFwfinfo(com.kendy.entity.TGFwfinfo) TextField(javafx.scene.control.TextField) Label(javafx.scene.control.Label) TGTeamInfo(com.kendy.entity.TGTeamInfo) Node(javafx.scene.Node) TGController(com.kendy.controller.TGController) Collectors(java.util.stream.Collectors) TGExcelModel(com.kendy.entity.TGExcelModel) FXML(javafx.fxml.FXML) List(java.util.List) CollectUtil(com.kendy.util.CollectUtil) ShowUtil(com.kendy.util.ShowUtil) TGKaixiaoInfo(com.kendy.entity.TGKaixiaoInfo) ObservableList(javafx.collections.ObservableList) ErrorUtil(com.kendy.util.ErrorUtil) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) TypeValueInfo(com.kendy.entity.TypeValueInfo) Node(javafx.scene.Node) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap) TGExcelModel(com.kendy.entity.TGExcelModel) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) TableView(javafx.scene.control.TableView)

Example 33 with CurrentMoneyInfo

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

the class TgWaizhaiService method getTempNewSuperInfo.

/**
 * 构造实时金额表的父节点信息
 * 场景:子节点存在于实时金额表中,但父节点没有存在于实时金额表
 * 效果:模拟出一条父节点信息,代替其下所有子ID信息(主要是联合额度)
 * @time 2017年12月28日
 * @param superId 父节点信息
 * @param tempSuperMap 临时存储的父节点及子列表信息,用于计算联合额度
 * @return
 */
private static CurrentMoneyInfo getTempNewSuperInfo(String superId, Map<String, List<CurrentMoneyInfo>> tempSuperMap) {
    // 获取父节点信息
    Player superInfo = DataConstans.membersMap.get(superId);
    // 构造实时金额表的父节点信息
    CurrentMoneyInfo tempNewSuperInfo = new CurrentMoneyInfo(superInfo.getPlayerName(), "0", superId, superInfo.getEdu());
    return tempNewSuperInfo;
}
Also used : Player(com.kendy.entity.Player) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 34 with CurrentMoneyInfo

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

the class TgWaizhaiService method copyCurrentMoneyInfo.

/**
 * 复制一个实时金额表的记录
 * @time 2017年12月29日
 * @param info
 * @param tempSuperInfoMap
 * @return
 */
private static CurrentMoneyInfo copyCurrentMoneyInfo(CurrentMoneyInfo info) {
    CurrentMoneyInfo copyInfo = new CurrentMoneyInfo(info.getMingzi(), info.getShishiJine(), info.getWanjiaId(), info.getCmiEdu());
    copyInfo.setColor(info.getColor());
    copyInfo.setCmSuperIdSum(info.getCmSuperIdSum());
    return copyInfo;
}
Also used : CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo)

Example 35 with CurrentMoneyInfo

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

the class TgWaizhaiService method generateWaizhaiTables.

/**
 * 自动生成外债信息表
 * @param tableWaizhai
 * @param hbox
 * @param tableCurrentMoneyInfo
 * @param tableTeam
 */
@SuppressWarnings("unchecked")
public static void generateWaizhaiTables(TableView<TypeValueInfo> tableWaizhai, HBox hbox, TableView<CurrentMoneyInfo> tableCurrentMoneyInfo, TableView<TeamInfo> tableTeam) {
    // //获取托管团队ID
    // Set<String> tgTeamIdSet = getTGTeamId();
    // 清空数据
    ObservableList<Node> allTables = hbox.getChildren();
    if (allTables != null && allTables.size() > 0)
        hbox.getChildren().remove(0, allTables.size());
    if (DataConstans.Index_Table_Id_Map.size() == 0) {
        ShowUtil.show("你当前还未锁定任意一局,查询没有数据!", 2);
        return;
    }
    ObservableList<CurrentMoneyInfo> CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
    Map<String, List<CurrentMoneyInfo>> tgTeamIdMap = get_SSJE_Gudong_Map(tableCurrentMoneyInfo);
    Map<String, String> sumMap = getSum(tgTeamIdMap);
    int tgTeamIdMapSize = tgTeamIdMap.size();
    if (tgTeamIdMapSize == 0) {
        ShowUtil.show("股东列表为空或实时金额为空!");
        return;
    }
    TableView<CurrentMoneyInfo> table;
    for (Map.Entry<String, List<CurrentMoneyInfo>> entry : tgTeamIdMap.entrySet()) {
        String tgTeamName = entry.getKey();
        List<CurrentMoneyInfo> list = entry.getValue();
        table = new TableView<CurrentMoneyInfo>();
        // 设置列
        TableColumn firstNameCol = new TableColumn("团队" + tgTeamName);
        // 禁止排序
        firstNameCol.setSortable(false);
        firstNameCol.setPrefWidth(80);
        firstNameCol.setCellValueFactory(new PropertyValueFactory<CurrentMoneyInfo, String>("mingzi"));
        TableColumn lastNameCol = new TableColumn(sumMap.get(tgTeamName));
        // 禁止排序
        lastNameCol.setSortable(false);
        lastNameCol.setStyle("-fx-alignment: CENTER;");
        lastNameCol.setPrefWidth(65);
        lastNameCol.setCellValueFactory(new PropertyValueFactory<CurrentMoneyInfo, String>("shishiJine"));
        lastNameCol.setCellFactory(MyController.getColorCellFactory(new CurrentMoneyInfo()));
        table.setPrefWidth(150);
        table.getColumns().addAll(firstNameCol, lastNameCol);
        // 设置数据
        CurrentMoneyInfo_OB_List = FXCollections.observableArrayList();
        for (CurrentMoneyInfo info : list) {
            CurrentMoneyInfo_OB_List.add(info);
        }
        table.setItems(CurrentMoneyInfo_OB_List);
        hbox.setSpacing(5);
        hbox.setPadding(new Insets(0, 0, 0, 0));
        hbox.getChildren().addAll(table);
    }
    // 设置债务表
    ObservableList<TypeValueInfo> obList = FXCollections.observableArrayList();
    for (Map.Entry<String, String> entry : sumMap.entrySet()) {
        obList.add(new TypeValueInfo(entry.getKey(), entry.getValue()));
    }
    tableWaizhai.setItems(obList);
    setWaizhaiSum(tableWaizhai);
}
Also used : Insets(javafx.geometry.Insets) TypeValueInfo(com.kendy.entity.TypeValueInfo) Node(javafx.scene.Node) CurrentMoneyInfo(com.kendy.entity.CurrentMoneyInfo) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) ObservableList(javafx.collections.ObservableList) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)39 LinkedList (java.util.LinkedList)14 ArrayList (java.util.ArrayList)13 HashMap (java.util.HashMap)13 List (java.util.List)12 ObservableList (javafx.collections.ObservableList)12 Map (java.util.Map)11 Player (com.kendy.entity.Player)10 TeamInfo (com.kendy.entity.TeamInfo)6 ProfitInfo (com.kendy.entity.ProfitInfo)5 Node (javafx.scene.Node)5 MyController (application.MyController)4 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)4 ZijinInfo (com.kendy.entity.ZijinInfo)4 Alert (javafx.scene.control.Alert)4 ButtonType (javafx.scene.control.ButtonType)4 DangjuInfo (com.kendy.entity.DangjuInfo)3 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)3 PingzhangInfo (com.kendy.entity.PingzhangInfo)3 ShangmaInfo (com.kendy.entity.ShangmaInfo)3