diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java index bf4c0fee3..7d4be7a49 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java @@ -1,17 +1,15 @@ package com.iformall.mapper; -import java.util.*; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxCardInfo; import com.iformall.domain.vo.WxCardVo; +import java.util.List; + public interface WxCardInfoMapper extends CommonMapper { List findVoList(WxCardVo wxCardVo); - - - - - + void updateTransferStatusByCouponId(Long couponId); + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index cd9193aed..b1b73dccf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -13,6 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo; import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.domain.vo.WxMerchantVo; import com.iformall.enums.*; +import com.iformall.mapper.WxCardInfoMapper; import com.iformall.mapper.WxCouponChannelMapper; import com.iformall.mapper.WxCouponMerchantMapper; import com.iformall.mapper.WxMerchantMapper; @@ -43,6 +44,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxOrderService wxOrderService; @Autowired QrCodeService qrCodeService; + @Autowired + WxCardInfoMapper wxCardInfoMapper; /** * B端业务端 @@ -107,6 +110,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); wxCoupon.setUpdateDate(new Date()); wxCouponService.update(wxCoupon); + //修改卡状态 + wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index bf903a781..7c7c27369 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -63,6 +63,9 @@ public class WxCouponServiceImpl implements WxCouponService { @Autowired WxCouponChannelMapper wxCouponChannelMapper; + @Autowired + WxCardInfoMapper wxCardInfoMapper; + @Override public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { if (null == wxCoupon) wxCoupon = new WxCoupon(); @@ -394,10 +397,15 @@ public class WxCouponServiceImpl implements WxCouponService { wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); //下架拼团券 wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); + //卡-转赠状态 + record.setSupportTransfer(EnumCouponTransfer.NO.getCode()); + //修改卡状态 + wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); } record.setUpdateDate(new Date()); wxCouponMapper.updateByPrimaryKeySelective(record); + } return new ResultData(record.getId()); } diff --git a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml index 1119c84fc..ffcd1a720 100644 --- a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml @@ -206,5 +206,8 @@ + + update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId} +