|
@@ -71,6 +71,7 @@ using MiniExcelLibs;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Text.Json;
|
|
using System.Text.Json;
|
|
|
|
+using System.Threading;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Cache;
|
|
using XF.Domain.Cache;
|
|
using XF.Domain.Exceptions;
|
|
using XF.Domain.Exceptions;
|
|
@@ -677,40 +678,63 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- if (order.Source != ESource.ProvinceStraight && order.FileOrgIsCenter.Value == false)
|
|
|
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
{
|
|
{
|
|
- var code = "";
|
|
|
|
- //受理类型为“投诉、举报”
|
|
|
|
- if ((order.AcceptTypeCode == "30" || order.AcceptTypeCode == "35") && orderVisit.VisitState != EVisitState.Visited)
|
|
|
|
|
|
+ if (order.Source == ESource.ProvinceStraight)
|
|
{
|
|
{
|
|
- code = "1017";
|
|
|
|
- orderVisit.VisitState = EVisitState.SMSVisiting;
|
|
|
|
- await _orderVisitRepository.UpdateAsync(orderVisit);
|
|
|
|
|
|
+ //发送查询短信
|
|
|
|
+ var messageDto = new Share.Dtos.Push.MessageDto
|
|
|
|
+ {
|
|
|
|
+ PushBusiness = EPushBusiness.SearchSms,
|
|
|
|
+ ExternalId = visitId,
|
|
|
|
+ OrderId = order.Id,
|
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
|
+ Remark = order.Title,
|
|
|
|
+ Name = order.FromName,
|
|
|
|
+ TemplateCode = "1021",
|
|
|
|
+ Params = new List<string>() { order.No, order.Password },
|
|
|
|
+ TelNumber = order.Contact,
|
|
|
|
+ };
|
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
- else
|
|
|
|
- code = "1018";
|
|
|
|
-
|
|
|
|
- var messageDto = new Share.Dtos.Push.MessageDto
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (order.Source != ESource.ProvinceStraight && order.FileOrgIsCenter.Value == false)
|
|
{
|
|
{
|
|
- PushBusiness = EPushBusiness.SearchSms,
|
|
|
|
- ExternalId = visitId,
|
|
|
|
- OrderId = order.Id,
|
|
|
|
- PushPlatform = EPushPlatform.Sms,
|
|
|
|
- Remark = order.Title,
|
|
|
|
- Name = order.FromName,
|
|
|
|
- TemplateCode = code,
|
|
|
|
- Params = new List<string>() { order.No, order.Password },
|
|
|
|
- TelNumber = order.Contact,
|
|
|
|
- };
|
|
|
|
- await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
|
-
|
|
|
|
- // 发送短信后推送一个 48小时的延迟消息队列. 当消息队列收到消息时, 判断用户是否回复了, 如果未回复短信就 默认满意
|
|
|
|
- var delaySecond = _systemSettingCacheManager.DefaultVisitSmsDelaySecond;
|
|
|
|
- await _capPublisher.PublishDelayAsync(
|
|
|
|
- TimeSpan.FromSeconds(delaySecond),
|
|
|
|
- EventNames.UpdateVisitDelaySms,
|
|
|
|
- messageDto,
|
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
|
|
|
+ var code = "";
|
|
|
|
+ //受理类型为“投诉、举报”
|
|
|
|
+ if ((order.AcceptTypeCode == "30" || order.AcceptTypeCode == "35") && orderVisit.VisitState != EVisitState.Visited)
|
|
|
|
+ {
|
|
|
|
+ code = "1017";
|
|
|
|
+ orderVisit.VisitState = EVisitState.SMSVisiting;
|
|
|
|
+ await _orderVisitRepository.UpdateAsync(orderVisit);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ code = "1018";
|
|
|
|
+
|
|
|
|
+ var messageDto = new Share.Dtos.Push.MessageDto
|
|
|
|
+ {
|
|
|
|
+ PushBusiness = EPushBusiness.SearchSms,
|
|
|
|
+ ExternalId = visitId,
|
|
|
|
+ OrderId = order.Id,
|
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
|
+ Remark = order.Title,
|
|
|
|
+ Name = order.FromName,
|
|
|
|
+ TemplateCode = code,
|
|
|
|
+ Params = new List<string>() { order.No, order.Password },
|
|
|
|
+ TelNumber = order.Contact,
|
|
|
|
+ };
|
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ // 发送短信后推送一个 48小时的延迟消息队列. 当消息队列收到消息时, 判断用户是否回复了, 如果未回复短信就 默认满意
|
|
|
|
+ var delaySecond = _systemSettingCacheManager.DefaultVisitSmsDelaySecond;
|
|
|
|
+ await _capPublisher.PublishDelayAsync(
|
|
|
|
+ TimeSpan.FromSeconds(delaySecond),
|
|
|
|
+ EventNames.UpdateVisitDelaySms,
|
|
|
|
+ messageDto,
|
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
catch (Exception)
|
|
@@ -5650,78 +5674,78 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
if (order.FileJson != null)
|
|
if (order.FileJson != null)
|
|
{
|
|
{
|
|
- var ids = order.FileJson.Select(x => x.Id).ToList();
|
|
|
|
- allFiles = await _fileRepository.GetFilesAsync(ids, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- foreach (var step in steps)
|
|
|
|
- {
|
|
|
|
- if (step.FileJson != null && step.FileJson.Any())
|
|
|
|
- {
|
|
|
|
- var ids = step.FileJson.Select(x => x.Id).ToList();
|
|
|
|
- var stepFiles = await _fileRepository.GetPermissionFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
|
- allFiles.AddRange(stepFiles);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return allFiles;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// 获取流程信息
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="workflowId"></param>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- [HttpGet("all_file/workflow/{id}")]
|
|
|
|
- public async Task<WorkflowDto> GetOrderWorkflowAsync(string workflowId)
|
|
|
|
- {
|
|
|
|
- var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, withSteps: false,
|
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
|
|
|
+ var ids = order.FileJson.Select(x => x.Id).ToList();
|
|
|
|
+ allFiles = await _fileRepository.GetFilesAsync(ids, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ foreach (var step in steps)
|
|
|
|
+ {
|
|
|
|
+ if (step.FileJson != null && step.FileJson.Any())
|
|
|
|
+ {
|
|
|
|
+ var ids = step.FileJson.Select(x => x.Id).ToList();
|
|
|
|
+ var stepFiles = await _fileRepository.GetPermissionFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
|
+ allFiles.AddRange(stepFiles);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return allFiles;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 获取流程信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="workflowId"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("all_file/workflow/{id}")]
|
|
|
|
+ public async Task<WorkflowDto> GetOrderWorkflowAsync(string workflowId)
|
|
|
|
+ {
|
|
|
|
+ var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, withSteps: false,
|
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
var steps = _mapper.Map<List<WorkflowTraceDto>>(workflow.Steps);
|
|
var steps = _mapper.Map<List<WorkflowTraceDto>>(workflow.Steps);
|
|
- var workflowDto = _mapper.Map<WorkflowDto>(workflow);
|
|
|
|
|
|
+ var workflowDto = _mapper.Map<WorkflowDto>(workflow);
|
|
workflowDto.Traces = steps;
|
|
workflowDto.Traces = steps;
|
|
- foreach (var item in workflowDto.Traces)
|
|
|
|
|
|
+ foreach (var item in workflowDto.Traces)
|
|
{
|
|
{
|
|
if (item.FileJson != null)
|
|
if (item.FileJson != null)
|
|
{
|
|
{
|
|
- var ids = item.FileJson.Select(x => x.Id).ToList();
|
|
|
|
- item.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ var ids = item.FileJson.Select(x => x.Id).ToList();
|
|
|
|
+ item.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return workflowDto;
|
|
return workflowDto;
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// 附件列表补充附件
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="dtos"></param>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- [HttpPost("list/file_upload")]
|
|
|
|
- [LogFilter("附件列表补充附件")]
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 附件列表补充附件
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dtos"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("list/file_upload")]
|
|
|
|
+ [LogFilter("附件列表补充附件")]
|
|
|
|
|
|
- public async Task Add([FromBody] OrderStepUploadFilesDto dto)
|
|
|
|
- {
|
|
|
|
- var order = await _orderRepository.GetAsync(dto.OrderId);
|
|
|
|
- var step = await _workflowStepRepository.GetAsync(dto.StepId);
|
|
|
|
|
|
+ public async Task Add([FromBody] OrderStepUploadFilesDto dto)
|
|
|
|
+ {
|
|
|
|
+ var order = await _orderRepository.GetAsync(dto.OrderId);
|
|
|
|
+ var step = await _workflowStepRepository.GetAsync(dto.StepId);
|
|
|
|
|
|
- var listFileJson = new List<FileJson>();
|
|
|
|
- if (dto.Files.Any())
|
|
|
|
|
|
+ var listFileJson = new List<FileJson>();
|
|
|
|
+ if (dto.Files.Any())
|
|
{
|
|
{
|
|
- listFileJson = await _fileRepository.AddFileAsync(dto.Files, dto.StepId, "", HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- await _workflowStepRepository.Updateable().SetColumns(x => new WorkflowStep { FileJson = listFileJson }).Where(x => x.Id == dto.StepId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
- await _workflowTraceRepository.Updateable().SetColumns(x => new WorkflowTrace { FileJson = listFileJson }).Where(x => x.Id == dto.StepId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
+ listFileJson = await _fileRepository.AddFileAsync(dto.Files, dto.StepId, "", HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ await _workflowStepRepository.Updateable().SetColumns(x => new WorkflowStep { FileJson = listFileJson }).Where(x => x.Id == dto.StepId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ await _workflowTraceRepository.Updateable().SetColumns(x => new WorkflowTrace { FileJson = listFileJson }).Where(x => x.Id == dto.StepId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
////附件上传后推送省上
|
|
////附件上传后推送省上
|
|
- var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
|
- var flowDto = new OrderFlowDto
|
|
|
|
- {
|
|
|
|
- Order = orderDto,
|
|
|
|
- WorkflowTrace = _mapper.Map<WorkflowTraceDto>(step),
|
|
|
|
- ExpiredTimeChanged = false,
|
|
|
|
- HandlerOrgLevel = step.HandlerOrgId.CalcOrgLevel()
|
|
|
|
- };
|
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowFile, flowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
|
|
+ var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
|
+ var flowDto = new OrderFlowDto
|
|
|
|
+ {
|
|
|
|
+ Order = orderDto,
|
|
|
|
+ WorkflowTrace = _mapper.Map<WorkflowTraceDto>(step),
|
|
|
|
+ ExpiredTimeChanged = false,
|
|
|
|
+ HandlerOrgLevel = step.HandlerOrgId.CalcOrgLevel()
|
|
|
|
+ };
|
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowFile, flowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|