|
@@ -11,20 +11,25 @@ using DataSharing.SendTask;
|
|
|
using DataSharing.SendTask.OtherPlatforms;
|
|
|
using DataSharing.Share.Consts;
|
|
|
using DataSharing.Share.Dtos.Common;
|
|
|
+using DataSharing.Share.Dtos.FwDataExchange;
|
|
|
using DataSharing.Share.Dtos.HotlineSetting;
|
|
|
using DataSharing.Share.Dtos.HotlineWeb;
|
|
|
using DataSharing.Share.Enums;
|
|
|
using DataSharing.Share.Requests;
|
|
|
using DotNetCore.CAP;
|
|
|
+using Google.Protobuf.WellKnownTypes;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using Microsoft.AspNetCore.Http.HttpResults;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Org.BouncyCastle.Utilities;
|
|
|
using Polly.Caching;
|
|
|
using SqlSugar;
|
|
|
+using System.Security.Policy;
|
|
|
using XF.Domain.Cache;
|
|
|
using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
@@ -67,6 +72,7 @@ namespace DataSharing.Host.Controllers
|
|
|
private readonly IRepository<DsOrder> _dsOrderRepository;
|
|
|
private readonly IRepository<SendHotlineErrorData> _sendHotlineErrorDataRepository;
|
|
|
private readonly FwClient _fwClient;
|
|
|
+ private readonly ISharingConfigurationManager _sharingConfigurationManager;
|
|
|
|
|
|
/// <summary>
|
|
|
///
|
|
@@ -101,6 +107,7 @@ namespace DataSharing.Host.Controllers
|
|
|
/// <param name="dsOrderRepository"></param>
|
|
|
/// <param name="sendHotlineErrorDataRepository"></param>
|
|
|
/// <param name="fwClient"></param>
|
|
|
+ /// <param name="sharingConfigurationManager"></param>
|
|
|
public HotlineWebController(IMapper mapper,
|
|
|
IMediator mediator,
|
|
|
ICapPublisher capPublisher,
|
|
@@ -130,7 +137,8 @@ namespace DataSharing.Host.Controllers
|
|
|
IRepository<DsSendTaskInfo> taskInfoRepository,
|
|
|
IRepository<DsOrder> dsOrderRepository,
|
|
|
IRepository<SendHotlineErrorData> sendHotlineErrorDataRepository,
|
|
|
- FwClient fwClient)
|
|
|
+ FwClient fwClient,
|
|
|
+ ISharingConfigurationManager sharingConfigurationManager)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_mediator = mediator;
|
|
@@ -162,6 +170,7 @@ namespace DataSharing.Host.Controllers
|
|
|
_dsOrderRepository = dsOrderRepository;
|
|
|
_sendHotlineErrorDataRepository = sendHotlineErrorDataRepository;
|
|
|
_fwClient = fwClient;
|
|
|
+ _sharingConfigurationManager = sharingConfigurationManager;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -1345,11 +1354,31 @@ namespace DataSharing.Host.Controllers
|
|
|
//调用工单创建接口
|
|
|
try
|
|
|
{
|
|
|
- var result = await _fwClient.RequestNoTokenAsync<HotlineClientResponse>(data.Path, data.HttpMethod, data.RequestData);
|
|
|
- if (result == null || result.code != 0)
|
|
|
+ //推业务系统
|
|
|
+ if (data.ReceiveServiceInterface == "rest/receive_case_info")
|
|
|
{
|
|
|
- isSuccess = false;
|
|
|
- error = result?.message;
|
|
|
+ var result = await _fwClient.RequestNoTokenAsync<HotlineClientResponse>(data.Path, data.HttpMethod, data.RequestData);
|
|
|
+ if (result == null || result.code != 0)
|
|
|
+ {
|
|
|
+ isSuccess = false;
|
|
|
+ error = result?.message;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //推旧系统
|
|
|
+ if (data.ReceiveServiceInterface == "SendOldHotlineData")
|
|
|
+ {
|
|
|
+ var configSendDataOld = _sharingConfigurationManager.GetYiBinConfig().SendDataOld;
|
|
|
+ //先验证是否开启推送
|
|
|
+ if (configSendDataOld == null || !configSendDataOld.IsSend)
|
|
|
+ return;
|
|
|
+
|
|
|
+ var url = configSendDataOld.AddressUrl + data.Path;
|
|
|
+ var response = await _fwClient.RequestAsync<FwResponse>(url, data.HttpMethod, data.RequestData, HttpContext.RequestAborted);
|
|
|
+ if (response == null || response.code != 0)
|
|
|
+ {
|
|
|
+ isSuccess = false;
|
|
|
+ error = response?.msg;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|