田爽 1 year ago
parent
commit
ce98cdaa6d

+ 121 - 18
src/Hotline.Api/Controllers/OrderController.cs

@@ -492,7 +492,6 @@ public class OrderController : BaseController
                 //推省上
                 _capPublisher.Publish(EventNames.HotlineOrderVisited, new PublishVisitDto() { Order = orderDto, No = visit.No, VisitType = visit.VisitType, VisitName = visit.CreatorName, VisitTime = visit.VisitTime, VisitRemark = first.VisitContent, AreaCode = visit.Order.AreaCode!, SubjectResultSatifyCode = first.OrgProcessingResults.Id, FirstSatisfactionCode = visit.Order.FirstVisitResultCode!, ClientGuid = "" });
             }
-
             if (first != null)
             {
                 //写入质检
@@ -840,9 +839,29 @@ public class OrderController : BaseController
         catch (Exception e)
         {
             await _orderScreenRepository.RemoveAsync(id);
-            throw new UserFriendlyException($"工单开启甄别流程失败!, {e.Message}", "工单开启甄别流程失败");
+            id = string.Empty;
+			throw new UserFriendlyException($"工单开启甄别流程失败!, {e.Message}", "工单开启甄别流程失败");
         }
-    }
+        if (!string.IsNullOrEmpty(id))
+        {
+            var order = await _orderRepository.GetAsync(x => x.Id == dto.Data.OrderId);
+            if (order != null)
+            {
+                var orderDto = _mapper.Map<OrderDto>(order);
+                //推省上
+                _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto() {
+                    Order = orderDto,
+                    No = orderDto.No,
+                    CreatorName =_sessionContext.UserName,
+                    TypeDicName = model.TypeDicName,
+                    Content = model.Content,
+                    ApplyEndTime = model.ApplyEndTime,
+                    AreaCode = orderDto.AreaCode!,
+					ClientGuid = ""
+                });
+			}
+        }
+	}
 
     /// <summary>
     /// 查询工单甄别流程开启参数
@@ -942,7 +961,28 @@ public class OrderController : BaseController
         {
 	        //TODO 发送短信
         }
-        return id;
+        //推省上
+		//if (!string.IsNullOrEmpty(id))
+  //      {
+	 //       var order = await _orderRepository.GetAsync(x => x.Id == dto.Data.OrderId);
+	 //       if (order != null)
+	 //       {
+		//        var orderDto = _mapper.Map<OrderDto>(order);
+		        
+		//        _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+		//        {
+		//	        Order = orderDto,
+		//	        No = orderDto.No,
+		//	        CreatorName = _sessionContext.UserName,
+		//	        TypeDicName = model.TypeDicName,
+		//	        Content = model.Content,
+		//	        ApplyEndTime = model.ApplyEndTime,
+		//	        AreaCode = orderDto.AreaCode!,
+		//	        ClientGuid = ""
+		//        });
+	 //       }
+  //      }
+		return id;
     }
 
     /// <summary>
@@ -967,14 +1007,35 @@ public class OrderController : BaseController
         supervise.State = 1;
         if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, supervise.Id, HttpContext.RequestAborted);
         await _orderSuperviseRepository.UpdateAsync(supervise, HttpContext.RequestAborted);
-    }
+        //推省上
+        //if (!string.IsNullOrEmpty(id))
+        //      {
+        //       var order = await _orderRepository.GetAsync(x => x.Id == dto.Data.OrderId);
+        //       if (order != null)
+        //       {
+        //        var orderDto = _mapper.Map<OrderDto>(order);
+
+        //        _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+        //        {
+        //	        Order = orderDto,
+        //	        No = orderDto.No,
+        //	        CreatorName = _sessionContext.UserName,
+        //	        TypeDicName = model.TypeDicName,
+        //	        Content = model.Content,
+        //	        ApplyEndTime = model.ApplyEndTime,
+        //	        AreaCode = orderDto.AreaCode!,
+        //	        ClientGuid = ""
+        //        });
+        //       }
+        //      }
+	}
 
