|
|
|
@@ -291,14 +291,24 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQuery); |
|
|
|
WxCouponChannel wxCouponChannel = null; |
|
|
|
Date now = new Date(); |
|
|
|
Date showBeginTime = now; |
|
|
|
Date beginTime = null; |
|
|
|
Date endTime = null; |
|
|
|
if(coupon.getSoldStartTime() != null && coupon.getSoldEndTime() != null){ |
|
|
|
beginTime = coupon.getSoldStartTime(); |
|
|
|
endTime = coupon.getSoldEndTime(); |
|
|
|
}else{ |
|
|
|
beginTime = showBeginTime; |
|
|
|
endTime = coupon.getValidEndDate(); |
|
|
|
} |
|
|
|
if(wxCouponChannels == null || wxCouponChannels.isEmpty()){ |
|
|
|
wxCouponChannel = new WxCouponChannel(); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
wxCouponChannel.setId(idWorker.nextId()); |
|
|
|
wxCouponChannel.updateTenantInfo(coupon); |
|
|
|
wxCouponChannel.setShowBeginTime(now); |
|
|
|
wxCouponChannel.setBeginTime(now); |
|
|
|
wxCouponChannel.setEndTime(coupon.getValidEndDate()); |
|
|
|
wxCouponChannel.setShowBeginTime(showBeginTime); |
|
|
|
wxCouponChannel.setBeginTime(beginTime); |
|
|
|
wxCouponChannel.setEndTime(endTime); |
|
|
|
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode()); |
|
|
|
wxCouponChannel.setCouponId(coupon.getId()); |
|
|
|
wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId()); |
|
|
|
@@ -311,9 +321,9 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { |
|
|
|
|
|
|
|
}else if(wxCouponChannels.size() == 1){ |
|
|
|
wxCouponChannel = wxCouponChannels.get(0); |
|
|
|
wxCouponChannel.setShowBeginTime(now); |
|
|
|
wxCouponChannel.setBeginTime(now); |
|
|
|
wxCouponChannel.setEndTime(coupon.getValidEndDate()); |
|
|
|
wxCouponChannel.setShowBeginTime(showBeginTime); |
|
|
|
wxCouponChannel.setBeginTime(beginTime); |
|
|
|
wxCouponChannel.setEndTime(endTime); |
|
|
|
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode()); |
|
|
|
wxCouponChannel.setCouponId(coupon.getId()); |
|
|
|
wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId()); |
|
|
|
|