|
@@ -18,7 +18,6 @@ using Hotline.Import;
|
|
|
using Hotline.Orders;
|
|
|
using Hotline.Orders.Notifications;
|
|
|
using Hotline.OrderTranspond;
|
|
|
-using Hotline.Permissions;
|
|
|
using Hotline.Push.FWMessage;
|
|
|
using Hotline.Push.Notifies;
|
|
|
using Hotline.Repository.SqlSugar.CallCenter;
|
|
@@ -66,12 +65,12 @@ using XF.Utility.EnumExtensions;
|
|
|
using Hotline.Application.Contracts.Validators.FlowEngine;
|
|
|
using Hotline.Authentications;
|
|
|
using Hotline.Share.Dtos.CallCenter;
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
-using System.Threading;
|
|
|
using Hotline.Share.Mq;
|
|
|
using Hotline.CallCenter.Calls;
|
|
|
+using Hotline.FlowEngine.Notifications;
|
|
|
using Hotline.Share.Dtos.Order.Detail;
|
|
|
-using Hotline.Share.Dtos.File;
|
|
|
+using Hotline.Snapshot.Interfaces;
|
|
|
+using Hotline.Snapshot.Notifications;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -126,7 +125,6 @@ public class OrderController : BaseController
|
|
|
private readonly IOrderApplication _orderApplication;
|
|
|
private readonly IPushDomainService _pushDomainService;
|
|
|
private readonly ILogger<OrderController> _logger;
|
|
|
- private readonly ITypedCache<YbEnterpriseToken> _cacheResponse;
|
|
|
private readonly IRepository<OrderSendBackAudit> _orderSendBackAuditRepository;
|
|
|
private readonly IRepository<User> _userRepository;
|
|
|
private readonly IExportApplication _exportApplication;
|
|
@@ -147,6 +145,7 @@ public class OrderController : BaseController
|
|
|
private readonly IRepository<OrderRevoke> _orderRevokeRepository;
|
|
|
private readonly IOrderTerminateRepository _orderTerminateRepository;
|
|
|
private readonly ISystemLogApplication _systemLogApplication;
|
|
|
+ private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -213,7 +212,8 @@ public class OrderController : BaseController
|
|
|
BaseDataApplication baseDataApplication,
|
|
|
IOrderTerminateRepository orderTerminateRepository,
|
|
|
ITypedCache<string> typeCache,
|
|
|
- ISystemLogApplication systemLogApplication)
|
|
|
+ ISystemLogApplication systemLogApplication,
|
|
|
+ IOrderSnapshotRepository orderSnapshotRepository)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -257,7 +257,6 @@ public class OrderController : BaseController
|
|
|
_logger = logger;
|
|
|
_orderApplication = orderApplication;
|
|
|
_pushDomainService = pushDomainService;
|
|
|
- _cacheResponse = cacheResponse;
|
|
|
_orderSendBackAuditRepository = orderSendBackAuditRepository;
|
|
|
_userRepository = userRepository;
|
|
|
_exportApplication = exportApplication;
|
|
@@ -281,6 +280,7 @@ public class OrderController : BaseController
|
|
|
_typeCache = typeCache;
|
|
|
_baseDataApplication = baseDataApplication;
|
|
|
_systemLogApplication = systemLogApplication;
|
|
|
+ _orderSnapshotRepository = orderSnapshotRepository;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -3903,6 +3903,20 @@ public class OrderController : BaseController
|
|
|
outDto.Opinion = await _typeCache.GetAsync($"tmp_opinion_{orderId}{_sessionContext.UserId}", HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
+ //随手拍
|
|
|
+ bool.TryParse(_systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
|
|
|
+ out bool isSnapshotEnable);
|
|
|
+ if (isSnapshotEnable)
|
|
|
+ {
|
|
|
+ var orderSnapshot = await _orderSnapshotRepository.GetAsync(orderId, HttpContext.RequestAborted);
|
|
|
+ if (orderSnapshot is null)
|
|
|
+ throw new UserFriendlyException($"无效编号, id: {orderId}");
|
|
|
+ if (string.CompareOrdinal(orderSnapshot.IndustryName, "安全隐患") == 0)
|
|
|
+ {
|
|
|
+ outDto.Steps = outDto.Steps.Where(d => d.BusinessType != EBusinessType.Send).ToList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return outDto;
|
|
|
}
|
|
|
|
|
@@ -3919,6 +3933,23 @@ public class OrderController : BaseController
|
|
|
$"非法参数, {string.Join(',', validResult.Errors.Select(d => d.ErrorMessage))}");
|
|
|
var order = await _orderApplication.SaveOrderWorkflowInfo(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
+ //随手拍推送网格员
|
|
|
+ bool.TryParse(
|
|
|
+ _systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
|
|
|
+ out bool isSnapshotEnable);
|
|
|
+ if (isSnapshotEnable)
|
|
|
+ {
|
|
|
+ if (string.Compare(TagDefaults.OrderMark, dto.Workflow.Tag,
|
|
|
+ StringComparison.OrdinalIgnoreCase) == 0)
|
|
|
+ {
|
|
|
+ var orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id, HttpContext.RequestAborted);
|
|
|
+ if (orderSnapshot is null)
|
|
|
+ throw new UserFriendlyException($"无效编号, id: {order.Id}");
|
|
|
+ orderSnapshot.IsSafetyDepartment = dto.Data.IsSafetyDepartment;
|
|
|
+ await _orderSnapshotRepository.UpdateAsync(orderSnapshot, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(dto.Workflow.WorkflowId, withSteps: true, withTraces: true,
|
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
|
|