Browse Source

//spu_sync

release_toaliyun_real
xhxu 3 years ago
parent
commit
1ea290e871
3 changed files with 20 additions and 6 deletions
  1. +2
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java
  2. +2
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java
  3. +16
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java

+ 2
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java View File

@@ -96,6 +96,8 @@ public class WxCouponChannelController extends BaseController {
//生成二维码 //生成二维码
if(couponChannel!=null){ if(couponChannel!=null){
wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType()); wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType());

wxCouponChannelService.spuStatusSyncByCoupon(couponChannel,couponChannel.getCouponId());
} }
CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId());
CouponCacheUtils.removeDouyinLivePageCache(redisTemplate, wxCouponChannel.getTenantId(), null, null); CouponCacheUtils.removeDouyinLivePageCache(redisTemplate, wxCouponChannel.getTenantId(), null, null);


+ 2
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxCouponChannelController.java View File

@@ -83,6 +83,8 @@ public class WxCouponChannelController extends BaseController {
//生成二维码 //生成二维码
if(couponChannel!=null){ if(couponChannel!=null){
wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType()); wxCouponChannelService.updateQrCode(couponChannel,couponChannel.getId(),couponChannel.getType());

wxCouponChannelService.spuStatusSyncByCoupon(couponChannel,couponChannel.getCouponId());
} }
CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId());
return resultData; return resultData;


+ 16
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java View File

@@ -228,7 +228,10 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
updCC.setUpdateDate(new Date()); updCC.setUpdateDate(new Date());
wxCouponChannelMapper.updateStatusByTargetAd(updCC); wxCouponChannelMapper.updateStatusByTargetAd(updCC);


spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId());
/**
* 事务原因可能导致状态不一致, 放到事务完成之后
*/
// spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId());
} }


/** /**
@@ -255,7 +258,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
updCC.setUpdateDate(new Date()); updCC.setUpdateDate(new Date());
wxCouponChannelMapper.updateStatusByTargetAd(updCC); wxCouponChannelMapper.updateStatusByTargetAd(updCC);


spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId());
/**
*
* 事务原因可能导致状态不一致, 放到事务完成之后
*/
// spuStatusSyncByCoupon(wxCoupon,wxCoupon.getId());
} }
} }


@@ -709,12 +716,15 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
wxCouponChannel.setChannelStock(channelStock); wxCouponChannel.setChannelStock(channelStock);
ResultData resultData = saveOrUpdate(wxCouponChannel); ResultData resultData = saveOrUpdate(wxCouponChannel);
WxCouponChannel channel = (WxCouponChannel)resultData.data; WxCouponChannel channel = (WxCouponChannel)resultData.data;
vo.setId(channel.getId());
vo.setType(channel.getType());
vo.setSuc(true);
if(channel != null){
vo.setId(channel.getId());
vo.setType(channel.getType());
vo.setSuc(true);


this.updateQrCode(channel,channel.getId(),channel.getType());
this.updateQrCode(channel,channel.getId(),channel.getType());


this.spuStatusSyncByCoupon(channel,channel.getCouponId());
}
return vo; return vo;
} }




Loading…
Cancel
Save