Ver código fonte

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

xf 5 dias atrás
pai
commit
fac7eb37d2

+ 24 - 2
src/Hotline.Api/Controllers/CallNativeContrroller.cs

@@ -121,7 +121,7 @@ namespace Hotline.Api.Controllers
                 throw UserFriendlyException.SameMessage("电话号码不能为空!");
 
             if (dto.ValidDateTime.HasValue == false)
-                throw UserFriendlyException.SameMessage("有效期不能为空!");
+                dto.ValidDateTime = Convert.ToDateTime("2099-01-01 23:59:59");
 
             var isEx = await _db.Queryable<XingtangBlackPhone>().Where(p => p.StartPhone == dto.PhoneNum).AnyAsync();
             if (isEx)
@@ -164,6 +164,13 @@ namespace Hotline.Api.Controllers
         {
             var (total, items) = await _db.Queryable<XingtangWhitePhone>()
                 .WhereIF(!string.IsNullOrEmpty(dto.Keyword), p => p.Phone.Contains(dto.Keyword))
+                .Select(p => new WhitePhoneListDto
+                {
+                    Id = p.Id,
+                    StartPhone = p.Phone,
+                    ValidDateTime = p.ValidDateTime,
+                    Enabled = p.Enabled
+                })
                 .ToPagedListAsync(dto, HttpContext.RequestAborted);
 
             return new PagedDto<WhitePhoneListDto>(total, _mapper.Map<IReadOnlyList<WhitePhoneListDto>>(items));
@@ -204,7 +211,7 @@ namespace Hotline.Api.Controllers
                 throw UserFriendlyException.SameMessage("电话号码不能为空!");
 
             if (dto.ValidDateTime.HasValue == false)
-                throw UserFriendlyException.SameMessage("有效期不能为空!");
+                dto.ValidDateTime = Convert.ToDateTime("2099-01-01 23:59:59");
 
             var isEx = await _db.Queryable<XingtangWhitePhone>().Where(p => p.Phone == dto.PhoneNum).AnyAsync();
             if (isEx)
@@ -251,6 +258,21 @@ namespace Hotline.Api.Controllers
                 .ToPagedListAsync(dto, HttpContext.RequestAborted);
             return new PagedDto<WhiteBlackLog>(total, items);
         }
+
+        /// <summary>
+        /// 验证号码是否是白名单
+        /// </summary>
+        /// <param name="phone"></param>
+        /// <returns></returns>
+        [HttpGet("verify-white-list/{phone}")]
+        public async Task<bool> VerifyWhiteList(string phone)
+        {
+            var isEx = await _db.Queryable<XingtangWhitePhone>().Where(p => p.Phone == phone && p.ValidDateTime <= DateTime.Now).AnyAsync();
+            if (isEx)
+                return true;
+            else
+                return false;
+        }
         #endregion
     }
 }

+ 1 - 1
src/Hotline.Api/Controllers/KnowledgeCommonController.cs

@@ -158,7 +158,7 @@ namespace Hotline.Api.Controllers
                      KnowledgeNum = SqlFunc.Subqueryable<Knowledge>()
                          .InnerJoin<KnowledgeRelationType>((k, krt) => k.Id == krt.KnowledgeId)
                          .InnerJoin<KnowledgeType>((k, krt, t) => krt.KnowledgeTypeId == t.Id)
-                         .Where((k, krt, t) => t.SpliceName.StartsWith(x.SpliceName))
+                         .Where((k, krt, t) => t.SpliceName.StartsWith(x.SpliceName) &&  k.IsDeleted == false && t.IsDeleted == false)
                          .WhereIF(!string.IsNullOrEmpty(attribution) && !isCenter, (k, krt, t) => k.Attribution == attribution)
                          .WhereIF(status != null, k => k.Status == status)
                          .DistinctCount(k => k.Id)

+ 59 - 57
src/Hotline.Api/Controllers/OrderController.cs

