From a16dc87cfb12ee045d38b335f27936967dac31b2 Mon Sep 17 00:00:00 2001 From: hupeng Date: Thu, 30 Aug 2018 15:22:36 +0800 Subject: [PATCH] =?UTF-8?q?[A=E7=AB=AF][=E4=BF=AE=E5=A4=8D]:=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9B=B4=E6=96=B0campaign=E9=87=8D=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BAcouponchannel=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxCampaignServiceImpl.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxCampaignServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxCampaignServiceImpl.java index c23496189..da64a1a26 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxCampaignServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxCampaignServiceImpl.java @@ -77,6 +77,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { if (wxCouponChannels.size() > 0) { for (WxCouponChannel ch : wxCouponChannels) { ch.setStatus(EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); + wxCouponChannels.get(i).setUpdateDate(new Date()); wxCouponChannelMapper.updateByPrimaryKeySelective(ch); } } @@ -99,6 +100,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { { for (int i = 0; i < wxCouponChannels.size(); i++) { wxCouponChannels.get(i).setStatus(EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); + wxCouponChannels.get(i).setUpdateDate(new Date()); wxCouponChannelMapper.updateByPrimaryKeySelective(wxCouponChannels.get(i)); } @@ -118,19 +120,20 @@ public class WxCampaignServiceImpl implements WxCampaignService { throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF); } - if(wxCouponChannels.size()>0) { - for (int i = 0; i < wxCouponChannels.size(); i++) { - if (wxCouponChannels.get(i).getId().longValue() == couponId.longValue()) { - 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; - } + + for (int i = 0; i < wxCouponChannels.size(); i++) { + if (wxCouponChannels.get(i).getCouponId().longValue() == couponId.longValue()) { + wxCouponChannels.get(i).setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); + wxCouponChannels.get(i).setBeginTime(record.getValidStartDate()); + wxCouponChannels.get(i).setEndTime(record.getValidEndDate()); + wxCouponChannels.get(i).setUpdateDate(new Date()); + wxCouponChannelMapper.updateByPrimaryKeySelective(wxCouponChannels.get(i)); + wxCouponChannels.remove(i); + return; } } + WxCouponChannel wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setBeginTime(record.getValidStartDate()); wxCouponChannel.setEndTime(record.getValidEndDate());