use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MoneyService method getChuhuishui.
/**
* 计算出回水
* 公式:相应团的回水比例 乘以|原始战绩|,若回水比例为无(如公司),则直接返回
*/
public static String getChuhuishui(String zhanji, String teamId) {
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs == null) {
return "";
} else {
Double hsRate = Double.valueOf(hs.getHuishuiRate());
Double zj = Double.valueOf(zhanji);
return Math.abs(zj * hsRate) * -1 + "";
}
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MoneyService method isZjManaged.
// 战绩是否管理
private static boolean isZjManaged(String teamId) {
boolean zjManage = false;
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs != null) {
if ("是".equals(hs.getZjManaged())) {
zjManage = true;
}
}
return zjManage;
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MoneyService method getHuiBao.
/**
* 计算回保
* 不要参考Excel上的公式!!
* 新公式:保险 * 团队保险比例 * (-1)
*/
public static String getHuiBao(String baoxian, String teamId) {
if (StringUtil.isBlank(baoxian) || "0".equals(baoxian))
return "0";
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs == null) {
return "0";
} else {
String insuranceRate = hs.getInsuranceRate();
insuranceRate = !StringUtil.isBlank(insuranceRate) ? insuranceRate : "0";
return Double.valueOf(baoxian) * Double.valueOf(insuranceRate) * (-1) + "";
}
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MoneyService method exportTeamhsExcel.
/**
*********************** 导出团队回水表Excel ***********************************
*/
public static void exportTeamhsExcel() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String title = "回水表" + sdf.format(new Date());
log.info("导出团队回水表Excel:" + title);
String[] rowsName = new String[] { "团队ID", "团队名字", "比例", "保险比例", "股东", "战绩是否代管理", "备注", "回水比例", "回保比例", "服务费判定" };
List<Object[]> dataList = new ArrayList<Object[]>();
Object[] objs = null;
Map<String, Huishui> huishuiMap = DataConstans.huishuiMap;
String teamId;
Huishui hs;
for (Map.Entry<String, Huishui> entry : huishuiMap.entrySet()) {
teamId = entry.getKey();
hs = entry.getValue();
objs = new Object[rowsName.length];
objs[0] = teamId;
objs[1] = hs.getTeamName();
objs[2] = NumUtil.getPercentStr(NumUtil.getNum(NumUtil.digit4(hs.getHuishuiRate())));
objs[3] = NumUtil.getPercentStr(NumUtil.getNum(NumUtil.digit4(hs.getInsuranceRate())));
objs[4] = hs.getGudong();
objs[5] = hs.getZjManaged();
// "回水比例","回保比例","服务费判定","服务费判定"
objs[6] = hs.getBeizhu();
objs[7] = hs.getProxyHSRate();
objs[8] = hs.getProxyHBRate();
objs[9] = hs.getProxyFWF();
dataList.add(objs);
}
String out = "D:/" + title;
ExportTeamhsExcel ex = new ExportTeamhsExcel(title, rowsName, dataList, out);
try {
ex.export();
log.debug("导出回水表Excel成功");
} catch (Exception e) {
ErrorUtil.err("导出回水表Excel失败", e);
}
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class ShangmaService method resetTeamYajinAndEdu.
/**
* 重置团队押金与团队额度,包括团可上码
*/
private static void resetTeamYajinAndEdu() {
// 置零
teamShangmaAvailable.setText("0");
teamYajin.setText("0");
teamEdu.setText("0");
// 赋新值
// 获取团队信息
String teamId = shangmaTeamIdLabel.getText();
Huishui hs = DataConstans.huishuiMap.get(teamId);
if (hs != null) {
String _teamYajin = hs.getTeamYajin();
String _teamEdu = hs.getTeamEdu();
teamYajin.setText(_teamYajin);
teamEdu.setText(_teamEdu);
// 计算团队可上码
// 计算公式: 团队可上码= 押金 + 额度 + 团队战绩 - 团队已上码
Double teamSMAvailable = NumUtil.getNum(NumUtil.getSum(_teamYajin, _teamEdu, labelZZJ.getText())) - NumUtil.getNum(labelZSM.getText());
teamShangmaAvailable.setText(teamSMAvailable.intValue() + "");
}
}
Aggregations