|
@@ -25,6 +25,7 @@ using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Settings.TimeLimitDomain;
|
|
|
using Hotline.Share.Dtos;
|
|
|
+using Hotline.Share.Dtos.Article;
|
|
|
using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
|
|
|
using Hotline.Share.Dtos.File;
|
|
|
using Hotline.Share.Dtos.FlowEngine;
|
|
@@ -33,6 +34,7 @@ using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.Order.Publish;
|
|
|
using Hotline.Share.Dtos.Push;
|
|
|
using Hotline.Share.Dtos.Settings;
|
|
|
+using Hotline.Share.Enums.Article;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Hotline.Share.Enums.Push;
|
|
@@ -41,6 +43,7 @@ using Hotline.Share.Enums.Settings;
|
|
|
using Hotline.Share.Mq;
|
|
|
using Hotline.Share.Requests;
|
|
|
using Hotline.Share.Tools;
|
|
|
+using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.IRepository;
|
|
|
using Hotline.Statistics;
|
|
|
using Hotline.Tools;
|
|
@@ -49,6 +52,7 @@ using Hotline.Validators.FlowEngine;
|
|
|
using Mapster;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using PanGu;
|
|
|
using SqlSugar;
|
|
@@ -800,6 +804,13 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
public ISugarQueryable<Order> GetPublishOrderList(QueryOrderPublishDto dto)
|
|
|
{
|
|
|
var query = _orderRepository.Queryable().Includes(d => d.OrderTags);
|
|
|
+ if (_systemSettingCacheManager.Snapshot)
|
|
|
+ {
|
|
|
+ query = query.LeftJoin<OrderSnapshot>((d, snapshot) => d.Id == snapshot.Id)
|
|
|
+ .WhereIF(dto.IndustryId.NotNullOrEmpty(), (d, snapshot) => snapshot.IndustryId == dto.IndustryId)
|
|
|
+ .WhereIF(dto.IsRectifyDepartment.HasValue, (d, snapshot) => snapshot.IsRectifyDepartment == dto.IsRectifyDepartment)
|
|
|
+ .WhereIF(dto.IsDangerDepartment.HasValue, (d, snapshot) => snapshot.IsDangerDepartment == dto.IsDangerDepartment);
|
|
|
+ }
|
|
|
if (_appOptions.Value.IsLuZhou)
|
|
|
query = query.Includes(d => d.FwCallRecord);
|
|
|
//.Includes(d => d.OrderPublish)
|
|
@@ -1506,7 +1517,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
{
|
|
|
//if (string.IsNullOrEmpty(visit.EmployeeId)||)
|
|
|
// visit.EmployeeId = _sessionContext.UserId;
|
|
|
- if(dto.IsUpdate==false)
|
|
|
+ if (dto.IsUpdate == false)
|
|
|
visit.EmployeeId = _sessionContext.UserId;
|
|
|
}
|
|
|
else
|
|
@@ -5546,6 +5557,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
if (files != null && files.Any())
|
|
|
order.FileJson = await _fileRepository.AddFileAsync(files, order.Id, "", cancellationToken);
|
|
|
await _orderDomainService.AddAsync(order, cancellationToken: cancellationToken);
|
|
|
+
|
|
|
+ //不同来源渠道的待受理工单需给坐席进行待受理提醒
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ await PendingAcceptanceReminder(order.Id, cancellationToken);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -5615,6 +5630,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
_mapper.Map(dto.OrderExtension, orderExtension);
|
|
|
await _orderDomainService.UpdateExtensionAsync(orderExtension, cancellationToken);
|
|
|
}
|
|
|
+
|
|
|
+ //不同来源渠道的待受理工单需给坐席进行待受理提醒
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ await PendingAcceptanceReminder(order.Id, cancellationToken);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -5766,6 +5785,68 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
return _mapper.Map<AddOrderResponse>(order);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 自贡任务 不同来源渠道的待受理工单需给坐席进行待受理提醒
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="orderId"></param>
|
|
|
+ /// <param name="cancellationToken"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private async Task PendingAcceptanceReminder(string orderId, CancellationToken cancellationToken)
|
|
|
+ {
|
|
|
+ var order = await _orderRepository.GetAsync(p => p.Id == orderId && p.Status == EOrderStatus.WaitForAccept, cancellationToken);
|
|
|
+ if (order == null)
|
|
|
+ return;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var pendingAcceptanceReminder = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.PendingAcceptanceReminder);
|
|
|
+ if (pendingAcceptanceReminder != null && pendingAcceptanceReminder.Any())
|
|
|
+ {
|
|
|
+ if (pendingAcceptanceReminder.Any(p => p.DicDataValue.Contains(order.SourceChannelCode)))
|
|
|
+ {
|
|
|
+ //查询坐席角色
|
|
|
+ var setting = _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi).SettingValue;
|
|
|
+ var list = await _userRepository.Queryable()
|
|
|
+ .Includes(u => u.Roles)
|
|
|
+ .Where(u => u.Roles.Any(x => setting.Contains(x.Name)))
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ //给坐席发送提醒
|
|
|
+ if (list != null && list.Any())
|
|
|
+ {
|
|
|
+ AddCircularDto circularDto = new()
|
|
|
+ {
|
|
|
+ Title = "待受理提醒",
|
|
|
+ Content = "您有新的【" + order.SourceChannel + "】工单待受理",
|
|
|
+ CircularTypeId = "5",
|
|
|
+ CircularTypeName = "系统消息",
|
|
|
+ IsMustRead = true,
|
|
|
+ SourceOrgId = OrgSeedData.CenterId,
|
|
|
+ SourceOrgName = OrgSeedData.CenterName,
|
|
|
+ CircularType = ECircularType.Person
|
|
|
+ };
|
|
|
+ List<CircularReadGroupDto> users = [];
|
|
|
+ foreach (var user in list)
|
|
|
+ {
|
|
|
+ users.Add(new CircularReadGroupDto()
|
|
|
+ {
|
|
|
+ UserId = user.Id,
|
|
|
+ UserName = user.Name,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ circularDto.CircularReadGroups = users;
|
|
|
+ //调用推送消息通用接口
|
|
|
+ await _circularRecordDomainService.AddCircularMessage(circularDto, cancellationToken);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 派单量统计
|
|
|
/// </summary>
|