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();
}
Aggregations