|
|
|
@@ -120,32 +120,33 @@ public class WxCampaignServiceImpl implements WxCampaignService { |
|
|
|
|
|
|
|
if(wxCouponChannels.size()>0) { |
|
|
|
for (int i = 0; i < wxCouponChannels.size(); i++) { |
|
|
|
|
|
|
|
wxCouponChannels.get(i).setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannels.get(i).setBeginTime(record.getValidStartDate()); |
|
|
|
wxCouponChannels.get(i).setEndTime(record.getValidEndDate()); |
|
|
|
wxCouponChannelMapper.updateByPrimaryKeySelective(wxCouponChannels.get(i)); |
|
|
|
wxCouponChannels.remove(i); |
|
|
|
if (wxCouponChannels.get(i).getId() == couponId) { |
|
|
|
wxCouponChannels.get(i).setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannels.get(i).setBeginTime(record.getValidStartDate()); |
|
|
|
wxCouponChannels.get(i).setEndTime(record.getValidEndDate()); |
|
|
|
wxCouponChannelMapper.updateByPrimaryKeySelective(wxCouponChannels.get(i)); |
|
|
|
wxCouponChannels.remove(i); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.setBeginTime(record.getValidStartDate()); |
|
|
|
wxCouponChannel.setEndTime(record.getValidEndDate()); |
|
|
|
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannel.setCouponId(couponId); |
|
|
|
wxCouponChannel.setMerchantId(wxCoupon.getMerchantId()); |
|
|
|
wxCouponChannel.setType(wxCoupon.getType()); |
|
|
|
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); |
|
|
|
wxCouponChannel.setTenantId(wxCoupon.getTenantId()); |
|
|
|
wxCouponChannel.setBusiness(wxCoupon.getBusiness()); |
|
|
|
wxCouponChannel.setTitle(wxCoupon.getTitle()); |
|
|
|
wxCouponChannel.setSubTargetId(record.getId()); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
wxCouponChannel.setId(idWorker.nextId()); |
|
|
|
wxCouponChannelMapper.insertSelective(wxCouponChannel); |
|
|
|
} |
|
|
|
|
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.setBeginTime(record.getValidStartDate()); |
|
|
|
wxCouponChannel.setEndTime(record.getValidEndDate()); |
|
|
|
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
wxCouponChannel.setCouponId(couponId); |
|
|
|
wxCouponChannel.setMerchantId(wxCoupon.getMerchantId()); |
|
|
|
wxCouponChannel.setType(wxCoupon.getType()); |
|
|
|
wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); |
|
|
|
wxCouponChannel.setTenantId(wxCoupon.getTenantId()); |
|
|
|
wxCouponChannel.setBusiness(wxCoupon.getBusiness()); |
|
|
|
wxCouponChannel.setTitle(wxCoupon.getTitle()); |
|
|
|
wxCouponChannel.setSubTargetId(record.getId()); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
wxCouponChannel.setId(idWorker.nextId()); |
|
|
|
wxCouponChannelMapper.insertSelective(wxCouponChannel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|