use of com.kendy.entity.TGTeamModel in project financial by greatkendy123.
the class TGFwfService method convert2TGTeamInfo.
/**
* 代理查询中的数据转成托管中的团队信息数据
* @time 2018年3月7日
* @param teamId
* @param proxyTeamInfoList
* @return
*/
private List<TGTeamInfo> convert2TGTeamInfo(List<ProxyTeamInfo> proxyTeamInfoList) {
List<TGTeamInfo> list = new ArrayList<>();
TGController tgController = MyController.tgController;
Map<String, TGTeamModel> tgTeamRateMap = tgController.getTgTeamModelMap();
if (CollectUtil.isHaveValue(proxyTeamInfoList)) {
list = proxyTeamInfoList.stream().map(info -> {
TGTeamInfo tgTeam = new TGTeamInfo();
tgTeam.setTgPlayerId(info.getProxyPlayerId());
tgTeam.setTgPlayerName(info.getProxyPlayerName());
tgTeam.setTgYSZJ(info.getProxyYSZJ());
tgTeam.setTgBaoxian(info.getProxyBaoxian());
tgTeam.setTgChangci(info.getProxyTableId());
// 设置战绩2.5%
String percent25Str = NumUtil.digit2(Math.abs(NumUtil.getNum(info.getProxyYSZJ())) * 0.025 + "");
tgTeam.setTgZJ25(percent25Str);
// 设置战绩未知%
String teamId = info.getProxyTeamId();
TGTeamModel tgTeamModel = tgTeamRateMap.get(teamId);
String teamUnknowValue = tgTeamModel == null ? "0.0" : tgTeamModel.getTgHuishui();
String teamUnknowStr = NumUtil.digit2(Math.abs(NumUtil.getNumTimes(info.getProxyYSZJ(), teamUnknowValue)) + "");
tgTeam.setTgZJUnknow(teamUnknowStr);
// 设置回保
String teamHuibaoRateValue = tgTeamModel == null ? "0.0" : tgTeamModel.getTgHuiBao();
String teamHuibaoRateStr = NumUtil.digit2(-0.975 * NumUtil.getNumTimes(tgTeam.getTgBaoxian(), teamHuibaoRateValue) + "");
if (tgTeam.getTgBaoxian().equals("0")) {
teamHuibaoRateStr = "0";
}
tgTeam.setTgHuiBao(teamHuibaoRateStr);
// 设置利润
String profit = tgController.getRecordProfit(tgTeam);
tgTeam.setTgProfit(profit);
// 设置团队
tgTeam.setTgTeamId(teamId);
return tgTeam;
}).collect(Collectors.toList());
}
return list;
}
use of com.kendy.entity.TGTeamModel in project financial by greatkendy123.
the class TGController method saveTGTeamAction.
/**
* 保存托管团的各个比例
* @time 2018年3月11日
*/
public void saveTGTeamAction() {
String tgTeamId = currentTGTeamLabel.getText();
if (StringUtil.isBlank(tgTeamId)) {
ShowUtil.show("请先选择托管团队!");
return;
}
// 托管团队回水比例
String teamHSRate = StringUtil.nvl(tgTeamHSRate.getText(), "0%");
// 托管团队回保比例
String teamHBRate = StringUtil.nvl(tgTeamHBRate.getText(), "0%");
// 托管团队服务费
String teamFWFRate = StringUtil.nvl(tgTeamFwfRate.getText(), "0%");
// 托管团队是否代理 并 保存
TGTeamModel team = new TGTeamModel(tgTeamId, teamHSRate, teamHBRate, teamFWFRate, getTeamProxyChecked());
DBUtil.saveOrUpdate_tg_team(team);
ShowUtil.show("保存成功", 2);
}
use of com.kendy.entity.TGTeamModel in project financial by greatkendy123.
the class TGController method convert2TGTeamInfo.
/**
* 代理查询中的数据转成托管中的团队信息数据
* @time 2018年3月7日
* @param teamId
* @param proxyTeamInfoList
* @return
*/
private List<TGTeamInfo> convert2TGTeamInfo(String teamId, List<ProxyTeamInfo> proxyTeamInfoList) {
List<TGTeamInfo> list = new ArrayList<>();
TGController tgController = MyController.tgController;
Map<String, TGTeamModel> tgTeamRateMap = tgController.getTgTeamModelMap();
TGTeamModel tgTeamModel = tgTeamRateMap.get(teamId);
String teamUnknowValue = tgTeamModel == null ? "0%" : tgTeamModel.getTgHuishui();
String teamHuibaoRateValue = tgTeamModel == null ? "0.0" : tgTeamModel.getTgHuiBao();
// 更改列名称
changeColumnName_TeamUnknowRate(teamUnknowValue);
if (CollectUtil.isHaveValue(proxyTeamInfoList)) {
list = proxyTeamInfoList.stream().map(info -> {
TGTeamInfo tgTeam = new TGTeamInfo();
tgTeam.setTgPlayerId(info.getProxyPlayerId());
tgTeam.setTgPlayerName(info.getProxyPlayerName());
tgTeam.setTgYSZJ(info.getProxyYSZJ());
tgTeam.setTgBaoxian(info.getProxyBaoxian());
tgTeam.setTgChangci(info.getProxyTableId());
// 设置战绩2.5%
String percent25Str = NumUtil.digit2(Math.abs(NumUtil.getNum(info.getProxyYSZJ())) * 0.025 + "");
tgTeam.setTgZJ25(percent25Str);
// 设置战绩未知%
String teamUnknowStr = NumUtil.digit2(Math.abs(NumUtil.getNumTimes(info.getProxyYSZJ(), teamUnknowValue)) + "");
tgTeam.setTgZJUnknow(teamUnknowStr);
// 设置回保
String teamHuibaoRateStr = NumUtil.digit2((-1) * 0.975 * NumUtil.getNumTimes(tgTeam.getTgBaoxian(), teamHuibaoRateValue) + "");
if (tgTeam.getTgBaoxian().equals("0")) {
teamHuibaoRateStr = "0";
}
tgTeam.setTgHuiBao(teamHuibaoRateStr);
// 设置利润
String profit = getRecordProfit(tgTeam);
tgTeam.setTgProfit(profit);
return tgTeam;
}).collect(Collectors.toList());
}
return list;
}
use of com.kendy.entity.TGTeamModel in project financial by greatkendy123.
the class TGController method getTgTeamFwfRate.
/**
* 获取团队的服务费比例
* @param teamId
* @return
*/
public double getTgTeamFwfRate(String teamId) {
List<TGTeamModel> tgTeams = DBUtil.get_all_tg_team();
if (CollectUtil.isHaveValue(tgTeams)) {
Optional<TGTeamModel> teamInfoOpt = tgTeams.stream().filter(info -> teamId.equals(info.getTgTeamId())).findFirst();
if (teamInfoOpt.isPresent()) {
TGTeamModel teamInfo = teamInfoOpt.get();
String fwfRate = teamInfo.getTgFwfRate();
if (StringUtil.isBlank(fwfRate) || "0%".equals(fwfRate)) {
return 0.0;
} else {
// if("1".equals(teamInfo.getTgTeamProxy()))
return NumUtil.getNumByPercent(fwfRate);
}
}
}
return 0.0;
}
use of com.kendy.entity.TGTeamModel in project financial by greatkendy123.
the class DBUtil method get_tg_team_by_id.
public static TGTeamModel get_tg_team_by_id(String teamId) {
TGTeamModel model = null;
try {
con = DBConnection.getConnection();
String sql = "select * from tg_team where tg_team_id = '" + teamId + "'";
ps = con.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
// id, tg_date, tg_player_id, tg_player_name, tg_type, tg_id, tg_name, tg_beizhu
model = new TGTeamModel(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5));
}
} catch (SQLException e) {
ErrorUtil.err(teamId + ", 获有团队比例失败", e);
} finally {
close(con, ps);
}
return model;
}
Aggregations