|
|
|
@@ -169,34 +169,34 @@ public class WxTopicServiceImpl implements WxTopicService { |
|
|
|
if(showBeginTime == null){ |
|
|
|
showBeginTime = new Date(); |
|
|
|
} |
|
|
|
if(wxCoupon.getSoldStartTime() != null && wxCoupon.getSoldEndTime() != null){ |
|
|
|
if(showBeginTime.after(wxCoupon.getSoldEndTime())){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]上架时间不得晚于售卖结束时间"); |
|
|
|
} |
|
|
|
if(beginTime == null){ |
|
|
|
beginTime = wxCoupon.getSoldStartTime(); |
|
|
|
} |
|
|
|
if(beginTime.before(wxCoupon.getSoldStartTime())){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动开始时间不得早于售卖开始时间"); |
|
|
|
} |
|
|
|
if(endTime == null){ |
|
|
|
endTime = wxCoupon.getSoldEndTime(); |
|
|
|
} |
|
|
|
if(endTime.after(wxCoupon.getSoldEndTime())){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动结束时间不得晚于售卖结束时间"); |
|
|
|
} |
|
|
|
} |
|
|
|
// if(wxCoupon.getSoldStartTime() != null && wxCoupon.getSoldEndTime() != null){ |
|
|
|
// if(showBeginTime.after(wxCoupon.getSoldEndTime())){ |
|
|
|
// throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]上架时间不得晚于售卖结束时间"); |
|
|
|
// } |
|
|
|
// if(beginTime == null){ |
|
|
|
// beginTime = wxCoupon.getSoldStartTime(); |
|
|
|
// } |
|
|
|
// if(beginTime.before(wxCoupon.getSoldStartTime())){ |
|
|
|
// throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动开始时间不得早于售卖开始时间"); |
|
|
|
// } |
|
|
|
// if(endTime == null){ |
|
|
|
// endTime = wxCoupon.getSoldEndTime(); |
|
|
|
// } |
|
|
|
// if(endTime.after(wxCoupon.getSoldEndTime())){ |
|
|
|
// throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动结束时间不得晚于售卖结束时间"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
if(beginTime == null){ |
|
|
|
beginTime = showBeginTime; |
|
|
|
} |
|
|
|
if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wxCoupon.getValidType())){ |
|
|
|
if(endTime == null){ |
|
|
|
endTime = wxCoupon.getValidEndDate(); |
|
|
|
} |
|
|
|
if(endTime.after(wxCoupon.getValidEndDate())){ |
|
|
|
throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动结束时间不得晚于有效期结束时间"); |
|
|
|
} |
|
|
|
} |
|
|
|
// if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wxCoupon.getValidType())){ |
|
|
|
// if(endTime == null){ |
|
|
|
// endTime = wxCoupon.getValidEndDate(); |
|
|
|
// } |
|
|
|
// if(endTime.after(wxCoupon.getValidEndDate())){ |
|
|
|
// throw new MallinkException(ErrorCode.COUPON_IS_EXPIRED.getCode(),"["+wxCoupon.getTitle()+"]活动结束时间不得晚于有效期结束时间"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.updateTenantInfo(record); |
|
|
|
|