Преглед на файлове

自贡任务 484 特殊号码管理中导入新一批人大代表信息等需求

tangjiang преди 3 седмици
родител
ревизия
336aa40afa

+ 19 - 11
src/Hotline.Api/Controllers/OrderController.cs

@@ -59,6 +59,7 @@ using Hotline.Share.Requests;
 using Hotline.Share.Tools;
 using Hotline.Snapshot;
 using Hotline.Snapshot.IRepository;
+using Hotline.Special;
 using Hotline.Tools;
 using Hotline.Users;
 using Hotline.Validators.FlowEngine;
@@ -4233,7 +4234,7 @@ public class OrderController : BaseController
                 ActualHandleOrgName = d.ActualHandleOrgName,
                 Status = d.Status,
                 IsScreen = d.OrderScreens.Any(x => x.Status == EScreenStatus.End),
-                IsTerminate=d.OrderTerminates.Any(p=>p.Status== ETerminateStatus.End),
+                IsTerminate = d.OrderTerminates.Any(p => p.Status == ETerminateStatus.End),
                 //TerminateStatus = SqlFunc.Subqueryable<OrderTerminate>().Where(s => s.OrderId == d.Id).OrderByDesc(s => s.CreationTime).Select(s => s.Status)
             })
             .MergeTable()
@@ -4661,16 +4662,14 @@ public class OrderController : BaseController
         //工单保存特殊身份验证
         var specialIdentityVerification =
             bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.SpecialIdentityVerification).SettingValue[0]);
+        var specialNumber = await _specialNumberRepository.GetAsync(p => p.PhoneNumber == dto.FromPhone, HttpContext.RequestAborted);
         if (specialIdentityVerification)
         {
-            var specialNumber = await _specialNumberRepository.GetAsync(p => p.PhoneNumber == dto.FromPhone, HttpContext.RequestAborted);
             if (specialNumber != null && specialNumber.PoliticalIdentityValue == "1")
             {
-                if (dto.OrderPushTypes == null || dto.OrderPushTypes.Count() == 0)
+                if (dto.OrderPushTypes == null || dto.OrderPushTypes.Count() == 0 || dto.OrderPushTypes.Exists(p => p.PushTypeCode == "9") == false)
                     throw UserFriendlyException.SameMessage("人大代表来电,请选择推送分类人大代表意见快办!");
 
-                if (dto.OrderPushTypes.Exists(p => p.PushTypeCode == "9") == false)
-                    throw UserFriendlyException.SameMessage("人大代表来电,请选择推送分类人大代表意见快办!");
             }
         }
 
@@ -4713,6 +4712,11 @@ public class OrderController : BaseController
         var order = _mapper.Map<Orders.Order>(dto);
         order.SignerId = _sessionContext.UserId;
         order.SignerName = _sessionContext.UserName;
+        if (specialNumber != null)
+        {
+            order.PoliticalIdentityValue = specialNumber.PoliticalIdentityValue;
+            order.PoliticalIdentityName = specialNumber.PoliticalIdentityName;
+        }
         order.InitId();
         if (dto.Files.Any())
             order.FileJson = await _fileRepository.AddFileAsync(dto.Files, order.Id, "", HttpContext.RequestAborted);
@@ -4921,15 +4925,12 @@ public class OrderController : BaseController
         //工单保存特殊身份验证
         var specialIdentityVerification =
             bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.SpecialIdentityVerification).SettingValue[0]);
+        var specialNumber = await _specialNumberRepository.GetAsync(p => p.PhoneNumber == dto.FromPhone, HttpContext.RequestAborted);
         if (specialIdentityVerification)
         {
-            var specialNumber = await _specialNumberRepository.GetAsync(p => p.PhoneNumber == dto.FromPhone, HttpContext.RequestAborted);
             if (specialNumber != null && specialNumber.PoliticalIdentityValue == "1")
             {
-                if (dto.OrderPushTypes == null || dto.OrderPushTypes.Count() == 0)
-                    throw UserFriendlyException.SameMessage("人大代表来电,请选择推送分类人大代表意见快办!");
-
-                if (dto.OrderPushTypes.Exists(p => p.PushTypeCode == "9") == false)
+                if (dto.OrderPushTypes == null || dto.OrderPushTypes.Count() == 0 || dto.OrderPushTypes.Exists(p => p.PushTypeCode == "9") == false)
                     throw UserFriendlyException.SameMessage("人大代表来电,请选择推送分类人大代表意见快办!");
             }
         }
