|
@@ -0,0 +1,151 @@
|
|
|
+using DataSharing.FwDataExchange;
|
|
|
+using DataSharing.Province;
|
|
|
+using DataSharing.RawData;
|
|
|
+using DataSharing.SendTask;
|
|
|
+using DataSharing.Share.Dtos;
|
|
|
+using DataSharing.Share.Dtos.FwDataExchange;
|
|
|
+using DataSharing.Share.Dtos.HotlineSetting;
|
|
|
+using DataSharing.Share.Dtos.Province;
|
|
|
+using DataSharing.Share.Dtos.Province.XieTong.Receive;
|
|
|
+using DotNetCore.CAP;
|
|
|
+using Fw.Utility.UnifyResponse;
|
|
|
+using Hotline.Api.Sdk;
|
|
|
+using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
|
|
|
+using Hotline.Share.Dtos.File;
|
|
|
+using Hotline.Share.Dtos.Order;
|
|
|
+using MapsterMapper;
|
|
|
+using MediatR;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using System.Threading;
|
|
|
+using XF.Domain.Filters;
|
|
|
+using XF.Domain.Repository;
|
|
|
+
|
|
|
+namespace DataSharing.Host.Controllers
|
|
|
+{
|
|
|
+ public class TestController : BaseController
|
|
|
+ {
|
|
|
+ #region 注入
|
|
|
+ private readonly IMapper _mapper;
|
|
|
+ private readonly IMediator _mediator;
|
|
|
+ private readonly ICapPublisher _capPublisher;
|
|
|
+ private readonly IChannelConfigurationManager _channelConfigurationManager;
|
|
|
+ private readonly IRepository<DsOrder> _dataOrderRepository;
|
|
|
+ private readonly IRepository<DsReceiveProvinceData> _dsReceiveProvinceDataRepository;
|
|
|
+ private readonly IRepository<DsGetCaseMaterialInfo> _getCaseMaterialInfoRepository;
|
|
|
+ private readonly IRepository<DsGetCaseBackApply> _getCaseBackApplyRepository;
|
|
|
+ private readonly IRepository<DsSendCaseInfo> _sendCaseInfoRepository;
|
|
|
+ private readonly XieTongClient _xieTongClient;
|
|
|
+ private readonly HuiJuClient _huiJuClient;
|
|
|
+ private readonly FwClient _fwClient;
|
|
|
+ private readonly IRepository<SendFwErrorData> _sendFwErrorDataRepository;
|
|
|
+ private readonly IHotlineClient _hotlineClient;
|
|
|
+ private readonly IRepository<DsSendTask> _taskRepository;
|
|
|
+ private readonly IRepository<DsSendTaskInfo> _taskInfoRepository;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="mapper"></param>
|
|
|
+ /// <param name="mediator"></param>
|
|
|
+ /// <param name="capPublisher"></param>
|
|
|
+ /// <param name="channelConfigurationManager"></param>
|
|
|
+ /// <param name="dataOrderRepository"></param>
|
|
|
+ /// <param name="dsReceiveProvinceDataRepository"></param>
|
|
|
+ /// <param name="getCaseMaterialInfoRepository"></param>
|
|
|
+ /// <param name="getCaseBackApplyRepository"></param>
|
|
|
+ /// <param name="sendCaseInfoRepository"></param>
|
|
|
+ /// <param name="xieTongClient"></param>
|
|
|
+ /// <param name="fwClient"></param>
|
|
|
+ /// <param name="sendFwErrorDataRepository"></param>
|
|
|
+ public TestController(IMapper mapper,
|
|
|
+ IMediator mediator,
|
|
|
+ ICapPublisher capPublisher,
|
|
|
+ IChannelConfigurationManager channelConfigurationManager,
|
|
|
+ IRepository<DsOrder> dataOrderRepository,
|
|
|
+ IRepository<DsReceiveProvinceData> dsReceiveProvinceDataRepository,
|
|
|
+ IRepository<DsGetCaseMaterialInfo> getCaseMaterialInfoRepository,
|
|
|
+ IRepository<DsGetCaseBackApply> getCaseBackApplyRepository,
|
|
|
+ IRepository<DsSendCaseInfo> sendCaseInfoRepository,
|
|
|
+ XieTongClient xieTongClient,
|
|
|
+ FwClient fwClient,
|
|
|
+ IRepository<SendFwErrorData> sendFwErrorDataRepository,
|
|
|
+ IHotlineClient hotlineClient,
|
|
|
+ HuiJuClient huiJuClient,
|
|
|
+ IRepository<DsSendTask> taskRepository,
|
|
|
+ IRepository<DsSendTaskInfo> taskInfoRepository)
|
|
|
+ {
|
|
|
+ _mapper = mapper;
|
|
|
+ _mediator = mediator;
|
|
|
+ _capPublisher = capPublisher;
|
|
|
+ _channelConfigurationManager = channelConfigurationManager;
|
|
|
+ _dataOrderRepository = dataOrderRepository;
|
|
|
+ _dsReceiveProvinceDataRepository = dsReceiveProvinceDataRepository;
|
|
|
+ _getCaseMaterialInfoRepository = getCaseMaterialInfoRepository;
|
|
|
+ _getCaseBackApplyRepository = getCaseBackApplyRepository;
|
|
|
+ _sendCaseInfoRepository = sendCaseInfoRepository;
|
|
|
+ _xieTongClient = xieTongClient;
|
|
|
+ _fwClient = fwClient;
|
|
|
+ _sendFwErrorDataRepository = sendFwErrorDataRepository;
|
|
|
+ _hotlineClient = hotlineClient;
|
|
|
+ _huiJuClient = huiJuClient;
|
|
|
+ _taskRepository = taskRepository;
|
|
|
+ _taskInfoRepository = taskInfoRepository;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 测试token
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("gettesttokeninfo")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<TokenInfo> GetToken()
|
|
|
+ {
|
|
|
+ //获取附件上传Token
|
|
|
+ // string strToken = await _xieTongClient.GetTokenAsync(HttpContext.RequestAborted);
|
|
|
+ // var token = await _huiJuClient.GetTokenHJAsync(HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ var peizhi = _channelConfigurationManager.GetConfigurationProvince();
|
|
|
+
|
|
|
+ return await _huiJuClient.GetTokenAsync(peizhi.HuiJu, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ // return token;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="type">空查全部,1查成功,2查失败</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getdssendtask")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<List<DsSendTask>> GetDsSendTask(string? type)
|
|
|
+ {
|
|
|
+
|
|
|
+ return await _taskRepository.Queryable()
|
|
|
+ .WhereIF(type == "1", p => p.IsSuccess == true)
|
|
|
+ .WhereIF(type == "2", p => p.IsSuccess == false)
|
|
|
+ .OrderByDescending(p => p.CreationTime).Take(10).ToListAsync();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id">空差全部</param>
|
|
|
+ /// <param name="type">空查全部,1查成功,2查失败</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("getdssendtaskinfo")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<List<DsSendTaskInfo>> GetDsSendTaskInfo(string? id, string? type)
|
|
|
+ {
|
|
|
+
|
|
|
+ return await _taskInfoRepository.Queryable()
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(id), p => p.TaskId == id)
|
|
|
+ .WhereIF(type == "1", p => p.IsSuccess == true)
|
|
|
+ .WhereIF(type == "2", p => p.IsSuccess == false)
|
|
|
+ .OrderByDescending(p => p.CreationTime).Take(10).ToListAsync();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|