|
@@ -1860,7 +1860,7 @@ public class OrderController : BaseController
|
|
|
[HttpGet("urge")]
|
|
|
public async Task<PagedDto<UrgeOrderDto>> UrgeList([FromQuery] UrgeListDto dto)
|
|
|
{
|
|
|
- var (total, items) = await _orderUrgeRepository.Queryable()
|
|
|
+ var (total, items) = await _orderUrgeRepository.Queryable(permissionVerify:true)
|
|
|
.Includes(x => x.Order)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
|
|
|
d => d.Order.Title.Contains(dto.Keyword!) || d.Order.No.Contains(dto.Keyword!))
|
|
@@ -2046,7 +2046,7 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.Channels.Any(), d => dto.Channels.Contains(d.SourceChannelCode)) //来源渠道
|
|
|
.WhereIF(dto.HotspotIds.Any(), d => dto.HotspotIds.Contains(d.HotspotId)) //热点类型
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.TransferPhone), d => d.TransferPhone.Contains(dto.TransferPhone!)) //转接号码
|
|
|
- //.WhereIF(dto.OrgCodes.Any(), d => d.Workflow.Assigns.Any(s => dto.OrgCodes.Contains(s.OrgCode)))
|
|
|
+ //.WhereIF(dto.OrgCodes.Any(), d => d.Workflow.Assigns.Any(s => dto.OrgCodes.Contains(s.OrgCode)))
|
|
|
.WhereIF(dto.OrgCodes.Any(), d => dto.OrgCodes.Contains(d.ActualHandleOrgCode)) //接办部门
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.NameOrNo), d => d.AcceptorName.Contains(dto.NameOrNo!) || d.AcceptorStaffNo.Contains(dto.NameOrNo!)) //受理人/坐席
|
|
|
.WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart) //受理时间开始
|
|
@@ -2070,6 +2070,8 @@ public class OrderController : BaseController
|
|
|
.WhereIF(dto.IdentityType != null, d => d.IdentityType == dto.IdentityType) //来电主体
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.FromName), d => d.FromName.Contains(dto.FromName)) //来电人姓名
|
|
|
.WhereIF(dto.AreaCodes.Any(), d => dto.AreaCodes.Contains(d.AreaCode)) //区域
|
|
|
+ .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true,x=>x.IsProvince == true)
|
|
|
+ .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false,x=>x.IsProvince == false)
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
@@ -2758,6 +2760,49 @@ public class OrderController : BaseController
|
|
|
return new PagedDto<OrderSendBackDto>(total, _mapper.Map<IReadOnlyList<OrderSendBackDto>>(items));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 批量省工单退回
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("send_back/batch")]
|
|
|
+ public async Task<object> BatchApplyUrge([FromBody]List<OrderSendBackAddDto> dto)
|
|
|
+ {
|
|
|
+ int count = dto.Count;
|
|
|
+ int successCount = 0;
|
|
|
+ int errorCount = 0;
|
|
|
+ foreach (var item in dto)
|
|
|
+ {
|
|
|
+ //验证工单是否可以申请
|
|
|
+ var order = await _orderRepository.GetAsync(item.OrderId, HttpContext.RequestAborted);
|
|
|
+ if (order is null)
|
|
|
+ {
|
|
|
+ errorCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (order.Status > EOrderStatus.BackToUnAccept)
|
|
|
+ {
|
|
|
+ errorCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (order.Source <= ESource.HotlineImport)
|
|
|
+ {
|
|
|
+ errorCount++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ var model = _mapper.Map<OrderSendBack>(item);
|
|
|
+ await _orderSendBackRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
+ if (!string.IsNullOrEmpty(model.Id))
|
|
|
+ {
|
|
|
+ order.Status = EOrderStatus.BackToProvince;
|
|
|
+ await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
+ successCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new { Count = count, ErrorCount = errorCount, SuccessCount = successCount };
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 退回申请
|
|
|
/// </summary>
|
|
@@ -2772,9 +2817,9 @@ public class OrderController : BaseController
|
|
|
var order = await _orderRepository.GetAsync(dto.OrderId, HttpContext.RequestAborted);
|
|
|
if (order is null)
|
|
|
throw UserFriendlyException.SameMessage("无效工单");
|
|
|
- if ((int)order.Status > 1)
|
|
|
+ if (order.Status > EOrderStatus.BackToUnAccept)
|
|
|
throw UserFriendlyException.SameMessage("工单状态无效,请确认当前工单状态");
|
|
|
- if ((int)order.Source <= 1)
|
|
|
+ if (order.Source <= ESource.HotlineImport)
|
|
|
throw UserFriendlyException.SameMessage("工单来源无效,请确认当前工单来源");
|
|
|
var model = _mapper.Map<OrderSendBack>(dto);
|
|
|
model.InitId();
|
|
@@ -2784,7 +2829,6 @@ public class OrderController : BaseController
|
|
|
|
|
|
if (!string.IsNullOrEmpty(model.Id))
|
|
|
{
|
|
|
- order = await _orderRepository.GetAsync(dto.OrderId, HttpContext.RequestAborted);
|
|
|
order.Status = EOrderStatus.BackToProvince;
|
|
|
await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
|
}
|