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