@@ -2902,55 +2902,56 @@ public class OrderController : BaseController
         return rsp;
     }
 
-	/// <summary>
-	/// 自动延期写入
-	/// </summary>
-	/// <returns></returns>
-	[HttpPost("delay/automatic")]
-	[AllowAnonymous]
-	public async Task OrderDelayAutomatic() {
+    /// <summary>
+    /// 自动延期写入
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("delay/automatic")]
+    [AllowAnonymous]
+    public async Task OrderDelayAutomatic()
+    {
 
         await _orderApplication.OrderDelayAutomatic();
 
-		await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Automatic);
-
-		await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Sms);
-	}
-
-	///// <summary>
-	///// 延期短信执行
-	///// </summary>
-	///// <param name="type"></param>
-	///// <returns></returns>
-	//[HttpPost("delay/automatic/handle/sms")]
-	//[AllowAnonymous]
-	//public async Task OrderDelayAutomaticHandleSms()
-	//{
-	//	await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Sms);
-	//}
-	///// <summary>
-	///// 自动延期执行
-	///// </summary>
-	///// <param name="type"></param>
-	///// <returns></returns>
-	//[HttpPost("delay/automatic/handle")]
-	//[AllowAnonymous]
-	//public async Task OrderDelayAutomaticHandleAutomatic()
-	//{
-	//	await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Automatic);
-	//}
-
-
-	#endregion
-
-	#region 工单甄别
-
-	/// <summary>
-	/// 工单甄别待申请列表
-	/// </summary>
-	/// <param name="dto"></param>
-	/// <returns></returns>
-	[HttpGet("mayscreen")]
+        await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Automatic);
+
+        await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Sms);
+    }
+
+    ///// <summary>
+    ///// 延期短信执行
+    ///// </summary>
+    ///// <param name="type"></param>
+    ///// <returns></returns>
+    //[HttpPost("delay/automatic/handle/sms")]
+    //[AllowAnonymous]
+    //public async Task OrderDelayAutomaticHandleSms()
+    //{
+    //	await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Sms);
+    //}
+    ///// <summary>
+    ///// 自动延期执行
+    ///// </summary>
+    ///// <param name="type"></param>
+    ///// <returns></returns>
+    //[HttpPost("delay/automatic/handle")]
+    //[AllowAnonymous]
+    //public async Task OrderDelayAutomaticHandleAutomatic()
+    //{
+    //	await _orderApplication.OrderDelayAutomaticHandle(EOrderDelayAutomaticType.Automatic);
+    //}
+
+
+    #endregion
+
+    #region 工单甄别
+
+    /// <summary>
+    /// 工单甄别待申请列表
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    [HttpGet("mayscreen")]
     public async Task<PagedDto<OrderVisitDetailDto>> MayScreenList([FromQuery] MayScreenListDto dto)
     {
         if (_appOptions.Value.IsYiBin) dto.ScreenType = EOrderScreenType.Org;
@@ -3659,8 +3660,8 @@ public class OrderController : BaseController
             .Includes(x => x.Order)
             .WhereIF(!string.IsNullOrEmpty(dto.Keyword), x => x.Order.Title.Contains(dto.Keyword!) || x.Order.No.Contains(dto.Keyword!))
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No))                                //工单编号
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, x => x.Order.IsProvince == true)   //是否省工单
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false, x => x.Order.IsProvince == false)
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.IsProvince == true)   //是否省工单
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == false, x => x.Order.IsProvince == false)
             .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title))                       //工单标题
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.Order.SourceChannelCode == dto.Channel)              //来源渠道
             .WhereIF(dto.Status.HasValue, x => x.Order.Status == dto.Status)                                         //工单状态
