Authored by zhouxiang

no message

... ... @@ -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);
}
}
... ...
... ... @@ -72,6 +72,6 @@ rabbit_user=yoho
rabbit_password=yoho
userday.coupon={"20":"14146", "10":"14144"}
userday.coupon={"10":"14144","40":"14146","70":"14148"}
userday.open.day=28
userday.drawPrizeNum.redisSwitch=true
\ No newline at end of file
... ...