|
|
@@ -1277,6 +1277,21 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //单个支付每月限购2单奈飞
|
|
|
+ if (orderDon.getGoodsId() == 1) {
|
|
|
+ Integer count = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getBuyerId, orderDon.getBuyerId())
|
|
|
+ .eq(OrderDon::getGoodsId, 1)
|
|
|
+ .ne(OrderDon::getId, orderDon.getId())
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
+ .ge(OrderDon::getCreatedTime, DateUtil.beginOfMonth(DateTime.now())));
|
|
|
+ //超过2单 自动退款
|
|
|
+ if (count > 1) {
|
|
|
+ notifyRefundOrder(orderDon, goodsDon, sku);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (orderDon.getOrderType() == 1 && StrUtil.isNotEmpty(buyerId)) {
|
|
|
//近一个月同一买家id 只能购买一次 多人 非镜像
|