| | |
| | | if(coupon == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+index+"】个优惠券查询无效,请刷新页面重新!"); |
| | | } |
| | | BigDecimal maxPrice = BigDecimal.ZERO; |
| | | if(Constants.equalsInteger(coupon.getCouponType(),Constants.ZERO)){ |
| | | maxPrice = coupon.getPrice(); |
| | | }else if(Constants.equalsInteger(coupon.getCouponType(),Constants.ONE)){ |
| | | maxPrice = coupon.getLimitPrice().subtract(coupon.getLimitPrice().multiply(coupon.getPrice()).divide(new BigDecimal("100"),2, RoundingMode.HALF_UP)); |
| | | } |
| | | for(Member member : memberList){ |
| | | for (int i = 0; i < Constants.formatLongNum(param.getNum()); i++) { |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,member,now,Constants.TWO,loginUserInfo); |
| | | memberCoupon.setMaxPrice(maxPrice); |
| | | //挨个送 |
| | | addList.add(memberCoupon); |
| | | } |