Search in sources :

Example 6 with TeamInfo

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

the class MoneyService method fillTableTeam.

// 填充团队表
private static void fillTableTeam(TableView<TeamInfo> table, Set<String> relatedTeamIdSet) {
    sum_teamHS_and_teamBS = 0;
    // 准备数据
    ObservableList<TeamInfo> list = FXCollections.observableArrayList();
    // 这是后期增加:查看所有团队
    relatedTeamIdSet = DataConstans.Team_Huishui_Map.keySet();
    relatedTeamIdSet.forEach(relatedTeamId -> {
        if (!"公司".equals(relatedTeamId)) {
            double sumOfZJ = 0.0;
            double sumOfHS = 0.0;
            double sumOfBS = 0.0;
            List<TeamHuishuiInfo> teamLS = DataConstans.Team_Huishui_Map.get(relatedTeamId);
            for (TeamHuishuiInfo info : teamLS) {
                sumOfZJ += Double.valueOf(info.getShishou());
                sumOfHS += Math.abs(Double.valueOf(info.getChuHuishui()));
                // 就是回保
                sumOfBS += Double.valueOf(info.getBaoxian());
            }
            double sum = 0.0d;
            if (sumOfBS != 0) {
                // 需要乘以团队保险比例的
                // log.info(sumOfBS+"=="+getTeamInsuranceRate(relatedTeamId));
                sumOfBS *= -getTeamInsuranceRate(relatedTeamId);
            }
            if (isZjManaged(relatedTeamId)) {
                // 战绩代管理,不加战绩(个人记录有支付按钮,个人处理战绩)
                sum = sumOfHS + sumOfBS;
            } else {
                // 战绩不代管理,加战绩(个人记录没有支付按钮,团队处理战绩)
                sum = sumOfHS + sumOfBS + sumOfZJ;
            }
            // 团队回水和团队保险的总和
            sum_teamHS_and_teamBS += sum;
            // 计算当局需要显示的团队记录
            list.add(new TeamInfo(relatedTeamId, digit0(sumOfZJ), digit1(sumOfHS + ""), digit1(sumOfBS + ""), digit0(sum)));
        }
    });
    // 缓存总和
    DataConstans.SumMap.put("团队回水及保险总和", sum_teamHS_and_teamBS);
    // 填充团队表
    table.setItems(list);
    table.refresh();
}
Also used : TeamInfo(com.kendy.entity.TeamInfo) TeamHuishuiInfo(com.kendy.entity.TeamHuishuiInfo)

Aggregations

TeamInfo (com.kendy.entity.TeamInfo)6 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)5 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)4 ProfitInfo (com.kendy.entity.ProfitInfo)4 ZijinInfo (com.kendy.entity.ZijinInfo)4 LinkedList (java.util.LinkedList)4 DangjuInfo (com.kendy.entity.DangjuInfo)3 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)3 PingzhangInfo (com.kendy.entity.PingzhangInfo)3 TotalInfo (com.kendy.entity.TotalInfo)3 WanjiaInfo (com.kendy.entity.WanjiaInfo)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 ObservableList (javafx.collections.ObservableList)3 WaizhaiInfo (com.kendy.entity.WaizhaiInfo)2 ZonghuiInfo (com.kendy.entity.ZonghuiInfo)2 HashMap (java.util.HashMap)2 TableView (javafx.scene.control.TableView)2 DataConstans (application.DataConstans)1 MyController (application.MyController)1