diff --git a/zlt-business/order-center/src/main/java/com/central/order/constants/PayTypeConstants.java b/zlt-business/order-center/src/main/java/com/central/order/constants/PayTypeConstants.java index e2ad1f9c..27a8befb 100644 --- a/zlt-business/order-center/src/main/java/com/central/order/constants/PayTypeConstants.java +++ b/zlt-business/order-center/src/main/java/com/central/order/constants/PayTypeConstants.java @@ -17,7 +17,17 @@ public class PayTypeConstants { * 优惠券支付 */ public static final Integer COUPON_PAY = 2; - + + /** + * 第三方聚到核销 + */ + public static final Integer FEIPAI_VERIFY = 3; + + /** + * 支付宝支付 + */ + public static final Integer ALIPAY_PAY = 4; + private PayTypeConstants() { // 私有构造函数,防止实例化 } diff --git a/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java b/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java index 7ecb4987..13c44d2b 100644 --- a/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java +++ b/zlt-business/order-center/src/main/java/com/central/order/service/impl/AlipayConfigServiceImpl.java @@ -39,6 +39,20 @@ public class AlipayConfigServiceImpl @Override public AlipayConfig getConfigByTypeAndTenantId(String type, String tenantId) { + // 1. 先按当前租户查询 + AlipayConfig config = queryByTypeAndTenantId(type, tenantId); + if (config != null) { + return config; + } + // 2. 查不到时降级到 webApp 默认配置 + if (!"webApp".equals(tenantId)) { + log.info("当前租户[{}]未配置支付宝[{}],降级使用 webApp 默认配置", tenantId, type); + config = queryByTypeAndTenantId(type, "webApp"); + } + return config; + } + + private AlipayConfig queryByTypeAndTenantId(String type, String tenantId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(AlipayConfig::getType, type) .eq(AlipayConfig::getTenantId, tenantId) diff --git a/zlt-web/react-web-next/src/pages/orders/Order/components/buildColumns.tsx b/zlt-web/react-web-next/src/pages/orders/Order/components/buildColumns.tsx index 47ea59f7..15d59935 100644 --- a/zlt-web/react-web-next/src/pages/orders/Order/components/buildColumns.tsx +++ b/zlt-web/react-web-next/src/pages/orders/Order/components/buildColumns.tsx @@ -25,6 +25,7 @@ const PAY_TYPE = { WECHAT: 1, // 微信支付 COUPON: 2, // 优惠券支付 THIRD_PARTY: 3, // 第三方支付 + ALIPAY: 4, // 支付宝支付 }; // 资源列表操作组件 @@ -43,8 +44,10 @@ const ResourcesActionCell: React.FC<{ record: OrderItem; onReload?: () => void; const isThirdPartyPay = record.payType === PAY_TYPE.THIRD_PARTY; // 判断是否为优惠券支付(携程不支持退款接口) const isCouponPay = record.payType === PAY_TYPE.COUPON; - // 是否可以创建退款(任务完成 且 非第三方支付 且 非优惠券支付) - const canCreateRefund = isTaskComplete && !isThirdPartyPay && !isCouponPay; + // 判断是否为支付宝支付(暂不支持退款) + const isAlipayPay = record.payType === PAY_TYPE.ALIPAY; + // 是否可以创建退款(任务完成 且 非第三方支付 且 非优惠券支付 且 非支付宝支付) + const canCreateRefund = isTaskComplete && !isThirdPartyPay && !isCouponPay && !isAlipayPay; return ( <> @@ -60,6 +63,10 @@ const ResourcesActionCell: React.FC<{ record: OrderItem; onReload?: () => void; 创建退款 + ) : isAlipayPay ? ( + + 创建退款 + ) : ( setCreateRefundModalVisible(true)}>创建退款 ) diff --git a/zlt-web/react-web-next/src/pages/orders/Order/components/constants.ts b/zlt-web/react-web-next/src/pages/orders/Order/components/constants.ts index 9dde1867..47f6f3fb 100644 --- a/zlt-web/react-web-next/src/pages/orders/Order/components/constants.ts +++ b/zlt-web/react-web-next/src/pages/orders/Order/components/constants.ts @@ -5,6 +5,7 @@ export const PAY_TYPE_OPTIONS: { label: string; value: number; color?: string }[ { label: '微信支付', value: 1, color: 'green' }, { label: '优惠券支付', value: 2, color: 'blue' }, { label: '第三方支付', value: 3, color: 'purple' }, + { label: '支付宝支付', value: 4, color: 'geekblue' }, ]; export const ORDER_STATUS_OPTIONS: { label: string; value: number; color?: string }[] = [