| | |
| | | goods.add(commodity); |
| | | } |
| | | } |
| | | |
| | | List<Coupon> allCoupons = ucponClient.getAllCoupons(commodityRequest); |
| | | if (allCoupons.size() > 0) { |
| | | for (Coupon allCoupon : allCoupons) { |
| | |
| | | userCouponPayment.setCode(code); |
| | | userCouponPayment.setPayType(coupon.getRedemptionMethod()); |
| | | userCouponPayment.setIntegral(coupon.getIntegral().intValue()); |
| | | userCouponPayment.setCash(coupon.getCash().doubleValue()); |
| | | userCouponPayment.setCash(null == coupon.getCash() ? 0D : coupon.getCash().doubleValue()); |
| | | userCouponPayment.setCashPayType(exchangeType.getPayType()); |
| | | userCouponPayment.setInsertTime(new Date()); |
| | | |
| | |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | PointsMerchandise merchandise = new PointsMerchandise(); |
| | | if(exchangeType.getGoodsType() != 4){ |
| | | merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | }else{ |
| | | Coupon coupon = ucponClient.queryCouponById(exchangeType.getGoodId()); |
| | | merchandise.setId(coupon.getId()); |
| | | merchandise.setUserPopulation(coupon.getUserPopulation()); |
| | | merchandise.setIntegral(coupon.getIntegral().intValue()); |
| | | merchandise.setQuantityIssued(coupon.getQuantityIssued()); |
| | | merchandise.setPickUpQuantity(coupon.getPickUpQuantity()); |
| | | merchandise.setUseScope(coupon.getUseScope()); |
| | | merchandise.setCash(coupon.getCash()); |
| | | merchandise.setType(4); |
| | | } |
| | | |
| | | |
| | | if (ToolUtil.isEmpty(merchandise)) { |