-    /// <summary>
-    /// 签收督办
-    /// </summary>
-    /// <param name="dto"></param>
-    /// <returns></returns>
-    [Permission(EPermission.SignSupervise)]
+	/// <summary>
+	/// 签收督办
+	/// </summary>
+	/// <param name="dto"></param>
+	/// <returns></returns>
+	[Permission(EPermission.SignSupervise)]
     [HttpPost("supervise/sign")]
     public async Task SignSupervise([FromBody] SignOrderSuperviseDto dto)
     {
@@ -985,15 +1046,36 @@ public class OrderController : BaseController
         supervise.SignTime = DateTime.Now;
         supervise.SignUser = _sessionContext.UserName;
         await _orderSuperviseRepository.UpdateAsync(supervise, HttpContext.RequestAborted);
-    }
+        //推省上
+        //if (!string.IsNullOrEmpty(id))
+        //      {
+        //       var order = await _orderRepository.GetAsync(x => x.Id == dto.Data.OrderId);
+        //       if (order != null)
+        //       {
+        //        var orderDto = _mapper.Map<OrderDto>(order);
+
+        //        _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+        //        {
+        //	        Order = orderDto,
+        //	        No = orderDto.No,
+        //	        CreatorName = _sessionContext.UserName,
+        //	        TypeDicName = model.TypeDicName,
+        //	        Content = model.Content,
+        //	        ApplyEndTime = model.ApplyEndTime,
+        //	        AreaCode = orderDto.AreaCode!,
+        //	        ClientGuid = ""
+        //        });
+        //       }
+        //      }
+	}
 
 
-    /// <summary>
-    /// 督办详情
-    /// </summary>
-    /// <param name="id"></param>
-    /// <returns></returns>
-    [Permission(EPermission.SuperviseEntity)]
+	/// <summary>
+	/// 督办详情
+	/// </summary>
+	/// <param name="id"></param>
+	/// <returns></returns>
+	[Permission(EPermission.SuperviseEntity)]
     [HttpGet("supervise/{id}")]
     public async Task<OrderSupervise> SuperviseEntity(string id)
     {
@@ -1051,6 +1133,27 @@ public class OrderController : BaseController
 		{
 			//TODO 发送短信
 		}
+		//推省上
+		//if (!string.IsNullOrEmpty(id))
+		//      {
+		//       var order = await _orderRepository.GetAsync(x => x.Id == dto.Data.OrderId);
+		//       if (order != null)
+		//       {
+		//        var orderDto = _mapper.Map<OrderDto>(order);
+
+		//        _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+		//        {
+		//	        Order = orderDto,
+		//	        No = orderDto.No,
+		//	        CreatorName = _sessionContext.UserName,
+		//	        TypeDicName = model.TypeDicName,
+		//	        Content = model.Content,
+		//	        ApplyEndTime = model.ApplyEndTime,
+		//	        AreaCode = orderDto.AreaCode!,
+		//	        ClientGuid = ""
+		//        });
+		//       }
+		//      }
 		return id;
 	}
 

+ 4 - 0
src/Hotline.Api/Controllers/QualityController.cs

@@ -226,6 +226,10 @@ namespace Hotline.Api.Controllers
 			var groupingCount = await _qualityTemplate.CountAsync(x => x.Grouping == dto.Grouping && x.IsEnable == 0);
 			if (groupingCount > 0)
 				throw UserFriendlyException.SameMessage("当前已存在");
+			var names = dto.TemplateDetails.Select(x => x.Name).ToList();
+			var nameCount= names.GroupBy(x => x).Count(c => c.Count() > 1);
+			if (nameCount > 0)
+				throw UserFriendlyException.SameMessage("质检模版存在重复质检项");
 			var model = _mapper.Map<QualityTemplate>(dto);
 			var id = await _qualityTemplate.AddAsync(model, HttpContext.RequestAborted);
 			if (!string.IsNullOrEmpty(id))

+ 49 - 0
src/Hotline.Share/Dtos/Order/OrderScreenDto.cs

@@ -171,4 +171,53 @@ namespace Hotline.Share.Dtos.Order
 
 		public string? CreatorName { get; set; }
 	}
+
+	public class PublishScreenDto {
+		// <summary>
+		/// 工单对象
+		/// </summary>
+		public OrderDto Order { get; set; }
+
+		/// <summary>
+		/// 服务工单编号
+		/// </summary>
+		public string No { get; set; }
+
+		/// <summary>
+		/// 申请人
+		/// </summary>
+
+		public string? CreatorName { get; set; }
+
+		/// <summary>
+		/// 甄别申请类型名称
+		/// </summary>
+		public string? TypeDicName { get; set; }
+
+		/// <summary>
+		/// 甄别申请原因
+		/// </summary>
+		public string? Content { get; set; }
+
+		/// <summary>
+		/// 甄别申请回复
+		/// </summary>
+		public string? ReplyContent { get; set; }
+
+
+		/// <summary>
+		/// 甄别截至申请时间
+		/// </summary>
+		public DateTime? ApplyEndTime { get; set; }
+
+		/// <summary>
+		/// 行政区划代码
+		/// </summary>
+		public string AreaCode { get; set; }
+
+		/// <summary>
+		/// 附件
+		/// </summary>
+		public string ClientGuid { get; set; }
+	}
 }

+ 3 - 3
src/Hotline.Share/Enums/Quality/EQuality.cs

@@ -28,18 +28,18 @@ namespace Hotline.Share.Enums.Quality
 		/// 受理待质检
 		/// </summary>
 		[Description("受理待质检")]
-		Accepted = 0,
+		Accepted = 1,
 
 		/// <summary>
 		/// 派单待质检
 		/// </summary>
 		[Description("派单待质检")]
-		Send = 1,
+		Send = 2,
 
 		/// <summary>
 		/// 回访待质检
 		/// </summary>
 		[Description("回访待质检")]
-		Visit = 2
+		Visit = 3
 	}
 }

+ 2 - 2
src/Hotline.Share/Enums/Quality/ETemplateGrouping.cs

@@ -19,12 +19,12 @@ namespace Hotline.Share.Enums.Quality
 		/// 派单质检
 		/// </summary>
 		[Description("派单质检")]
-		SendOrder= 2,
+		Send = 2,
 
 		/// <summary>
 		/// 回访质检
 		/// </summary>
 		[Description("回访质检")]
-		Callback = 3,
+		Visit = 3,
 	}
 }

+ 0 - 5
src/Hotline.Share/Mq/EventNames.Order.cs

@@ -38,11 +38,6 @@ namespace Hotline.Share.Mq
         /// </summary>
         public const string HotlineOrderScreenApply = "hotline.order.screen.apply";
 
-		/// <summary>
-		/// 甄别通过
-		/// </summary>
-		public const string HotlineOrderScreenSuccess = "hotline.order.screen.success";
-
         /// <summary>
         /// 督办过程
         /// </summary>