Test #2

Merged
duzhichao merged 34 commits from test into prod 2026-11-19 07:44:04 +00:00
4 changed files with 35 additions and 3 deletions
Showing only changes of commit 84146bee17 - Show all commits
@@ -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() {
// 私有构造函数,防止实例化
}
@@ -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<AlipayConfig> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AlipayConfig::getType, type)
.eq(AlipayConfig::getTenantId, tenantId)
@@ -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;
<Tooltip title="优惠券支付订单不支持退款">
<span style={{ color: '#999', cursor: 'not-allowed' }}>创建退款</span>
</Tooltip>
) : isAlipayPay ? (
<Tooltip title="支付宝支付订单暂不支持退款">
<span style={{ color: '#999', cursor: 'not-allowed' }}>创建退款</span>
</Tooltip>
) : (
<Link onClick={() => setCreateRefundModalVisible(true)}>创建退款</Link>
)
@@ -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 }[] = [