|
@@ -66,6 +66,9 @@ using XF.Utility.EnumExtensions;
|
|
|
using Hotline.Application.Contracts.Validators.FlowEngine;
|
|
|
using Hotline.Authentications;
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
+using Quartz.Simpl;
|
|
|
+using static Lucene.Net.Util.Fst.Util;
|
|
|
+using DocumentFormat.OpenXml.Spreadsheet;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -305,8 +308,8 @@ public class OrderController : BaseController
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Hotspot), d => d.HotspotSpliceName != null && d.HotspotSpliceName.Contains(dto.Hotspot))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.FromPhone), d => d.FromPhone == dto.FromPhone) //来电号码
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.PubMan),
|
|
|
- // d => d.AcceptorName.Contains(dto.PubMan!) || d.AcceptorStaffNo.Contains(dto.PubMan!))
|
|
|
+ //.WhereIF(!string.IsNullOrEmpty(dto.PubMan),
|
|
|
+ // d => d.AcceptorName.Contains(dto.PubMan!) || d.AcceptorStaffNo.Contains(dto.PubMan!))
|
|
|
.WhereIF(dto.PubRange == EPublicState.Pub, d => d.OrderPublish.PublishState)
|
|
|
.WhereIF(dto.PubRange == EPublicState.NoPub, d => !d.OrderPublish.PublishState)
|
|
|
.WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, d => d.Source == ESource.ProvinceStraight)
|
|
@@ -358,132 +361,7 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- OrderPublish orderPublish = new OrderPublish();
|
|
|
- orderPublish.OrderId = order.Id;
|
|
|
- orderPublish.No = order.No;
|
|
|
- orderPublish.PublishState = false; //当前写死为false
|
|
|
- orderPublish.ArrangeTitle = order.Title;
|
|
|
- orderPublish.ArrangeContent = order.Content;
|
|
|
- orderPublish.ArrangeOpinion = order.FileOpinion;
|
|
|
- orderPublish.ProPublishState = false;
|
|
|
- orderPublish.FeedBackPhone = order.Contact;
|
|
|
- orderPublish.CreatorName = _sessionContext.UserName;
|
|
|
- await _orderPublishRepository.AddAsync(orderPublish);
|
|
|
- order.Publish(orderPublish.PublishState);
|
|
|
- await _orderRepository.UpdateAsync(order);
|
|
|
- //推省上
|
|
|
- var publishPublishOrder = _mapper.Map<PublishPublishOrderDto>(orderPublish);
|
|
|
- publishPublishOrder.Order = _mapper.Map<OrderDto>(order);
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderPublishOrder, publishPublishOrder);
|
|
|
-
|
|
|
- //推应急管理局
|
|
|
- //是否开启
|
|
|
- var isOpenContingencyManagement =
|
|
|
- _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenContingencyManagement)?.SettingValue[0];
|
|
|
- if (isOpenContingencyManagement == "true")
|
|
|
- await _publisher.PublishAsync(new ContingencyManagementNotify(order, order.Title, order.Content, order.ActualOpinion),
|
|
|
- PublishStrategy.ParallelWhenAll, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- var orderVisit = new OrderVisit();
|
|
|
- orderVisit.No = order.No;
|
|
|
- orderVisit.OrderId = order.Id;
|
|
|
- orderVisit.VisitState = EVisitState.WaitForVisit;
|
|
|
- orderVisit.PublishTime = DateTime.Now;
|
|
|
- orderVisit.IsCanHandle = true;
|
|
|
- orderVisit.EmployeeId = _sessionContext.RequiredUserId;
|
|
|
-
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- orderVisit.EmployeeId = string.Empty;
|
|
|
- }
|
|
|
-
|
|
|
- if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null } && !order.IsProvince)
|
|
|
- {
|
|
|
- orderVisit.VisitState = EVisitState.Visited;
|
|
|
- orderVisit.VisitTime = DateTime.Now;
|
|
|
- orderVisit.VisitType = EVisitType.OtherVisit;
|
|
|
- orderVisit.NowEvaluate = new Kv() { Key = "4", Value = "满意" };
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- // 根据禅道 自贡需求 Id_361, 第一条, 3小条需求;
|
|
|
- // 直办件归档后自动回访量需统计在“胡玲”的默认回访量中;
|
|
|
- orderVisit.EmployeeId = _systemSettingCacheManager.DefaultVisitEmployeeId;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (order.CounterSignType != ECounterSignType.Center)
|
|
|
- {
|
|
|
- orderVisit.IsCanAiVisit = true;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- string visitId = await _orderVisitRepository.AddAsync(orderVisit);
|
|
|
-
|
|
|
- //新增回访信息
|
|
|
- var visitedDetail = new List<OrderVisitDetail>();
|
|
|
-
|
|
|
- var seatDetail = new OrderVisitDetail();
|
|
|
- seatDetail.VisitId = visitId;
|
|
|
- seatDetail.VisitTarget = EVisitTarget.Seat;
|
|
|
-
|
|
|
-
|
|
|
- var orgDetail = new OrderVisitDetail();
|
|
|
- orgDetail.VisitId = visitId;
|
|
|
- orgDetail.VisitOrgCode = order.ActualHandleOrgCode;
|
|
|
- orgDetail.VisitOrgName = order.ActualHandleOrgName;
|
|
|
- orgDetail.VisitTarget = EVisitTarget.Org;
|
|
|
- if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null, IsProvince: false })
|
|
|
- {
|
|
|
- var satisfy = new Kv() { Key = "4", Value = "满意" };
|
|
|
- orgDetail.OrgProcessingResults = satisfy;
|
|
|
- //orgDetail.OrgHandledAttitude = satisfy;
|
|
|
- }
|
|
|
-
|
|
|
- visitedDetail.Add(orgDetail);
|
|
|
-
|
|
|
- if (order is { ProcessType: EProcessType.Zhiban, CounterSignType: null })
|
|
|
- {
|
|
|
- seatDetail.VoiceEvaluate = EVoiceEvaluate.Satisfied;
|
|
|
- seatDetail.SeatEvaluate = ESeatEvaluate.Satisfied;
|
|
|
- order.Visited("4", "满意");
|
|
|
- order.Status = EOrderStatus.Visited;
|
|
|
- await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- visitedDetail.Add(seatDetail);
|
|
|
- await _orderVisitedDetailRepository.AddRangeAsync(visitedDetail, HttpContext.RequestAborted);
|
|
|
-
|
|
|
- if (orderVisit.VisitState == EVisitState.Visited)
|
|
|
- {
|
|
|
- //推省上
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderVisited,
|
|
|
- new PublishVisitDto()
|
|
|
- {
|
|
|
- Order = _mapper.Map<OrderDto>(order),
|
|
|
- No = orderVisit.No,
|
|
|
- VisitType = orderVisit.VisitType,
|
|
|
- VisitName = orderVisit.CreatorName,
|
|
|
- VisitTime = orderVisit.VisitTime,
|
|
|
- VisitRemark = orderVisit.NowEvaluate?.Value,
|
|
|
- AreaCode = order.AreaCode!,
|
|
|
- SubjectResultSatifyCode = orderVisit.NowEvaluate?.Key,
|
|
|
- FirstSatisfactionCode = orderVisit.NowEvaluate?.Key,
|
|
|
- ClientGuid = ""
|
|
|
- }, cancellationToken: HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- //推门户
|
|
|
- await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderVisitedWeb, new PublishVisitAllDto()
|
|
|
- {
|
|
|
- Id = orderVisit.Id,
|
|
|
- Order = _mapper.Map<OrderDto>(order),
|
|
|
- OrderVisitDetails = _mapper.Map<List<VisitDetailDto>>(orderVisit.OrderVisitDetails),
|
|
|
- VisitName = _sessionContext.UserName,
|
|
|
- VisitTime = orderVisit.VisitTime,
|
|
|
- VisitType = orderVisit.VisitType,
|
|
|
- VisitState = orderVisit.VisitState,
|
|
|
- PublishTime = orderVisit.PublishTime,
|
|
|
- }, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ await _orderDomainService.OrderPublishAsync(order, HttpContext.RequestAborted);
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
@@ -888,6 +766,7 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.Visited, d => d.VisitState == EVisitState.Visited)
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.SMSUnsatisfied, d => d.VisitState == EVisitState.SMSUnsatisfied)
|
|
|
.WhereIF(dto.VisitStateQuery == EVisitStateQuery.SMSVisiting, d => d.VisitState == EVisitState.SMSVisiting)
|
|
|
+ .WhereIF(dto.VisitStateQuery == EVisitStateQuery.NoPutThrough , d=>d.IsPutThrough == false)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Order.Title.StartsWith(dto.Keyword!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No)
|
|
|
.WhereIF(dto.VisitType != null, d => d.VisitType == dto.VisitType)
|
|
@@ -936,7 +815,7 @@ public class OrderController : BaseController
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("visit/basedata")]
|
|
|
- public async Task<object> VisitBaseData()
|
|
|
+ public Dictionary<string, dynamic> VisitBaseData()
|
|
|
=> _baseDataApplication
|
|
|
.VisitType()
|
|
|
.VoiceEvaluate()
|
|
@@ -1181,7 +1060,7 @@ public class OrderController : BaseController
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("visit/batch-basedata")]
|
|
|
- public async Task<dynamic> VisitBatchBaseDat()
|
|
|
+ public Dictionary<string, dynamic> VisitBatchBaseDat()
|
|
|
=> _baseDataApplication
|
|
|
.SeatEvaluate()
|
|
|
.DissatisfiedReason()
|
|
@@ -1318,16 +1197,29 @@ public class OrderController : BaseController
|
|
|
}).ToList();
|
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 二次回访申请
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 可二次回访申请列表
|
|
|
+ /// 设置未接通
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet("visitapply/visitagainlist")]
|
|
|
+ [HttpPut("visit/put_through")]
|
|
|
+ public async Task VisitPutThrough([FromBody] VisitPutThroughDto dto ) {
|
|
|
+
|
|
|
+ await _orderVisitRepository.Updateable().SetColumns(x => new OrderVisit { IsPutThrough = false }).Where(x => x.Id == dto.id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 二次回访申请
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 可二次回访申请列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("visitapply/visitagainlist")]
|
|
|
public async Task<PagedDto<OrderCanVisitAgainDto>> OrderVisitAgainList([FromQuery] OrderVisitAgainListDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderVisitedDetailRepository.Queryable()
|
|
@@ -1756,23 +1648,34 @@ public class OrderController : BaseController
|
|
|
[HttpGet("delay/{workflowId}/nextsteps")]
|
|
|
public async Task<NextStepsDto> OrderDelayNextsteps(string workflowId)
|
|
|
{
|
|
|
- var workflow = await _workflowRepository.GetAsync(workflowId, HttpContext.RequestAborted);
|
|
|
+ //var workflow = await _workflowRepository.GetAsync(workflowId, HttpContext.RequestAborted);
|
|
|
+ var workflow = await _workflowDomainService.GetWorkflowAsync(workflowId, withDefine: true, withSteps: true,
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ var currentStep = workflow.Steps.FirstOrDefault(d => d.Status == EWorkflowStepStatus.WaitForAccept || d.Status == EWorkflowStepStatus.WaitForHandle);
|
|
|
if (workflow != null)
|
|
|
{
|
|
|
- var orderDelay = await _orderDelayRepository.Queryable().Includes(x => x.Order).Where(x => x.Id == workflow.ExternalId)
|
|
|
+
|
|
|
+ var orderDelay = await _orderDelayRepository.Queryable().Includes(x => x.Order).Where(x => x.Id == workflow.ExternalId)
|
|
|
.FirstAsync(HttpContext.RequestAborted);
|
|
|
if (orderDelay != null)
|
|
|
{
|
|
|
- var result = await _workflowApplication.GetNextStepsAsync(workflowId, HttpContext.RequestAborted);
|
|
|
- if (!orderDelay.Order.IsProvince)
|
|
|
+ var result = await _workflowApplication.GetNextStepsAsync(workflowId, HttpContext.RequestAborted);
|
|
|
+ if (!orderDelay.Order.IsProvince)
|
|
|
{
|
|
|
if (result.Steps.Any(x => x.Value == "省审批"))
|
|
|
{
|
|
|
result.Steps.Remove(result.Steps.First(x => x.Value == "省审批"));
|
|
|
}
|
|
|
}
|
|
|
+ if (!_sessionContext.OrgIsCenter && currentStep.Name != "中心初审")
|
|
|
+ {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心终审"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心终审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- return result;
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1838,7 +1741,7 @@ public class OrderController : BaseController
|
|
|
if (!_sessionContext.OrgIsCenter)
|
|
|
{
|
|
|
query.Where(d => d.AutomaticDelayNum == 0 || d.AutomaticDelayNum == null);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
var (total, items) = await query
|
|
@@ -1938,9 +1841,23 @@ public class OrderController : BaseController
|
|
|
[HttpGet("delay/startflow")]
|
|
|
public async Task<NextStepsDto> GetDelayFlowStartOptions()
|
|
|
{
|
|
|
- return await _workflowApplication.GetStartStepsAsync(WorkflowModuleConsts.OrderDelay,
|
|
|
+ var result = await _workflowApplication.GetStartStepsAsync(WorkflowModuleConsts.OrderDelay,
|
|
|
HttpContext.RequestAborted);
|
|
|
- }
|
|
|
+ if (_sessionContext.OrgIsCenter)
|
|
|
+ {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心初审"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心初审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心终审"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心终审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 延期页面基础信息
|
|
@@ -1979,103 +1896,61 @@ public class OrderController : BaseController
|
|
|
// dto.CreationTimeStart = _timeLimitDomainService.CalcWorkTimeReduce(DateTime.Now, 5);
|
|
|
dto.CreationTimeStart = await _expireTime.CalcWorkTimeReduce(DateTime.Now, 5);
|
|
|
}
|
|
|
-
|
|
|
- var query = _orderVisitedDetailRepository.Queryable(false, true)
|
|
|
- .Includes(x => x.OrderVisit)
|
|
|
- .Includes(x => x.OrderVisit, y => y.Order)
|
|
|
- .Includes(x => x.OrderVisit, y => y.Employee)
|
|
|
- //.LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.IsDeleted == false)
|
|
|
- .Includes(x => x.OrderScreens)
|
|
|
- .Where(x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply == true) ||
|
|
|
- x.OrderScreens.Any() == false
|
|
|
- //|| x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.SendBackApply != true)) == false
|
|
|
- )
|
|
|
- .WhereIF(dto.ScreenType == EOrderScreenType.Seat, x => x.OrderVisit.Order.IsProvince == false)
|
|
|
- .WhereIF(dto.ScreenSendBack is 1,
|
|
|
- x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply == true))
|
|
|
- .WhereIF(dto.ScreenSendBack is 2,
|
|
|
- x => x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply != true)) ==
|
|
|
- false)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order!.No!.Contains(dto.No!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.OrderVisit.Order!.Title!.Contains(dto.Title!))
|
|
|
- .WhereIF(dto.IsProvince.HasValue, x => x.OrderVisit.Order!.IsProvince == dto.IsProvince)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), x => x.OrderVisit.Order!.AcceptTypeCode! == dto.AcceptType!)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.HotspotSpliceName),
|
|
|
- x => x.OrderVisit.Order!.Hotspot.HotSpotFullName!.StartsWith(dto.HotspotSpliceName!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.SourceChannel), x => x.OrderVisit.Order!.SourceChannelCode! == dto.SourceChannel!)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.OrgLevelOneName), x => x.OrderVisit.Order!.OrgLevelOneName!.Contains(dto.OrgLevelOneName!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.CurrentHandleOrgName),
|
|
|
- x => x.OrderVisit.Order!.CurrentHandleOrgName!.Contains(dto.CurrentHandleOrgName!))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.VisitOrgName), x => x.VisitOrgName!.Contains(dto.VisitOrgName!))
|
|
|
- .WhereIF(dto.CreationTime.HasValue && dto.EndCreationTime.HasValue,
|
|
|
- x => x.OrderVisit.Order!.CreationTime >= dto.CreationTime && x.OrderVisit.Order!.CreationTime <= dto.EndCreationTime)
|
|
|
- .WhereIF(dto.CurrentHandleTime.HasValue && dto.EndCurrentHandleTime.HasValue,
|
|
|
- x => x.OrderVisit.Order!.CurrentHandleTime >= dto.CurrentHandleTime &&
|
|
|
- x.OrderVisit.Order!.ActualHandleTime <= dto.EndCurrentHandleTime)
|
|
|
- .WhereIF(dto.FiledTime.HasValue && dto.EndFiledTime.HasValue,
|
|
|
- x => x.OrderVisit.Order!.FiledTime >= dto.FiledTime && x.OrderVisit.Order!.FiledTime <= dto.EndFiledTime)
|
|
|
- .WhereIF(dto.VisitTime.HasValue && dto.EndVisitTime.HasValue,
|
|
|
- x => x.OrderVisit.VisitTime >= dto.VisitTime && x.OrderVisit.VisitTime <= dto.EndVisitTime)
|
|
|
- .WhereIF(dto.IsHomePage.HasValue && dto.IsHomePage == true,
|
|
|
- x => x.OrderVisit.VisitTime < dto.CreationTimeEnd && x.OrderVisit.VisitTime > dto.CreationTimeStart)
|
|
|
- //.WhereIF(dto.CounterSignType.HasValue, x => x.OrderVisit.Order!.CounterSignType == dto.CounterSignType)
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.OrgProcessingResults),
|
|
|
- // x => SqlFunc.JsonField(x.OrgProcessingResults, "Key") == dto.OrgProcessingResults)
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.OrgHandledAttitude),
|
|
|
- // x => SqlFunc.JsonListObjectAny(x.OrgHandledAttitude, "Key", dto.OrgHandledAttitude))
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.OrgNoSatisfiedReason),
|
|
|
- // x => SqlFunc.JsonField(x.OrgNoSatisfiedReason, "Key") == dto.OrgNoSatisfiedReason)
|
|
|
- .Where(x => x.OrderVisit.VisitState == EVisitState.Visited && x.OrderVisit.IsCanHandle);
|
|
|
- if (_sessionContext.OrgId != null && !_sessionContext.OrgIsCenter)
|
|
|
- {
|
|
|
- query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
- x => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
- x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
- .Where(x => x.VisitTarget == EVisitTarget.Org && x.VisitOrgCode == _sessionContext.OrgId && (
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2"
|
|
|
- ));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
- x => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
|
|
|
- x.OrderVisit.Order.No.Contains(dto.Keyword!))
|
|
|
- .WhereIF(dto.ScreenType == EOrderScreenType.Org, x => 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"
|
|
|
- ))
|
|
|
- .WhereIF(dto.ScreenType == EOrderScreenType.Seat,
|
|
|
- x => x.VisitTarget == EVisitTarget.Seat &&
|
|
|
- (x.SeatEvaluate == ESeatEvaluate.VeryNoSatisfied || x.SeatEvaluate == ESeatEvaluate.NoSatisfied))
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
- var (total, items) = await query
|
|
|
- .OrderByIF(dto is { SortRule: 0, SortField: "order.startTime" }, x => x.OrderVisit.Order.StartTime, OrderByType.Asc)
|
|
|
- .OrderByIF(dto is { SortRule: 1, SortField: "order.startTime" }, x => x.OrderVisit.Order.StartTime, OrderByType.Desc)
|
|
|
- .OrderByIF(dto is { SortRule: 0, SortField: "order.actualHandleTime" }, x => x.OrderVisit.Order.ActualHandleTime, OrderByType.Asc)
|
|
|
- .OrderByIF(dto is { SortRule: 1, SortField: "order.actualHandleTime" }, x => x.OrderVisit.Order.ActualHandleTime, OrderByType.Desc)
|
|
|
- .OrderByIF(dto is { SortRule: 0, SortField: "order.filedTime" }, x => x.OrderVisit.Order.FiledTime, OrderByType.Asc)
|
|
|
- .OrderByIF(dto is { SortRule: 1, SortField: "order.filedTime" }, x => x.OrderVisit.Order.FiledTime, OrderByType.Desc)
|
|
|
- .OrderByIF(dto is { SortRule: 0, SortField: "orderVisit.visitTime" }, x => x.OrderVisit.VisitTime, OrderByType.Asc)
|
|
|
- .OrderByIF(dto is { SortRule: 1, SortField: "orderVisit.visitTime" }, x => x.OrderVisit.VisitTime, OrderByType.Desc)
|
|
|
- .OrderByIF(dto.SortRule is null, x => x.CreationTime, OrderByType.Desc)
|
|
|
- .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ var (total, items) = await _orderApplication.MayScreenList(dto)
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
- /// 工单甄别列表
|
|
|
+ /// 工单甄别待申请列表导出
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- [HttpGet("screen")]
|
|
|
+ [HttpPost("mayscreen/_export")]
|
|
|
+ public async Task<FileStreamResult> ScreenListExport([FromBody] ExportExcelDto<MayScreenListDto> dto)
|
|
|
+ {
|
|
|
+ if (_appOptions.Value.IsYiBin) dto.QueryDto.ScreenType = EOrderScreenType.Org;
|
|
|
+
|
|
|
+ dto.QueryDto.CreationTimeEnd = DateTime.Now;
|
|
|
+ dto.QueryDto.CreationTimeStart = DateTime.Now;
|
|
|
+ if (dto.QueryDto.IsHomePage != null && dto.QueryDto.IsHomePage == true)
|
|
|
+ {
|
|
|
+ // dto.CreationTimeStart = _timeLimitDomainService.CalcWorkTimeReduce(DateTime.Now, 5);
|
|
|
+ dto.QueryDto.CreationTimeStart = await _expireTime.CalcWorkTimeReduce(DateTime.Now, 5);
|
|
|
+ }
|
|
|
+
|
|
|
+ var query = _orderApplication.MayScreenList(dto.QueryDto);
|
|
|
+ List<OrderVisitDetail> data;
|
|
|
+ if (dto.IsExportAll)
|
|
|
+ {
|
|
|
+ data = await query.ToListAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var (_, items) = await query.ToPagedListAsync(dto.QueryDto, HttpContext.RequestAborted);
|
|
|
+ data = items;
|
|
|
+ }
|
|
|
+
|
|
|
+ var dataDtos = _mapper.Map<ICollection<OrderVisitDetailDto>>(data);
|
|
|
+
|
|
|
+ dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
|
|
|
+
|
|
|
+ var dtos = dataDtos
|
|
|
+ .Select(stu => _mapper.Map(stu, typeof(OrderVisitDetailDto), dynamicClass))
|
|
|
+ .Cast<object>()
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var stream = ExcelHelper.CreateStream(dtos);
|
|
|
+
|
|
|
+ return ExcelStreamResult(stream, "工单甄别待申请列表数据");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 工单甄别列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("screen")]
|
|
|
public async Task<PagedDto<OrderScreenListDto>> ScreenList([FromQuery] ScreenListDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderApplication.OrderScreenList(dto)
|
|
@@ -2264,9 +2139,22 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
//return await _workflowApplication.GetStartOptionsAsync(WorkflowModuleConsts.OrderScreen,
|
|
|
// HttpContext.RequestAborted);
|
|
|
-
|
|
|
- return await _workflowApplication.GetStartStepsAsync(WorkflowModuleConsts.OrderScreen,
|
|
|
+ var result = await _workflowApplication.GetStartStepsAsync(WorkflowModuleConsts.OrderScreen,
|
|
|
HttpContext.RequestAborted);
|
|
|
+ if (_sessionContext.OrgIsCenter)
|
|
|
+ {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心初审"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心初审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心班长"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心班长"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2304,6 +2192,13 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (!_sessionContext.OrgIsCenter)
|
|
|
+ {
|
|
|
+ if (result.Steps.Any(x => x.Value == "中心班长"))
|
|
|
+ {
|
|
|
+ result.Steps.Remove(result.Steps.First(x => x.Value == "中心班长"));
|
|
|
+ }
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
@@ -3151,7 +3046,7 @@ public class OrderController : BaseController
|
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
|
|
|
|
List<OrderRemarksDto> remarks = workflow.Steps.Where(x => !string.IsNullOrEmpty(x.Remark)).Select(x => new OrderRemarksDto
|
|
|
- { Remark = x.Remark, RemarkTime = x.CreationTime, RemarkUser = x.CreatorName }).ToList();
|
|
|
+ { Remark = x.Remark, RemarkTime = x.HandleTime, RemarkUser = x.HandlerName }).ToList();
|
|
|
dto.OrderRemarks = remarks;
|
|
|
if (order.Status == EOrderStatus.SendBack || order.Status == EOrderStatus.SendBackAudit || order.Status == EOrderStatus.BackToUnAccept)
|
|
|
{
|
|
@@ -3589,7 +3484,7 @@ public class OrderController : BaseController
|
|
|
var startDto = _mapper.Map<StartWorkflowDto>(dto.Workflow);
|
|
|
startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderHandle;
|
|
|
startDto.Title = order.Title;
|
|
|
- var (workflow,startStep) = await _workflowDomainService.StartAsync(startDto, order.Id, order.ExpiredTime, HttpContext.RequestAborted);
|
|
|
+ var (workflow, startStep) = await _workflowDomainService.StartAsync(startDto, order.Id, order.ExpiredTime, HttpContext.RequestAborted);
|
|
|
|
|
|
await HandleOrderAsync(order, workflow, startStep, dto.Data, dto.Workflow, HttpContext.RequestAborted);
|
|
|
}
|
|
@@ -3599,7 +3494,7 @@ public class OrderController : BaseController
|
|
|
throw new UserFriendlyException($"工单开启流程失败!, {e.Message}, {e.StackTrace}", "工单开启流程失败");
|
|
|
}
|
|
|
|
|
|
- if (_appOptions.Value.IsYiBin && dto.Data.Transpond.HasValue && dto.Data.Transpond.Value)
|
|
|
+ if (_appOptions.Value.IsYiBin && order.Transpond.HasValue && order.Transpond.Value)
|
|
|
{
|
|
|
//开启流程处理事件,处理市州互转
|
|
|
await _publisher.PublishAsync(new OrderStartWorkflowNotify(order.Id), PublishStrategy.ParallelWhenAll,
|
|
@@ -3656,19 +3551,20 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
private async Task HandleOrderAsync(Order order, Workflow workflow, WorkflowStep startStep, OrderHandleFlowDto orderHandleFlowDto,
|
|
|
- BasicWorkflowDto workflowDto,
|
|
|
- CancellationToken cancellationToken)
|
|
|
+ BasicWorkflowDto workflowDto, CancellationToken cancellationToken)
|
|
|
{
|
|
|
+ var isAutoFillSummaryOpinion = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsAutoFillSummaryOpinion).SettingValue[0]);
|
|
|
+
|
|
|
switch (orderHandleFlowDto.OrderAssignMode)
|
|
|
{
|
|
|
case EOrderAssignMode.AdjoinLevel:
|
|
|
var nextDto = _mapper.Map<NextWorkflowDto>(workflowDto);
|
|
|
nextDto.WorkflowId = startStep.WorkflowId;
|
|
|
nextDto.StepId = startStep.Id;
|
|
|
-
|
|
|
- // 宜宾需求: 1.是否是判断节点 2.是否存在历史派单节点 3.存在获取上个派单节点 4.不存在走平均派单
|
|
|
+
|
|
|
if (workflowDto.BusinessType == EBusinessType.Send)
|
|
|
{
|
|
|
+ // 宜宾需求: 1.是否是派单节点 2.是否存在历史派单节点 3.存在获取上个派单节点 4.不存在走平均派单
|
|
|
if (_appOptions.Value.IsYiBin)
|
|
|
{
|
|
|
var sendOrderTraces = workflow.Traces.Where(x => x.BusinessType == EBusinessType.Send);
|
|
@@ -3689,34 +3585,16 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // 平均派单
|
|
|
- var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
|
|
|
- if (averageSendOrder)
|
|
|
- {
|
|
|
- if (!nextDto.NextHandlers.Any())
|
|
|
- {
|
|
|
- var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
|
- nextDto.NextHandlers = new List<FlowStepHandler> { handler };
|
|
|
- }
|
|
|
- }
|
|
|
+ await AverageSendOrderAsync(nextDto, HttpContext.RequestAborted);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- // 平均派单
|
|
|
- var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
|
|
|
- if (averageSendOrder)
|
|
|
- {
|
|
|
- if (!nextDto.NextHandlers.Any())
|
|
|
- {
|
|
|
- var handler = await _orderDomainService.AverageOrder(cancellationToken);
|
|
|
- nextDto.NextHandlers = new List<FlowStepHandler> { handler };
|
|
|
- }
|
|
|
- }
|
|
|
+ await AverageSendOrderAsync(nextDto, HttpContext.RequestAborted);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- await _workflowDomainService.NextAsync(_sessionContext, nextDto, order.ExpiredTime, cancellationToken);
|
|
|
+ await _workflowDomainService.NextAsync(_sessionContext, nextDto, order.ExpiredTime,isAutoFillSummaryOpinion, cancellationToken);
|
|
|
break;
|
|
|
case EOrderAssignMode.CrossLevel:
|
|
|
if (!orderHandleFlowDto.CrossSteps.Any())
|
|
@@ -3746,7 +3624,8 @@ public class OrderController : BaseController
|
|
|
OrgId = unhandleStep.HandlerOrgId,
|
|
|
OrgName = unhandleStep.HandlerOrgName,
|
|
|
};
|
|
|
- var nextSteps = await _workflowDomainService.NextAsync(operater, nextflowDto, order.ExpiredTime, cancellationToken);
|
|
|
+ var nextSteps = await _workflowDomainService.NextAsync(operater, nextflowDto, order.ExpiredTime,
|
|
|
+ isAutoFillSummaryOpinion, cancellationToken);
|
|
|
tempSteps.AddRange(nextSteps);
|
|
|
}
|
|
|
|
|
@@ -3761,6 +3640,20 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private async Task AverageSendOrderAsync(NextWorkflowDto nextDto, CancellationToken cancellationToken)
|
|
|
+ {
|
|
|
+ // 平均派单
|
|
|
+ var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
|
|
|
+ if (averageSendOrder)
|
|
|
+ {
|
|
|
+ if (!nextDto.NextHandlers.Any())
|
|
|
+ {
|
|
|
+ var handler = await _orderDomainService.AverageOrder(cancellationToken);
|
|
|
+ nextDto.NextHandlers = new List<FlowStepHandler> { handler };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 跨级指派查询下一步可选节点及办理对象参数
|
|
|
/// </summary>
|
|
@@ -4018,6 +3911,22 @@ public class OrderController : BaseController
|
|
|
await _orderDomainService.TriggerAverageOrder(HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 批量归档
|
|
|
+ /// </summary>
|
|
|
+ [HttpPost("batch-file")]
|
|
|
+ public async Task BatchFile([FromBody]OrderBatchFileDto dto)
|
|
|
+ {
|
|
|
+ var orders = await _orderRepository.Queryable()
|
|
|
+ .Where(d => dto.OrderIds.Contains(d.Id))
|
|
|
+ .ToListAsync(HttpContext.RequestAborted);
|
|
|
+ foreach (var order in orders)
|
|
|
+ {
|
|
|
+ await _workflowDomainService.JumpToEndAsync(_sessionContext, order.WorkflowId,dto.Opinion,dto.Files,
|
|
|
+ order.ExpiredTime, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 工单待办
|
|
@@ -4029,10 +3938,10 @@ public class OrderController : BaseController
|
|
|
public async Task<PagedDto<OrderDto>> QueryWaited([FromQuery] QueryOrderWaitedDto dto)
|
|
|
{
|
|
|
var isHandledStep = dto.IsHandled.HasValue && dto.IsHandled.Value;
|
|
|
- if (!isHandledStep)
|
|
|
- dto.QueryType = null;
|
|
|
+ if (isHandledStep)
|
|
|
+ dto.QueryType = null;
|
|
|
|
|
|
- var isAdmin = _orderDomainService.IsCheckAdmin();
|
|
|
+ var isAdmin = _orderDomainService.IsCheckAdmin();
|
|
|
var query = _orderRepository
|
|
|
.Queryable(hasHandledStep: isHandledStep, isAdmin: isAdmin)
|
|
|
.Includes(d => d.OrderSpecials);
|
|
@@ -4070,7 +3979,14 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.EndTime.HasValue, d => d.StartTime <= dto.EndTime)
|
|
|
.WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent!.Value)
|
|
|
.WhereIF(dto.Status.HasValue, d => d.Status == dto.Status)
|
|
|
- .OrderByDescending(d => new { d.IsUrgent, d.StartTime })
|
|
|
+ .OrderByDescending(d=> d.IsUrgent)
|
|
|
+ .OrderByIF(string.IsNullOrEmpty(dto.SortField),d => d.StartTime ,OrderByType.Desc)
|
|
|
+ .OrderByIF(dto is { SortField: "creationTime", SortRule:0 },d=> d.CreationTime,OrderByType.Asc) //创建时间升序
|
|
|
+ .OrderByIF(dto is { SortField: "creationTime", SortRule: 1 }, d => d.CreationTime, OrderByType.Desc) //创建时间降序
|
|
|
+ .OrderByIF(dto is { SortField: "startTime", SortRule: 0 }, d => d.StartTime, OrderByType.Asc) //受理时间升序
|
|
|
+ .OrderByIF(dto is { SortField: "startTime", SortRule: 1 }, d => d.StartTime, OrderByType.Desc) //受理时间降序
|
|
|
+ .OrderByIF(dto is { SortField: "expiredTime", SortRule: 0 }, d => d.ExpiredTime, OrderByType.Asc) //期满时间升序
|
|
|
+ .OrderByIF(dto is { SortField: "expiredTime", SortRule: 1 }, d => d.ExpiredTime, OrderByType.Desc) //期满时间降序
|
|
|
.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
@@ -4160,7 +4076,11 @@ public class OrderController : BaseController
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName)
|
|
|
.WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent!.Value)
|
|
|
.OrderBy(d => d.Status)
|
|
|
- .OrderBy(d => d.CreationTime, OrderByType.Desc)
|
|
|
+ .OrderByIF(string.IsNullOrEmpty(dto.SortField),d => d.CreationTime, OrderByType.Desc)
|
|
|
+ .OrderByIF(dto is { SortField: "startTime", SortRule: 0 }, d => d.StartTime, OrderByType.Asc) //受理时间升序
|
|
|
+ .OrderByIF(dto is { SortField: "startTime", SortRule: 1 }, d => d.StartTime, OrderByType.Desc) //受理时间降序
|
|
|
+ .OrderByIF(dto is { SortField: "expiredTime", SortRule: 0 }, d => d.ExpiredTime, OrderByType.Asc) //期满时间升序
|
|
|
+ .OrderByIF(dto is { SortField: "expiredTime", SortRule: 1 }, d => d.ExpiredTime, OrderByType.Desc) //期满时间降序
|
|
|
.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
@@ -4877,27 +4797,28 @@ public class OrderController : BaseController
|
|
|
|
|
|
if (dto.FlowDirection is EFlowDirection.OrgToOrg)
|
|
|
{
|
|
|
- expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
- }
|
|
|
- else {
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- if (dto.FlowDirection != null)
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
+ expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ if (dto.FlowDirection != null)
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
var processType = dto.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
|
? EProcessType.Zhiban
|
|
@@ -4913,13 +4834,13 @@ public class OrderController : BaseController
|
|
|
// ETimeType.WorkDay,
|
|
|
// dto.TimeLimit.Value, order.AcceptTypeCode);
|
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order()
|
|
|
- {
|
|
|
- ExpiredTime = expiredTime.ExpiredTime,
|
|
|
- NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
- NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
- ProcessType = processType,
|
|
|
- Status = EOrderStatus.Special
|
|
|
- })
|
|
|
+ {
|
|
|
+ ExpiredTime = expiredTime.ExpiredTime,
|
|
|
+ NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
+ NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
+ ProcessType = processType,
|
|
|
+ Status = EOrderStatus.Special
|
|
|
+ })
|
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
@@ -5075,11 +4996,11 @@ public class OrderController : BaseController
|
|
|
|
|
|
endTime = expiredTime.EndTime;
|
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order()
|
|
|
- {
|
|
|
- ExpiredTime = expiredTime.EndTime,
|
|
|
- NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
- NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne
|
|
|
- })
|
|
|
+ {
|
|
|
+ ExpiredTime = expiredTime.EndTime,
|
|
|
+ NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
+ NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne
|
|
|
+ })
|
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
@@ -5171,50 +5092,50 @@ public class OrderController : BaseController
|
|
|
HandlerType = special.HandlerType.Value,
|
|
|
BusinessType = special.BusinessType.Value
|
|
|
};
|
|
|
- ExpiredTimeWithConfig? expiredTime = new ExpiredTimeWithConfig();
|
|
|
+ ExpiredTimeWithConfig? expiredTime = new ExpiredTimeWithConfig();
|
|
|
|
|
|
- if (dto.FlowDirection is EFlowDirection.OrgToOrg)
|
|
|
- {
|
|
|
- expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- if (dto.FlowDirection != null)
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
- if (expiredTime.ExpiredTime < order.ExpiredTime)
|
|
|
- {
|
|
|
- expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
- }
|
|
|
+ if (dto.FlowDirection is EFlowDirection.OrgToOrg)
|
|
|
+ {
|
|
|
+ expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ if (dto.FlowDirection != null)
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (expiredTime.ExpiredTime < order.ExpiredTime)
|
|
|
+ {
|
|
|
+ expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
+ }
|
|
|
|
|
|
- var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
|
+ var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
|
? EProcessType.Zhiban
|
|
|
: EProcessType.Jiaoban;
|
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order()
|
|
|
- {
|
|
|
- ExpiredTime = expiredTime.ExpiredTime,
|
|
|
- NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
- NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
- ProcessType = processType,
|
|
|
- Status = EOrderStatus.Special
|
|
|
- })
|
|
|
+ {
|
|
|
+ ExpiredTime = expiredTime.ExpiredTime,
|
|
|
+ NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
+ NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
+ ProcessType = processType,
|
|
|
+ Status = EOrderStatus.Special
|
|
|
+ })
|
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
@@ -5306,49 +5227,49 @@ public class OrderController : BaseController
|
|
|
HandlerType = special.HandlerType.Value,
|
|
|
BusinessType = special.BusinessType.Value
|
|
|
};
|
|
|
- ExpiredTimeWithConfig? expiredTime = new ExpiredTimeWithConfig();
|
|
|
+ ExpiredTimeWithConfig? expiredTime = new ExpiredTimeWithConfig();
|
|
|
|
|
|
- if (dto.FlowDirection is EFlowDirection.OrgToOrg)
|
|
|
- {
|
|
|
- expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
- {
|
|
|
- if (dto.FlowDirection != null)
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
- }
|
|
|
- }
|
|
|
- if (expiredTime.ExpiredTime < order.ExpiredTime)
|
|
|
- {
|
|
|
- expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
- expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
- }
|
|
|
- var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
|
+ if (dto.FlowDirection is EFlowDirection.OrgToOrg)
|
|
|
+ {
|
|
|
+ expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ if (dto.FlowDirection != null)
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcExpiredTime(DateTime.Now, dto.FlowDirection.Value, order.Adapt<OrderTimeClacInfo>());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ expiredTime = await _expireTime.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (expiredTime.ExpiredTime < order.ExpiredTime)
|
|
|
+ {
|
|
|
+ expiredTime.ExpiredTime = order.ExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTime = order.NearlyExpiredTime.Value;
|
|
|
+ expiredTime.NearlyExpiredTimeOne = order.NearlyExpiredTimeOne.Value;
|
|
|
+ }
|
|
|
+ var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
|
? EProcessType.Zhiban
|
|
|
: EProcessType.Jiaoban;
|
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order()
|
|
|
- {
|
|
|
- ExpiredTime = expiredTime.ExpiredTime,
|
|
|
- NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
- NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
- ProcessType = processType,
|
|
|
- Status = EOrderStatus.Special
|
|
|
- })
|
|
|
+ {
|
|
|
+ ExpiredTime = expiredTime.ExpiredTime,
|
|
|
+ NearlyExpiredTime = expiredTime.NearlyExpiredTime,
|
|
|
+ NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne,
|
|
|
+ ProcessType = processType,
|
|
|
+ Status = EOrderStatus.Special
|
|
|
+ })
|
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
@@ -5491,7 +5412,7 @@ public class OrderController : BaseController
|
|
|
d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
|
|
|
//.WhereIF(!string.IsNullOrEmpty(dto.Content), d => d.Content.Contains(dto.Content!))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType) //受理类型
|
|
|
- //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
|
|
|
+ //.WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptTypeCode)) //受理类型
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel) //来源渠道
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Hotspot), d => d.HotspotSpliceName != null && d.HotspotSpliceName.Contains(dto.Hotspot))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.TransferPhone), d => d.TransferPhone.Contains(dto.TransferPhone!))
|
|
@@ -6286,7 +6207,8 @@ public class OrderController : BaseController
|
|
|
[HttpGet("order/about_expire/list")]
|
|
|
public async Task<PagedDto<OrderDto>> AboutList([FromQuery] AboutToExpireListDto dto)
|
|
|
{
|
|
|
- var (total, items) = await _orderApplication.GetAboutToExpireAsync(dto).ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ var (total, items) = await _orderApplication.GetAboutToExpireAsync(dto)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
}
|
|
|
|
|
@@ -6338,7 +6260,8 @@ public class OrderController : BaseController
|
|
|
[HttpGet("order/expire/list")]
|
|
|
public async Task<PagedDto<OrderDto>> ExpireList([FromQuery] AboutToExpireListDto dto)
|
|
|
{
|
|
|
- var (total, items) = await _orderApplication.GetToExpireAsync(dto).ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
+ var (total, items) = await _orderApplication.GetToExpireAsync(dto)
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
|
}
|
|
|
|
|
@@ -7228,7 +7151,7 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
await _orderRepository.Updateable()
|
|
|
.SetColumns(o => new Orders.Order()
|
|
|
- { SignerId = dto.Handler.UserId, SignerName = dto.Handler.Username, Status = EOrderStatus.HandOverToUnAccept })
|
|
|
+ { SignerId = dto.Handler.UserId, SignerName = dto.Handler.Username, Status = EOrderStatus.HandOverToUnAccept })
|
|
|
.Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
}
|
|
|
else
|