Commit a60fad76 by huluobin

update

parent 4f715c7b
...@@ -86,14 +86,8 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom ...@@ -86,14 +86,8 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom
.filter(orderServe -> { .filter(orderServe -> {
return orderServe.getBindCoupon() == 2; return orderServe.getBindCoupon() == 2;
}) })
.filter(orderServe -> { //不是活动价格
if (orderServe.getProduceId() != null) { .filter(orderServe -> !orderServe.isActivity())
return orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1;
}
return true;
})
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.map(OrderServe::getServeId) .map(OrderServe::getServeId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
......
...@@ -225,14 +225,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme ...@@ -225,14 +225,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
List<Integer> canUserServeIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(coupon.getId()); List<Integer> canUserServeIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(coupon.getId());
canUserServeIds.retainAll(orderServeList.stream() canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2) .filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> { .filter(orderServe -> !orderServe.isActivity())
if (orderServe.getProduceId() != null) {
return orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1;
}
return true;
})
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.map(OrderServe::getServeId) .map(OrderServe::getServeId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
coupon.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds)); coupon.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds));
......
...@@ -233,6 +233,6 @@ public class OrderServe implements Serializable { ...@@ -233,6 +233,6 @@ public class OrderServe implements Serializable {
public Boolean isActivity() { public Boolean isActivity() {
return price.equals(leisurePrice) || return price.equals(leisurePrice) ||
price.equals(promotionPrice) || price.equals(promotionPrice) ||
(price.equals(produceCurrentPrice) && produceCurrentPrice.compareTo(produceBargainPrice) > -1); (price.equals(produceCurrentPrice) && produceCurrentPrice.compareTo(produceBargainPrice) < 0);
} }
} }
\ No newline at end of file
...@@ -210,6 +210,6 @@ public class ScheduleServe implements Serializable { ...@@ -210,6 +210,6 @@ public class ScheduleServe implements Serializable {
public Boolean isActivity() { public Boolean isActivity() {
return price.equals(leisurePrice) || return price.equals(leisurePrice) ||
price.equals(promotionPrice) || price.equals(promotionPrice) ||
(price.equals(produceCurrentPrice) && produceCurrentPrice.compareTo(produceBargainPrice) > -1); (price.equals(produceCurrentPrice) && produceCurrentPrice.compareTo(produceBargainPrice) < 0);
} }
} }
...@@ -183,14 +183,7 @@ public class TimesCardController { ...@@ -183,14 +183,7 @@ public class TimesCardController {
canUserServeIds.retainAll(orderServeList.stream() canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2) .filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> { .filter(orderServe -> !orderServe.isActivity())
if (orderServe.getProduceId() != null) {
return orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1;
}
return true;
})
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.map(OrderServe::getServeId) .map(OrderServe::getServeId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
timesCardCustomerRelevance.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds)); timesCardCustomerRelevance.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment