|
@@ -13,8 +13,10 @@ using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using System.Collections.Generic;
|
|
|
using XF.Domain.Filters;
|
|
|
using XF.Domain.Repository;
|
|
|
+using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
|
|
namespace Hotline.Api.Controllers.DataSharing
|
|
|
{
|
|
@@ -677,7 +679,7 @@ namespace Hotline.Api.Controllers.DataSharing
|
|
|
{
|
|
|
return OpenResponse.Ok(Reponse.Failed(strResult));
|
|
|
}
|
|
|
-
|
|
|
+ List<DsGetCaseMaterialInfo> listData = new();
|
|
|
// 文件列表
|
|
|
foreach (var file in files)
|
|
|
{
|
|
@@ -702,18 +704,79 @@ namespace Hotline.Api.Controllers.DataSharing
|
|
|
Direction = "2",
|
|
|
SyncState = "1"
|
|
|
};
|
|
|
+ listData.Add(materialInfo);
|
|
|
await _getCaseMaterialInfoRepository.AddAsync(materialInfo, HttpContext.RequestAborted);
|
|
|
+
|
|
|
//向业务系统推送消息
|
|
|
// await _capPublisher.PublishAsync(Sharing.Share.Mq.EventNames.SharingFileData, _mapper.Map<FileDto>(materialInfo), cancellationToken: HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
- var list = await _getCaseMaterialInfoRepository.Queryable().Where(p => p.CliengGuid == tmpCaseMaterialInfo.CliengGuid && p.CaseSerial == tmpCaseMaterialInfo.CaseSerial).ToListAsync();
|
|
|
-
|
|
|
- if (list!=null&&list.Count>0)
|
|
|
+ if (listData != null && listData.Count > 0)
|
|
|
{
|
|
|
- foreach (var item in list)
|
|
|
+ //处理附件数据
|
|
|
+ var receiveData = await _dsReceiveProvinceDataRepository.GetAsync(p => p.CliengGuid == tmpCaseMaterialInfo.CliengGuid && p.CaseSerial == tmpCaseMaterialInfo.CaseSerial, HttpContext.RequestAborted);
|
|
|
+ if (receiveData != null)
|
|
|
{
|
|
|
+ List<FileDto> listFiles = new();
|
|
|
|
|
|
+ //根据接口处理数据
|
|
|
+ switch (receiveData.ServiceInterface)
|
|
|
+ {
|
|
|
+ case "receive_case_info":
|
|
|
+ listFiles = await InitFileData(listData, "工单受理");
|
|
|
+ await _mediator.Send(new ReceiveOrderNotify { AddOrderDto = new() { ProvinceNo = tmpCaseMaterialInfo.CaseSerial }, Files = listFiles }, HttpContext.RequestAborted);
|
|
|
+ break;
|
|
|
+ case "get_case_back_result":
|
|
|
+ var data = await _getCaseBackApplyRepository.GetAsync(p => p.CaseSerial == tmpCaseMaterialInfo.CaseSerial, HttpContext.RequestAborted);
|
|
|
+ if (data != null)
|
|
|
+ {
|
|
|
+ listFiles = await InitFileData(listData, "工单退回审核");
|
|
|
+ await _mediator.Send(new OrderSendBackResultNotify { OrderSendBackResultDto = new() { Id = data.OrderSendBackId } }, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "send_supervise_info":
|
|
|
+ listFiles = await InitFileData(listData, "督办工单派发");
|
|
|
+ await _mediator.Send(new ProvinceOrderSuperviseNotify { ProvinceOrderSuperviseDto = new() { CaseSerial = tmpCaseMaterialInfo.CaseSerial }, Files = listFiles }, HttpContext.RequestAborted);
|
|
|
+ break;
|
|
|
+ case "remind_case_info":
|
|
|
+ listFiles = await InitFileData(listData, "工单催单");
|
|
|
+ await _mediator.Send(new ProvinceOrderUrgeNotify { ProvinceOrderUrgeDto = new() { CaseSerial = tmpCaseMaterialInfo.CaseSerial } }, HttpContext.RequestAborted);
|
|
|
+ break;
|
|
|
+ case "screen_case_result_receive":
|
|
|
+ listFiles = await InitFileData(listData, "工单甄别结果");
|
|
|
+ await _mediator.Send(new ScreenProvinceResultNotify { ProvinceScreenResult = new() { CaseSerial = tmpCaseMaterialInfo.CaseSerial } }, HttpContext.RequestAborted);
|
|
|
+ break;
|
|
|
+ case "delay_case_result_receive":
|
|
|
+ listFiles = await InitFileData(listData, "工单延期审核结果");
|
|
|
+ await _mediator.Send(new DelayProvinceResultNotify { No = tmpCaseMaterialInfo.CaseSerial }, HttpContext.RequestAborted);
|
|
|
+ break;
|
|
|
+ case "supply_case_info_receive":
|
|
|
+ listFiles = await InitFileData(listData, "工单补充");
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "revoke_case_info":
|
|
|
+ listFiles = await InitFileData(listData, "工单撤单");
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "send_warn_info":
|
|
|
+ listFiles = await InitFileData(listData, "工单预警");
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "send_case_evl_result":
|
|
|
+ listFiles = await InitFileData(listData, "工单满意度");
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "get_case_result_send":
|
|
|
+ listFiles = await InitFileData(listData, "工单处理结果");
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "get_visit_info_send":
|
|
|
+ listFiles = await InitFileData(listData, "上报工单评价");
|
|
|
+
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return OpenResponse.Ok(Reponse.Success("您已成功提交数据!"));
|
|
@@ -832,6 +895,29 @@ namespace Hotline.Api.Controllers.DataSharing
|
|
|
|
|
|
#region 私有方法
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 组装附件参数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="listData"></param>
|
|
|
+ /// <param name="Classify"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private async Task<List<FileDto>> InitFileData(List<DsGetCaseMaterialInfo> listData, string Classify)
|
|
|
+ {
|
|
|
+ List<FileDto> fileDtos = new();
|
|
|
+ foreach (var item in listData)
|
|
|
+ {
|
|
|
+ fileDtos.Add(new FileDto()
|
|
|
+ {
|
|
|
+ Name = item.FileName,
|
|
|
+ Type = item.Type,
|
|
|
+ Classify = Classify,
|
|
|
+ Additions = item.Additions,
|
|
|
+ Path = item.Path
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return fileDtos;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 根据附件Id,工单编号查询所有附件
|
|
|
/// </summary>
|