@@ -4063,8 +4064,8 @@ public class OrderController : BaseController
             .WhereIF(!string.IsNullOrEmpty(dto.OrgLevelOneName), x => x.Order.OrgLevelOneName.Contains(dto.OrgLevelOneName)) //一级部门
             .WhereIF(!string.IsNullOrEmpty(dto.CurrentStepCode), x => x.Order.CurrentStepCode == dto.CurrentStepCode) //当前办理节点
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No))                                //工单编号
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, x => x.Order.IsProvince == true)   //是否省工单
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false, x => x.Order.IsProvince == false)
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.IsProvince == true)   //是否省工单
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == false, x => x.Order.IsProvince == false)
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.Order.SourceChannelCode == dto.Channel)              //来源渠道
             .WhereIF(dto.ExpiredTimeStart.HasValue, x => x.Order.ExpiredTime >= dto.ExpiredTimeStart)                //期满时间Start
             .WhereIF(dto.ExpiredTimeEnd.HasValue, x => x.Order.ExpiredTime <= dto.ExpiredTimeEnd)                    //期满时间End
@@ -4072,7 +4073,7 @@ public class OrderController : BaseController
             .WhereIF(dto.CreationTimeEnd.HasValue, x => x.Order.CreationTime <= dto.CreationTimeEnd)                 //受理时间End
             .WhereIF(dto.Status.HasValue, x => x.Order.Status == dto.Status)                                         //工单状态
             .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title))                       //工单标题
-            .WhereIF(!string.IsNullOrEmpty(dto.CurrentHandleOrgName), x => x.Order.CurrentHandleOrgName.Contains(dto.CurrentHandleOrgName)) //接办部门
+            .WhereIF(!string.IsNullOrEmpty(dto.CurrentHandleOrgName), x => x.Order.ActualHandleOrgName.Contains(dto.CurrentHandleOrgName)) //接办部门
             .WhereIF(dto.CurrentHandleTimeStart.HasValue, x => x.Order.CurrentHandleTime >= dto.CurrentHandleTimeStart)//接办时间Start
             .WhereIF(dto.CurrentHandleTimeEnd.HasValue, x => x.Order.CurrentHandleTime <= dto.CurrentHandleTimeEnd)    //接办时间End
             .WhereIF(!string.IsNullOrEmpty(dto.Hotspot), x => x.Order.HotspotSpliceName != null && x.Order.HotspotSpliceName.Contains(dto.Hotspot)) //热点
@@ -4104,8 +4105,8 @@ public class OrderController : BaseController
             .WhereIF(dto.UrgeState > -1, x => x.State == dto.UrgeState)
             .WhereIF(_sessionContext.OrgIsCenter == false, x => x.OrgId.StartsWith(_sessionContext.OrgId))
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No))                                //工单编号
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, x => x.Order.IsProvince == true)   //是否省工单
-            .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false, x => x.Order.IsProvince == false)
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.IsProvince == true)   //是否省工单
+            .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == false, x => x.Order.IsProvince == false)
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.Order.SourceChannelCode == dto.Channel)              //来源渠道
             .WhereIF(dto.ExpiredTimeStart.HasValue, x => x.Order.ExpiredTime >= dto.ExpiredTimeStart)                //期满时间Start
             .WhereIF(dto.ExpiredTimeEnd.HasValue, x => x.Order.ExpiredTime <= dto.ExpiredTimeEnd)                    //期满时间End
@@ -4113,7 +4114,7 @@ public class OrderController : BaseController
             .WhereIF(dto.CreationTimeEnd.HasValue, x => x.Order.CreationTime <= dto.CreationTimeEnd)                 //受理时间End
             .WhereIF(dto.Status.HasValue, x => x.Order.Status == dto.Status)                                         //工单状态
             .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title))                       //工单标题
