Просмотр исходного кода

[A端][修复]:修复更新campaign重复创建couponchannel的问题

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
a16dc87cfb
1 измененных файлов: 13 добавлений и 10 удалений
  1. +13
    -10
      mallinkService/src/main/java/com/simple/service/impl/WxCampaignServiceImpl.java

+ 13
- 10
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());


Загрузка…
Отмена
Сохранить