|
@@ -8,6 +8,7 @@ using Hotline.Application.Quality;
|
|
|
using Hotline.Application.Systems;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.Caching.Services;
|
|
|
+using Hotline.CallCenter.Calls;
|
|
|
using Hotline.Configurations;
|
|
|
using Hotline.ContingencyManagement.Notifies;
|
|
|
using Hotline.EventBus;
|
|
@@ -22,6 +23,7 @@ using Hotline.OrderTranspond;
|
|
|
using Hotline.Permissions;
|
|
|
using Hotline.Push.FWMessage;
|
|
|
using Hotline.Push.Notifies;
|
|
|
+using Hotline.Repository.SqlSugar.CallCenter;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Repository.SqlSugar.Ts;
|
|
|
using Hotline.SeedData;
|
|
@@ -132,9 +134,11 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<ExternalCitizens> _externalCitizensRepository;
|
|
|
private readonly IRepository<OrderModifyingRecords> _orderModifyingRecordsRepository;
|
|
|
private readonly ICallApplication _callApplication;
|
|
|
+ private readonly ICallNativeRepository _callNativeRepository;
|
|
|
private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
private readonly IOrderSendBackAuditApplication _orderSendBackAuditApplication;
|
|
|
private readonly Publisher _publisher;
|
|
|
+ private readonly ICallNativeApplication _callNativeApplication;
|
|
|
private readonly IOrderAnalysisApplication _orderAnalysisApplication;
|
|
|
private readonly ICalcExpireTime _expireTime;
|
|
|
private readonly IRepository<OrderPushType> _orderPushTypeRepository;
|
|
@@ -201,6 +205,9 @@ public class OrderController : BaseController
|
|
|
ICalcExpireTime expireTime,
|
|
|
IOptions<CityBaseConfiguration> cityBaseConfiguration,
|
|
|
IRepository<OrderPushType> orderPushTypeRepository,
|
|
|
+ IOptions<CityBaseConfiguration> cityBaseConfiguration,
|
|
|
+ ICallNativeRepository callNativeRepository,
|
|
|
+ ICallNativeApplication callNativeApplication)
|
|
|
BaseDataApplication baseDataApplication)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
@@ -263,6 +270,9 @@ public class OrderController : BaseController
|
|
|
_expireTime = expireTime;
|
|
|
_orderPushTypeRepository = orderPushTypeRepository;
|
|
|
_cityBaseConfiguration = cityBaseConfiguration;
|
|
|
+ _callNativeRepository = callNativeRepository;
|
|
|
+ _callNativeApplication = callNativeApplication;
|
|
|
+ }
|
|
|
_baseDataApplication = baseDataApplication;
|
|
|
}
|
|
|
#endregion
|
|
@@ -362,7 +372,7 @@ public class OrderController : BaseController
|
|
|
orderVisit.PublishTime = DateTime.Now;
|
|
|
orderVisit.IsCanHandle = true;
|
|
|
orderVisit.EmployeeId = _sessionContext.RequiredUserId;
|
|
|
- if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null })
|
|
|
+ if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null } && !order.IsProvince)
|
|
|
{
|
|
|
orderVisit.VisitState = EVisitState.Visited;
|
|
|
orderVisit.VisitTime = DateTime.Now;
|
|
@@ -395,7 +405,7 @@ public class OrderController : BaseController
|
|
|
orgDetail.VisitOrgCode = order.ActualHandleOrgCode;
|
|
|
orgDetail.VisitOrgName = order.ActualHandleOrgName;
|
|
|
orgDetail.VisitTarget = EVisitTarget.Org;
|
|
|
- if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null })
|
|
|
+ if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null, IsProvince: false })
|
|
|
{
|
|
|
var satisfy = new Kv() { Key = "4", Value = "满意" };
|
|
|
orgDetail.OrgProcessingResults = satisfy;
|
|
@@ -921,7 +931,8 @@ public class OrderController : BaseController
|
|
|
var histories = await _orderVisitRepository.Queryable()
|
|
|
.Includes(m => m.OrderVisitDetails)
|
|
|
.Where(m => m.OrderId == orderVisit.OrderId)
|
|
|
- .Select(m => new OrderVisitDetailHistiryDto
|
|
|
+ .Where(m => m.VisitState == EVisitState.None && m.NowEvaluate != null)
|
|
|
+ .Select(m => new OrderVisitDetailHistoryDto
|
|
|
{
|
|
|
VoiceEvaluate = m.OrderVisitDetails.Where(n => n.VisitTarget == EVisitTarget.Seat).Select(s => s.VoiceEvaluate).First(),
|
|
|
SeatEvaluate = m.OrderVisitDetails.Where(n => n.VisitTarget == EVisitTarget.Seat).Select(s => s.SeatEvaluate).First(),
|
|
@@ -932,6 +943,12 @@ public class OrderController : BaseController
|
|
|
VisitTime = m.VisitTime
|
|
|
}).ToListAsync();
|
|
|
|
|
|
+ var seat = orderVisit.OrderVisitDetails.FirstOrDefault(m => m.VisitTarget == EVisitTarget.Seat);
|
|
|
+ if (orderVisit.VisitState == EVisitState.WaitForVisit)
|
|
|
+ { // 如果是待回访, 就取用户电话评价时评价的内容;
|
|
|
+ var callNative = await _callNativeApplication.GetReplyVoiceOrDefaultByOrderIdAsync(orderVisit.OrderId);
|
|
|
+ seat.VoiceEvaluate = callNative;
|
|
|
+ }
|
|
|
return new
|
|
|
{
|
|
|
OrderVisitModel = _mapper.Map<OrderVisitDto>(orderVisit),
|
|
@@ -1014,38 +1031,42 @@ public class OrderController : BaseController
|
|
|
.Where(m => m.VisitId == visit.VisitId)
|
|
|
.ToListAsync();
|
|
|
var seatDetail = details.First(m => m.VisitTarget == EVisitTarget.Seat);
|
|
|
+ var seatDetailDto = new VisitDetailDto()
|
|
|
+ {
|
|
|
+ Id = seatDetail.Id,
|
|
|
+ VisitId = visit.VisitId,
|
|
|
+ VisitContent = dto.SeatVisitContent,
|
|
|
+ SeatEvaluate = dto.SeatEvaluate,
|
|
|
+ VisitTarget = EVisitTarget.Seat,
|
|
|
+ };
|
|
|
+ if (seatDetail.VoiceEvaluate == null)
|
|
|
+ seatDetailDto.VoiceEvaluate = EVoiceEvaluate.DefaultSatisfied;
|
|
|
+
|
|
|
var visitDto = new VisitDto
|
|
|
{
|
|
|
Id = visit.VisitId,
|
|
|
IsPutThrough = true,
|
|
|
IsAgain = false,
|
|
|
- VisitDetails = new List<VisitDetailDto>
|
|
|
- {
|
|
|
- new()
|
|
|
- {
|
|
|
- Id = seatDetail.Id,
|
|
|
- VisitId = visit.VisitId,
|
|
|
- VisitContent = dto.SeatVisitContent,
|
|
|
- SeatEvaluate = dto.SeatEvaluate,
|
|
|
- VisitTarget = EVisitTarget.Seat
|
|
|
- }
|
|
|
- }
|
|
|
+ VisitDetails = new List<VisitDetailDto>()
|
|
|
};
|
|
|
+ visitDto.VisitDetails.Add(seatDetailDto);
|
|
|
|
|
|
var orgDetails = details.Where(m => m.VisitTarget == EVisitTarget.Org).ToList();
|
|
|
foreach (var orgDetail in orgDetails)
|
|
|
{
|
|
|
visitDto.VisitDetails.Add(
|
|
|
- new()
|
|
|
- {
|
|
|
- Id = orgDetail.Id,
|
|
|
- VisitId = visit.VisitId,
|
|
|
- VisitContent = dto.OrgVisitContent,
|
|
|
- VisitTarget = EVisitTarget.Org,
|
|
|
- OrgNoSatisfiedReason = dto.OrgNoSatisfiedReason,
|
|
|
- OrgProcessingResults = dto.OrgProcessingResults,
|
|
|
- OrgHandledAttitude = dto.OrgHandledAttitude
|
|
|
- });
|
|
|
+ new()
|
|
|
+ {
|
|
|
+ Id = orgDetail.Id,
|
|
|
+ VisitId = visit.VisitId,
|
|
|
+ VisitContent = dto.OrgVisitContent,
|
|
|
+ VisitTarget = EVisitTarget.Org,
|
|
|
+ OrgNoSatisfiedReason = dto.OrgNoSatisfiedReason,
|
|
|
+ OrgProcessingResults = dto.OrgProcessingResults,
|
|
|
+ OrgHandledAttitude = dto.OrgHandledAttitude,
|
|
|
+ VisitOrgName = orgDetail.VisitOrgName,
|
|
|
+ VisitOrgCode = orgDetail.VisitOrgCode,
|
|
|
+ });
|
|
|
}
|
|
|
await _orderApplication.SaveOrderVisit(visitDto, HttpContext.RequestAborted);
|
|
|
outDto.CompleteCount += 1;
|
|
@@ -2694,8 +2715,10 @@ public class OrderController : BaseController
|
|
|
[HttpGet("fixed")]
|
|
|
public async Task<IReadOnlyList<OrderDto>> QueryFixed([FromQuery] QueryOrderFixedDto dto)
|
|
|
{
|
|
|
+ var hasSetting = Int32.TryParse(
|
|
|
+ _systemSettingCacheManager.GetSetting(SettingConstants.FixedQueryCount)?.SettingValue[0], out var queryCount);
|
|
|
var query = _orderApplication.QueryOrders(dto);
|
|
|
- var orders = await query.ToFixedListAsync(dto.QueryIndex, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ var orders = await query.ToFixedListAsync(dto.QueryIndex, hasSetting ? queryCount : null, HttpContext.RequestAborted);
|
|
|
return _mapper.Map<IReadOnlyList<OrderDto>>(orders);
|
|
|
}
|
|
|
|
|
@@ -2703,7 +2726,7 @@ public class OrderController : BaseController
|
|
|
/// 查询总数
|
|
|
/// </summary>
|
|
|
[HttpGet("count")]
|
|
|
- public async Task<int> Count([FromQuery] QueryOrderFixedDto dto)
|
|
|
+ public async Task<int> Count([FromQuery] QueryOrderDto dto)
|
|
|
{
|
|
|
var query = _orderApplication.QueryOrders(dto);
|
|
|
return await query.CountAsync(HttpContext.RequestAborted);
|
|
@@ -3242,7 +3265,7 @@ public class OrderController : BaseController
|
|
|
var pushTypeAny = await _orderPushTypeRepository.AnyAsync(x => x.OrderId == order.Id);
|
|
|
if (pushTypeAny)
|
|
|
await _orderPushTypeRepository.RemoveAsync(x => x.OrderId == order.Id);
|
|
|
- order.OrderPushTypes.ForEach(x => x.OrderId = order.Id);
|
|
|
+ dto.OrderPushTypes.ForEach(x => x.OrderId = order.Id);
|
|
|
var orderPushTypes = _mapper.Map<List<OrderPushType>>(dto.OrderPushTypes);
|
|
|
await _orderPushTypeRepository.AddRangeAsync(orderPushTypes);
|
|
|
var pushTypes = dto.OrderPushTypes.Select(x => x.PushType);
|
|
@@ -3293,18 +3316,6 @@ public class OrderController : BaseController
|
|
|
NearlyExpiredTimeOne = timeResult.NearlyExpiredTimeOne,
|
|
|
};
|
|
|
}
|
|
|
- //else if (dto.Workflow.FlowDirection == EFlowDirection.CenterToCenter)
|
|
|
- //{
|
|
|
- // var timeResult = _timeLimitDomainService.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 1, 0);
|
|
|
- // expiredTimeConfig = new ExpiredTimeWithConfig
|
|
|
- // {
|
|
|
- // Count = 1,
|
|
|
- // TimeType = ETimeType.WorkDay,
|
|
|
- // TimeText = "1个工作日",
|
|
|
- // ExpiredTime = timeResult.EndTime,
|
|
|
- // NearlyExpiredTime = timeResult.NearlyExpiredTime
|
|
|
- // };
|
|
|
- //}
|
|
|
else
|
|
|
{
|
|
|
if (_appOptions.Value.IsZiGong)
|
|
@@ -3345,21 +3356,6 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
//开启流程处理事件,处理市州互转
|
|
|
await _publisher.PublishAsync(new OrderStartWorkflowNotify(order.Id), PublishStrategy.ParallelWhenAll, HttpContext.RequestAborted);
|
|
|
- //{
|
|
|
- // var order = await _orderRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
- // var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
- // await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderTranspondCity, orderDto);
|
|
|
- // //保存本地数据
|
|
|
- // TranspondCityRawData cityRawData = new TranspondCityRawData
|
|
|
- // {
|
|
|
- // OrderCode = order.No,
|
|
|
- // TransferOutTime = DateTime.Now,
|
|
|
- // CityName = order.TranspondCityName,
|
|
|
- // Direction = ETranspondDirection.Out
|
|
|
- // };
|
|
|
-
|
|
|
- // await _transpondCityRawDataRepository.AddAsync(cityRawData, HttpContext.RequestAborted);
|
|
|
- //}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -4048,7 +4044,10 @@ public class OrderController : BaseController
|
|
|
Status = order.Status,
|
|
|
TraceId = currentStep.Id
|
|
|
};
|
|
|
- if (_appOptions.Value.IsZiGong && prevStep.BusinessType == EBusinessType.Send)
|
|
|
+ audit.InitId();
|
|
|
+ if (dto.Files.Any())
|
|
|
+ audit.FileJson = await _fileRepository.AddFileAsync(dto.Files, audit.Id, "", HttpContext.RequestAborted);
|
|
|
+ if (_appOptions.Value.IsZiGong && prevStep.BusinessType == EBusinessType.Send)
|
|
|
{
|
|
|
// 平均派单
|
|
|
var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
|
|
@@ -4276,12 +4275,20 @@ public class OrderController : BaseController
|
|
|
/// <param name="id"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("order_previous/{id}")]
|
|
|
- public async Task<OrderSendBackAudit> OrderSendBackEntity(string id)
|
|
|
+ public async Task<SendBackDto> OrderSendBackEntity(string id)
|
|
|
{
|
|
|
- return await _orderSendBackAuditRepository.Queryable()
|
|
|
+ var res = await _orderSendBackAuditRepository.Queryable()
|
|
|
.Includes(x => x.Order)
|
|
|
.FirstAsync(x => x.Id == id);
|
|
|
- }
|
|
|
+ var resDto = _mapper.Map<SendBackDto>(res);
|
|
|
+ if (res.FileJson != null && res.FileJson.Any())
|
|
|
+ {
|
|
|
+ var ids = res.FileJson.Select(x => x.Id).ToList();
|
|
|
+ var files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ resDto.Files = files.Where(x => x.Classify == "退回附件" && string.IsNullOrEmpty(x.FlowKey)).ToList();
|
|
|
+ }
|
|
|
+ return resDto;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 列表页面基础数据
|