From 00843a54e82c18781728eaa7797d98645bfc5af9 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 29 Jun 2022 17:55:09 +0800 Subject: [PATCH] //tt goods --- .../impl/TtCouponGoodsServiceImpl.java | 30 ++++++++++--------- .../service/impl/WxCouponServiceImpl.java | 20 ++++++------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java index e19074421..bfc0303a7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java @@ -326,8 +326,8 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { @Override public ResultData productOperate(TenantEntity tenantInfo, Long id) { WxCoupon wxCoupon = wxCouponMapper.selectById(id, tenantInfo.getTenantId()); - if(wxCoupon == null || EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到或已作废"); + if(wxCoupon == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到"); } TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),id); if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ @@ -336,14 +336,16 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { //查询上架 //op_type int64 TRUE 1-上线 2-下线 Integer op_type = 2; - WxCouponChannel wxCouponChannelQuery = new WxCouponChannel(); - wxCouponChannelQuery.updateTenantInfo(wxCoupon); - wxCouponChannelQuery.setCouponId(wxCoupon.getId()); - wxCouponChannelQuery.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); - wxCouponChannelQuery.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); - List wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQuery); - if(wxCouponChannels.size() > 0){ - op_type = 1; + if(!EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ + WxCouponChannel wxCouponChannelQuery = new WxCouponChannel(); + wxCouponChannelQuery.updateTenantInfo(wxCoupon); + wxCouponChannelQuery.setCouponId(wxCoupon.getId()); + wxCouponChannelQuery.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); + wxCouponChannelQuery.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); + List wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQuery); + if(wxCouponChannels.size() > 0){ + op_type = 1; + } } try { @@ -364,8 +366,8 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { @Override public ResultData productStockSync(TenantEntity tenantInfo, Long id) { WxCoupon wxCoupon = wxCouponMapper.selectById(id, tenantInfo.getTenantId()); - if(wxCoupon == null || EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到或已作废"); + if(wxCoupon == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到"); } TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),id); if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ @@ -389,8 +391,8 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { @Override public ResultData productFreeAudit(TenantEntity tenantInfo, Long id) { WxCoupon wxCoupon = wxCouponMapper.selectById(id, tenantInfo.getTenantId()); - if(wxCoupon == null || EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到或已作废"); + if(wxCoupon == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未找到"); } TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),id); if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 76d07d5e3..b79461b70 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -1036,11 +1036,11 @@ public class WxCouponServiceImpl implements WxCouponService { if (num == 0) { throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); } - try{ - spuStockSync(tenantEntity,id); - }catch(Exception e){ - logger.error("send spuStockSync error: " + e.getMessage()); - } +// try{ +// spuStockSync(tenantEntity,id); +// }catch(Exception e){ +// logger.error("send spuStockSync error: " + e.getMessage()); +// } } @Override @@ -1050,11 +1050,11 @@ public class WxCouponServiceImpl implements WxCouponService { if (num == 0) { throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL); } - try{ - spuStockSync(tenantEntity,id); - }catch(Exception e){ - logger.error("send spuStockSync error: " + e.getMessage()); - } +// try{ +// spuStockSync(tenantEntity,id); +// }catch(Exception e){ +// logger.error("send spuStockSync error: " + e.getMessage()); +// } } private void spuStockSync(TenantEntity tenantEntity,Long couponId){