|
|
@@ -253,6 +253,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
private final OrderRefundService orderRefundService;
|
|
|
|
|
|
+ private final UserPayOrderBlockMapper userPayOrderBlockMapper;
|
|
|
+
|
|
|
private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
|
|
|
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
@@ -1064,6 +1066,15 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderDon.setType(OrderDon.Type.ALI_PAY);
|
|
|
|
|
|
orderDon.setBuyerId(buyerId);
|
|
|
+ //该支付账号id 是否被后台拉黑
|
|
|
+ Integer count1 = userPayOrderBlockMapper.selectCount(Wrappers.lambdaQuery(UserPayOrderBlock.class)
|
|
|
+ .eq(UserPayOrderBlock::getBuyerId, buyerId));
|
|
|
+ if (count1 > 0) {
|
|
|
+ log.info("该支付账号id:{} 已被后台拉黑", buyerId);
|
|
|
+ notifyRefundOrder(orderDon, goodsDon, sku);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (orderDon.getOrderType() == 1 && StrUtil.isNotEmpty(buyerId)) {
|
|
|
//近一个月同一买家id 只能购买一次 多人
|
|
|
if (orderDon.getGoodsId() == 26l && sku.getNum() != 1) {
|
|
|
@@ -1076,20 +1087,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (count > 1) {
|
|
|
//退款
|
|
|
log.info("一个月内同一买家id购买过Midjourney账号,对订单号:{}进行退款", orderDon.getOrderNo());
|
|
|
- OrderRefundReq orderRefundReq = new OrderRefundReq();
|
|
|
- orderRefundReq.setOrderId(orderDon.getId());
|
|
|
- orderRefundReq.setRefundType("ALI_PAY");
|
|
|
- orderRefundReq.setRefundMoney(orderDon.getMoney());
|
|
|
- orderDon.setRefundDesc("近一个月内购买过Midjourney账号");
|
|
|
- String outNo = orderRefundService.centerRefund(orderRefundReq, orderDon);
|
|
|
-
|
|
|
- orderDon.setStatus(OrderDon.Status.refund);
|
|
|
- orderDonMapper.updateById(orderDon);
|
|
|
-
|
|
|
- clearUserLockingRelation(groupsRelationMapper.selectById(orderDon.getRelationId()), orderDon);
|
|
|
-
|
|
|
- //记录退款
|
|
|
- orderRefundService.refundRecord(orderDon, orderRefundReq.getRefundMoney(), goodsDon, sku, outNo, orderDon.getType().getType());
|
|
|
+ notifyRefundOrder(orderDon, goodsDon, sku);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -2683,4 +2681,26 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderCommonService.delRelation(groupsRelation);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 回调后 直接退款
|
|
|
+ */
|
|
|
+ public void notifyRefundOrder(OrderDon orderDon, GoodsDon goodsDon, GoodsDonSku sku) throws Exception {
|
|
|
+ //退款
|
|
|
+ OrderRefundReq orderRefundReq = new OrderRefundReq();
|
|
|
+ orderRefundReq.setOrderId(orderDon.getId());
|
|
|
+ orderRefundReq.setRefundType("ALI_PAY");
|
|
|
+ orderRefundReq.setRefundMoney(orderDon.getMoney());
|
|
|
+ orderDon.setRefundDesc("近一个月内购买过Midjourney账号");
|
|
|
+ String outNo = orderRefundService.centerRefund(orderRefundReq, orderDon);
|
|
|
+
|
|
|
+ orderDon.setStatus(OrderDon.Status.refund);
|
|
|
+ orderDonMapper.updateById(orderDon);
|
|
|
+
|
|
|
+ clearUserLockingRelation(groupsRelationMapper.selectById(orderDon.getRelationId()), orderDon);
|
|
|
+
|
|
|
+ //记录退款
|
|
|
+ orderRefundService.refundRecord(orderDon, orderRefundReq.getRefundMoney(), goodsDon, sku, outNo, orderDon.getType().getType());
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|