|
|
@@ -396,6 +396,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
throw new BusinessRuntimeException("您有未支付订单.");
|
|
|
}
|
|
|
}
|
|
|
+ if (goodsId != null && goodsId == 1) {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ Integer selectCount = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .in(OrderDon::getUserId, userIdList)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
+ .ge(OrderDon::getCreatedTime, DateUtil.offsetMonth(DateTime.now(), -1)));
|
|
|
+ if (selectCount > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("奈飞近30天内限购一单");
|
|
|
+ }
|
|
|
+ }
|
|
|
GroupsRelation relation = null;
|
|
|
String orderPhone = payRequest.getPhone();
|
|
|
if (StrUtil.isNotBlank(orderPhone)) {
|
|
|
@@ -1285,9 +1295,9 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
.eq(OrderDon::getGoodsId, 1)
|
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
- .ge(OrderDon::getCreatedTime, DateUtil.beginOfMonth(DateTime.now())));
|
|
|
+ .ge(OrderDon::getCreatedTime, DateUtil.offsetMonth(DateTime.now(), -1)));
|
|
|
//超过2单 自动退款
|
|
|
- if (count > 1) {
|
|
|
+ if (count > 0) {
|
|
|
notifyRefundOrder(orderDon, goodsDon, sku);
|
|
|
return;
|
|
|
}
|