|
@@ -606,7 +606,7 @@ public class OrderController : BaseController
|
|
|
orgDetail.VisitOrgCode = item.Key;
|
|
|
orgDetail.VisitOrgName = item.Value;
|
|
|
orgDetail.VisitTarget = EVisitTarget.Org;
|
|
|
- if (order is { CounterSignType: null, FileOrgIsCenter: true } )
|
|
|
+ if (order is { CounterSignType: null, FileOrgIsCenter: true })
|
|
|
{
|
|
|
var satisfy = new Kv() { Key = "4", Value = "满意" };
|
|
|
orgDetail.OrgProcessingResults = satisfy;
|
|
@@ -2827,47 +2827,47 @@ public class OrderController : BaseController
|
|
|
return rspModel;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 甄别详情
|
|
|
- /// </summary>
|
|
|
- /// <param name="id"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("screen/visitdetail/{id}")]
|
|
|
- public async Task<OrderScreenListDto> VisitDetailScreenEntity(string id)
|
|
|
- {
|
|
|
- var model = await _orderScreenRepository.Queryable(canView: false)
|
|
|
- .Includes(x => x.Order)
|
|
|
- .Includes(x => x.Workflow, d => d.Steps)
|
|
|
- .Includes(x => x.Visit, d => d.Order)
|
|
|
- .FirstAsync(x => x.VisitDetailId == id);
|
|
|
- var rspModel = _mapper.Map<OrderScreenListDto>(model);
|
|
|
- //rspModel.IsCanHandle = model.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
- rspModel.IsCanHandle = model.Workflow?.IsCanHandle(
|
|
|
- _sessionContext.RequiredUserId, _sessionContext.RequiredOrgId, _sessionContext.Roles) ?? false;
|
|
|
- if (model.Status == EScreenStatus.SendBack && model.SendBackApply)
|
|
|
- rspModel.IsCanHandle = false;
|
|
|
- rspModel.Handle = false;
|
|
|
- if (!string.IsNullOrEmpty(rspModel.WorkflowId))
|
|
|
- {
|
|
|
- rspModel.Handle = await _workflowDomainService.CheckCurrentIsStartStepAsync(rspModel.WorkflowId, _sessionContext.RequiredUserId,
|
|
|
- _sessionContext.RequiredOrgId, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- if (rspModel.FileJson != null && rspModel.FileJson.Any())
|
|
|
- {
|
|
|
- var ids = rspModel.FileJson.Select(x => x.Id).ToList();
|
|
|
- rspModel.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- return rspModel;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 更新甄别提起截至时限
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPut("order_screen_endtime")]
|
|
|
+ /// <summary>
|
|
|
+ /// 甄别详情
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("screen/visitdetail/{id}")]
|
|
|
+ public async Task<OrderScreenListDto> VisitDetailScreenEntity(string id)
|
|
|
+ {
|
|
|
+ var model = await _orderScreenRepository.Queryable(canView: false)
|
|
|
+ .Includes(x => x.Order)
|
|
|
+ .Includes(x => x.Workflow, d => d.Steps)
|
|
|
+ .Includes(x => x.Visit, d => d.Order)
|
|
|
+ .FirstAsync(x => x.VisitDetailId == id);
|
|
|
+ var rspModel = _mapper.Map<OrderScreenListDto>(model);
|
|
|
+ //rspModel.IsCanHandle = model.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
+ rspModel.IsCanHandle = model.Workflow?.IsCanHandle(
|
|
|
+ _sessionContext.RequiredUserId, _sessionContext.RequiredOrgId, _sessionContext.Roles) ?? false;
|
|
|
+ if (model.Status == EScreenStatus.SendBack && model.SendBackApply)
|
|
|
+ rspModel.IsCanHandle = false;
|
|
|
+ rspModel.Handle = false;
|
|
|
+ if (!string.IsNullOrEmpty(rspModel.WorkflowId))
|
|
|
+ {
|
|
|
+ rspModel.Handle = await _workflowDomainService.CheckCurrentIsStartStepAsync(rspModel.WorkflowId, _sessionContext.RequiredUserId,
|
|
|
+ _sessionContext.RequiredOrgId, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (rspModel.FileJson != null && rspModel.FileJson.Any())
|
|
|
+ {
|
|
|
+ var ids = rspModel.FileJson.Select(x => x.Id).ToList();
|
|
|
+ rspModel.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ return rspModel;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 更新甄别提起截至时限
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPut("order_screen_endtime")]
|
|
|
[LogFilter("更新甄别提起截至时限")]
|
|
|
public async Task Update([FromBody] OrderScreenEndTimeDto dto)
|
|
|
{
|
|
@@ -6011,10 +6011,10 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
if (order.Status < EOrderStatus.Filed)
|
|
|
{
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
- new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(model) },
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
- }
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
+ new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(model) },
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
|
|
|
//try
|
|
|
//{
|
|
@@ -6065,17 +6065,19 @@ public class OrderController : BaseController
|
|
|
|
|
|
var model = _mapper.Map<OrderSpecial>(dto);
|
|
|
|
|
|
- var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSteps: true,
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
- var currentStep = workflow.Steps.FirstOrDefault(x => x.Status != EWorkflowStepStatus.Handled);
|
|
|
- if (currentStep is null)
|
|
|
- currentStep = workflow.Steps.OrderByDescending(x => x.CreationTime).FirstOrDefault(x => x.StepType == EStepType.End);
|
|
|
-
|
|
|
- model.OrgId = currentStep is null ? _sessionContext.RequiredOrgId : currentStep.HandlerOrgId;
|
|
|
- model.OrgName = currentStep is null ? _sessionContext.OrgName : currentStep.HandlerOrgName;
|
|
|
- var step = await _workflowDomainService.FindLastStepAsync(model.WorkflowId, HttpContext.RequestAborted);
|
|
|
- model.StepName = step.Name;
|
|
|
- model.StepCode = step.Code;
|
|
|
+ // var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSteps: true,
|
|
|
+ // cancellationToken: HttpContext.RequestAborted);
|
|
|
+ // var currentStep = workflow.Steps.FirstOrDefault(x => x.Status != EWorkflowStepStatus.Handled);
|
|
|
+ // if (currentStep is null)
|
|
|
+ // currentStep = workflow.Steps.OrderByDescending(x => x.CreationTime).FirstOrDefault(x => x.StepType == EStepType.End);
|
|
|
+
|
|
|
+ // model.OrgId = currentStep is null ? _sessionContext.RequiredOrgId : currentStep.HandlerOrgId;
|
|
|
+ // model.OrgName = currentStep is null ? _sessionContext.OrgName : currentStep.HandlerOrgName;
|
|
|
+ model.OrgId = _sessionContext.RequiredOrgId;
|
|
|
+ model.OrgName = _sessionContext.OrgName;
|
|
|
+ // var step = await _workflowDomainService.FindLastStepAsync(model.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ // model.StepName = step.Name;
|
|
|
+ // model.StepCode = step.Code;
|
|
|
model.State = 1;
|
|
|
model.SpecialType = dto.SpecialType;
|
|
|
model.LastFileOpinion = order.FileOpinion;
|
|
@@ -6086,7 +6088,7 @@ public class OrderController : BaseController
|
|
|
model.InitId();
|
|
|
if (dto.Files.Any())
|
|
|
model.FileJson = await _fileRepository.AddFileAsync(dto.Files, model.Id, "", HttpContext.RequestAborted);
|
|
|
- await _orderSpecialRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ // await _orderSpecialRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
if (dto.ReTransactError != null && dto.ReTransactError.Any())
|
|
|
{
|
|
|
List<OrderSpecialDetail> details = new();
|
|
@@ -6189,7 +6191,8 @@ public class OrderController : BaseController
|
|
|
// }
|
|
|
|
|
|
// var reverseFlowStepAssignInfo = _orderDomainService.GetOrderRecallAssignInfo(dto.BusinessType, stepAssignInfo);
|
|
|
- await _workflowDomainService.RecallAsync(recall, recall.NextHandlers.FirstOrDefault(), EWorkflowTraceType.Redo,
|
|
|
+ var (workflow, targetStepDefine, currentStep, targetStep, newStep, isOrgToCenter) = await _workflowDomainService.RecallAsync(
|
|
|
+ recall, recall.NextHandlers.FirstOrDefault(), EWorkflowTraceType.Redo,
|
|
|
endTime, order.Status >= EOrderStatus.Filed, EHandleMode.Redo,
|
|
|
async (workflow, prevStepDefine, prevStep, newStep) =>
|
|
|
{
|
|
@@ -6200,21 +6203,27 @@ public class OrderController : BaseController
|
|
|
var validator = new StepAssignInfoValidator();
|
|
|
await validator.ValidateAndThrowAsync(stepAssignInfo, HttpContext.RequestAborted);
|
|
|
newStep.Assign(stepAssignInfo);
|
|
|
+ }, HttpContext.RequestAborted);
|
|
|
|
|
|
- // await _orderSpecialRepository.Updateable().SetColumns(x => new OrderSpecial
|
|
|
- // { NextHandlers = new List<StepAssignInfo> { stepAssignInfo } })
|
|
|
- // .Where(x => x.Id == model.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
- await _orderSpecialRepository.Updateable(model)
|
|
|
- .UpdateColumns(d => new { NextHandlers = new List<StepAssignInfo> { stepAssignInfo } })
|
|
|
- .ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
- if (dto.BusinessType == EBusinessType.Send)
|
|
|
- {
|
|
|
- await _orderRepository.Updateable().SetColumns(o => new Orders.Order()
|
|
|
- { CenterToOrgHandlerId = stepAssignInfo.UserId, CenterToOrgHandlerName = stepAssignInfo.Username })
|
|
|
- .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
+ if (string.IsNullOrEmpty(currentStep?.HandlerOrgId))
|
|
|
+ {
|
|
|
+ model.OrgId = currentStep.HandlerOrgId;
|
|
|
+ model.OrgName = currentStep.HandlerOrgName;
|
|
|
+ model.StepName = currentStep.Name;
|
|
|
+ model.StepCode = currentStep.Code;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_appOptions.Value.IsZiGong && dto.BusinessType == EBusinessType.Send)
|
|
|
+ {
|
|
|
+ model.NextHandlers = new List<StepAssignInfo> { newStep.GetWorkflowStepHandler() };
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dto.BusinessType == EBusinessType.Send)
|
|
|
+ {
|
|
|
+ order.CenterToOrgHandlerId = newStep.HandlerId;
|
|
|
+ order.CenterToOrgHandlerName = newStep.HandlerName;
|
|
|
+ }
|
|
|
|
|
|
//await _workflowApplication.RecallAsync(recall, endTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Redo,
|
|
|
// HttpContext.RequestAborted);
|
|
@@ -6244,10 +6253,16 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
//ReTransactNum = reTransactNum,
|
|
|
- var Status = model.StepType == EStepType.Start ? orderStartStatus : orderStatus;
|
|
|
- await _orderRepository.Updateable()
|
|
|
- .SetColumns(o => new Orders.Order() { ProcessType = processType, Status = Status })
|
|
|
- .Where(o => o.Id == order.Id)
|
|
|
+ order.Status = model.StepType == EStepType.Start ? orderStartStatus : orderStatus;
|
|
|
+ order.ProcessType = processType;
|
|
|
+ await _orderRepository.Updateable(order)
|
|
|
+ .UpdateColumns(d=>new
|
|
|
+ {
|
|
|
+ d.CenterToOrgHandlerId,
|
|
|
+ d.CenterToOrgHandlerName,
|
|
|
+ d.ProcessType,
|
|
|
+ d.Status
|
|
|
+ })
|
|
|
.ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
// 重办清空已取消发布的工单的回访信息
|
|
@@ -6259,6 +6274,8 @@ public class OrderController : BaseController
|
|
|
// await _orderVisitRepository.UpdateAsync(visit, HttpContext.RequestAborted);
|
|
|
//}
|
|
|
}
|
|
|
+
|
|
|
+ await _orderSpecialRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -6439,13 +6456,12 @@ public class OrderController : BaseController
|
|
|
cityBase.CityProvinceAssign.OrgId.Equals(special.OrgId) || cityBase.CityEnterprise.OrgId.Equals(special.OrgId) ||
|
|
|
cityBase.PublicSecurity.OrgId.Equals(special.OrgId)))
|
|
|
{
|
|
|
- if (order.Status < EOrderStatus.Filed)
|
|
|
+ if (order.Status < EOrderStatus.Filed)
|
|
|
{
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
- new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
+ new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -6632,12 +6648,12 @@ public class OrderController : BaseController
|
|
|
cityBase.CityEnterprise.OrgId.Equals(special.OrgId) ||
|
|
|
cityBase.PublicSecurity.OrgId.Equals(special.OrgId)))
|
|
|
{
|
|
|
- if (order.Status < EOrderStatus.Filed)
|
|
|
+ if (order.Status < EOrderStatus.Filed)
|
|
|
{
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
- new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
- cancellationToken: HttpContext.RequestAborted);
|
|
|
- }
|
|
|
+ await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled,
|
|
|
+ new PublishSpecialDto { Order = _mapper.Map<OrderDto>(order), Special = _mapper.Map<OrderSpecialDto>(special) },
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -6917,9 +6933,10 @@ public class OrderController : BaseController
|
|
|
|
|
|
if (!order.FileOrgIsCenter.Value)
|
|
|
{
|
|
|
- if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
+ if (step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1).Any())
|
|
|
{
|
|
|
- var stepdDefault = step.Steps.Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1 && x.StepType == EStepType.Normal)
|
|
|
+ var stepdDefault = step.Steps
|
|
|
+ .Where(x => x.BusinessType == EBusinessType.Department && x.OrgLevel == 1 && x.StepType == EStepType.Normal)
|
|
|
.FirstOrDefault();
|
|
|
defaultStepKey = stepdDefault.Key;
|
|
|
defaultHandlerKey = stepdDefault.Handler.Key;
|