use of com.kendy.entity.GudongRateInfo in project financial by greatkendy123.
the class GDController method setDynamicTableData_team_part.
/**
* 设置单个动态表的数据(联盟桌费部分)
*
* @time 2018年1月21日
* @param table
* @param gudong
*/
private void setDynamicTableData_team_part(TableView<GudongRateInfo> table, String gudong) {
Double LM1Zhuofei = getLM1TotalZhuofei(gudong) * (-1);
Double LM1Zhuofei_Double = NumUtil.getNumDivide(LM1Zhuofei, getComputeTotalProfit());
String LM1ZhuofeiStr = NumUtil.getPercentStr(LM1Zhuofei_Double);
table.getItems().add(new GudongRateInfo("联盟桌费", LM1ZhuofeiStr, LM1Zhuofei + ""));
table.refresh();
}
use of com.kendy.entity.GudongRateInfo in project financial by greatkendy123.
the class GDController method setGudongRenci.
/**
* 计算每个股东的人次
* 计算公式:人次总值 = 1人次的利润值 * 人次
*
* @time 2018年1月25日
* @param table 需要改变的表格
* @param teamMap 用于计算生活中的人次
*/
private void setGudongRenci(TableView<GudongRateInfo> table, Map<String, List<Record>> teamMap) {
// 整个股东的所有人次(生活)
Long gudongRenciCount = teamMap.values().stream().collect(Collectors.summarizingInt(l -> l.size())).getSum();
Double teamRenci = gudongRenciCount * NumUtil.getNum(getRenci());
Double teamRenci_Double = divide(teamRenci, getComputeTotalProfit_mins_totalSalary());
String teamRenciStr = NumUtil.getPercentStr(teamRenci_Double);
table.getItems().add(new GudongRateInfo("人次", teamRenciStr, teamRenci.intValue() + ""));
table.refresh();
}
use of com.kendy.entity.GudongRateInfo in project financial by greatkendy123.
the class GDController method setDynamicTableData_team_company_part.
/**
* 设置单个动态表的数据(团队中的公司部分)
* 公司利润计算公式:收回水+水后险,这里计成合利润
*/
private void setDynamicTableData_team_company_part(TableView<GudongRateInfo> table, String teamId, List<Record> teamList, String gudong) {
Double companyProfit = getHelirun(teamList);
// 计算团队中公司的占比 公式 = sum(收回水+水后险) / 计算总利润
// Double teamRenci = teamList.size() * NumUtil.getNum(getRenci());
Double companyRate_Double = NumUtil.getNumDivide(companyProfit, getComputeTotalProfit());
String companyRateStr = NumUtil.getPercentStr(companyRate_Double);
table.getItems().add(new GudongRateInfo(getFinalTeamId(teamId, gudong), companyRateStr, companyProfit + ""));
table.refresh();
}
use of com.kendy.entity.GudongRateInfo in project financial by greatkendy123.
the class GDController method setDynamicTableData_team_not_comanpy_part.
/**
* 设置单个动态表的数据(团队部分)
* 1、公司的计入X客,如股东A,就计入A客
* 2、团队服务费问题:目前是直接引用代理查询表的数据,但最好重新计算!!!(已经重算了)
*
* @time 2018年1月20日
* @param table
* @param teamId
*/
private void setDynamicTableData_team_not_comanpy_part(TableView<GudongRateInfo> table, String teamId, List<Record> teamList, String gudong) {
// 获取团队服务费
// 获取服务费(根据锁定的存到数据库中的数据)
String teamFWF = TeamProxyService.getTeamFWF_GD(teamId, teamList);
// 获取团队利润
Double teamPersonProfit = getTeamProfit(teamList);
Double teamProfits = NumUtil.getNum(teamFWF) + teamPersonProfit;
// 计算团队占比 公式 = (人次 + 团队服务费) / 当天总利润
Double teamRate_Double = NumUtil.getNumDivide(teamProfits, getComputeTotalProfit());
String teamRateStr = NumUtil.getPercentStr(teamRate_Double);
table.getItems().add(new GudongRateInfo(getFinalTeamId(teamId, gudong), teamRateStr, NumUtil.digit2(teamProfits + "")));
table.refresh();
}
use of com.kendy.entity.GudongRateInfo in project financial by greatkendy123.
the class GDController method dynamicGenerateGDTable.
/**
* 生成动态股东表
*
* @time 2018年1月20日
*/
private void dynamicGenerateGDTable() {
// 股东列表
Set<String> gudongSet = gudongTeamMap.keySet();
List<String> _gudongList = new ArrayList<>(gudongSet);
Collections.sort(_gudongList);
TableView<GudongRateInfo> table;
ObservableList<GudongRateInfo> obList = FXCollections.observableArrayList();
for (String gudongName : _gudongList) {
table = new TableView<GudongRateInfo>();
// 设置列
TableColumn firstNameCol = new TableColumn("股东" + gudongName);
firstNameCol.setStyle("-fx-alignment: CENTER;");
firstNameCol.setPrefWidth(100);
firstNameCol.setCellValueFactory(new PropertyValueFactory<GudongRateInfo, String>("gudongName"));
TableColumn lastNameCol = new TableColumn("0%");
lastNameCol.setStyle("-fx-alignment: CENTER;");
lastNameCol.setPrefWidth(92);
lastNameCol.setCellValueFactory(new PropertyValueFactory<GudongRateInfo, String>("gudongProfit"));
lastNameCol.setCellFactory(MyController.getColorCellFactory(new GudongRateInfo()));
table.setPrefWidth(210);
TableColumn tempValCol = new TableColumn("0");
tempValCol.setStyle("-fx-alignment: CENTER;");
tempValCol.setPrefWidth(60);
tempValCol.setCellValueFactory(new PropertyValueFactory<GudongRateInfo, String>("description"));
tempValCol.setCellFactory(MyController.getColorCellFactory(new GudongRateInfo()));
table.setPrefWidth(210 + 60);
table.getColumns().addAll(firstNameCol, lastNameCol, tempValCol);
// 设置数据
// {团队ID:List<Record}
Map<String, List<Record>> teamMap = gudongTeamMap.get(gudongName);
List<KaixiaoInfo> kaixiaoList = gudongKaixiaoMap.get(gudongName);
setDynamicTableData(table, teamMap, kaixiaoList, gudongName);
// 往左边的股东表中添加记录
setDataToSumTable(table);
contributionHBox.setSpacing(5);
contributionHBox.setPadding(new Insets(0, 0, 0, 0));
contributionHBox.getChildren().addAll(table);
}
}
Aggregations