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());