312
This commit is contained in:
parent
28753d80bf
commit
6811251e22
|
|
@ -1,7 +1,9 @@
|
||||||
using CoreCms.Net.Caching.AutoMate.RedisCache;
|
using CoreCms.Net.Caching.AutoMate.RedisCache;
|
||||||
using CoreCms.Net.IServices;
|
using CoreCms.Net.IServices;
|
||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -63,7 +65,7 @@ public class SQReservationRefundJob
|
||||||
var payInfoRes = await _billPaymentsServices.GetInfo(participant.paymentId, participant.user_id);
|
var payInfoRes = await _billPaymentsServices.GetInfo(participant.paymentId, participant.user_id);
|
||||||
if (payInfoRes.status == false || payInfoRes.data is not CoreCmsBillPayments payInfo)
|
if (payInfoRes.status == false || payInfoRes.data is not CoreCmsBillPayments payInfo)
|
||||||
{
|
{
|
||||||
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9 }, it => it.id == participant.id);
|
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9, remarks = $"获取支付单失败" }, it => it.id == participant.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +81,7 @@ public class SQReservationRefundJob
|
||||||
var addRefundRes = await _billRefundServices.ToAdd(participant.user_id, payInfo.sourceId, payInfo.type, refundMoney, "");
|
var addRefundRes = await _billRefundServices.ToAdd(participant.user_id, payInfo.sourceId, payInfo.type, refundMoney, "");
|
||||||
if (addRefundRes.status == false)
|
if (addRefundRes.status == false)
|
||||||
{
|
{
|
||||||
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9 }, it => it.id == participant.id);
|
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9, remarks = $"创建退款单失败" }, it => it.id == participant.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +90,7 @@ public class SQReservationRefundJob
|
||||||
p.userId == participant.user_id && p.sourceId == payInfo.sourceId && p.type == payInfo.type && p.money == refundMoney && p.status == 1);
|
p.userId == participant.user_id && p.sourceId == payInfo.sourceId && p.type == payInfo.type && p.money == refundMoney && p.status == 1);
|
||||||
if (refundInfo == null)
|
if (refundInfo == null)
|
||||||
{
|
{
|
||||||
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9 }, it => it.id == participant.id);
|
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9, remarks = $"查询退款单并执行原路退款失败" }, it => it.id == participant.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,13 +101,13 @@ public class SQReservationRefundJob
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9 }, it => it.id == participant.id);
|
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9, remarks = $"发起退款失败!" + refundInfo.refundId }, it => it.id == participant.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"[SQReservationRefundJob] 处理失败 participantId={participant.id}, ex={ex.Message}");
|
Console.WriteLine($"[SQReservationRefundJob] 处理失败 participantId={participant.id}, ex={ex.Message}");
|
||||||
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9 }, it => it.id == participant.id);
|
await _participantsServices.UpdateAsync(it => new SQReservationParticipants { is_refund = 9, remarks = $"出现异常,退款失败!{ex.Message}" }, it => it.id == participant.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Console.WriteLine($"[SQReservationRefundJob] 执行结束 @ {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
Console.WriteLine($"[SQReservationRefundJob] 执行结束 @ {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user