Search in sources :

Example 11 with ProfitInfo

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

the class MoneyService method updateTableProfit.

/**
 * 更新利润表
 */
public static void updateTableProfit(TableView<ProfitInfo> table, double todayKaixiao) {
    // 获取ObserableList
    try {
        ObservableList<ProfitInfo> list = table.getItems();
        for (ProfitInfo info : list) {
            String type = info.getProfitType();
            if ("总服务费".equals(type)) {
                info.setProfitAccount(digit0(getNum(info.getProfitAccount()) + getTeamSum("服务费")));
            } else if ("总保险".endsWith(type)) {
                info.setProfitAccount(digit0(getNum(info.getProfitAccount()) + getTeamSum("保险")));
            } else if ("总回水".endsWith(type)) {
                info.setProfitAccount(digit0(getNum(info.getProfitAccount()) + getTeamSum("团队回水")));
            } else if ("总开销".endsWith(type)) {
                info.setProfitAccount(digit0((getNum(info.getProfitAccount()) + todayKaixiao - getTeamSum("上场开销")) + ""));
            } else if ("总回保".endsWith(type)) {
                // 无公式  总保回
                info.setProfitAccount(digit0(getNum(info.getProfitAccount()) + (getTeamSum("总保回") * (-1)) + ""));
            }
        }
        ;
        table.setItems(list);
    } catch (Exception e) {
        log.error("检测到更新利润表出错,可能是没有导入数据就进行平帐和锁定");
    }
}
Also used : ProfitInfo(com.kendy.entity.ProfitInfo)

Example 12 with ProfitInfo

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

Aggregations

ProfitInfo (com.kendy.entity.ProfitInfo)12 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)8 KaixiaoInfo (com.kendy.entity.KaixiaoInfo)8 ZijinInfo (com.kendy.entity.ZijinInfo)8 TeamInfo (com.kendy.entity.TeamInfo)7 LinkedList (java.util.LinkedList)7 DangjuInfo (com.kendy.entity.DangjuInfo)6 JiaoshouInfo (com.kendy.entity.JiaoshouInfo)6 PingzhangInfo (com.kendy.entity.PingzhangInfo)6 TotalInfo (com.kendy.entity.TotalInfo)6 WanjiaInfo (com.kendy.entity.WanjiaInfo)6 ArrayList (java.util.ArrayList)6 List (java.util.List)6 ObservableList (javafx.collections.ObservableList)6 MyController (application.MyController)4 TypeReference (com.alibaba.fastjson.TypeReference)4 GDController (com.kendy.controller.GDController)4 HashMap (java.util.HashMap)4 JSON (com.alibaba.fastjson.JSON)3 DBUtil (com.kendy.db.DBUtil)3