Преглед изворни кода

Merge branch 'master' into pre

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java
#	netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
zoujiajian пре 2 година
родитељ
комит
e8df87a622

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java

@@ -149,7 +149,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 				if (!sync) return nfVerifyUrl;
 				//失败返回验证链接
 				if (!groupsRelationNetflix.confirmUpdate(nfVerifyUrl)) {
-					return url;
+					return nfVerifyUrl;
 				}
 				return StrUtil.EMPTY;
 			}

+ 19 - 17
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -1153,23 +1153,25 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		}
 
 
-//		if (orderDon.getOrderType() == 1 && StrUtil.isNotEmpty(buyerId)) {
-//			//近一个月同一买家id 只能购买一次 多人
-//			if (orderDon.getGoodsId() == 26l && sku.getNum() != 1) {
-//				Integer count = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
-//						.ne(OrderDon::getId, orderDon.getId())
-//						.eq(OrderDon::getGoodsId, orderDon.getGoodsId())
-//						.eq(OrderDon::getBuyerId, buyerId)
-//						.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
-//						.ge(OrderDon::getCreatedTime, DateUtil.offsetMonth(DateTime.now(), -1)));
-//				if (count > 1) {
-//					//退款
-//					log.info("一个月内同一买家id购买过Midjourney账号,对订单号:{}进行退款", orderDon.getOrderNo());
-//					notifyRefundOrder(orderDon, goodsDon, sku);
-//					return;
-//				}
-//			}
-//		}
+		if (orderDon.getOrderType() == 1 && StrUtil.isNotEmpty(buyerId)) {
+			//近一个月同一买家id 只能购买一次 多人
+			if (orderDon.getGoodsId() == 26l && sku.getNum() != 1) {
+				List<Long> userIdList = userBindRelationService.getRelationUserIdList(orderDon.getUserId(), null);
+				Integer count = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
+						.ne(OrderDon::getId, orderDon.getId())
+						.eq(OrderDon::getGoodsId, orderDon.getGoodsId())
+						.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
+						.ge(OrderDon::getCreatedTime, DateUtil.offsetMonth(DateTime.now(), -1))
+						//同一买家或者同一用户
+						.and(o -> o.eq(OrderDon::getBuyerId, buyerId).or().in(OrderDon::getUserId, userIdList)));
+				if (count > 1) {
+					//退款
+					log.info("一个月内同一买家id购买过Midjourney账号,对订单号:{}进行退款", orderDon.getOrderNo());
+					notifyRefundOrder(orderDon, goodsDon, sku);
+					return;
+				}
+			}
+		}
 		//回调
 		unifiedHandlerOrderNotify(orderDon, goodsDon, sku);
 	}