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