|
|
|
@@ -3,20 +3,33 @@ package com.simple.service.impl; |
|
|
|
import java.util.*; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.Result; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
import com.simple.domain.po.WxCoupon; |
|
|
|
import com.simple.domain.po.WxCouponChannel; |
|
|
|
import com.simple.domain.po.WxCouponSend; |
|
|
|
import com.simple.domain.vo.WxCouponCVo; |
|
|
|
import com.simple.mapper.WxCouponChannelMapper; |
|
|
|
import com.simple.mapper.WxCouponMapper; |
|
|
|
import com.simple.service.WxCampaignService; |
|
|
|
import com.simple.service.WxCouponChannelService; |
|
|
|
import com.simple.service.WxCouponSendService; |
|
|
|
import com.simple.service.WxCouponService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponMapper wxCouponMapper; |
|
|
|
@Autowired |
|
|
|
WxCouponChannelService wxCouponChannelService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponSendService wxCouponSendService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -67,4 +80,20 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
return wxCouponMapper.selectDetailForCUser(record); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public ResultData updateCoupon(WxCoupon wxCoupon) { |
|
|
|
WxCoupon query = wxCouponMapper.selectByPrimaryKey(wxCoupon.getId()); |
|
|
|
if(wxCoupon.getStatus()!=null){ |
|
|
|
if(wxCoupon.getStatus()==1){ //已作废 |
|
|
|
//作废所有投放频道 |
|
|
|
wxCouponChannelService.updateStatusByCouponId(wxCoupon.getId(),query.getTenantId(),1); |
|
|
|
wxCouponSendService.updateStatusByCouponId(query.getId(),query.getTenantId(),1); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(saveOrUpdate(wxCoupon)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |