|
|
@ -87,9 +87,9 @@ namespace Myshipping.Application.Event
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var id in idToDo)
|
|
|
|
foreach (var id in idToDo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var order = await repoBooking.AsQueryable().FirstAsync(x => x.Id == id);
|
|
|
|
var order = await repoBooking.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == id);
|
|
|
|
var iptId = string.IsNullOrEmpty(order.OPID) ? order.CreatedUserId.Value : Convert.ToInt64(order.OPID);
|
|
|
|
var iptId = string.IsNullOrEmpty(order.OPID) ? order.CreatedUserId.Value : Convert.ToInt64(order.OPID);
|
|
|
|
var user = await repoUser.AsQueryable().FirstAsync(x => x.Id == iptId);
|
|
|
|
var user = await repoUser.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == iptId);
|
|
|
|
if (user == null || string.IsNullOrEmpty(user.DjyUserId))
|
|
|
|
if (user == null || string.IsNullOrEmpty(user.DjyUserId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var errMsg = $"未找到{order.MBLNO}({id})的用户信息,无法调用扣费";
|
|
|
|
var errMsg = $"未找到{order.MBLNO}({id})的用户信息,无法调用扣费";
|
|
|
@ -100,7 +100,7 @@ namespace Myshipping.Application.Event
|
|
|
|
|
|
|
|
|
|
|
|
var seconds = DateTime.Now.ToTimeStamp();
|
|
|
|
var seconds = DateTime.Now.ToTimeStamp();
|
|
|
|
var runId = Guid.NewGuid().ToString();
|
|
|
|
var runId = Guid.NewGuid().ToString();
|
|
|
|
var srcBeforMD5 = $"{runId}{feeKey.Value}expend{bsType}0{id}{order.MBLNO}{seconds}{feeKey.Value}";
|
|
|
|
var srcBeforMD5 = $"{runId}{feeUserId.Value}expend{bsType}{sendType}{id}{order.MBLNO}{seconds}{feeKey.Value}";
|
|
|
|
var postObj = new
|
|
|
|
var postObj = new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
runId,
|
|
|
|
runId,
|
|
|
@ -135,7 +135,7 @@ namespace Myshipping.Application.Event
|
|
|
|
.SendAsStringAsync();
|
|
|
|
.SendAsStringAsync();
|
|
|
|
_logger.LogInformation($"调用扣费返回:{apiRtn}");
|
|
|
|
_logger.LogInformation($"调用扣费返回:{apiRtn}");
|
|
|
|
var jobjApiRtn = JObject.Parse(apiRtn);
|
|
|
|
var jobjApiRtn = JObject.Parse(apiRtn);
|
|
|
|
var code = Convert.ToInt32(jobjApiRtn.GetValue("code").ToString());
|
|
|
|
var code = jobjApiRtn.GetIntValue("code");
|
|
|
|
var jobjApiRtnData = jobjApiRtn.GetValue("data") as JObject;
|
|
|
|
var jobjApiRtnData = jobjApiRtn.GetValue("data") as JObject;
|
|
|
|
if (code == 200 || code == 450)
|
|
|
|
if (code == 200 || code == 450)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -154,7 +154,7 @@ namespace Myshipping.Application.Event
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var errMsg = jobjApiRtnData.GetValue("message").ToString();
|
|
|
|
var errMsg = jobjApiRtn.GetValue("message").ToString();
|
|
|
|
_logger.LogError($"扣费失败:{errMsg}");
|
|
|
|
_logger.LogError($"扣费失败:{errMsg}");
|
|
|
|
DingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", errMsg);
|
|
|
|
DingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", errMsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|