Search in sources :

Example 6 with ProxyTeamInfo

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

the class TGController method getTeamButton.

/**
 * 获取动态的团队按钮
 *
 * @time 2018年3月7日
 * @param teamId
 * @return
 */
private Button getTeamButton(String teamId) {
    Button teamBtn = new Button(teamId);
    teamBtn.setPrefWidth(90);
    teamBtn.setOnAction(event -> {
        // 清空数据
        clearWhenChangeTeamBtn();
        currentTGTeamLabel.setText(teamId);
        // 获取代理查询的团队数据
        final List<ProxyTeamInfo> proxyTeamInfoList = getProxyTeamInfoList(teamId);
        // 转化为托管公司的团队数据
        List<TGTeamInfo> tgTeamList = convert2TGTeamInfo(teamId, proxyTeamInfoList);
        tableTGZhanji.setItems(FXCollections.observableArrayList(tgTeamList));
        // 设置团队合计
        refreshTableTGTeamSum();
        // 设置团队的托管回水比例、回保比例、服务费
        setTGTeamRateInfo(teamId);
    });
    return teamBtn;
}
Also used : ProxyTeamInfo(com.kendy.entity.ProxyTeamInfo) Button(javafx.scene.control.Button) TGTeamInfo(com.kendy.entity.TGTeamInfo)

Example 7 with ProxyTeamInfo

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

ProxyTeamInfo (com.kendy.entity.ProxyTeamInfo)7 ArrayList (java.util.ArrayList)5 ProxySumInfo (com.kendy.entity.ProxySumInfo)4 TGTeamInfo (com.kendy.entity.TGTeamInfo)2 ExportExcel (com.kendy.excel.ExportExcel)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 TableView (javafx.scene.control.TableView)2 MyController (application.MyController)1 GDController (com.kendy.controller.GDController)1 QuotaController (com.kendy.controller.QuotaController)1 TGController (com.kendy.controller.TGController)1 DBUtil (com.kendy.db.DBUtil)1 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)1 DangjuInfo (com.kendy.entity.DangjuInfo)1 DangtianHuizongInfo (com.kendy.entity.DangtianHuizongInfo)1 Huishui (com.kendy.entity.Huishui)1 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)1 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)1 MemberZJInfo (com.kendy.entity.MemberZJInfo)1