Search in sources :

Example 1 with PartnerRebate

use of com.code.server.constant.db.PartnerRebate in project summer by foxsugar.

the class CenterService method createAgentRecords.

private static AgentRecords createAgentRecords(AgentBean agentBean, String date) {
    if (agentBean.getAgentInfo().getEveryPartnerRebate() != null) {
        PartnerRebate partnerRebate = agentBean.getAgentInfo().getEveryPartnerRebate().get(date);
        if (partnerRebate != null) {
            AgentRecords agentRecord = new AgentRecords();
            agentRecord.setId(agentBean.getId() + "|" + date);
            agentRecord.setDate(date);
            agentRecord.setAgentId((int) agentBean.getId());
            agentRecord.setAllRebate(partnerRebate.getAllRebate());
            agentRecord.setChildCost(partnerRebate.getCost());
            agentRecord.setMoneyRebate(partnerRebate.getMoneyRebate());
            agentRecord.setGoldRebate(partnerRebate.getGoldRebate());
            return agentRecord;
        }
    }
    return null;
}
Also used : PartnerRebate(com.code.server.constant.db.PartnerRebate)

Example 2 with PartnerRebate

use of com.code.server.constant.db.PartnerRebate in project summer by foxsugar.

the class AgentRedisService method addPartnerRebate.

public void addPartnerRebate(long agentId, double cost, double moneyRebate, double goldRebate, String date, String deleteDay) {
    AgentBean agentBean = getAgentBean(agentId);
    if (agentBean != null) {
        if (agentBean.getAgentInfo().getEveryPartnerRebate() == null) {
            agentBean.getAgentInfo().setEveryPartnerRebate(new HashMap<>());
        }
        PartnerRebate partnerRebate = agentBean.getAgentInfo().getEveryPartnerRebate().getOrDefault(date, new PartnerRebate());
        partnerRebate.cost += cost;
        partnerRebate.moneyRebate += moneyRebate;
        partnerRebate.goldRebate += goldRebate;
        partnerRebate.allRebate += moneyRebate;
        partnerRebate.allRebate += goldRebate;
        agentBean.getAgentInfo().getEveryPartnerRebate().put(date, partnerRebate);
        agentBean.getAgentInfo().getEveryPartnerRebate().remove(deleteDay);
        updateAgentBean(agentBean);
    }
}
Also used : AgentBean(com.code.server.constant.game.AgentBean) PartnerRebate(com.code.server.constant.db.PartnerRebate)

Aggregations

PartnerRebate (com.code.server.constant.db.PartnerRebate)2 AgentBean (com.code.server.constant.game.AgentBean)1