|
|
@@ -72,6 +72,7 @@ import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
|
import com.cyksj.service.template.TemplateCommonService;
|
|
|
import com.cyksj.service.user.UserBenefitsService;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.service.wechat.WeChatService;
|
|
|
import com.cyksj.task.JobManager;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -203,6 +204,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
private final OrderDiscountPlusPurchaseSkuRelationMapper orderDiscountPlusPurchaseSkuRelationMapper;
|
|
|
|
|
|
+ private final UserBindRelationService userBindRelationService;
|
|
|
+
|
|
|
private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
|
|
|
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
@@ -360,7 +363,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
if (orderDon.getStatus() == OrderDon.Status.noPayment) {
|
|
|
jobManager.addJob(EXPIRY_TIME, () -> {
|
|
|
- closeOrder(orderDon.getId());
|
|
|
+ closeOrder(orderDon.getId(), null);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -597,10 +600,19 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
@Override
|
|
|
- public void closeOrder(Long orderId) {
|
|
|
- log.info("关闭订单 orderId:{}", orderId);
|
|
|
+ public void closeOrder(Long orderId, Long userId) {
|
|
|
//关闭订单逻辑
|
|
|
OrderDon orderDon = getById(orderId);
|
|
|
+ if (orderDon == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (userId != null) {
|
|
|
+ List<Long> relationUserIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ if (!relationUserIdList.contains(orderDon.getUserId())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("关闭订单 orderId:{}", orderId);
|
|
|
if (OrderDon.Status.noPayment.equals(orderDon.getStatus())) {
|
|
|
//调用微信、支付宝第三方接口查询订单是否支付
|
|
|
OrderDon.Status status = isHasPaid(orderDon);
|
|
|
@@ -788,7 +800,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
if (orderDon.getStatus() == OrderDon.Status.noPayment) {
|
|
|
jobManager.addJob(EXPIRY_TIME, () -> {
|
|
|
- closeOrder(orderDon.getId());
|
|
|
+ closeOrder(orderDon.getId(), null);
|
|
|
});
|
|
|
}
|
|
|
return orderDon;
|