Jason há 1 ano atrás
pai
commit
5382bc1ede

+ 22 - 5
src/Hotline.Api/Controllers/SysController.cs

@@ -8,6 +8,7 @@ using Hotline.Share.Dtos.Dic;
 using Hotline.Share.Dtos.Menu;
 using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Dtos.Trunk;
+using Hotline.Share.Enums.Settings;
 using Hotline.Share.Requests;
 using MapsterMapper;
 using Microsoft.AspNetCore.Authorization;
@@ -15,6 +16,7 @@ using Microsoft.AspNetCore.Mvc;
 using System.Diagnostics.CodeAnalysis;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
+using XF.Utility.EnumExtensions;
 
 namespace Hotline.Api.Controllers
 {
@@ -435,9 +437,9 @@ namespace Hotline.Api.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpGet("common-list")]
-        public async Task<IReadOnlyList<SystemCommonOpinion>> GetCommon(string typecode)
+        public async Task<IReadOnlyList<SystemCommonOpinion>> GetCommon([FromQuery]ECommonType commonType)
         {
-            return await _commonOpinionDomainService.GetCommonOpinions(typecode);
+            return await _commonOpinionRepository.Queryable().Where(x => x.CommonType == commonType).ToListAsync();
         }
 
         /// <summary>
@@ -446,7 +448,7 @@ namespace Hotline.Api.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost("add-common")]
-        public async Task AddCommon([FromBody] AddCommonDto dto)
+        public async Task AddCommon([FromBody]AddCommonDto dto)
         {
             var entity = _mapper.Map<SystemCommonOpinion>(dto);
             await _commonOpinionDomainService.AddCommonOpinion(entity, HttpContext.RequestAborted);
@@ -458,11 +460,26 @@ namespace Hotline.Api.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost("del-common")]
-        public async Task DelCommon([FromBody] DelCommonDto dto)
+        public async Task DelCommon([FromBody]DelCommonDto dto)
         {
             await _commonOpinionDomainService.DelCommonOpinion(dto.Ids, HttpContext.RequestAborted);
         }
 
+        /// <summary>
+        /// 常用意见页面基础信息
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet("common-basepage")]
+        public async Task<object> CommonBasePage()
+        {
+            var rsp = new
+            {
+                CommonType = EnumExts.GetDescriptions<ECommonType>()
+            };
+
+            return rsp;
+        }
+
         #endregion
 
         #region 公开
@@ -476,7 +493,7 @@ namespace Hotline.Api.Controllers
         {
             var (total,items) = await _commonOpinionRepository.Queryable()
                 .Where(x => x.IsOpen)
-                .WhereIF(!string.IsNullOrEmpty(dto.code), x => x.TypeCode.Contains(dto.code))
+                .WhereIF(dto.CommonType!=null, x => x.CommonType == dto.CommonType)
                 .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
             return new PagedDto<SystemCommonOpinion>(total, items);
         }

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

@@ -5,7 +5,7 @@ namespace Hotline.Share.Dtos.Order
     public class CallConnectOrderDto
     {
         public OrderDto Order { get; set; }
-        //todo 补充calldto
+        
         public CallRecordDto CallRecord { get; set; }
     }
 }

+ 5 - 7
src/Hotline.Share/Dtos/Settings/CommonDto.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Requests;
+using Hotline.Share.Enums.Settings;
+using Hotline.Share.Requests;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,17 +10,14 @@ namespace Hotline.Share.Dtos.Settings
 {
     public class AddCommonDto
     {
-        /// <summary>
-        /// 类型Code(对应常量)
-        /// </summary>
-        public string TypeCode { get; set; }
-
         /// <summary>
         /// 内容
         /// </summary>
         public string Content { get; set; }
 
         public bool IsOpen { get; set; }
+
+        public ECommonType CommonType { get; set; }
     }
 
     public class CommonModifyDto:AddCommonDto
@@ -38,7 +36,7 @@ namespace Hotline.Share.Dtos.Settings
 
     public record QueryCommonDto: PagedRequest
     {
-        public string? code { get; set; }
+        public ECommonType? CommonType { get; set; }
     }
 
 

+ 46 - 0
src/Hotline.Share/Enums/Settings/ECommonType.cs

@@ -0,0 +1,46 @@
+using System.ComponentModel;
+
+namespace Hotline.Share.Enums.Settings
+{
+    public enum ECommonType
+    {
+        [Description("坐席")]
+        Seat = 1,
+
+        [Description("休息")]
+        Rest = 2,
+
+        [Description("工单流转")]
+        OrderCirculation = 3,
+
+        [Description("知识库")]
+        KnowledgeLocution = 4,
+
+        [Description("休息原因")]
+        RestReason = 5,
+
+        [Description("办理意见")]
+        HandleAgain = 6,
+
+        [Description("督办意见")]
+        Supervise = 7,
+
+        [Description("退回意见")]
+        Return = 8,
+
+        [Description("归档意见")]
+        Archive= 9,
+
+        [Description("特提")]
+        Teti = 10,
+
+        [Description("甄别")]
+        Discriminate = 11,
+
+        [Description("回访")]
+        ReturnVisit = 12,
+
+        [Description("延期")]
+        Delay = 13,
+    }
+}

+ 4 - 1
src/Hotline/Settings/CommonOpinions/SystemCommonOpinion.cs

@@ -1,4 +1,5 @@
-using SqlSugar;
+using Hotline.Share.Enums.Settings;
+using SqlSugar;
 using XF.Domain.Repository;
 
 namespace Hotline.Settings.CommonOpinions
@@ -13,5 +14,7 @@ namespace Hotline.Settings.CommonOpinions
 
         [SugarColumn(DefaultValue = "f")]
         public bool IsOpen { get; set; }
+
+        public ECommonType CommonType { get; set; }
     }
 }