-            .WhereIF(!string.IsNullOrEmpty(dto.CurrentHandleOrgName), x => x.Order.CurrentHandleOrgName.Contains(dto.CurrentHandleOrgName)) //接办部门
+            .WhereIF(!string.IsNullOrEmpty(dto.CurrentHandleOrgName), x => x.Order.ActualHandleOrgName.Contains(dto.CurrentHandleOrgName)) //接办部门
             .WhereIF(dto.CurrentHandleTimeStart.HasValue, x => x.Order.CurrentHandleTime >= dto.CurrentHandleTimeStart)//接办时间Start
             .WhereIF(dto.CurrentHandleTimeEnd.HasValue, x => x.Order.CurrentHandleTime <= dto.CurrentHandleTimeEnd)    //接办时间End
             .WhereIF(!string.IsNullOrEmpty(dto.Hotspot), x => x.Order.HotspotSpliceName != null && x.Order.HotspotSpliceName.Contains(dto.Hotspot)) //热点
@@ -4123,7 +4124,7 @@ public class OrderController : BaseController
             .WhereIF(dto.CrTimeStart.HasValue, x => x.CreationTime >= dto.CrTimeStart)                               //催办时间Start
             .WhereIF(dto.CrTimeEnd.HasValue, x => x.CreationTime <= dto.CrTimeEnd)                                   //催办时间End
             .WhereIF(!string.IsNullOrEmpty(dto.OrgName), x => x.OrgName.Contains(dto.OrgName))                       //催办部门
-            .WhereIF(!string.IsNullOrEmpty(dto.CurrentStepCode), x => x.Order.CurrentStepCode == dto.CurrentStepCode) //当前办理节点
+            .WhereIF(!string.IsNullOrEmpty(dto.CurrentStepName), x => x.Order.CurrentStepName == dto.CurrentStepName) //当前办理节点
             .WhereIF(dto.CrState.HasValue, x => x.State == dto.CrState)
             .OrderByDescending(x => x.CreationTime)
             .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
@@ -4990,7 +4991,8 @@ public class OrderController : BaseController
             await _orderSnapshotRepository.Queryable()
                 .LeftJoin<IndustryCase>((snapshot, industryCase) => snapshot.IndustryCase == industryCase.Id)
                 .Where((snapshot, industryCase) => snapshot.Id == order.Id)
-                .Select((snapshot, industryCase) => new {
+                .Select((snapshot, industryCase) => new
+                {
                     snapshot.IndustryId,
                     snapshot.IndustryName,
                     industryCase.Name,
@@ -9337,7 +9339,7 @@ public class OrderController : BaseController
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No))                                //工单编号
             .WhereIF(dto.Status.HasValue, x => x.Order.Status == dto.Status)                                         //工单状态
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.Order.SourceChannelCode == dto.Channel)              //来源渠道
-            .WhereIF(!string.IsNullOrEmpty(dto.CurrentStepCode), x => x.Order.CurrentStepCode.Contains(dto.CurrentStepCode)) //当前节点
+            .WhereIF(!string.IsNullOrEmpty(dto.CurrentStepName), x => x.Order.CurrentStepName.Contains(dto.CurrentStepName)) //当前节点
             .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title))                       //工单标题
             .WhereIF(dto.CreationTimeStart.HasValue, x => x.Order.CreationTime >= dto.CreationTimeStart)             //受理时间Start
             .WhereIF(dto.CreationTimeEnd.HasValue, x => x.Order.CreationTime <= dto.CreationTimeEnd)                 //受理时间End

+ 2 - 2
src/Hotline.Application/OrderApp/OrderApplication.cs

@@ -6482,8 +6482,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
                 .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Order.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
                 .WhereIF(dto.IsApply == false, d => d.DelayState == EDelayState.Examining)
                 .WhereIF(!string.IsNullOrEmpty(dto.No), d => d.Order.No.Contains(dto.No))                                   //工单编号
-                .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, d => d.Order.IsProvince == true)      //是否省工单
-                .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false, d => d.Order.IsProvince == false)
+                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, d => d.Order.IsProvince == true)      //是否省工单
+                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == false, d => d.Order.IsProvince == false)
                 .WhereIF(!string.IsNullOrEmpty(dto.Title), d => d.Order.Title.Contains(dto.Title))                          //工单标题
                 .WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.Order.SourceChannelCode == dto.Channel)                 //来源渠道
                 .WhereIF(dto.CreationTimeStart.HasValue, d => d.Order.CreationTime >= dto.CreationTimeStart)                //受理时间Start

+ 3 - 2
src/Hotline.Application/OrderApp/OrderSendBackAuditApplication.cs

@@ -23,12 +23,13 @@ namespace Hotline.Application.OrderApp
         {
             return _orderSendBackAuditRepository.Queryable()
                 .Includes(x => x.Order)
+                .Includes(x => x.SendBackData)
                 .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
                     x => x.Order.Title.Contains(dto.Keyword!) || x.Order.No.Contains(dto.Keyword!))
                 .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Order.Title.Contains(dto.Title!))
                 .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.Order.No.Contains(dto.No!))
-                .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == true, x => x.Order.IsProvince == true)
-                .WhereIF(dto.IsProvinceOrder.HasValue && dto.IsProvinceOrder == false, x => x.Order.IsProvince == false)
+                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, x => x.Order.IsProvince == true)
+                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == false, x => x.Order.IsProvince == false)
                 .WhereIF(!string.IsNullOrEmpty(dto.Channel), x => x.Order.SourceChannelCode == dto.Channel)    //来源渠道
                 .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), x => x.Order.AcceptTypeCode == dto.AcceptTypeCode)
                 .WhereIF(!string.IsNullOrEmpty(dto.Hotspot), x => x.Order.HotspotSpliceName != null && x.Order.HotspotSpliceName.Contains(dto.Hotspot)) //热点

+ 1 - 1
src/Hotline.Share/Dtos/CallNative/BlackPhoneListDto.cs

@@ -69,7 +69,7 @@ namespace Hotline.Share.Dtos.CallNative
         /// <summary>
         /// 号码
         /// </summary>
-        public string? Phone { get; set; }
+        public string? StartPhone { get; set; }
 
         /// <summary>
         /// 有效期

+ 1 - 1
src/Hotline.Share/Dtos/Order/OrderFinalityDto.cs

@@ -65,7 +65,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 当前节点
         /// </summary>
-        public string? CurrentStepCode { get; set; }
+        public string? CurrentStepName { get; set; }
 
         /// <summary>
         /// 标题

+ 4 - 4
src/Hotline.Share/Dtos/Order/QueryOrderDto.cs

@@ -634,7 +634,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 省工单
         /// </summary>
-        public bool? IsProvinceOrder { get; set; }
+        public bool? IsProvince { get; set; }
 
         /// <summary>
         /// 工单标题
@@ -759,7 +759,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 省工单
         /// </summary>
-        public bool? IsProvinceOrder { get; set; }
+        public bool? IsProvince { get; set; }
 
         /// <summary>
         /// 工单标题
@@ -1183,7 +1183,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 当前办理节点
         /// </summary>
-        public string? CurrentStepCode { get; set; }
+        public string? CurrentStepName { get; set; }
 
 
         /// <summary>
@@ -1194,7 +1194,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 省工单
         /// </summary>
-        public bool? IsProvinceOrder { get; set; }
+        public bool? IsProvince { get; set; }
 
         /// <summary>
         /// 来源渠道

+ 1 - 1
src/Hotline.Share/Dtos/Order/SendBackDto.cs

@@ -219,7 +219,7 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 是否省工单
         /// </summary>
-        public bool? IsProvinceOrder { get; set; }
+        public bool? IsProvince { get; set; }
 
         /// <summary>
         /// 来源渠道

+ 1 - 1
src/Hotline.Share/Dtos/Order/SendOrderReportOutDto.cs

@@ -31,5 +31,5 @@ public class SendOrderReportOutDto
 
 	public string StepName { get; set; }
 
-    public string RoldName => string.IsNullOrEmpty(StepName) ? "" : StepName == "派单组" ? "派单员" : "中心班长";
+    public string RoleName => string.IsNullOrEmpty(StepName) ? "" : StepName == "派单组" ? "派单员" : "中心班长";
 }