Search in sources :

Example 6 with TeamHuishuiInfo

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

Example 7 with TeamHuishuiInfo

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

the class TeamProxyService method refresh_TableTeamProxy_TableProxySum.

/**
 * 刷新两个表,共用代码(选择团下拉框和点击刷新按钮时共用的代码)
 *
 * @param newValue teamID
 */
public static void refresh_TableTeamProxy_TableProxySum(Object newValue) {
    if (newValue == null)
        return;
    Huishui hs = DataConstans.huishuiMap.get(newValue);
    if (hs != null) {
        if ("否".equals(hs.getZjManaged())) {
            isZjManage.setSelected(false);
        } else {
            isZjManage.setSelected(true);
        }
    } else {
        // add 2018-01-20
        return;
    }
    // 加载数据{teamId={}}
    double sumYSZJ = 0d;
    double sumZJ = 0d;
    double sumHS = 0d;
    double sumHB = 0d;
    double sumBX = 0d;
    int sumRC = 0;
    // Map<String,List<TeamHuishuiInfo>> teamMap = DataConstans.Total_Team_Huishui_Map;//锁定就保留信息,不减
    Map<String, List<TeamHuishuiInfo>> teamMap = getTotalTeamHuishuiMap();
    if (teamMap != null && teamMap.size() == 0) {
        // 这个有问题,后期再看
        log.error("----------------");
    }
    List<TeamHuishuiInfo> teamList = teamMap.get(newValue.toString().toUpperCase());
    ObservableList<ProxyTeamInfo> obList = FXCollections.observableArrayList();
    if (teamList != null) {
        for (TeamHuishuiInfo info : teamList) {
            obList.add(new ProxyTeamInfo(info.getTuan(), info.getWanjiaId(), info.getWanjia(), // yszj
            info.getZj(), info.getShishou(), // 出回水是否等于回水
            MoneyService.getNum(info.getChuHuishui()) * (-1) + "", // 保险是否等于回保
            info.getHuibao(), info.getTableId(), // 保险
            info.getBaoxian()));
            sumYSZJ += MoneyService.getNum(info.getZj());
            sumZJ += MoneyService.getNum(info.getShishou());
            sumBX += MoneyService.getNum(info.getBaoxian());
            sumHS += (MoneyService.getNum(info.getChuHuishui())) * (-1);
            sumHB += MoneyService.getNum(info.getHuibao());
            sumRC += 1;
        }
    }
    tableProxyTeam.setItems(obList);
    tableProxyTeam.refresh();
    ObservableList<Node> sumHBox = proxySumHBox.getChildren();
    for (Node node : sumHBox) {
        Label label = (Label) node;
        String labelId = label.getId();
        switch(labelId) {
            case "sumYSZJ":
                label.setText(MoneyService.digit0(sumYSZJ));
                break;
            case "sumZJ":
                label.setText(MoneyService.digit0(sumZJ));
                break;
            case "sumBX":
                label.setText(MoneyService.digit0(sumBX));
                break;
            case "sumHS":
                label.setText(MoneyService.digit1(sumHS + ""));
                break;
            case "sumHB":
                label.setText(sumHB + "");
                break;
            case "sumRC":
                label.setText(sumRC + "");
                break;
        }
    }
    // add by kendy 添加总回保比例,总回水比例,服务费和合计
    proxyHSRate.setText(hs.getProxyHSRate());
    proxyHBRate.setText(hs.getProxyHBRate());
    proxyFWF.setText(hs.getProxyFWF());
    double HSRate = getNumByPercent(hs.getProxyHSRate());
    double HBRate = getNumByPercent(hs.getProxyHBRate());
    // 服务费有效值
    double FWFValid = NumUtil.getNum(hs.getProxyFWF());
    // 计算服务费
    double proxyFWFVal = calculateProxSumFWF(sumHS, HSRate, sumHB, HBRate, FWFValid);
    // 计算合计
    double proxyHeji = sumZJ + sumHS + sumHB - proxyFWFVal;
    // 初始化合计表
    tableProxySum.setItems(null);
    ObservableList<ProxySumInfo> ob_Heji_List = FXCollections.observableArrayList();
    ob_Heji_List.addAll(new ProxySumInfo("总战绩", NumUtil.digit0(sumZJ)), new ProxySumInfo("总回水", NumUtil.digit1(sumHS + "")), new ProxySumInfo("总回保", NumUtil.digit1(sumHB + "")), new ProxySumInfo("服务费", NumUtil.digit1(proxyFWFVal + "")), new ProxySumInfo("总人次", sumRC + ""));
    tableProxySum.setItems(ob_Heji_List);
    tableProxySum.getColumns().get(1).setText(NumUtil.digit1(proxyHeji + ""));
    tableProxySum.refresh();
}
Also used : Huishui(com.kendy.entity.Huishui) ProxyTeamInfo(com.kendy.entity.ProxyTeamInfo) Node(javafx.scene.Node) Label(javafx.scene.control.Label) TeamHuishuiInfo(com.kendy.entity.TeamHuishuiInfo) ProxySumInfo(com.kendy.entity.ProxySumInfo) ArrayList(java.util.ArrayList) List(java.util.List) ObservableList(javafx.collections.ObservableList)

Aggregations

TeamHuishuiInfo (com.kendy.entity.TeamHuishuiInfo)7 ArrayList (java.util.ArrayList)4 List (java.util.List)3 ObservableList (javafx.collections.ObservableList)3 Player (com.kendy.entity.Player)2 HashMap (java.util.HashMap)2 HistoryRecord (com.kendy.entity.HistoryRecord)1 Huishui (com.kendy.entity.Huishui)1 MemberZJInfo (com.kendy.entity.MemberZJInfo)1 ProxySumInfo (com.kendy.entity.ProxySumInfo)1 ProxyTeamInfo (com.kendy.entity.ProxyTeamInfo)1 TeamInfo (com.kendy.entity.TeamInfo)1 TotalInfo (com.kendy.entity.TotalInfo)1 UserInfos (com.kendy.entity.UserInfos)1 WanjiaInfo (com.kendy.entity.WanjiaInfo)1 SimpleDateFormat (java.text.SimpleDateFormat)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Node (javafx.scene.Node)1 Label (javafx.scene.control.Label)1