|
|
|
@@ -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<WxCouponChannel> 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<WxCouponChannel> 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())){ |
|
|
|
|