刘帅
2026-09-20 8a85fc834d98b2c14c5b886a957ccf3197aad293
cloud-server-activity/src/main/java/com/dsh/activity/service/impl/UserCouponServiceImpl.java
@@ -128,7 +128,10 @@
        }
        try {
            JSONObject content = JSON.parseObject(coupon.getContent());
            BigDecimal deductionAmount = content.getBigDecimal("deductionAmount");
            // 满减券使用 deductionAmount,代金券历史规则将抵扣额存放在 conditionalAmount。
            BigDecimal deductionAmount = Integer.valueOf(2).equals(coupon.getType())
                    ? content.getBigDecimal("conditionalAmount")
                    : content.getBigDecimal("deductionAmount");
            return deductionAmount == null ? BigDecimal.ZERO : deductionAmount.max(BigDecimal.ZERO);
        } catch (Exception e) {
            LOGGER.warn("解析优惠券抵扣规则失败,couponId={}", coupon.getId(), e);
@@ -155,6 +158,10 @@
        List<CouponListVo> listVos = new ArrayList<>();
        for (Map<String, Object> userCoupon : userCoupons) {
            Integer type = Integer.valueOf(userCoupon.get("type").toString());
            // 支付减免只支持满减券和代金券;体验券/抵扣券不能用于订单金额计算。
            if (type != 1 && type != 2) {
                continue;
            }
            CouponListVo couponListVo = new CouponListVo();
            couponListVo.setId(Long.valueOf(userCoupon.get("id").toString()));
            couponListVo.setName(userCoupon.get("name").toString());
@@ -204,7 +211,11 @@
    @Override
    public List<CouponListVo> querySiteCouponList(Integer uid, Integer siteId, Double price, String lon, String lat) throws Exception {
        Site site = siteClient.querySiteById(siteId);
        Integer storeId = site.getStoreId();
        return queryStoreCouponList(uid, site.getStoreId(), price, lon, lat);
    }
    @Override
    public List<CouponListVo> queryStoreCouponList(Integer uid, Integer storeId, Double price, String lon, String lat) throws Exception {
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat);
        String provinceCode = geocode.get("provinceCode");
        String cityCode = geocode.get("cityCode");
@@ -212,6 +223,9 @@
        List<CouponListVo> listVos = new ArrayList<>();
        for (Map<String, Object> userCoupon : userCoupons) {
            Integer type = Integer.valueOf(userCoupon.get("type").toString());
            if (type != 1 && type != 2) {
                continue;
            }
            CouponListVo couponListVo = new CouponListVo();
            couponListVo.setId(Long.valueOf(userCoupon.get("id").toString()));
            couponListVo.setName(userCoupon.get("name").toString());