Authored by zhouxiang

no message

@@ -29,8 +29,8 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ @@ -29,8 +29,8 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ
29 @Autowired 29 @Autowired
30 private SendCouponHelper sendCouponHelper; 30 private SendCouponHelper sendCouponHelper;
31 31
32 - @Resource(name = "couponMap")  
33 - private Map<Integer,Integer> couponMap; 32 + @Value("${userday.coupon}")
  33 + private String prizeConpon;
34 34
35 @Override 35 @Override
36 public DrawPrizeBo drawPrize(int uid) throws Exception { 36 public DrawPrizeBo drawPrize(int uid) throws Exception {
@@ -86,6 +86,7 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ @@ -86,6 +86,7 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ
86 * @return 86 * @return
87 */ 87 */
88 private DrawPrizeBo getDrawPrize() { 88 private DrawPrizeBo getDrawPrize() {
  89 + JSONObject couponObj = JSONObject.parseObject(prizeConpon);
89 int random = new Random().nextInt(100); 90 int random = new Random().nextInt(100);
90 //100有货币(15%) 91 //100有货币(15%)
91 if (random > 84) { 92 if (random > 84) {
@@ -101,13 +102,13 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ @@ -101,13 +102,13 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ
101 } 102 }
102 //10元优惠券(40%) 103 //10元优惠券(40%)
103 if(random > 39){ 104 if(random > 39){
104 - return new DrawPrizeBo(2,couponMap.get(10),4); 105 + return new DrawPrizeBo(2,couponObj.getInteger("10"),4);
105 } 106 }
106 //299-40优惠券(35%) 107 //299-40优惠券(35%)
107 if(random > 4){ 108 if(random > 4){
108 - return new DrawPrizeBo(2,couponMap.get(40),5); 109 + return new DrawPrizeBo(2,couponObj.getInteger("40"),5);
109 } 110 }
110 //499-70优惠券(5%) 111 //499-70优惠券(5%)
111 - return new DrawPrizeBo(2,couponMap.get(70),6); 112 + return new DrawPrizeBo(2,couponObj.getInteger("70"),6);
112 } 113 }
113 } 114 }
@@ -72,6 +72,6 @@ rabbit_user=yoho @@ -72,6 +72,6 @@ rabbit_user=yoho
72 rabbit_password=yoho 72 rabbit_password=yoho
73 73
74 74
75 -userday.coupon={"20":"14146", "10":"14144"} 75 +userday.coupon={"10":"14144","40":"14146","70":"14148"}
76 userday.open.day=28 76 userday.open.day=28
77 userday.drawPrizeNum.redisSwitch=true 77 userday.drawPrizeNum.redisSwitch=true