|
@@ -5,6 +5,7 @@ using Hotline.Application.ExportExcel;
|
|
using Hotline.Application.FlowEngine;
|
|
using Hotline.Application.FlowEngine;
|
|
using Hotline.Application.Orders;
|
|
using Hotline.Application.Orders;
|
|
using Hotline.Application.Quality;
|
|
using Hotline.Application.Quality;
|
|
|
|
+using Hotline.Application.Systems;
|
|
using Hotline.Caching.Interfaces;
|
|
using Hotline.Caching.Interfaces;
|
|
using Hotline.Caching.Services;
|
|
using Hotline.Caching.Services;
|
|
using Hotline.Configurations;
|
|
using Hotline.Configurations;
|
|
@@ -35,6 +36,7 @@ using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
using Hotline.Share.Dtos.Order;
|
|
using Hotline.Share.Dtos.Order;
|
|
using Hotline.Share.Dtos.Order.Migration;
|
|
using Hotline.Share.Dtos.Order.Migration;
|
|
using Hotline.Share.Dtos.Order.Publish;
|
|
using Hotline.Share.Dtos.Order.Publish;
|
|
|
|
+using Hotline.Share.Dtos.Push;
|
|
using Hotline.Share.Dtos.Settings;
|
|
using Hotline.Share.Dtos.Settings;
|
|
using Hotline.Share.Enums.CallCenter;
|
|
using Hotline.Share.Enums.CallCenter;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
@@ -42,6 +44,7 @@ using Hotline.Share.Enums.Order;
|
|
using Hotline.Share.Enums.Push;
|
|
using Hotline.Share.Enums.Push;
|
|
using Hotline.Share.Enums.Quality;
|
|
using Hotline.Share.Enums.Quality;
|
|
using Hotline.Share.Enums.Settings;
|
|
using Hotline.Share.Enums.Settings;
|
|
|
|
+using Hotline.Share.Mq;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Share.Tools;
|
|
using Hotline.Share.Tools;
|
|
using Hotline.Tools;
|
|
using Hotline.Tools;
|
|
@@ -58,6 +61,7 @@ using MongoDB.Driver;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using StackExchange.Redis;
|
|
using StackExchange.Redis;
|
|
using System.Text;
|
|
using System.Text;
|
|
|
|
+using System.Threading.Tasks;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Cache;
|
|
using XF.Domain.Cache;
|
|
using XF.Domain.Entities;
|
|
using XF.Domain.Entities;
|
|
@@ -75,6 +79,7 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
#region 注入
|
|
#region 注入
|
|
private readonly IOrderDomainService _orderDomainService;
|
|
private readonly IOrderDomainService _orderDomainService;
|
|
|
|
+ private readonly BaseDataApplication _baseDataApplication;
|
|
private readonly IOrderRepository _orderRepository;
|
|
private readonly IOrderRepository _orderRepository;
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
private readonly IWorkflowApplication _workflowApplication;
|
|
private readonly IWorkflowDomainService _workflowDomainService;
|
|
private readonly IWorkflowDomainService _workflowDomainService;
|
|
@@ -194,8 +199,9 @@ public class OrderController : BaseController
|
|
Publisher publisher,
|
|
Publisher publisher,
|
|
IOrderAnalysisApplication orderAnalysisApplication,
|
|
IOrderAnalysisApplication orderAnalysisApplication,
|
|
ICalcExpireTime expireTime,
|
|
ICalcExpireTime expireTime,
|
|
- IRepository<OrderPushType> orderPushTypeRepository,
|
|
|
|
IOptions<CityBaseConfiguration> cityBaseConfiguration)
|
|
IOptions<CityBaseConfiguration> cityBaseConfiguration)
|
|
|
|
+ IRepository<OrderPushType> orderPushTypeRepository,
|
|
|
|
+ BaseDataApplication baseDataApplication)
|
|
{
|
|
{
|
|
_orderDomainService = orderDomainService;
|
|
_orderDomainService = orderDomainService;
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
@@ -257,7 +263,9 @@ public class OrderController : BaseController
|
|
_expireTime = expireTime;
|
|
_expireTime = expireTime;
|
|
_orderPushTypeRepository = orderPushTypeRepository;
|
|
_orderPushTypeRepository = orderPushTypeRepository;
|
|
_cityBaseConfiguration = cityBaseConfiguration;
|
|
_cityBaseConfiguration = cityBaseConfiguration;
|
|
|
|
+ _baseDataApplication = baseDataApplication;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 工单发布
|
|
#region 工单发布
|
|
@@ -839,20 +847,14 @@ public class OrderController : BaseController
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("visit/basedata")]
|
|
[HttpGet("visit/basedata")]
|
|
public async Task<object> VisitBaseData()
|
|
public async Task<object> VisitBaseData()
|
|
- {
|
|
|
|
- var rsp = new
|
|
|
|
- {
|
|
|
|
- VisitType = EnumExts.GetDescriptions<EVisitType>(),
|
|
|
|
- VoiceEvaluate = EnumExts.GetDescriptions<EVoiceEvaluate>(),
|
|
|
|
- SeatEvaluate = EnumExts.GetDescriptions<ESeatEvaluate>(),
|
|
|
|
- // 部门办件结果
|
|
|
|
- VisitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction).Where(x => x.DicDataValue != "-1").Select(m => new { m.Id, m.DicDataName, m.DicDataValue }),
|
|
|
|
- // 部门办件态度
|
|
|
|
- VisitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner).Where(x => x.DicDataValue != "-1").Select(m => new { m.Id, m.DicDataName, m.DicDataValue }),
|
|
|
|
- VisitStateQuery = EnumExts.GetDescriptions<EVisitStateQuery>()
|
|
|
|
- };
|
|
|
|
- return rsp;
|
|
|
|
- }
|
|
|
|
|
|
+ => _baseDataApplication
|
|
|
|
+ .VisitType()
|
|
|
|
+ .VoiceEvaluate()
|
|
|
|
+ .SeatEvaluate()
|
|
|
|
+ .VisitSatisfaction()
|
|
|
|
+ .VisitManner()
|
|
|
|
+ .VisitStateQuery()
|
|
|
|
+ .Build();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 回访详情
|
|
/// 回访详情
|
|
@@ -1068,21 +1070,13 @@ public class OrderController : BaseController
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("visit/batch-basedata")]
|
|
[HttpGet("visit/batch-basedata")]
|
|
- [AllowAnonymous]
|
|
|
|
public async Task<dynamic> VisitBatchBaseDat()
|
|
public async Task<dynamic> VisitBatchBaseDat()
|
|
- {
|
|
|
|
- return new
|
|
|
|
- {
|
|
|
|
- // 话务员评价
|
|
|
|
- SeatEvaluate = EnumExts.GetDescriptions<ESeatEvaluate>(),
|
|
|
|
- // 不满意原因
|
|
|
|
- DissatisfiedReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.DissatisfiedReason).Select(m => new { m.Id, m.DicDataName, m.DicDataValue }),
|
|
|
|
- // 回访满意度
|
|
|
|
- VisitSatisfaction = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitSatisfaction).Where(x => x.DicDataValue != "-1").Select(m => new { m.Id, m.DicDataName, m.DicDataValue }),
|
|
|
|
- // 回访态度
|
|
|
|
- VisitManner = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.VisitManner).Where(x => x.DicDataValue != "-1").Select(m => new { m.Id, m.DicDataName, m.DicDataValue })
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
|
|
+ => _baseDataApplication
|
|
|
|
+ .SeatEvaluate()
|
|
|
|
+ .DissatisfiedReason()
|
|
|
|
+ .VisitSatisfaction()
|
|
|
|
+ .VisitManner()
|
|
|
|
+ .Build();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 扭转列表
|
|
/// 扭转列表
|
|
@@ -3251,7 +3245,6 @@ public class OrderController : BaseController
|
|
ExpiredTimeWithConfig expiredTimeConfig;
|
|
ExpiredTimeWithConfig expiredTimeConfig;
|
|
if (dto.Workflow.NextHandlers.Any(d => d.Key == _cityBaseConfiguration.Value.CityProvince.OrgId || d.Key == _cityBaseConfiguration.Value.CityProvinceAssign.OrgId))
|
|
if (dto.Workflow.NextHandlers.Any(d => d.Key == _cityBaseConfiguration.Value.CityProvince.OrgId || d.Key == _cityBaseConfiguration.Value.CityProvinceAssign.OrgId))
|
|
{
|
|
{
|
|
- // var timeResult = _timeLimitDomainService.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 45, 80, 50);
|
|
|
|
var timeResult = await _expireTime.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 45, 80, 50);
|
|
var timeResult = await _expireTime.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 45, 80, 50);
|
|
expiredTimeConfig = new ExpiredTimeWithConfig
|
|
expiredTimeConfig = new ExpiredTimeWithConfig
|
|
{
|
|
{
|
|
@@ -3284,7 +3277,6 @@ public class OrderController : BaseController
|
|
else
|
|
else
|
|
{
|
|
{
|
|
//期满时间
|
|
//期满时间
|
|
- //expiredTimeConfig = _timeLimitDomainService.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToOrg, order.AcceptTypeCode);
|
|
|
|
expiredTimeConfig = await _expireTime.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToOrg, order.Adapt<OrderTimeClacInfo>());
|
|
expiredTimeConfig = await _expireTime.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToOrg, order.Adapt<OrderTimeClacInfo>());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3306,6 +3298,7 @@ public class OrderController : BaseController
|
|
var startDto = _mapper.Map<StartWorkflowDto>(dto.Workflow);
|
|
var startDto = _mapper.Map<StartWorkflowDto>(dto.Workflow);
|
|
startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderHandle;
|
|
startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderHandle;
|
|
startDto.Title = order.Title;
|
|
startDto.Title = order.Title;
|
|
|
|
+ startDto.IsForwarded = dto.IsForwarded;
|
|
await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, order.Id, order.ExpiredTime, HttpContext.RequestAborted);
|
|
await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, order.Id, order.ExpiredTime, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -3349,77 +3342,8 @@ public class OrderController : BaseController
|
|
[HttpPost("handle")]
|
|
[HttpPost("handle")]
|
|
public async Task Handle([FromBody] NextWorkflowDto dto)
|
|
public async Task Handle([FromBody] NextWorkflowDto dto)
|
|
{
|
|
{
|
|
- var order = await _orderRepository.Queryable()
|
|
|
|
- .FirstAsync(d => d.WorkflowId == dto.WorkflowId, HttpContext.RequestAborted);
|
|
|
|
- if (order is null)
|
|
|
|
- throw UserFriendlyException.SameMessage("无效工单编号");
|
|
|
|
- //if (await _orderDelayRepository.AnyAsync(x => x.OrderId == order.Id && x.DelayState == EDelayState.Examining, HttpContext.RequestAborted))
|
|
|
|
- //{
|
|
|
|
- // throw UserFriendlyException.SameMessage("该工单存在正在审核中的延期,不能办理");
|
|
|
|
- //}
|
|
|
|
- if (await _orderSendBackAuditRepository.AnyAsync(x => x.OrderId == order.Id && x.State == ESendBackAuditState.Apply,
|
|
|
|
- HttpContext.RequestAborted))
|
|
|
|
- {
|
|
|
|
- throw UserFriendlyException.SameMessage("该工单存在正在审核中的退回,不能办理");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ExpiredTimeWithConfig? expiredTimeConfig = null;
|
|
|
|
- if (dto.NextHandlers.Any(d => d.Key == _cityBaseConfiguration.Value.CityProvince.OrgId || d.Key == _cityBaseConfiguration.Value.CityProvinceAssign.OrgId))
|
|
|
|
- {
|
|
|
|
- // var timeResult = _timeLimitDomainService.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 45, 80, 50);
|
|
|
|
- var timeResult = await _expireTime.CalcEndTime(DateTime.Now, ETimeType.WorkDay, 45, 80, 50);
|
|
|
|
- expiredTimeConfig = new ExpiredTimeWithConfig
|
|
|
|
- {
|
|
|
|
- Count = 45,
|
|
|
|
- TimeType = ETimeType.WorkDay,
|
|
|
|
- TimeText = "45个工作日",
|
|
|
|
- ExpiredTime = timeResult.EndTime,
|
|
|
|
- NearlyExpiredTime = timeResult.NearlyExpiredTime,
|
|
|
|
- NearlyExpiredTimeOne = timeResult.NearlyExpiredTimeOne
|
|
|
|
- };
|
|
|
|
- var canUpdateOrderSender = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.CanUpdateOrderSender).SettingValue[0]);
|
|
|
|
- order.CenterToOrg(
|
|
|
|
- expiredTimeConfig.TimeText, expiredTimeConfig.Count,
|
|
|
|
- expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime,
|
|
|
|
- expiredTimeConfig.NearlyExpiredTime, expiredTimeConfig.NearlyExpiredTimeOne, dto.Opinion,
|
|
|
|
- _sessionContext.RequiredUserId, _sessionContext.UserName,
|
|
|
|
- canUpdateOrderSender);
|
|
|
|
- //TODO发送短信即将超期
|
|
|
|
- //_capPublisher.PublishDelay(expiredTimeConfig.NearlyExpiredTime - DateTime.Now, EventNames.HotlineOrderNearlyExpiredTimeSms, new PublishNearlyExpiredTimeSmsDto() { OrderId = order.Id });
|
|
|
|
- }
|
|
|
|
- else if (dto.FlowDirection is EFlowDirection.CenterToOrg)
|
|
|
|
- {
|
|
|
|
- //expiredTimeConfig = _timeLimitDomainService.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToOrg, order.AcceptTypeCode);
|
|
|
|
- expiredTimeConfig = await _expireTime.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToOrg, order.Adapt<OrderTimeClacInfo>());
|
|
|
|
- var canUpdateOrderSender = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.CanUpdateOrderSender).SettingValue[0]);
|
|
|
|
- order.CenterToOrg(
|
|
|
|
- expiredTimeConfig.TimeText, expiredTimeConfig.Count,
|
|
|
|
- expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime,
|
|
|
|
- expiredTimeConfig.NearlyExpiredTime, expiredTimeConfig.NearlyExpiredTimeOne, dto.Opinion,
|
|
|
|
- _sessionContext.RequiredUserId, _sessionContext.UserName,
|
|
|
|
- canUpdateOrderSender);
|
|
|
|
- //TODO发送短信即将超期
|
|
|
|
- //_capPublisher.PublishDelay(expiredTimeConfig.NearlyExpiredTime - DateTime.Now, EventNames.HotlineOrderNearlyExpiredTimeSms, new PublishNearlyExpiredTimeSmsDto() { OrderId = order.Id });
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- else if (dto.FlowDirection is EFlowDirection.CenterToCenter)
|
|
|
|
- {
|
|
|
|
- if (_appOptions.Value.IsZiGong == false)
|
|
|
|
- {
|
|
|
|
- // expiredTimeConfig = _timeLimitDomainService.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToCenter, order.AcceptTypeCode);
|
|
|
|
- expiredTimeConfig = await _expireTime.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToCenter, order.Adapt<OrderTimeClacInfo>());
|
|
|
|
- order.CenterToCenter(expiredTimeConfig.TimeText, expiredTimeConfig.Count,
|
|
|
|
- expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime, expiredTimeConfig.NearlyExpiredTime, expiredTimeConfig.NearlyExpiredTimeOne);
|
|
|
|
- //TODO发送短信即将超期
|
|
|
|
- //_capPublisher.PublishDelay(expiredTimeConfig.NearlyExpiredTime - DateTime.Now, EventNames.HotlineOrderNearlyExpiredTimeSms, new PublishNearlyExpiredTimeSmsDto() { OrderId = order.Id });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ var order = await _orderApplication.SaveOrderWorkflowInfo(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
- if (expiredTimeConfig is not null)
|
|
|
|
- {
|
|
|
|
- _mapper.Map(expiredTimeConfig, order);
|
|
|
|
- await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
//1.是否是判断节点 2.是否存在历史派单节点 3.存在获取上个派单节点 4.不存在走平均派单
|
|
//1.是否是判断节点 2.是否存在历史派单节点 3.存在获取上个派单节点 4.不存在走平均派单
|
|
if (dto.BusinessType == EBusinessType.Send)
|
|
if (dto.BusinessType == EBusinessType.Send)
|
|
{
|
|
{
|
|
@@ -3450,6 +3374,20 @@ public class OrderController : BaseController
|
|
await _workflowApplication.NextAsync(dto, _sessionContext, order.ExpiredTime, HttpContext.RequestAborted);
|
|
await _workflowApplication.NextAsync(dto, _sessionContext, order.ExpiredTime, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 临时保存
|
|
|
|
+ /// </summary>
|
|
|
|
+ [HttpPost("steps/temp")]
|
|
|
|
+ public async Task TempSaveAsync([FromBody] StepTempInDto dto)
|
|
|
|
+ {
|
|
|
|
+ await _workflowStepRepository.GetAsync(dto.StepId)
|
|
|
|
+ .Then(async (step) =>
|
|
|
|
+ {
|
|
|
|
+ step!.Opinion = dto.Opinion;
|
|
|
|
+ await _workflowStepRepository.UpdateAsync(step);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 查询工单办理下一步可选节点(带推荐部门)
|
|
/// 查询工单办理下一步可选节点(带推荐部门)
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -3471,7 +3409,15 @@ public class OrderController : BaseController
|
|
step.RecommendOrgId = org.Id;
|
|
step.RecommendOrgId = org.Id;
|
|
step.RecommendOrgName = org.Name;
|
|
step.RecommendOrgName = org.Name;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ rsp.LeaderSMS = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.LeaderSMS)
|
|
|
|
+ .Select(m => new Kv { Key = m.Id, Value = m.DicDataName }).ToList();
|
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
|
+ {
|
|
|
|
+ await _workflowStepRepository.GetAsync(dto.StepId)
|
|
|
|
+ .Then(step => rsp.Opinion = step!.Opinion ?? string.Empty);
|
|
|
|
+ }
|
|
|
|
+ rsp.TranspondCity = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.TranspondCity)
|
|
|
|
+ .ToList().Adapt<List<SystemDicDataOutDto>>();
|
|
return rsp;
|
|
return rsp;
|
|
}
|
|
}
|
|
|
|
|