Search in sources :

Example 1 with Huishui

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 + "";
    }
}
Also used : Huishui(com.kendy.entity.Huishui)

Example 2 with Huishui

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;
}
Also used : Huishui(com.kendy.entity.Huishui)

Example 3 with Huishui

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) + "";
    }
}
Also used : Huishui(com.kendy.entity.Huishui)

Example 4 with Huishui

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);
    }
}
Also used : Huishui(com.kendy.entity.Huishui) ArrayList(java.util.ArrayList) Date(java.util.Date) SimpleDateFormat(java.text.SimpleDateFormat) Map(java.util.Map) HashMap(java.util.HashMap) ExportTeamhsExcel(com.kendy.excel.ExportTeamhsExcel)

Example 5 with Huishui

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() + "");
    }
}
Also used : Huishui(com.kendy.entity.Huishui)

Aggregations

Huishui (com.kendy.entity.Huishui)24 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 Player (com.kendy.entity.Player)4 Map (java.util.Map)4 TextInputDialog (javafx.scene.control.TextInputDialog)4 InputDialog (com.kendy.util.InputDialog)3 CurrentMoneyInfo (com.kendy.entity.CurrentMoneyInfo)2 ShangmaInfo (com.kendy.entity.ShangmaInfo)2 SMResultModel (com.kendy.model.SMResultModel)2 Wrap (com.kendy.other.Wrap)2 IOException (java.io.IOException)2 SQLException (java.sql.SQLException)2 LinkedHashMap (java.util.LinkedHashMap)2 LinkedList (java.util.LinkedList)2 Pair (javafx.util.Pair)2 DataConstans (application.DataConstans)1 MyController (application.MyController)1 JSON (com.alibaba.fastjson.JSON)1 TypeReference (com.alibaba.fastjson.TypeReference)1