是否能禁止退货,关联到用户订单详情和商家订单列表

This commit is contained in:
Jack 2025-10-21 11:07:38 +08:00
parent 12523f13da
commit b60f4d9210
2 changed files with 17 additions and 1 deletions

View File

@ -670,6 +670,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
Integer user_id = user.getId();
log.debug("当前用户ID: {}", user_id);
QueryWrapper<ShopDistributionUserOrder> userOrderQueryWrapper = new QueryWrapper<>();
userOrderQueryWrapper.eq("user_id", user_id).in("order_id", order_ids);
ShopDistributionUserOrder distributionUserOrder = shopDistributionUserOrderService.findOne(userOrderQueryWrapper);
@ -761,11 +762,14 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
throw new ApiException(I18nUtil._("无该订单访问权限!"));
}
// 是否禁止退款
int isOrderDenyReturn = shopOrderReturnService.isOrderDenyReturn(order_id) ? 1 : 2;
data.put("is_deny_return", isOrderDenyReturn);
log.info("订单详情获取完成订单ID: {}", order_id);
return data;
}
/**
* @param order_id
* @param base_row shopOrderBase

View File

@ -2117,6 +2117,12 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
return true;
}
if (orderStateId.intValue() == StateCode.ORDER_STATE_CANCEL ||
orderStateId.intValue() == StateCode.ORDER_STATE_WAIT_PAY) {
log.debug("[是否禁止退货] 订单已取消或未支付order_id: {}", orderId);
return true;
}
// 2. 先判断整个订单是否可以退货订单级别检查
// 2.1 检查订单状态是否为已收货或已完成
if (orderStateId.intValue() == StateCode.ORDER_STATE_RECEIVED ||
@ -2239,6 +2245,12 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
return true;
}
if (orderStateId.intValue() == StateCode.ORDER_STATE_CANCEL ||
orderStateId.intValue() == StateCode.ORDER_STATE_WAIT_PAY) {
log.debug("[是否禁止退货] 订单已取消或未支付order_id: {}", orderId);
return true;
}
if (orderStateId.intValue() == StateCode.ORDER_STATE_RECEIVED ||
orderStateId.intValue() == StateCode.ORDER_STATE_FINISH) {