|
@@ -48,13 +48,13 @@ public class OrderVisitDomainService : IOrderVisitDomainService, IScopeDependenc
|
|
|
_logger.LogInformation($"UpdateSmsReplyAsync 收到通知: {data.ToJson()}");
|
|
|
if (data.IsSmsReply == false || data.SmsReplyContent.IsNullOrEmpty() || data.ExternalId.IsNullOrEmpty()) return;
|
|
|
|
|
|
- var orderVisit = await _orderVisitRepository.GetAsync(data.ExternalId)
|
|
|
+ var orderVisit = await _orderVisitRepository.GetAsync(data.ExternalId!)
|
|
|
?? throw new UserFriendlyException($"回访单不存在, visitId: {data.ExternalId} message: {data.ToJson()}");
|
|
|
|
|
|
if (orderVisit.VisitState == EVisitState.Visited)
|
|
|
throw new UserFriendlyException($"回访单已回访. visitId: {data.ExternalId}");
|
|
|
|
|
|
- var replyTxt = data.SmsReplyContent.Trim();
|
|
|
+ var replyTxt = data.SmsReplyContent!;
|
|
|
if (new string[] { "4", "5" }.Contains(replyTxt))
|
|
|
{
|
|
|
// “短信不满意待回访”状态下,由其他方式再次进行回访,回访方式需更新为最新的回访方式
|
|
@@ -73,7 +73,7 @@ public class OrderVisitDomainService : IOrderVisitDomainService, IScopeDependenc
|
|
|
await _orderRepository.GetAsync(orderVisit.OrderId)
|
|
|
.Then(async order =>
|
|
|
{
|
|
|
- order.Visited(replyTxt, GetVisitEvaluateByReplyTxt<string>(replyTxt));
|
|
|
+ order!.Visited(replyTxt, GetVisitEvaluateByReplyTxt<string>(replyTxt));
|
|
|
await _orderRepository.UpdateAsync(order);
|
|
|
});
|
|
|
|
|
@@ -83,17 +83,19 @@ public class OrderVisitDomainService : IOrderVisitDomainService, IScopeDependenc
|
|
|
.ToListAsync();
|
|
|
foreach (var item in detailOrg)
|
|
|
{
|
|
|
- item.OrgProcessingResults = visitSatisfactionKv;
|
|
|
- item.OrgHandledAttitude = visitSatisfactionKv;
|
|
|
+ item.ReplyBackfill(visitSatisfactionKv);
|
|
|
}
|
|
|
+ await _orderVisitDetailRepository.UpdateRangeAsync(detailOrg);
|
|
|
|
|
|
await _orderVisitDetailRepository.Queryable()
|
|
|
.Where(m => m.VisitId == orderVisit.Id && m.VisitTarget == EVisitTarget.Seat)
|
|
|
.FirstAsync()
|
|
|
.Then(async detailSeat =>
|
|
|
{
|
|
|
- detailSeat.SeatEvaluate ??= GetVisitEvaluateByReplyTxt<ESeatEvaluate>(replyTxt);
|
|
|
- detailSeat.VoiceEvaluate ??= GetVisitEvaluateByReplyTxt<EVoiceEvaluate>(replyTxt);
|
|
|
+ detailSeat.ReplyBackfill(
|
|
|
+ GetVisitEvaluateByReplyTxt<ESeatEvaluate>(replyTxt),
|
|
|
+ GetVisitEvaluateByReplyTxt<EVoiceEvaluate>(replyTxt)
|
|
|
+ );
|
|
|
await _orderVisitDetailRepository.UpdateAsync(detailSeat);
|
|
|
});
|
|
|
}
|