|
@@ -505,56 +505,67 @@ namespace Hotline.Application.Subscribers
|
|
|
//var setting = _systemSettingCacheManager.GetSetting(SettingConstants.CityBaseConfiguration)?.SettingValue[0];
|
|
|
//CityBaseConfiguration cityBase = JsonConvert.DeserializeObject<CityBaseConfiguration>(setting);
|
|
|
SessionContextCreator.CreateSessionContext(_sessionContextProvider, dto.Source);
|
|
|
- await _workflowApplication.HandleToEndAsync(orderScreen.WorkflowId, dto.ProvinceScreenResult.AuditOpinion, null,
|
|
|
- reviewResult: dto.ProvinceScreenResult.AuditResult
|
|
|
- ? Share.Enums.FlowEngine.EReviewResult.Approval
|
|
|
- : Share.Enums.FlowEngine.EReviewResult.Failed, cancellationToken: cancellationToken);
|
|
|
- orderScreen.Status = dto.ProvinceScreenResult.AuditResult ? Share.Enums.Order.EScreenStatus.End : Share.Enums.Order.EScreenStatus.Refuse;
|
|
|
- //if (orderScreen.Status == Share.Enums.Order.EScreenStatus.End)
|
|
|
- //{
|
|
|
- // var visitDetail = await _orderVisitedDetailRepository.GetAsync(orderScreen.VisitDetailId, cancellationToken);
|
|
|
- // if (visitDetail != null)
|
|
|
- // {
|
|
|
- // var screenSatisfy = new Kv() { Key = "-1", Value = "视为满意" };
|
|
|
- // visitDetail.OrgProcessingResults = screenSatisfy;
|
|
|
- // visitDetail.OrgHandledAttitude = screenSatisfy;
|
|
|
- // await _orderVisitedDetailRepository.UpdateAsync(visitDetail, cancellationToken);
|
|
|
- // }
|
|
|
- //}
|
|
|
- orderScreen.ReplyContent = dto.ProvinceScreenResult.AuditOpinion;
|
|
|
- orderScreen.AuditName = dto.ProvinceScreenResult.AuditPerson;
|
|
|
- orderScreen.AuditOrgName = dto.ProvinceScreenResult.AuditOuname;
|
|
|
- orderScreen.AuditTime = dto.ProvinceScreenResult.AuditTime;
|
|
|
+ if (int.Parse(dto.ProvinceScreenResult.AuditResult) == 0)
|
|
|
+ {
|
|
|
+ PreviousWorkflowDto previous = new PreviousWorkflowDto();
|
|
|
+ previous.Opinion = dto.ProvinceScreenResult.AuditOpinion;
|
|
|
+ previous.WorkflowId = orderScreen.WorkflowId;
|
|
|
+ await _workflowApplication.PreviousAsync(previous, cancellationToken);
|
|
|
+ }
|
|
|
|
|
|
- if (dto.Files.Any())
|
|
|
- orderScreen.FileJson =
|
|
|
- await _fileRepository.AddFileAsync(dto.Files, orderScreen.Id, "", cancellationToken);
|
|
|
- await _orderScreenRepository.UpdateAsync(orderScreen, cancellationToken);
|
|
|
- //多部门甄别回访 省上结果处理
|
|
|
- if (orderScreen.Status == Share.Enums.Order.EScreenStatus.End)
|
|
|
+ if (int.Parse(dto.ProvinceScreenResult.AuditResult) > 0)
|
|
|
{
|
|
|
- var visitDetails = await _orderVisitedDetailRepository.Queryable().Where(x => x.OrderVisit.OrderId == orderScreen.OrderId &&
|
|
|
- x.VisitTarget == EVisitTarget.Org && (
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") ==
|
|
|
- "1" ||
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") ==
|
|
|
- "2" ||
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") ==
|
|
|
- "1" ||
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") ==
|
|
|
- "2"
|
|
|
- ) && x.Id != orderScreen.VisitDetailId).ToListAsync();
|
|
|
- foreach (var visitDetail in visitDetails)
|
|
|
- {
|
|
|
- if (visitDetail != null)
|
|
|
- {
|
|
|
- var screenSatisfy = new Kv() { Key = "-1", Value = "视为满意" };
|
|
|
- visitDetail.OrgProcessingResults = screenSatisfy;
|
|
|
- visitDetail.OrgHandledAttitude = screenSatisfy;
|
|
|
- await _orderVisitedDetailRepository.UpdateAsync(visitDetail, cancellationToken);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ await _workflowApplication.HandleToEndAsync(orderScreen.WorkflowId, dto.ProvinceScreenResult.AuditOpinion, null,
|
|
|
+ reviewResult: int.Parse(dto.ProvinceScreenResult.AuditResult) == 1
|
|
|
+ ? Share.Enums.FlowEngine.EReviewResult.Approval
|
|
|
+ : Share.Enums.FlowEngine.EReviewResult.Failed, cancellationToken: cancellationToken);
|
|
|
+ orderScreen.Status = int.Parse(dto.ProvinceScreenResult.AuditResult) == 1 ? Share.Enums.Order.EScreenStatus.End : Share.Enums.Order.EScreenStatus.Refuse;
|
|
|
+ //if (orderScreen.Status == Share.Enums.Order.EScreenStatus.End)
|
|
|
+ //{
|
|
|
+ // var visitDetail = await _orderVisitedDetailRepository.GetAsync(orderScreen.VisitDetailId, cancellationToken);
|
|
|
+ // if (visitDetail != null)
|
|
|
+ // {
|
|
|
+ // var screenSatisfy = new Kv() { Key = "-1", Value = "视为满意" };
|
|
|
+ // visitDetail.OrgProcessingResults = screenSatisfy;
|
|
|
+ // visitDetail.OrgHandledAttitude = screenSatisfy;
|
|
|
+ // await _orderVisitedDetailRepository.UpdateAsync(visitDetail, cancellationToken);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ orderScreen.ReplyContent = dto.ProvinceScreenResult.AuditOpinion;
|
|
|
+ orderScreen.AuditName = dto.ProvinceScreenResult.AuditPerson;
|
|
|
+ orderScreen.AuditOrgName = dto.ProvinceScreenResult.AuditOuname;
|
|
|
+ orderScreen.AuditTime = dto.ProvinceScreenResult.AuditTime;
|
|
|
+
|
|
|
+ if (dto.Files.Any())
|
|
|
+ orderScreen.FileJson =
|
|
|
+ await _fileRepository.AddFileAsync(dto.Files, orderScreen.Id, "", cancellationToken);
|
|
|
+ await _orderScreenRepository.UpdateAsync(orderScreen, cancellationToken);
|
|
|
+ //多部门甄别回访 省上结果处理
|
|
|
+ if (orderScreen.Status == Share.Enums.Order.EScreenStatus.End)
|
|
|
+ {
|
|
|
+ var visitDetails = await _orderVisitedDetailRepository.Queryable().Where(x => x.OrderVisit.OrderId == orderScreen.OrderId &&
|
|
|
+ x.VisitTarget == EVisitTarget.Org && (
|
|
|
+ SqlFunc.JsonField(x.OrgProcessingResults, "Key") ==
|
|
|
+ "1" ||
|
|
|
+ SqlFunc.JsonField(x.OrgProcessingResults, "Key") ==
|
|
|
+ "2" ||
|
|
|
+ SqlFunc.JsonField(x.OrgHandledAttitude, "Key") ==
|
|
|
+ "1" ||
|
|
|
+ SqlFunc.JsonField(x.OrgHandledAttitude, "Key") ==
|
|
|
+ "2"
|
|
|
+ ) && x.Id != orderScreen.VisitDetailId).ToListAsync();
|
|
|
+ foreach (var visitDetail in visitDetails)
|
|
|
+ {
|
|
|
+ if (visitDetail != null)
|
|
|
+ {
|
|
|
+ var screenSatisfy = new Kv() { Key = "-1", Value = "视为满意" };
|
|
|
+ visitDetail.OrgProcessingResults = screenSatisfy;
|
|
|
+ visitDetail.OrgHandledAttitude = screenSatisfy;
|
|
|
+ await _orderVisitedDetailRepository.UpdateAsync(visitDetail, cancellationToken);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|