|
@@ -26,6 +26,8 @@ using System.Runtime.InteropServices;
|
|
|
using Lucene.Net.Util;
|
|
|
using NPOI.Util;
|
|
|
using XF.Domain.Entities;
|
|
|
+using Hotline.SeedData;
|
|
|
+using Hotline.Authentications;
|
|
|
|
|
|
namespace Hotline.Api.Controllers
|
|
|
{
|
|
@@ -590,5 +592,35 @@ namespace Hotline.Api.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 省件退回中心弹窗提示 type 0 工单坐席待办 1 工单待办
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("home_province_sendback")]
|
|
|
+ public async Task<object> GetProvinceSendBack() {
|
|
|
+
|
|
|
+ if (_sessionContext.RequiredOrgId == OrgSeedData.CenterId)
|
|
|
+ {
|
|
|
+ var msg = "工单编码为{0}的工单,已被退回,请及时处理!";
|
|
|
+ var orders = await _orderSendBackAuditRepository.Queryable().Includes(x => x.Order)
|
|
|
+ .Where(x => x.Order.IsProvince)
|
|
|
+ .Where(x => x.ApplyOrgId.Length == 6 && x.SendBackOrgId == OrgSeedData.CenterId && x.State == ESendBackAuditState.End)
|
|
|
+ .Where(x => SqlFunc.Subqueryable<WorkflowStep>()
|
|
|
+ .Where(step => step.ExternalId == x.OrderId && (
|
|
|
+ (step.FlowAssignType == EFlowAssignType.User && step.HandlerId == _sessionContext.RequiredUserId)
|
|
|
+ || (step.FlowAssignType == EFlowAssignType.Role && _sessionContext.Roles.Contains(step.RoleId))
|
|
|
+ )).Any()
|
|
|
+ ).ToListAsync();
|
|
|
+ if (orders != null && orders.Any())
|
|
|
+ {
|
|
|
+ var order = orders.FirstOrDefault();
|
|
|
+ msg = string.Format(msg, order.Order.No);
|
|
|
+ var type = order.Order.Status < EOrderStatus.Handling ? 0 : 1;
|
|
|
+ return new { count = orders.Count, msg = msg, type = type };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new { count = 0, msg = string.Empty, type = -1 };
|
|
|
+ }
|
|
|
}
|
|
|
}
|