Selaa lähdekoodia

Merge branch 'master' of http://110.188.24.182:10023/Fengwo/hotline

田爽 1 vuosi sitten
vanhempi
commit
8f72d89758

+ 8 - 0
src/Hotline.Api/Controllers/OrderController.cs

@@ -1872,6 +1872,14 @@ public class OrderController : BaseController
     public async Task<string> Add([FromBody] AddOrderDto dto)
     {
         //todo dto validation
+
+        if(!string.IsNullOrEmpty(dto.CallId))
+        {
+            var exists = await _orderRepository.AnyAsync(d => d.CallId == dto.CallId, HttpContext.RequestAborted);
+            if (exists)
+                throw UserFriendlyException.SameMessage("来电已保存工单");
+        }
+
         var order = _mapper.Map<Order>(dto);
         order.SignerId = _sessionContext.UserId;
         order.SignerName = _sessionContext.UserName;

+ 3 - 0
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -339,6 +339,8 @@ namespace Hotline.Share.Dtos.Order
         /// </summary>
         public string? Password { get; set; }
 
+        public string? HotspotCodeLv1 { get; set; }
+
         public string WorkflowId { get; set; }
         public WorkflowDto Workflow { get; set; }
 
@@ -542,6 +544,7 @@ namespace Hotline.Share.Dtos.Order
         /// 热点
         /// </summary>
         public string? HotspotId { get; set; }
+        public string? HotspotCode { get; set; }
         public string? HotspotName { get; set; }
         public string? HotspotSpliceName { get; set; }
 

+ 22 - 2
src/Hotline.Share/Dtos/Position.cs

@@ -18,15 +18,35 @@ public class Position
     public string? AreaCode { get; set; }
 
     /// <summary>
-    /// 行政区划地址
+    /// 
     /// </summary>
-    public string? Address { get; set; }
+    public string? Province { get; set; }
+
+    /// <summary>
+    /// 市
+    /// </summary>
+    public string? City { get; set; }
+
+    /// <summary>
+    /// 区/县
+    /// </summary>
+    public string? County { get; set; }
+
+    /// <summary>
+    /// 乡镇(4级行政区划)
+    /// </summary>
+    public string? Town { get; set; }
 
     /// <summary>
     /// 详细街道
     /// </summary>
     public string? Street { get; set; }
 
+    /// <summary>
+    /// 行政区划地址
+    /// </summary>
+    public string? Address { get; set; }
+
     /// <summary>
     /// 完整地址
     /// </summary>

+ 8 - 0
src/Hotline/Orders/Order.cs

@@ -21,6 +21,11 @@ namespace Hotline.Orders
     [SugarIndex("unique_order_no", nameof(Order.No), OrderByType.Desc, true)]
     public partial class Order : PositionWorkflowEntity
     {
+        public Order()
+        {
+            HotspotCodeLv1 ??= HotspotCode?[..2];
+        }
+
         /// <summary>
         /// 第一次评价结果
         /// </summary>
@@ -146,6 +151,9 @@ namespace Hotline.Orders
         /// </summary>
         public string? HotspotId { get; set; }
 
+        public string? HotspotCode { get; set; }
+        public string? HotspotCodeLv1 { get; set; }
+
         public string? HotspotName { get; set; }
 
         public string? HotspotSpliceName { get; set; }

+ 24 - 3
src/XF.Domain.Repository/Entity.cs

@@ -197,6 +197,7 @@ public abstract class PositionEntity : FullStateEntity
 {
     public PositionEntity()
     {
+        Address ??= $"{Province}{City}{County}{Town}";
         FullAddress ??= $"{Address}{Street}";
     }
 
@@ -215,19 +216,39 @@ public abstract class PositionEntity : FullStateEntity
     /// <summary>
     /// 行政区划编码
     /// </summary>
-    [SugarColumn(ColumnDescription = "行政区划编码", IsNullable = true)]
+    [SugarColumn(ColumnDescription = "行政区划编码")]
     public string? AreaCode { get; set; }
 
     /// <summary>
-    /// 行政区划地址
+    /// 
     /// </summary>
-    public string? Address { get; set; }
+    public string? Province { get; set; }
+
+    /// <summary>
+    /// 市
+    /// </summary>
+    public string? City { get; set; }
+
+    /// <summary>
+    /// 区/县
+    /// </summary>
+    public string? County { get; set; }
+
+    /// <summary>
+    /// 乡镇(4级行政区划)
+    /// </summary>
+    public string? Town { get; set; }
 
     /// <summary>
     /// 详细街道
     /// </summary>
     public string? Street { get; set; }
 
+    /// <summary>
+    /// 行政区划地址
+    /// </summary>
+    public string? Address { get; set; }
+
     /// <summary>
     /// 完整地址
     /// </summary>