ReceiveController.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. using DotNetCore.CAP;
  2. using Hotline.Share.Enums.Order;
  3. using MapsterMapper;
  4. using Microsoft.AspNetCore.Authorization;
  5. using Microsoft.AspNetCore.Mvc;
  6. using Sharing.Province.Dtos;
  7. using Sharing.Province.Dtos.XieTong.Receive;
  8. using Sharing.Province.XieTong.Receive;
  9. using Sharing.WebCore;
  10. namespace Sharing.Province.Controllers
  11. {
  12. /// <summary>
  13. ///
  14. /// </summary>
  15. public class ReceiveController : BaseController
  16. {
  17. #region 注入
  18. private readonly IMapper _mapper;
  19. private readonly ICapPublisher _capPublisher;
  20. private readonly IReceiveCaseInfoRepository _receiveCaseInfoRepository;
  21. private readonly IGetCaseBackResultRepository _getCaseBackResultRepository;
  22. private readonly IDelayCaseResultRepository _delayCaseResultRepository;
  23. private readonly ISupplyCaseInfoRepository _supplyCaseInfoRepository;
  24. private readonly IRevokeCaseInfoRepository _revokeCaseInfoRepository;
  25. private readonly IRemindCaseInfoRepository _remindCaseInfoRepository;
  26. private readonly ISendWarnInfoRepository _sendWarnInfoRepository;
  27. private readonly ISendSuperviseInfoRepository _sendSuperviseInfoRepository;
  28. private readonly IScreenCaseResultReceiveRepository _screenCaseResultReceiveRepository;
  29. private readonly ISendCaseEvlResultRepository _sendCaseEvlResultRepository;
  30. private readonly IGetCaseReultSendRepository _getCaseReultSendRepository;
  31. private readonly IGetVisitInfoSendRepository _getVisitInfoSendRepository;
  32. /// <summary>
  33. ///
  34. /// </summary>
  35. /// <param name="mapper"></param>
  36. /// <param name="capPublisher"></param>
  37. /// <param name="receiveCaseInfoRepository"></param>
  38. /// <param name="getCaseBackResultRepository"></param>
  39. /// <param name="delayCaseResultRepository"></param>
  40. /// <param name="supplyCaseInfoRepository"></param>
  41. /// <param name="revokeCaseInfoRepository"></param>
  42. /// <param name="remindCaseInfoRepository"></param>
  43. /// <param name="sendWarnInfoRepository"></param>
  44. /// <param name="sendSuperviseInfoRepository"></param>
  45. /// <param name="screenCaseResultReceiveRepository"></param>
  46. /// <param name="sendCaseEvlResultRepository"></param>
  47. /// <param name="getCaseReultSendRepository"></param>
  48. /// <param name="getVisitInfoSendRepository"></param>
  49. public ReceiveController(IMapper mapper, ICapPublisher capPublisher, IReceiveCaseInfoRepository receiveCaseInfoRepository,
  50. IGetCaseBackResultRepository getCaseBackResultRepository, IDelayCaseResultRepository delayCaseResultRepository
  51. , ISupplyCaseInfoRepository supplyCaseInfoRepository, IRevokeCaseInfoRepository revokeCaseInfoRepository
  52. , IRemindCaseInfoRepository remindCaseInfoRepository, ISendWarnInfoRepository sendWarnInfoRepository
  53. , ISendSuperviseInfoRepository sendSuperviseInfoRepository, IScreenCaseResultReceiveRepository screenCaseResultReceiveRepository
  54. , ISendCaseEvlResultRepository sendCaseEvlResultRepository, IGetCaseReultSendRepository getCaseReultSendRepository
  55. , IGetVisitInfoSendRepository getVisitInfoSendRepository)
  56. {
  57. _mapper = mapper;
  58. _capPublisher = capPublisher;
  59. _receiveCaseInfoRepository = receiveCaseInfoRepository;
  60. _getCaseBackResultRepository = getCaseBackResultRepository;
  61. _delayCaseResultRepository = delayCaseResultRepository;
  62. _supplyCaseInfoRepository = supplyCaseInfoRepository;
  63. _revokeCaseInfoRepository = revokeCaseInfoRepository;
  64. _remindCaseInfoRepository = remindCaseInfoRepository;
  65. _sendWarnInfoRepository = sendWarnInfoRepository;
  66. _sendSuperviseInfoRepository = sendSuperviseInfoRepository;
  67. _screenCaseResultReceiveRepository = screenCaseResultReceiveRepository;
  68. _sendCaseEvlResultRepository = sendCaseEvlResultRepository;
  69. _getCaseReultSendRepository = getCaseReultSendRepository;
  70. _getVisitInfoSendRepository = getVisitInfoSendRepository;
  71. }
  72. #endregion
  73. /// <summary>
  74. /// 服务工单交办接口
  75. /// </summary>
  76. /// <param name="receiveCaseInfo"></param>
  77. /// <returns></returns>
  78. [HttpPost("receive_case_info")]
  79. [AllowAnonymous]
  80. public async Task<Reponse> ReceiveCaseInfo([FromBody] ReceiveCaseInfoRequest receiveCaseInfo)
  81. {
  82. // 验证
  83. if (receiveCaseInfo is null || receiveCaseInfo.paras is null)
  84. {
  85. Reponse.Failed("数据解析失败");
  86. }
  87. //验证接收的数据是否正确
  88. string strResult = receiveCaseInfo.paras.Validate();
  89. if (!string.IsNullOrEmpty(strResult))
  90. Reponse.Failed(strResult);
  91. //转换数据
  92. var dto = _mapper.Map<ReceiveCaseInfo>(receiveCaseInfo.paras);
  93. //添加数据
  94. var id = await _receiveCaseInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  95. //处理组装数据,推送数据
  96. #region 处理接收的数据
  97. ReceiveCaseInfoAddOrderDto addOrderDto = new()
  98. {
  99. ProvinceNo = dto.CaseSerial,
  100. Title = dto.CaseTitle,
  101. CaseRegister = dto.CaseRegister,
  102. CaseRegisterNo = dto.CaseRegisterNo,
  103. CaseDate = dto.CaseDate,
  104. FromPhone = dto.PhoneNumber,
  105. Contact = dto.PhoneNumber,
  106. FromName = dto.AppLicantName,
  107. Content = dto.CaseContent,
  108. CaseProcessType = dto.CaseProcessType,
  109. TSigntTmeBf = dto.TSigntTmeBf,
  110. TfdBackTimeBf = dto.TfdBackTimeBf,
  111. TBackTimeBf = dto.TBackTimeBf,
  112. AreaCode = dto.AreaCode,
  113. Street = dto.CaseAddress,
  114. IncidentTime = dto.EventDate,
  115. HotspotCode = dto.CaseAccord,
  116. LicenceNo = dto.AppLicantId,
  117. AgeRangeCode = dto.AppLicantAge,
  118. TaskType = dto.TaskType,
  119. IsPublic = dto.CaseIsPublic == "1",
  120. IsSecrect = dto.CaseIsSecrect == "1",
  121. IsVisit = dto.CaseIsVisit == "1",
  122. CaseEmotion = dto.CaseEmotion,
  123. TrowGuid = dto.TrowGuid,
  124. CliengGuid = dto.CliengGuid,
  125. AdviseType = dto.AdviseType,
  126. AdviseDept = dto.AdviseDept,
  127. ComplainType = dto.ComplainType,
  128. ComplainDept = dto.ComplainDept
  129. };
  130. //处理诉求渠道
  131. switch (dto.CaseSource.ToUpper())
  132. {
  133. case "RGDH":
  134. addOrderDto.Channel = EChannel.Phone;
  135. break;
  136. case "WX":
  137. addOrderDto.Channel = EChannel.WxOfficial;
  138. break;
  139. case "WZ":
  140. addOrderDto.Channel = EChannel.Web;
  141. break;
  142. case "AP":
  143. addOrderDto.Channel = EChannel.App;
  144. break;
  145. case "XCX":
  146. addOrderDto.Channel = EChannel.WxMiniProgram;
  147. break;
  148. default:
  149. break;
  150. }
  151. //处理性别
  152. switch (dto.AppLicantSex)
  153. {
  154. case "0":
  155. addOrderDto.FromGender = EGender.Female;
  156. break;
  157. case "1":
  158. addOrderDto.FromGender = EGender.Male;
  159. break;
  160. case "2":
  161. addOrderDto.FromGender = EGender.Unknown;
  162. break;
  163. default:
  164. break;
  165. }
  166. //处理年龄范围名称
  167. switch (dto.AppLicantAge)
  168. {
  169. case "10":
  170. addOrderDto.AgeRange = "20以下";
  171. break;
  172. case "20":
  173. addOrderDto.AgeRange = "20-39";
  174. break;
  175. case "30":
  176. addOrderDto.AgeRange = "40-59";
  177. break;
  178. case "40":
  179. addOrderDto.AgeRange = "60岁以上";
  180. break;
  181. case "70":
  182. addOrderDto.AgeRange = "无法获取";
  183. break;
  184. default:
  185. break;
  186. }
  187. //处理证件类型
  188. switch (dto.CertifiCateType)
  189. {
  190. case "10":
  191. addOrderDto.LicenceTypeCode = "10";
  192. addOrderDto.LicenceType = "中华人民共和国居民身份证";
  193. break;
  194. case "20":
  195. addOrderDto.LicenceTypeCode = "40";
  196. addOrderDto.LicenceType = "外国(地区)护照";
  197. break;
  198. case "30":
  199. addOrderDto.LicenceTypeCode = "55";
  200. addOrderDto.LicenceType = "港澳居民来往内地通行证";
  201. break;
  202. case "40":
  203. addOrderDto.LicenceTypeCode = "57";
  204. addOrderDto.LicenceType = "台湾居民来往大陆通行证";
  205. break;
  206. default:
  207. addOrderDto.LicenceTypeCode = "90";
  208. addOrderDto.LicenceType = "其他有效身份证件";
  209. break;
  210. }
  211. //处理受理类型
  212. switch (dto.CaseType)
  213. {
  214. case "10":
  215. addOrderDto.AcceptType = EAcceptType.Consult;
  216. break;
  217. case "15":
  218. addOrderDto.AcceptType = EAcceptType.Suggest;
  219. break;
  220. case "20":
  221. addOrderDto.AcceptType = EAcceptType.SeekHelp;
  222. break;
  223. case "25":
  224. addOrderDto.AcceptType = EAcceptType.Praise;
  225. break;
  226. case "30":
  227. addOrderDto.AcceptType = EAcceptType.Report;
  228. break;
  229. case "35":
  230. addOrderDto.AcceptType = EAcceptType.Report;
  231. break;
  232. case "40":
  233. addOrderDto.AcceptType = EAcceptType.Other;
  234. break;
  235. default:
  236. break;
  237. }
  238. //处理紧急程度
  239. switch (dto.CaseIsUrgent)
  240. {
  241. case "10":
  242. addOrderDto.EmergencyLevel = EEmergencyLevel.QuiteEmergency;
  243. break;
  244. case "20":
  245. addOrderDto.EmergencyLevel = EEmergencyLevel.Emergency;
  246. break;
  247. case "30":
  248. addOrderDto.EmergencyLevel = EEmergencyLevel.Normal;
  249. break;
  250. default:
  251. break;
  252. }
  253. //经纬度处理
  254. var lngLat = dto.CaseLngLat.Split(',');
  255. if (lngLat != null && lngLat.Length == 2)
  256. {
  257. addOrderDto.Longitude = Convert.ToDouble(lngLat[0]);
  258. addOrderDto.Latitude = Convert.ToDouble(lngLat[1]);
  259. }
  260. #endregion
  261. //向业务系统推送消息
  262. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, addOrderDto,cancellationToken: HttpContext.RequestAborted);
  263. if (!string.IsNullOrEmpty(id))
  264. return Reponse.Success("您已成功提交数据!");
  265. else
  266. return Reponse.Failed("接口调用失败!");
  267. }
  268. /// <summary>
  269. /// 服务工单退回反馈接口
  270. /// </summary>
  271. /// <param name="receiveBackResult">退回反馈</param>
  272. /// <returns></returns>
  273. [HttpPost("get_case_back_result")]
  274. [AllowAnonymous]
  275. public async Task<Reponse> GetCaseBackResult([FromBody] GetCaseBackResultRequest receiveBackResult)
  276. {
  277. // 验证
  278. if (receiveBackResult is null || receiveBackResult.paras is null)
  279. Reponse.Failed("数据解析失败");
  280. //验证接收的数据是否正确
  281. string strResult = receiveBackResult.paras.Validate();
  282. if (!string.IsNullOrEmpty(strResult))
  283. Reponse.Failed(strResult);
  284. //转换数据
  285. var dto = _mapper.Map<GetCaseBackResult>(receiveBackResult.paras);
  286. //添加数据
  287. var id = await _getCaseBackResultRepository.AddAsync(dto, HttpContext.RequestAborted);
  288. //向业务系统推送消息
  289. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  290. if (!string.IsNullOrEmpty(id))
  291. return Reponse.Success("您已成功提交数据!");
  292. else
  293. return Reponse.Failed("接口调用失败!");
  294. }
  295. /// <summary>
  296. /// 服务工单延时审核结果接口
  297. /// </summary>
  298. /// <param name="receiveDelayCaseResult">延时审核结果对象</param>
  299. /// <returns></returns>
  300. [HttpPost("delay_case_result_receive")]
  301. [AllowAnonymous]
  302. public async Task<Reponse> DelayCaseResultReceive([FromBody] DelayCaseResultRequest receiveDelayCaseResult)
  303. {
  304. // 验证
  305. if (receiveDelayCaseResult is null || receiveDelayCaseResult.paras is null)
  306. Reponse.Failed("数据解析失败");
  307. string strResult = receiveDelayCaseResult.paras.Validate();
  308. if (!string.IsNullOrEmpty(strResult))
  309. Reponse.Failed(strResult);
  310. //转换数据
  311. var dto = _mapper.Map<DelayCaseResult>(receiveDelayCaseResult.paras);
  312. //添加数据
  313. var id = await _delayCaseResultRepository.AddAsync(dto, HttpContext.RequestAborted);
  314. //向业务系统推送消息
  315. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  316. if (!string.IsNullOrEmpty(id))
  317. return Reponse.Success("您已成功提交数据!");
  318. else
  319. return Reponse.Failed("接口调用失败!");
  320. }
  321. /// <summary>
  322. /// 服务工单交办补充诉求接口
  323. /// </summary>
  324. /// <param name="receiveSupplyCaseInfo">交办补充诉求对象</param>
  325. /// <returns></returns>
  326. [HttpPost("supply_case_info_receive")]
  327. [AllowAnonymous]
  328. public async Task<Reponse> SupplyCaseInfoReceive([FromBody] SupplyCaseInfoRequest receiveSupplyCaseInfo)
  329. {
  330. // 验证
  331. if (receiveSupplyCaseInfo is null || receiveSupplyCaseInfo.paras is null)
  332. Reponse.Failed("数据解析失败");
  333. string strResult = receiveSupplyCaseInfo.paras.Validate();
  334. if (!string.IsNullOrEmpty(strResult))
  335. Reponse.Failed(strResult);
  336. //转换数据
  337. var dto = _mapper.Map<SupplyCaseInfo>(receiveSupplyCaseInfo.paras);
  338. //添加数据
  339. var id = await _supplyCaseInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  340. //向业务系统推送消息
  341. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  342. if (!string.IsNullOrEmpty(id))
  343. return Reponse.Success("您已成功提交数据!");
  344. else
  345. return Reponse.Failed("接口调用失败!");
  346. }
  347. /// <summary>
  348. /// 服务工单撤单接口
  349. /// </summary>
  350. /// <param name="receiveRevokeCaseInfo">撤单对象</param>
  351. /// <returns></returns>
  352. [HttpPost("revoke_case_info")]
  353. [AllowAnonymous]
  354. public async Task<Reponse> RevokeCaseInfo([FromBody] RevokeCaseInfoRequest receiveRevokeCaseInfo)
  355. {
  356. // 验证
  357. if (receiveRevokeCaseInfo is null || receiveRevokeCaseInfo.paras is null)
  358. Reponse.Failed("数据解析失败");
  359. string strResult = receiveRevokeCaseInfo.paras.Validate();
  360. if (!string.IsNullOrEmpty(strResult))
  361. Reponse.Failed(strResult);
  362. //转换数据
  363. var dto = _mapper.Map<RevokeCaseInfo>(receiveRevokeCaseInfo.paras);
  364. //添加数据
  365. var id = await _revokeCaseInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  366. //向业务系统推送消息
  367. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  368. if (!string.IsNullOrEmpty(id))
  369. return Reponse.Success("您已成功提交数据!");
  370. else
  371. return Reponse.Failed("接口调用失败!");
  372. }
  373. /// <summary>
  374. /// 服务工单催单接口
  375. /// </summary>
  376. /// <param name="receiveRemindCaseInfo">催单对象</param>
  377. /// <returns></returns>
  378. [HttpPost("remind_case_info")]
  379. [AllowAnonymous]
  380. public async Task<Reponse> RemindCaseInfo([FromBody] RemindCaseInfoRequest receiveRemindCaseInfo)
  381. {
  382. // 验证
  383. if (receiveRemindCaseInfo is null || receiveRemindCaseInfo.paras is null)
  384. Reponse.Failed("数据解析失败");
  385. string strResult = receiveRemindCaseInfo.paras.Validate();
  386. if (!string.IsNullOrEmpty(strResult))
  387. Reponse.Failed(strResult);
  388. //转换数据
  389. var dto = _mapper.Map<RemindCaseInfo>(receiveRemindCaseInfo.paras);
  390. //添加数据
  391. var id = await _remindCaseInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  392. //向业务系统推送消息
  393. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  394. if (!string.IsNullOrEmpty(id))
  395. return Reponse.Success("您已成功提交数据!");
  396. else
  397. return Reponse.Failed("接口调用失败!");
  398. }
  399. /// <summary>
  400. /// 服务工单预警接口
  401. /// </summary>
  402. /// <param name="receiveSendWarnInfo">预警对象</param>
  403. /// <returns></returns>
  404. [HttpPost("send_warn_info")]
  405. [AllowAnonymous]
  406. public async Task<Reponse> SendWarnInfo([FromBody] SendWarnInfoRequest receiveSendWarnInfo)
  407. {
  408. // 验证
  409. if (receiveSendWarnInfo is null || receiveSendWarnInfo.paras is null)
  410. Reponse.Failed("数据解析失败");
  411. string strResult = receiveSendWarnInfo.paras.Validate();
  412. if (!string.IsNullOrEmpty(strResult))
  413. Reponse.Failed(strResult);
  414. //转换数据
  415. var dto = _mapper.Map<SendWarnInfo>(receiveSendWarnInfo.paras);
  416. //添加数据
  417. var id = await _sendWarnInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  418. //向业务系统推送消息
  419. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  420. if (!string.IsNullOrEmpty(id))
  421. return Reponse.Success("您已成功提交数据!");
  422. else
  423. return Reponse.Failed("接口调用失败!");
  424. }
  425. /// <summary>
  426. /// 督办工单派发接口
  427. /// </summary>
  428. /// <param name="receiveSendSuperviseInfo">督办工单对象</param>
  429. /// <returns></returns>
  430. [HttpPost("send_supervise_info")]
  431. [AllowAnonymous]
  432. public async Task<Reponse> SendSuperviseInfo([FromBody] SendSuperviseInfoRequest receiveSendSuperviseInfo)
  433. {
  434. // 验证
  435. if (receiveSendSuperviseInfo is null || receiveSendSuperviseInfo.paras is null)
  436. Reponse.Failed("数据解析失败");
  437. string strResult = receiveSendSuperviseInfo.paras.Validate();
  438. if (!string.IsNullOrEmpty(strResult))
  439. Reponse.Failed(strResult);
  440. //转换数据
  441. var dto = _mapper.Map<SendSuperviseInfo>(receiveSendSuperviseInfo.paras);
  442. //添加数据
  443. var id = await _sendSuperviseInfoRepository.AddAsync(dto, HttpContext.RequestAborted);
  444. //向业务系统推送消息
  445. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  446. if (!string.IsNullOrEmpty(id))
  447. return Reponse.Success("您已成功提交数据!");
  448. else
  449. return Reponse.Failed("接口调用失败!");
  450. }
  451. /// <summary>
  452. /// 服务工单甄别结果接口
  453. /// </summary>
  454. /// <param name="receiveScreenCaseResultReceive">服务工单甄别结果对象</param>
  455. /// <returns></returns>
  456. [HttpPost("screen_case_result_receive")]
  457. [AllowAnonymous]
  458. public async Task<Reponse> ScreenCaseResultReceive([FromBody] ScreenCaseResultReceiveRequest receiveScreenCaseResultReceive)
  459. {
  460. // 验证
  461. if (receiveScreenCaseResultReceive is null || receiveScreenCaseResultReceive.paras is null)
  462. return Reponse.Failed("数据解析失败");
  463. string strResult = receiveScreenCaseResultReceive.paras.Validate();
  464. if (!string.IsNullOrEmpty(strResult))
  465. return Reponse.Failed(strResult);
  466. //转换数据
  467. var dto = _mapper.Map<ScreenCaseResultReceive>(receiveScreenCaseResultReceive.paras);
  468. //添加数据
  469. var id = await _screenCaseResultReceiveRepository.AddAsync(dto, HttpContext.RequestAborted);
  470. //向业务系统推送消息
  471. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  472. if (!string.IsNullOrEmpty(id))
  473. return Reponse.Success("您已成功提交数据!");
  474. else
  475. return Reponse.Failed("接口调用失败!");
  476. }
  477. /// <summary>
  478. /// 交办工单满意度接收接口
  479. /// </summary>
  480. /// <param name="receiveSendCaseEvlResult">交办工单满意度对象</param>
  481. /// <returns></returns>
  482. [HttpPost("send_case_evl_result")]
  483. [AllowAnonymous]
  484. public async Task<Reponse> SendCaseEvlResult([FromBody] SendCaseEvlResultRequest receiveSendCaseEvlResult)
  485. {
  486. // 验证
  487. if (receiveSendCaseEvlResult is null || receiveSendCaseEvlResult.paras is null)
  488. return Reponse.Failed("数据解析失败");
  489. string strResult = receiveSendCaseEvlResult.paras.Validate();
  490. if (!string.IsNullOrEmpty(strResult))
  491. return Reponse.Failed(strResult);
  492. //转换数据
  493. var dto = _mapper.Map<SendCaseEvlResult>(receiveSendCaseEvlResult.paras);
  494. //添加数据
  495. var id = await _sendCaseEvlResultRepository.AddAsync(dto, HttpContext.RequestAborted);
  496. //向业务系统推送消息
  497. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  498. if (!string.IsNullOrEmpty(id))
  499. return Reponse.Success("您已成功提交数据!");
  500. else
  501. return Reponse.Failed("接口调用失败!");
  502. }
  503. /// <summary>
  504. /// 上报工单处理结果/退回接口
  505. /// </summary>
  506. /// <param name="receiveGetCaseReultSend">上报工单处理结果/退回对象</param>
  507. /// <returns></returns>
  508. [HttpPost]
  509. [Route("get_case_result_send")]
  510. public async Task<Reponse> GetCaseReultSend([FromBody] GetCaseReultSendRequest receiveGetCaseReultSend)
  511. {
  512. // 验证
  513. if (receiveGetCaseReultSend is null || receiveGetCaseReultSend.paras is null)
  514. return Reponse.Failed("数据解析失败");
  515. string strResult = receiveGetCaseReultSend.paras.Validate();
  516. if (!string.IsNullOrEmpty(strResult))
  517. return Reponse.Failed(strResult);
  518. //转换数据
  519. var dto = _mapper.Map<GetCaseReultSend>(receiveGetCaseReultSend.paras);
  520. //添加数据
  521. var id = await _getCaseReultSendRepository.AddAsync(dto, HttpContext.RequestAborted);
  522. //向业务系统推送消息
  523. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  524. if (!string.IsNullOrEmpty(id))
  525. return Reponse.Success("您已成功提交数据!");
  526. else
  527. return Reponse.Failed("接口调用失败!");
  528. }
  529. /// <summary>
  530. /// 上报工单评价接口
  531. /// </summary>
  532. /// <param name="receiveGetVisitInfoSend">上报工单评价对象</param>
  533. /// <returns></returns>
  534. [HttpPost]
  535. [Route("get_visit_info_send")]
  536. public async Task<Reponse> GetVisitInfoSend([FromBody] GetCaseReultSendRequest receiveGetVisitInfoSend)
  537. {
  538. // 验证
  539. if (receiveGetVisitInfoSend is null || receiveGetVisitInfoSend.paras is null)
  540. return Reponse.Failed("数据解析失败");
  541. string strResult = receiveGetVisitInfoSend.paras.Validate();
  542. if (!string.IsNullOrEmpty(strResult))
  543. return Reponse.Failed(strResult);
  544. //转换数据
  545. var dto = _mapper.Map<GetVisitInfoSend>(receiveGetVisitInfoSend.paras);
  546. //添加数据
  547. var id = await _getVisitInfoSendRepository.AddAsync(dto, HttpContext.RequestAborted);
  548. //向业务系统推送消息
  549. // await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, dto,cancellationToken: HttpContext.RequestAborted);
  550. if (!string.IsNullOrEmpty(id))
  551. return Reponse.Success("您已成功提交数据!");
  552. else
  553. return Reponse.Failed("接口调用失败!");
  554. }
  555. }
  556. }