Sfoglia il codice sorgente

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

tangjiang 8 mesi fa
parent
commit
e2983e2217

+ 28 - 0
src/Hotline.Api/Controllers/ArticleController.cs

@@ -569,9 +569,37 @@ namespace Hotline.Api.Controllers
             var model = _mapper.Map<Bulletin>(dto);
             model.BulletinState = Share.Enums.Article.EBulletinState.Draft;
             model.ReadedNum = 0;
+            model.IsArrive = false;
             await _bulletinRepository.AddAsync(model, HttpContext.RequestAborted);
         }
 
+        /// <summary>
+        /// 公告上架或者下架
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost("bulletin-arrive")]
+        public async Task BulletinArrive([FromBody] BulletinArriveDto dto)
+        {
+            var bulletin = await _bulletinRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
+            if (bulletin == null)
+                throw UserFriendlyException.SameMessage("无效数据");
+
+            if (bulletin.BulletinState != EBulletinState.ReviewPass)
+                throw UserFriendlyException.SameMessage("当前状态不能操作上架或下架");
+
+            bulletin.IsArrive = dto.IsArrive;
+            if (bulletin.IsArrive==false)
+            {
+                bulletin.ExaminTime = null;
+                bulletin.ExaminManId = null;
+                bulletin.ExaminOpinion = null;
+                bulletin.CommitTime = null;
+                bulletin.BulletinState = EBulletinState.Draft;
+            }
+            await _bulletinRepository.UpdateAsync(bulletin, HttpContext.RequestAborted);
+        }
+
         /// <summary>
         /// 列表页面基础数据
         /// </summary>

+ 8 - 4
src/Hotline.Api/Controllers/WebPortalController.cs

@@ -95,7 +95,8 @@ namespace Hotline.Api.Controllers
             RefAsync<int> total = 0;
             var items = await _bulletinRepository.Queryable()
                 .Where(p => p.LoseEfficacyTime >= DateTime.Now)
-                .Where(d => SqlFunc.JsonListObjectAny(d.PushRanges, "Key", "2"))
+                .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
                  .Where(p => p.BulletinTypeId == dto.NoticeType)
                  .WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
                  .OrderByDescending(p => p.BulletinTime)
@@ -135,7 +136,8 @@ namespace Hotline.Api.Controllers
         {
             var items = await _bulletinRepository.Queryable()
                 .Where(p => p.LoseEfficacyTime >= DateTime.Now)
-                .Where(d => SqlFunc.JsonListObjectAny(d.PushRanges, "Key", "2"))
+                .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
                  .Where(p => p.BulletinTypeId == dto.BulletinTypeId)
                  .WhereIF(!string.IsNullOrEmpty(dto.CheckChar), p => p.Content.Contains(dto.CheckChar))
                  .OrderByDescending(p => p.BulletinTime)
@@ -198,7 +200,8 @@ namespace Hotline.Api.Controllers
         {
             var sugar = _bulletinRepository.Queryable()
                 .Where(p => p.LoseEfficacyTime >= DateTime.Now)
-                .Where(d => SqlFunc.JsonListObjectAny(d.PushRanges, "Key", "2"))
+                 .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
                 ;
             if (dto.FullSearch == "1")//全文搜索
             {
@@ -271,7 +274,8 @@ namespace Hotline.Api.Controllers
             RefAsync<int> total = 0;
             var items = await _bulletinRepository.Queryable()
                 .Where(p => p.LoseEfficacyTime >= DateTime.Now)
-                .Where(d => SqlFunc.JsonListObjectAny(d.PushRanges, "Key", "2"))
+                 .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", "2"))
                  .Where(p => p.BulletinTypeId == "1" || p.BulletinTypeId == "5" || p.BulletinTypeId == "6" || p.BulletinTypeId == "7" || p.BulletinTypeId == "3" || p.BulletinTypeId == "4")
                  .WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
                  .OrderByDescending(p => p.BulletinTime)

+ 10 - 0
src/Hotline.Share/Dtos/Article/BulletinDto.cs

@@ -381,6 +381,16 @@ namespace Hotline.Share.Dtos.Article
         public string SourceOrgName { get; set; }
     }
 
+    public record BulletinArriveDto
+    {
+        public string Id { get; set; }
+
+        /// <summary>
+        /// 上架true  下架false
+        /// </summary>
+        public bool IsArrive { get; set; }
+
+    }
     public record UpdateBulletinDto:AddBulletinDto
     {
         public string Id { get; set; }

+ 4 - 0
src/Hotline/Article/Bulletin.cs

@@ -82,6 +82,10 @@ namespace Hotline.Article
         /// </summary>
         public DateTime? ExaminTime { get; set; }
 
+        /// <summary>
+        /// 是否上架
+        /// </summary>
+        public bool? IsArrive { get; set; }
 
         /// <summary>
         /// 阅读量+1

+ 10 - 0
src/Hotline/Permissions/EPermission.cs

@@ -2029,6 +2029,16 @@ namespace Hotline.Permissions
         /// </summary>
         [Display(GroupName ="话务管理",Name ="失联工单",Description ="失联工单")]
         NoLinkCall = 800102,
+        /// <summary>
+        /// 录音转写(批量)
+        /// </summary>
+        [Display(GroupName = "话务管理",Name ="录音转写(批量)",Description ="录音转写(批量)")]
+        RecordingTranscribed = 800103,
+        /// <summary>
+        /// 转工单
+        /// </summary>
+        [Display(GroupName ="话务管理",Name ="转工单",Description ="转工单")]
+        ConvertToOrder = 800104,
         #endregion
 
         #region 黑白名单