puzhibing
2023-12-04 2e2be7f7475b5e583b0cffd89c6d18db52c247a6
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -1025,6 +1025,7 @@
                goods.add(commodity);
            }
        }
        List<Coupon> allCoupons = ucponClient.getAllCoupons(commodityRequest);
        if (allCoupons.size() > 0) {
            for (Coupon allCoupon : allCoupons) {
@@ -1312,7 +1313,7 @@
            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());
@@ -1358,7 +1359,20 @@
        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)) {