统一前后端代码格式化配置
This commit is contained in:
@@ -173,19 +173,25 @@ export async function syncKuaishouFeifeiTaskStatus(task: TaskRow) {
|
||||
resultMessage = consumeResult.failed[0]?.errorMessage || '电子凭证核销失败,请人工处理'
|
||||
lastError = resultMessage
|
||||
nextFlow.consumeStatus = 'failed'
|
||||
logIntegration('[kuaishou-feifei]', '飞飞履约完成,但行业电子凭证核销失败', {
|
||||
taskId: task.id,
|
||||
platformOrderNo: nextFlow.platformOrderNo,
|
||||
orderNo: nextFlow.orderNo,
|
||||
voucherCount: consumeResult.vouchers.length,
|
||||
failedCount: consumeResult.failed.length,
|
||||
errorMessage: resultMessage,
|
||||
}, { level: 'warn' })
|
||||
logIntegration(
|
||||
'[kuaishou-feifei]',
|
||||
'飞飞履约完成,但行业电子凭证核销失败',
|
||||
{
|
||||
taskId: task.id,
|
||||
platformOrderNo: nextFlow.platformOrderNo,
|
||||
orderNo: nextFlow.orderNo,
|
||||
voucherCount: consumeResult.vouchers.length,
|
||||
failedCount: consumeResult.failed.length,
|
||||
errorMessage: resultMessage,
|
||||
},
|
||||
{ level: 'warn' },
|
||||
)
|
||||
}
|
||||
} else if ([40, 50, 60].includes(order.rechargeStatus)) {
|
||||
nextTaskStatus = order.rechargeStatus === 60 ? TASK_STATUS.CLOSED : TASK_STATUS.MANUAL_REVIEW
|
||||
resultCode = `kuaishou_feifei_status_${order.rechargeStatus}`
|
||||
resultMessage = order.rechargeResultMessage || order.rechargeStatusLabel || 'kuaishou-feifei 履约异常'
|
||||
resultMessage =
|
||||
order.rechargeResultMessage || order.rechargeStatusLabel || 'kuaishou-feifei 履约异常'
|
||||
lastError = resultMessage
|
||||
}
|
||||
|
||||
@@ -229,10 +235,9 @@ export type KuaishouFeifeiFlow = {
|
||||
}
|
||||
|
||||
export function normalizeKuaishouFeifeiFlow(value: unknown): KuaishouFeifeiFlow {
|
||||
const source = value && typeof value === 'object' && !Array.isArray(value)
|
||||
? value as JsonObject
|
||||
: {}
|
||||
const h5 = source.h5 && typeof source.h5 === 'object' ? source.h5 as JsonObject : {}
|
||||
const source =
|
||||
value && typeof value === 'object' && !Array.isArray(value) ? (value as JsonObject) : {}
|
||||
const h5 = source.h5 && typeof source.h5 === 'object' ? (source.h5 as JsonObject) : {}
|
||||
|
||||
return {
|
||||
flowType: 'kuaishou_feifei',
|
||||
@@ -263,10 +268,7 @@ export function resolveKuaishouFeifeiClaimUrl(value: unknown) {
|
||||
}
|
||||
|
||||
/** 在已有 expectedUid 时返回拼好 uid 的 H5 链接。 */
|
||||
export function resolveKuaishouFeifeiH5UrlWithUid(
|
||||
value: unknown,
|
||||
expectedUid?: unknown,
|
||||
) {
|
||||
export function resolveKuaishouFeifeiH5UrlWithUid(value: unknown, expectedUid?: unknown) {
|
||||
const directUrl = resolveKuaishouFeifeiClaimUrl(value)
|
||||
if (!directUrl) {
|
||||
return ''
|
||||
@@ -319,9 +321,7 @@ function mergeKuaishouFeifeiOrder(
|
||||
}
|
||||
}
|
||||
|
||||
function resolveKuaishouFeifeiDirectClaimUrl(
|
||||
flow: KuaishouFeifeiFlow,
|
||||
) {
|
||||
function resolveKuaishouFeifeiDirectClaimUrl(flow: KuaishouFeifeiFlow) {
|
||||
const h5ClaimUrl = flow.h5.rechargeUrl || flow.h5.entryUrl
|
||||
if (h5ClaimUrl) {
|
||||
return h5ClaimUrl
|
||||
@@ -335,7 +335,9 @@ function resolveKuaishouFeifeiDirectClaimUrl(
|
||||
return isLocalClaimUrl(flow.claimUrl) ? '' : flow.claimUrl
|
||||
}
|
||||
|
||||
function resolveKuaishouFeifeiOrderClaimUrl(order: Awaited<ReturnType<typeof createKuaishouFeifeiOrder>>) {
|
||||
function resolveKuaishouFeifeiOrderClaimUrl(
|
||||
order: Awaited<ReturnType<typeof createKuaishouFeifeiOrder>>,
|
||||
) {
|
||||
return String(order.h5.rechargeUrl || order.h5.entryUrl || '').trim()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user