Commit 9b2f2489 by guanchen

平推奖励类型740分拆为740,750,760

更正 奖励基数
parent a709d80d
......@@ -20,8 +20,12 @@ public class Constants {
public static final String AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK = "城市代理商所得的购买半年-VIP";
public static final int AGENT_REWARD_TYPE_SVIP = 730;
public static final String AGENT_REWARD_TYPE_SVIP_REMARK = "城市代理商所得的购买超级VIP收益";
public static final int AGENT_REWARD_TYPE_ORDER_AND_REDPACK = 740;
public static final String AGENT_REWARD_TYPE_ORDER_AND_REDPACK_REMARK = "城市代理商的CPS 收益(所有商品购物相关收益)和购买红包订单收益";
public static final int AGENT_REWARD_TYPE_REDPACK = 740;
public static final String AGENT_REWARD_TYPE_REDPACK_REMARK = "城市代理商的红包收益";
public static final int AGENT_REWARD_TYPE_SELF_ORDER = 750;
public static final String AGENT_REWARD_TYPE_SELF_ORDER_REMARK = "城市代理商的自购省收益";
public static final int AGENT_REWARD_TYPE_SHARE_ORDER = 760;
public static final String AGENT_REWARD_TYPE_SHARE_ORDER_REMARK = "城市代理商的分享赚收益";
public static Map<Integer, Map<Integer, BigDecimal>> AGENT_RATE_MAP = new HashMap<Integer, Map<Integer, BigDecimal>>();
public static Map<Integer, String> AGENT_REWARD_REMARK = new HashMap<Integer, String>();
public static final int AGENT_LEVEL_1 = 1;
......@@ -37,7 +41,9 @@ public class Constants {
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_YEAR_VIP, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_HALF_YEAR_VIP, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SVIP, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_ORDER_AND_REDPACK, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_REDPACK, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SELF_ORDER, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SHARE_ORDER, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(0, new BigDecimal("0.03333333"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(1, new BigDecimal("0.01388889"));
......@@ -51,13 +57,21 @@ public class Constants {
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SVIP).put(1, new BigDecimal("0.01111111"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SVIP).put(2, new BigDecimal("0.00555556"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_ORDER_AND_REDPACK).put(0, new BigDecimal("0.03"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_ORDER_AND_REDPACK).put(1, new BigDecimal("0.02"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_ORDER_AND_REDPACK).put(2, new BigDecimal("0.01"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_REDPACK).put(0, new BigDecimal("0.03"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_REDPACK).put(1, new BigDecimal("0.02"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_REDPACK).put(2, new BigDecimal("0.01"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(0, new BigDecimal("0.03"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(1, new BigDecimal("0.02"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(2, new BigDecimal("0.01"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(0, new BigDecimal("0.03"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(1, new BigDecimal("0.02"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(2, new BigDecimal("0.01"));
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_YEAR_VIP, AGENT_REWARD_TYPE_YEAR_VIP_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_HALF_YEAR_VIP, AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_SVIP, AGENT_REWARD_TYPE_SVIP_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_ORDER_AND_REDPACK, AGENT_REWARD_TYPE_ORDER_AND_REDPACK_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_REDPACK, AGENT_REWARD_TYPE_REDPACK_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_SELF_ORDER, AGENT_REWARD_TYPE_SELF_ORDER_REMARK);
AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_SHARE_ORDER, AGENT_REWARD_TYPE_SHARE_ORDER_REMARK);
}
}
......@@ -26,6 +26,7 @@ public class AgentRewardMessage extends BaseModel {
String orderSn;
String subOrderSn;
BigDecimal orderCommission;
BigDecimal sourceUserPayment;
// public AgentRewardMessage(int rewardType, String rechargeTime, int sourceUserId, String referenceId, int agentId, BigDecimal agentReward, int settleState, String orderType, String orderSn, String subOrderSn, BigDecimal orderCommission) {
// this.rewardType = rewardType;
// this.rechargeTime = rechargeTime;
......
......@@ -179,6 +179,7 @@ public class AgentRewardQueueTask {
private boolean doInsert(BigDecimal commissionRate, ParentAgent agent, AgentRewardMessage message) {
try {
int rewardType = message.getRewardType();
int sourceUserLevel = partnerAccountService.getOneByUserId(message.getSourceUserId()).getPartnerLevel();
AgentReward agentReward = new AgentReward();
agentReward.setRewardType(message.getRewardType());
......@@ -205,10 +206,16 @@ public class AgentRewardQueueTask {
* commission 奖励金额
* cash_code 支付金额
*/
agentReward.setMoney(message.getAgentReward());
agentReward.setCommissionAcount(message.getAgentReward());
agentReward.setAmount(message.getAgentReward().multiply(commissionRate));
agentReward.setCommission(message.getAgentReward().multiply(commissionRate));
BigDecimal rewardBasement;
if (rewardType == AGENT_REWARD_TYPE_YEAR_VIP || rewardType == AGENT_REWARD_TYPE_HALF_YEAR_VIP || rewardType == AGENT_REWARD_TYPE_SVIP) {
rewardBasement = message.getSourceUserPayment();
} else {
rewardBasement = message.getAgentReward();
}
agentReward.setMoney(rewardBasement);
agentReward.setCommissionAcount(rewardBasement);
agentReward.setAmount(rewardBasement.multiply(commissionRate));
agentReward.setCommission(rewardBasement.multiply(commissionRate));
agentReward.setCashCode("0");
return agentRewardService.save(agentReward);
} catch (Exception e) {
......
_ooOoo_
o8888888o
88" . "88
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment