用户端兑换相关
This commit is contained in:
parent
45fe70f28d
commit
f210284292
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.dto.CouponInfoDTO;
|
||||
import com.czg.market.entity.MkRechargeRedemptionConfig;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
|
|
@ -32,7 +33,7 @@ public class MkCouponRedemptionConfigVO implements Serializable {
|
|||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private List<CouponInfoVO> couponInfoList;
|
||||
private List<CouponInfoDTO> couponInfoList;
|
||||
/**
|
||||
* 优惠券数量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.czg.account.service.ShopUserService;
|
|||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.dto.CouponInfoDTO;
|
||||
import com.czg.market.dto.MkCouponRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
import com.czg.market.dto.MkShopCouponGiftDTO;
|
||||
|
|
@ -75,7 +76,7 @@ public class MkCouponRedemptionConfigServiceImpl extends ServiceImpl<MkCouponRed
|
|||
|
||||
MkCouponRedemptionConfigVO infoList = BeanUtil.copyProperties(redemptionConfig, MkCouponRedemptionConfigVO.class, "couponInfoList");
|
||||
if (StrUtil.isNotBlank(redemptionConfig.getCouponInfoList())) {
|
||||
infoList.setCouponInfoList(JSONArray.parseArray(redemptionConfig.getCouponInfoList(), CouponInfoVO.class));
|
||||
infoList.setCouponInfoList(JSONArray.parseArray(redemptionConfig.getCouponInfoList(), CouponInfoDTO.class));
|
||||
}
|
||||
|
||||
return infoList;
|
||||
|
|
@ -104,8 +105,8 @@ public class MkCouponRedemptionConfigServiceImpl extends ServiceImpl<MkCouponRed
|
|||
|
||||
MkCouponRedemptionConfigVO config = BeanUtil.copyProperties(item, MkCouponRedemptionConfigVO.class, "couponInfoList");
|
||||
if (StrUtil.isNotBlank(item.getCouponInfoList())) {
|
||||
config.setCouponInfoList(JSONArray.parseArray(item.getCouponInfoList(), CouponInfoVO.class));
|
||||
config.setCouponNum(config.getCouponInfoList().stream().map(CouponInfoVO::getNum).reduce(0, Integer::sum));
|
||||
config.setCouponInfoList(JSONArray.parseArray(item.getCouponInfoList(), CouponInfoDTO.class));
|
||||
config.setCouponNum(config.getCouponInfoList().stream().map(CouponInfoDTO::getNum).reduce(0, Integer::sum));
|
||||
}
|
||||
configList.add(config);
|
||||
});
|
||||
|
|
@ -246,7 +247,7 @@ public class MkCouponRedemptionConfigServiceImpl extends ServiceImpl<MkCouponRed
|
|||
|
||||
if (config.getCouponInfoList() != null && !config.getCouponInfoList().isEmpty()) {
|
||||
config.getCouponInfoList().forEach(item -> {
|
||||
MkShopCouponGiftDTO giftDTO = new MkShopCouponGiftDTO().setCouponId(item.getCoupon().getId())
|
||||
MkShopCouponGiftDTO giftDTO = new MkShopCouponGiftDTO().setCouponId(item.getId())
|
||||
.setShopId(mainShopId)
|
||||
.setSourceId(redemptionCode.getId())
|
||||
.setShopUserId(shopUserInfo.getId())
|
||||
|
|
|
|||
Loading…
Reference in New Issue