@@ -5006,6 +5007,12 @@ public class OrderController : BaseController
         if (order.SourceChannelCode != AppDefaults.SourceChannel.DianHua)
             order.CallId = null;
 
+        if (specialNumber != null)
+        {
+            order.PoliticalIdentityValue = specialNumber.PoliticalIdentityValue;
+            order.PoliticalIdentityName = specialNumber.PoliticalIdentityName;
+        }
+
         if (dto.IsEdit && !string.IsNullOrEmpty(dto.CenterOpinion) && order.CenterToOrgOpinion != dto.CenterOpinion)
             order.CenterToOrgOpinion = dto.CenterOpinion;
         if (dto.IsEdit && !string.IsNullOrEmpty(dto.FileOpinion) && order.FileOpinion != dto.FileOpinion)
@@ -5839,7 +5846,8 @@ public class OrderController : BaseController
             CurrentStepOptions = definition?.Steps.Select(x => new Kv(x.Code, x.Name)),
             IdentityTypeOptions = EnumExts.GetDescriptions<EIdentityType>(),
             OrderTags = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.OrderTag),
-            FocusOnEvents = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.FocusOnEvent)
+            FocusOnEvents = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.FocusOnEvent),
+            PoliticalIdentity = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.PoliticalIdentity)
         };
         return rsp;
     }

+ 1 - 0
src/Hotline.Application/OrderApp/OrderApplication.cs

@@ -1724,6 +1724,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         //}
 
         query = query
+                .WhereIF(!string.IsNullOrEmpty(dto.PoliticalIdentityValue), d => d.PoliticalIdentityValue == dto.PoliticalIdentityValue)//政治身份查询
                 .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!)) //标题
                 .WhereIF(!string.IsNullOrEmpty(dto.ProvinceNo), d => d.ProvinceNo.Contains(dto.ProvinceNo)) //省本地编号
                 .WhereIF(!string.IsNullOrEmpty(dto.ReceiveProvinceNo), d => d.ReceiveProvinceNo.Contains(dto.ReceiveProvinceNo)) //省编号

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

@@ -1219,6 +1219,15 @@ namespace Hotline.Share.Dtos.Order
     public class AddOrderDto : Position
     {
         #region 来电信息
+        /// <summary>
+        /// 政治身份
+        /// </summary>
+        public string? PoliticalIdentityValue { get; set; }
+
+        /// <summary>
+        /// 政治身份
+        /// </summary>
+        public string? PoliticalIdentityName { get; set; }
 
         /// <summary>
         /// 来源渠道

+ 5 - 0
src/Hotline.Share/Dtos/Order/QueryOrderDto.cs

@@ -10,6 +10,11 @@ namespace Hotline.Share.Dtos.Order
 {
     public record QueryOrderDto : PagedKeywordRequest
     {
+        /// <summary>
+        /// 政治身份
+        /// </summary>
+        public string? PoliticalIdentityValue {  get; set; }
+
         /// <summary>
         /// 省本地编号(√)
         /// </summary>

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

@@ -45,6 +45,17 @@ namespace Hotline.Orders
         public string? FirstVisitResultCode { get; set; }
 
         #region 来电信息
+        /// <summary>
+        /// 政治身份
+        /// </summary>
+        [SugarColumn(ColumnDescription = "政治身份")]
+        public string? PoliticalIdentityValue { get; set; }
+
+        /// <summary>
+        /// 政治身份
+        /// </summary>
+        [SugarColumn(ColumnDescription = "政治身份")]
+        public string? PoliticalIdentityName { get; set; }
 
         /// <summary>
         /// 来源渠道(电话、网站、APP等)