| @@ -1,17 +1,15 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import java.util.*; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxCardInfo; | import com.iformall.domain.po.WxCardInfo; | ||||
| import com.iformall.domain.vo.WxCardVo; | import com.iformall.domain.vo.WxCardVo; | ||||
| import java.util.List; | |||||
| public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | ||||
| List<WxCardVo> findVoList(WxCardVo wxCardVo); | List<WxCardVo> findVoList(WxCardVo wxCardVo); | ||||
| void updateTransferStatusByCouponId(Long couponId); | |||||
| } | } | ||||
| @@ -13,6 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.WxCardInfoMapper; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxCouponMerchantMapper; | import com.iformall.mapper.WxCouponMerchantMapper; | ||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| @@ -43,6 +44,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| WxOrderService wxOrderService; | WxOrderService wxOrderService; | ||||
| @Autowired | @Autowired | ||||
| QrCodeService qrCodeService; | QrCodeService qrCodeService; | ||||
| @Autowired | |||||
| WxCardInfoMapper wxCardInfoMapper; | |||||
| /** | /** | ||||
| * B端业务端 | * B端业务端 | ||||
| @@ -107,6 +110,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); | wxCoupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); | ||||
| wxCoupon.setUpdateDate(new Date()); | wxCoupon.setUpdateDate(new Date()); | ||||
| wxCouponService.update(wxCoupon); | wxCouponService.update(wxCoupon); | ||||
| //修改卡状态 | |||||
| wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -63,6 +63,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Autowired | @Autowired | ||||
| WxCouponChannelMapper wxCouponChannelMapper; | WxCouponChannelMapper wxCouponChannelMapper; | ||||
| @Autowired | |||||
| WxCardInfoMapper wxCardInfoMapper; | |||||
| @Override | @Override | ||||
| public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| @@ -394,10 +397,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); | wxScreenAdService.updateStatusByCouponId(record.getId(), record.getTenantId(), EnumScreenAdStatus.INVALID.getCode()); | ||||
| //下架拼团券 | //下架拼团券 | ||||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.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()); | record.setUpdateDate(new Date()); | ||||
| wxCouponMapper.updateByPrimaryKeySelective(record); | wxCouponMapper.updateByPrimaryKeySelective(record); | ||||
| } | } | ||||
| return new ResultData(record.getId()); | return new ResultData(record.getId()); | ||||
| } | } | ||||
| @@ -206,5 +206,8 @@ | |||||
| <include refid="dynamicVoWhereConditions" /> | <include refid="dynamicVoWhereConditions" /> | ||||
| </select> | </select> | ||||
| <update id="updateTransferStatusByCouponId" parameterType="Long"> | |||||
| update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||