| | |
| | | if (data==null){ |
| | | return R.fail("当前优惠券不存在,请刷新后重试"); |
| | | } |
| | | if (data.getSendType()!=1&&byId.getLavePoint().compareTo(data.getNeedPoint().intValue())==-1){ |
| | | if (data.getSendType()!=1&& byId.getLavePoint().compareTo(data.getNeedPoint().intValue()) < 0){ |
| | | return R.fail("当前积分不足,兑换失败"); |
| | | } |
| | | //检验发放时间 |
| | |
| | | UserCoupon userCoupon = new UserCoupon(); |
| | | userCoupon.setAppUserId(userid); |
| | | if (data.getPeriodType()==1) { |
| | | userCoupon.setStartTime(data.getPeriodStartTime()); |
| | | userCoupon.setEndTime(data.getPeriodEndTime()); |
| | | userCoupon.setStartTime(data.getPeriodStartTime().atTime(0,0,0)); |
| | | userCoupon.setEndTime(data.getPeriodEndTime().atTime(0,0,0)); |
| | | }else { |
| | | userCoupon.setStartTime(now); |
| | | userCoupon.setEndTime(now.plusDays(data.getPeriodDays())); |