Commit a8770582 by guanchen

添加美团的支持

parent f826c915
...@@ -30,6 +30,7 @@ public class Constants { ...@@ -30,6 +30,7 @@ public class Constants {
public static final int AGENT_REWARD_TYPE_SHARE_ORDER = 760; public static final int AGENT_REWARD_TYPE_SHARE_ORDER = 760;
public static final String AGENT_REWARD_TYPE_SHARE_ORDER_REMARK = "推荐奖励-分享赚"; public static final String AGENT_REWARD_TYPE_SHARE_ORDER_REMARK = "推荐奖励-分享赚";
public static final int JD_OFFSET = 1000; //用于查找京东的平推奖励比例 public static final int JD_OFFSET = 1000; //用于查找京东的平推奖励比例
public static final int MT_OFFSET = 2000; //用于查找美团的平推奖励比例
public static Map<Integer, Map<Integer, BigDecimal>> AGENT_RATE_MAP = new HashMap<Integer, Map<Integer, BigDecimal>>(); 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 Map<Integer, String> AGENT_REWARD_REMARK = new HashMap<Integer, String>();
public static final int AGENT_LEVEL_1 = 1; public static final int AGENT_LEVEL_1 = 1;
...@@ -40,6 +41,7 @@ public class Constants { ...@@ -40,6 +41,7 @@ public class Constants {
public static final String PARENT_COLUMN_NAME_CENGJI = "parent_agent_id"; public static final String PARENT_COLUMN_NAME_CENGJI = "parent_agent_id";
public static final String PARENT_COLUMN_NAME_PINGTUI = "presenter_id"; public static final String PARENT_COLUMN_NAME_PINGTUI = "presenter_id";
public static final String ORDER_TYPE_JD = "jd"; public static final String ORDER_TYPE_JD = "jd";
public static final String ORDER_TYPE_MT = "mt";
/** /**
* 回扣类型 * 回扣类型
*/ */
...@@ -144,6 +146,7 @@ public class Constants { ...@@ -144,6 +146,7 @@ public class Constants {
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SHARE_ORDER, new HashMap<Integer, BigDecimal>()); AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SHARE_ORDER, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET, new HashMap<Integer, BigDecimal>()); AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SHARE_ORDER + JD_OFFSET, new HashMap<Integer, BigDecimal>()); AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SHARE_ORDER + JD_OFFSET, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SELF_ORDER + MT_OFFSET, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(0, new BigDecimal("0.02512563")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(0, new BigDecimal("0.02512563"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(1, new BigDecimal("0.01507538")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_YEAR_VIP).put(1, new BigDecimal("0.01507538"));
...@@ -155,13 +158,23 @@ public class Constants { ...@@ -155,13 +158,23 @@ public class Constants {
// AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SVIP).put(0, new BigDecimal("0.02500000")); // AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SVIP).put(0, new BigDecimal("0.02500000"));
// AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SVIP).put(1, new BigDecimal("0.01111111")); // 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_SVIP).put(2, new BigDecimal("0.00555556"));
/**
* 红包
*/
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_REDPACK).put(0, new BigDecimal("0.03")); 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(1, new BigDecimal("0.02"));
/**
* 自购省
*/
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(0, new BigDecimal("0.009")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(0, new BigDecimal("0.009"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(1, new BigDecimal("0.009")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER).put(1, new BigDecimal("0.009"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET).put(0, new BigDecimal("0.0087")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET).put(0, new BigDecimal("0.0087"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET).put(1, new BigDecimal("0.0087")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + JD_OFFSET).put(1, new BigDecimal("0.0087"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + MT_OFFSET).put(0, new BigDecimal("0.01"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SELF_ORDER + MT_OFFSET).put(1, new BigDecimal("0.01"));
/**
* 分享赚
*/
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(0, new BigDecimal("0.009")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(0, new BigDecimal("0.009"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(1, new BigDecimal("0.009")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER).put(1, new BigDecimal("0.009"));
AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER + JD_OFFSET).put(0, new BigDecimal("0.0087")); AGENT_RATE_MAP.get(AGENT_REWARD_TYPE_SHARE_ORDER + JD_OFFSET).put(0, new BigDecimal("0.0087"));
......
...@@ -22,7 +22,6 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -22,7 +22,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.TransactionStatus;
...@@ -111,6 +110,9 @@ public class AgentRewardQueueTask { ...@@ -111,6 +110,9 @@ public class AgentRewardQueueTask {
if ((rewardType == AGENT_REWARD_TYPE_SELF_ORDER || rewardType == AGENT_REWARD_TYPE_SHARE_ORDER) if ((rewardType == AGENT_REWARD_TYPE_SELF_ORDER || rewardType == AGENT_REWARD_TYPE_SHARE_ORDER)
&& message.getOrderType().equals(ORDER_TYPE_JD) ) { && message.getOrderType().equals(ORDER_TYPE_JD) ) {
rateMap = AGENT_RATE_MAP.get(rewardType + JD_OFFSET); rateMap = AGENT_RATE_MAP.get(rewardType + JD_OFFSET);
} else if (rewardType == AGENT_REWARD_TYPE_SELF_ORDER
&& message.getOrderType().equals(ORDER_TYPE_MT) ) {
rateMap = AGENT_RATE_MAP.get(rewardType + MT_OFFSET);
} else { } else {
rateMap = AGENT_RATE_MAP.get(rewardType); rateMap = AGENT_RATE_MAP.get(rewardType);
} }
......
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