|
@@ -28,6 +28,7 @@ import com.yonge.cooleshow.common.enums.EStatus;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -77,9 +78,11 @@ public class CouponIssueServiceImp extends ServiceImpl<CouponIssueMapper, Coupon
|
|
|
|
|
|
// 优惠券过期状态
|
|
|
couponIssueWrappers = couponIssueWrappers.stream()
|
|
|
- .peek(couponIssueWrapper -> {
|
|
|
- if (couponIssueWrapper.getEndTime().compareTo(query.getExpiredTime()) <0) {
|
|
|
- couponIssueWrapper.setUseState(CouponUseStateEnum.EXPIRED);
|
|
|
+ .peek(x -> {
|
|
|
+ if (StringUtils.isEmpty(x.getOrderNo())
|
|
|
+ && CouponUseStateEnum.WITHDRAW != x.getUseState()
|
|
|
+ && x.getEndTime().compareTo(query.getExpiredTime()) <0) {
|
|
|
+ x.setUseState(CouponUseStateEnum.EXPIRED);
|
|
|
}
|
|
|
}).collect(Collectors.toList());
|
|
|
|