Commit d3fbdc7c authored by hezhen's avatar hezhen

123

parent ef776514
......@@ -156,11 +156,15 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
example.createCriteria().andEqualTo("tickerNo",TickerNo).andEqualTo("isDel",0);
List<UserCoupon> list=selectByExample(example);
if(list.size()==0){
log.error(userId+"----已领优惠卷");
log.error(userId+"----没有可用优惠卷--TickerNo==="+TickerNo);
return couponAmout;
}
UserCoupon userCoupon=list.get(0);
if(userCoupon!=null&&userCoupon.getIsUse()==1){
log.error(userId+"----该优惠卷已使用--TickerNo=="+TickerNo);
return couponAmout;
}
if (type==1){
userCoupon.setIsUse(1);
userCoupon.setOrderNo(orderNo);
......@@ -181,7 +185,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
BigDecimal useAmout = coupon.getUsedAmount();
if (amout.compareTo(useAmout) > 0) {
if (type == 3 || (type == 1 && (amout.compareTo(coupon.getWithAmount()) >= 0))) {
couponAmout = amout.subtract(useAmout);
//couponAmout = amout.subtract(useAmout);
couponAmout=useAmout;
}
}
}
......
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