diff --git a/cash-api/order-server/src/main/java/com/czg/controller/user/UPointGoodsController.java b/cash-api/order-server/src/main/java/com/czg/controller/user/UPointGoodsController.java index 79b2e832b..f6274bd62 100644 --- a/cash-api/order-server/src/main/java/com/czg/controller/user/UPointGoodsController.java +++ b/cash-api/order-server/src/main/java/com/czg/controller/user/UPointGoodsController.java @@ -2,8 +2,10 @@ package com.czg.controller.user; import com.czg.market.entity.MkPointsGoods; import com.czg.market.entity.MkPointsGoodsRecord; +import com.czg.market.entity.ShopCoupon; import com.czg.market.service.MkPointsGoodsRecordService; import com.czg.market.service.MkPointsGoodsService; +import com.czg.market.service.ShopCouponService; import com.czg.order.dto.CommonRefundDTO; import com.czg.order.dto.LtPayOtherDTO; import com.czg.order.service.PointsGoodPayService; @@ -35,6 +37,8 @@ public class UPointGoodsController { private MkPointsGoodsRecordService goodsRecordService; @Resource private PointsGoodPayService goodPayService; + @Resource + private ShopCouponService shopCouponService; /** * 商品列表 @@ -57,6 +61,14 @@ public class UPointGoodsController { */ @GetMapping("/{id}") public CzgResult getPointsGoodsSettingById(@PathVariable("id") Long id) { + MkPointsGoods goods = pointsGoodsService.getById(id); + if ("优惠券".equals(goods.getGoodsCategory())) { + ShopCoupon one = shopCouponService.getOne(QueryWrapper.create().eq(ShopCoupon::getId, goods.getCouponId()) + .eq(ShopCoupon::getShopId, goods.getShopId()) + .eq(ShopCoupon::getStatus, 1) + .eq(ShopCoupon::getIsDel, 0)); + goods.setCouponInfo(one); + } return CzgResult.success(pointsGoodsService.getById(id)); }