...
|
...
|
@@ -29,8 +29,8 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ |
|
|
@Autowired
|
|
|
private SendCouponHelper sendCouponHelper;
|
|
|
|
|
|
@Resource(name = "couponMap")
|
|
|
private Map<Integer,Integer> couponMap;
|
|
|
@Value("${userday.coupon}")
|
|
|
private String prizeConpon;
|
|
|
|
|
|
@Override
|
|
|
public DrawPrizeBo drawPrize(int uid) throws Exception {
|
...
|
...
|
@@ -86,6 +86,7 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ |
|
|
* @return
|
|
|
*/
|
|
|
private DrawPrizeBo getDrawPrize() {
|
|
|
JSONObject couponObj = JSONObject.parseObject(prizeConpon);
|
|
|
int random = new Random().nextInt(100);
|
|
|
//100有货币(15%)
|
|
|
if (random > 84) {
|
...
|
...
|
@@ -101,13 +102,13 @@ public class UserdayDrawCouponOrCoinServiceImpl implements IUserdayDrawPrizeServ |
|
|
}
|
|
|
//10元优惠券(40%)
|
|
|
if(random > 39){
|
|
|
return new DrawPrizeBo(2,couponMap.get(10),4);
|
|
|
return new DrawPrizeBo(2,couponObj.getInteger("10"),4);
|
|
|
}
|
|
|
//299-40优惠券(35%)
|
|
|
if(random > 4){
|
|
|
return new DrawPrizeBo(2,couponMap.get(40),5);
|
|
|
return new DrawPrizeBo(2,couponObj.getInteger("40"),5);
|
|
|
}
|
|
|
//499-70优惠券(5%)
|
|
|
return new DrawPrizeBo(2,couponMap.get(70),6);
|
|
|
return new DrawPrizeBo(2,couponObj.getInteger("70"),6);
|
|
|
}
|
|
|
} |
...
|
...
|
|