Explorar o código

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

xf hai 3 meses
pai
achega
6d355c258f

+ 1 - 1
src/Hotline.Api/Controllers/ExportData/ExportDataController.cs

@@ -18,7 +18,7 @@ namespace Hotline.Api.Controllers.ExportData;
 ///        比如: RedPackController.GetRedPackList 就会去查找 RedPackApplication.GetRedPackList 方法
 ///     3. 通过反射调用对应的方法
 ///     4. ApplicationService 的方法返回的必须是 ISugarQueryable
-///     5. ApplicationService 中方法的Description 属性会作为导出的文件名
+///     5. ApplicationService 中方法的ExportExcel属性会作为导出的文件名
 /// </summary>
 [ApiController]
 [Route("{*path:regex(.*export_excel$)}")]

+ 22 - 6
src/Hotline.Api/Controllers/OrderController.cs

@@ -380,6 +380,7 @@ public class OrderController : BaseController
     public async Task<PagedDto<PublishDto>> PublishOrderList([FromQuery] QueryOrderPublishDto dto)
     {
         var (total, items) = await _orderRepository.Queryable()
+            .Includes(d=>d.OrderTags)
             //.Includes(d => d.OrderPublish)
             .Where(x => x.Status == EOrderStatus.Filed)
             .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.StartsWith(dto.Keyword!))
@@ -388,8 +389,9 @@ public class OrderController : BaseController
             //.WhereIF(dto.PubState == EPubState.Pub, d => d.Status >= EOrderStatus.Published)
             //.WhereIF(dto.PubState == EPubState.NoPub, d => d.Status == EOrderStatus.Filed)
             .WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)
-            .WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
-            .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName!) //派单人
+			//.WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
+			.WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTags.Any(ot=>ot.DicDataValue == dto.OrderTag)) //工单标签
+			.WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName!) //派单人
             .WhereIF(!string.IsNullOrEmpty(dto.NameOrNo), d => d.AcceptorName == dto.NameOrNo! || d.AcceptorStaffNo == dto.NameOrNo!) //受理人/坐席
             .WhereIF(!string.IsNullOrEmpty(dto.ActualHandleOrgName), d => d.ActualHandleOrgName.Contains(dto.ActualHandleOrgName)) //接办部门(综合查询模糊)
             .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType) //受理类型
@@ -3402,6 +3404,7 @@ public class OrderController : BaseController
             .Includes(d => d.OrderPublish)
             .Includes(d => d.OrderPushTypes)
             .Includes(d => d.OrderComplements)
+            .Includes(d=>d.OrderTags)
             //.Includes(d => d.OrderScreens)
             .Includes(d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited).ToList(), x => x.OrderVisitDetails)
             .Includes(d => d.OrderVisits.Where(x => x.VisitState == EVisitState.Visited).ToList(), x => x.Employee)
@@ -3734,6 +3737,12 @@ public class OrderController : BaseController
             order.PushType = string.Join(",", pushTypes);
         }
 
+        if (dto.OrderTags != null && dto.OrderTags.Any())
+        {
+            var orderTags = _mapper.Map<List<SystemDicData>>(dto.OrderTags);
+            order.OrderTags = orderTags;
+		}
+
         await _orderDomainService.AddAsync(order, true, HttpContext.RequestAborted);
 
         if (_systemSettingCacheManager.Snapshot && dto.IndustryId.NotNullOrEmpty() && dto.IndustryName.NotNullOrEmpty())
@@ -3766,6 +3775,8 @@ public class OrderController : BaseController
             await _repeatableEventDetailRepository.AddRangeAsync(repeatables, HttpContext.RequestAborted);
         }
 
+
+
         //工单ID跟通话记录相关联
         //var callRecord = await _trCallRecordRepository.GetAsync(p => p.CallAccept == order.CallId, HttpContext.RequestAborted);//由CallAccept改为OtherAccept
         //var callRecord = await _trCallRecordRepository.GetAsync(p => p.OtherAccept == order.CallId && string.IsNullOrEmpty(p.OtherAccept) == false, HttpContext.RequestAborted);
@@ -3968,10 +3979,15 @@ public class OrderController : BaseController
             var pushTypes = dto.OrderPushTypes.Select(x => x.PushType);
             order.PushType = string.Join(",", pushTypes);
         }
+		if (dto.OrderTags != null && dto.OrderTags.Any())
+		{
+			var orderTags = _mapper.Map<List<SystemDicData>>(dto.OrderTags);
+			order.OrderTags = orderTags;
+		}
 
-        //处理工单的期满时间
-        //首先是工单编辑页面提交的、流程已经开启、工单未归档的工单才能修改期满时间
-        if (dto.IsEdit && !string.IsNullOrEmpty(order.WorkflowId) && order.Status < EOrderStatus.Filed && dto.AcceptTypeCode != acceptTypeCode)
+		//处理工单的期满时间
+		//首先是工单编辑页面提交的、流程已经开启、工单未归档的工单才能修改期满时间
+		if (dto.IsEdit && !string.IsNullOrEmpty(order.WorkflowId) && order.Status < EOrderStatus.Filed && dto.AcceptTypeCode != acceptTypeCode)
         {
             //查询当前工单的实际办理节点,如果在热线中心不处理,如果在部门需要更新期满时间
             var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSteps: true, withTraces: true,
@@ -3999,7 +4015,7 @@ public class OrderController : BaseController
             }
         }
 
-        await _orderRepository.UpdateNav(order, new UpdateNavRootOptions { IgnoreColumns = ["CallId"] }).Include(d => d.OrderExtension).ExecuteCommandAsync();
+        await _orderRepository.UpdateNav(order, new UpdateNavRootOptions { IgnoreColumns = ["CallId"] }).Include(d => d.OrderExtension).Include(d=>d.OrderTags).ExecuteCommandAsync();
 
         //订阅此事件的内部处理工单数据只能更新各自业务的字段,不能全部更新
         //修改工单其他处理事件  (受理短信)

+ 12 - 2
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -50,8 +50,9 @@ public class SnapshotController : BaseController
     private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
     private readonly ISessionContext _sessionContext;
     private readonly IThirdAccountRepository _thirdAccountRepository;
+    private readonly ILogger<SnapshotController> _logger;
 
-    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService, IIndustryRepository industryRepository, IOrderDomainService orderDomainService, IFileRepository fileRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISessionContext sessionContext, IThirdAccountRepository thirdAccountRepository)
+    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService, IIndustryRepository industryRepository, IOrderDomainService orderDomainService, IFileRepository fileRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISessionContext sessionContext, IThirdAccountRepository thirdAccountRepository, ILogger<SnapshotController> logger)
     {
         _orderRepository = orderRepository;
         _snapshotApplication = snapshotApplication;
@@ -63,6 +64,7 @@ public class SnapshotController : BaseController
         _systemDicDataCacheManager = systemDicDataCacheManager;
         _sessionContext = sessionContext;
         _thirdAccountRepository = thirdAccountRepository;
+        _logger = logger;
     }
 
     /// <summary>
@@ -119,6 +121,14 @@ public class SnapshotController : BaseController
         orderSnapshot.IndustryId = dto.IndustryId;
         orderSnapshot.IndustryName = industry.Name;
         orderSnapshot.CompanyName = dto.CompanyName;
+        try
+        {
+            orderSnapshot.JobTypeName = _systemDicDataCacheManager.JobType.FirstOrDefault(m => m.DicDataValue == dto.JobType.ToString())?.DicDataName;
+        }
+        catch (Exception e)
+        {
+            _logger.LogError(e, $"添加随手拍工单, 获取JobTypeName异常. '{dto.JobType}'");
+        }
         if (dto.StartWorkTime.NotNullOrEmpty()) orderSnapshot.StartWorkTime = dto.StartWorkTime.ObjToDate();
         if (dto.EndWorkTime.NotNullOrEmpty()) orderSnapshot.EndWorkTime = dto.EndWorkTime.ObjToDate();
         if (dto.Name.NotNullOrEmpty())
@@ -389,7 +399,7 @@ public class SnapshotController : BaseController
                 EventType = 0,
                 WorkAddress = order.Address,
                 CreatedTime = order.CreationTime,
-                WorkType = snapshot.JobType.ObjToInt(),
+                WorkType = snapshot.JobType.Value,
                 Source = 1,
                 WorkTimeStart = snapshot.StartWorkTime.Value,
                 WorkTimeStop = snapshot.EndWorkTime.Value,

+ 362 - 0
src/Hotline.Api/Controllers/WebPortalController.cs

@@ -8,6 +8,7 @@ using Hotline.KnowledgeBase;
 using Hotline.Orders;
 using Hotline.Push.Notifies;
 using Hotline.Repository.SqlSugar.Extensions;
+using Hotline.Repository.SqlSugar.Knowledge;
 using Hotline.Settings;
 using Hotline.Settings.Hotspots;
 using Hotline.Share.Dtos;
@@ -25,6 +26,7 @@ using MediatR;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
+using Senparc.Weixin.WxOpen.AdvancedAPIs.WxApp.WxAppJson;
 using SqlSugar;
 using XF.Domain.Authentications;
 using XF.Domain.Cache;
@@ -398,6 +400,366 @@ namespace Hotline.Api.Controllers
 
         #endregion
 
+        #region 通知-宜宾
+
+        /// <summary>
+        /// 获取列表
+        /// </summary>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost("getarticlelist_yibin")]
+        public async Task<OpenResponse> GetArticleListYiBin([FromBody] QueryArticleListDto dto)
+        {
+            if (string.IsNullOrEmpty(dto.PushRanges))
+                dto.PushRanges = "2";
+
+            RefAsync<int> total = 0;
+            var items1 = _bulletinRepository.Queryable()
+                .Where(p => p.LoseEfficacyTime >= DateTime.Now)
+                .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
+                .Where(p => p.BulletinTypeId == dto.NoticeType)
+                .WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
+                .Select(it => new ArticleListDto
+                {
+                    Page = 0,
+                    NoticeID = it.Id,
+                    //NoticeContent = it.Content,
+                    NoticeTypeName = it.BulletinTypeName,
+                    NoticeTitle = it.Title,
+                    NoticeBMName = it.SourceOrgName,
+                    NoticeCreateDate = it.CreationTime,
+                    VideoUrl = "",
+                    WNLT_FullCode = ""
+                });
+
+            List<ArticleListDto> items = new List<ArticleListDto>();
+            if (dto.NoticeType == "6")
+            {
+                //知识库
+                var items2 = _knowledgeRepository.Queryable()
+                    .Where(k => k.IsPublic == true)
+                    .Where(k => k.Status == EKnowledgeStatus.OnShelf)
+                    .Where(k => k.Attribution == "部门知识库")
+                    .Select(it => new ArticleListDto
+                    {
+                        Page = 0,
+                        NoticeID = it.Id,
+                        //NoticeContent = it.Content,
+                        NoticeTypeName = "知识库",
+                        NoticeTitle = it.Title,
+                        NoticeBMName = it.CreatorOrgName,
+                        NoticeCreateDate = it.CreationTime,
+                        VideoUrl = "",
+                        WNLT_FullCode = ""
+                    });
+
+                items = await _orderRepository.UnionAll(items1, items2)
+                  .Select(x => new ArticleListDto
+                  {
+                      Page = SqlFunc.RowNumber($"{x.NoticeCreateDate} desc "),
+                      NoticeID = x.NoticeID,
+                      //NoticeContent = x.NoticeContent,
+                      NoticeTypeName = x.NoticeTypeName,
+                      NoticeTitle = x.NoticeTitle,
+                      NoticeBMName = x.NoticeBMName,
+                      NoticeCreateDate = x.NoticeCreateDate,
+                      VideoUrl = x.VideoUrl,
+                      WNLT_FullCode = x.WNLT_FullCode
+                  })
+                  .OrderByDescending(p => p.NoticeCreateDate)
+                  .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+            }
+            else
+            {
+                items = await items1
+                  .OrderByDescending(p => p.NoticeCreateDate)
+                  .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+
+            }
+
+            //计算总页数
+            int nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(total) / dto.PageSize));
+            ArticleListDataDto dataDto = new()
+            {
+                PageCount = nPageCount,
+                Total = total,
+                data = _mapper.Map<IReadOnlyList<ArticleListDto>>(items)
+            };
+
+            return OpenResponse.Ok(WebPortalDeResponse<ArticleListDataDto>.Success(dataDto));
+        }
+
+        /// <summary>
+        /// 获取详情,修改阅读次数
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost("getarticledetails_yibin")]
+        public async Task<OpenResponse> GetArticleDetailsYiBin([FromBody] ArticleIdDto dto)
+        {
+            ArticleDetailsDto detailsDto = null;
+            if (dto.TypeName == "知识库")
+            {
+                var data = await _knowledgeRepository.GetAsync(p => p.Id == dto.Id, HttpContext.RequestAborted);
+                if (data != null)
+                {
+                    data.PageView = data.PageView++;
+                    await _knowledgeRepository.UpdateAsync(data, HttpContext.RequestAborted);
+                    detailsDto = new()
+                    {
+                        NoticeID = data.Id,
+                        NoticeTypeName = "知识库",
+                        NoticeTitle = data.Title,
+                        NoticeBMName = data.CreatorOrgName,
+                        NoticeCreateDate = data.CreationTime,
+                        NoticeRCount = data.PageView,
+                        WNED_VideoUrl = "",
+                        NoticeContent = data.Content
+                    };
+                    if (data != null && !string.IsNullOrEmpty(data.Content))
+                        data.Content = _bulletinApplication.GetSiteUrls(data.Content);
+                }
+                else
+                    detailsDto = new();
+            }
+            else
+            {
+                var data = await _bulletinRepository.GetAsync(p => p.Id == dto.Id, HttpContext.RequestAborted);
+                if (data != null)
+                {
+                    data.ReadedNum = data.ReadedNum++;
+                    await _bulletinRepository.UpdateAsync(data, HttpContext.RequestAborted);
+                    detailsDto = new()
+                    {
+                        NoticeID = data.Id,
+                        NoticeTypeName = data.BulletinTypeName,
+                        NoticeTitle = data.Title,
+                        NoticeBMName = data.SourceOrgName,
+                        NoticeCreateDate = data.CreationTime,
+                        NoticeRCount = data.ReadedNum,
+                        WNED_VideoUrl = "",
+                        NoticeContent = data.Content
+                    };
+                    if (data != null && !string.IsNullOrEmpty(data.Content))
+                        data.Content = _bulletinApplication.GetSiteUrls(data.Content);
+                }
+                else
+                    detailsDto = new();
+            }
+
+            List<ArticleDetailsDto> dataDto = new() { detailsDto };
+            return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<ArticleDetailsDto>>.Success(dataDto));
+        }
+
+        /// <summary>
+        /// 上一条和下一条
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost("getpreviousandnext_yibin")]
+        public async Task<OpenResponse> GetPreviousAndNextYiBin([FromBody] ArticlePreviousAndNextDto dto)
+        {
+            if (string.IsNullOrEmpty(dto.PushRanges))
+                dto.PushRanges = "2";
+
+            var sugar = _bulletinRepository.Queryable()
+                .Where(p => p.LoseEfficacyTime >= DateTime.Now)
+                .Where(p => p.IsArrive == true)
+                .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges));
+
+            if (dto.FullSearch == "1")//全文搜索
+            {
+                if (_appOptions.Value.IsYiBin)
+                {
+                    sugar.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.Content.Contains(dto.Condition) || p.Title.Contains(dto.Condition));
+                }
+                if (_appOptions.Value.IsZiGong)
+                {
+                    sugar.Where(p => p.BulletinTypeId == "5013" || p.BulletinTypeId == "5016" || p.BulletinTypeId == "5011" || p.BulletinTypeId == "5015" || p.BulletinTypeId == "5017")
+                    .WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Content.Contains(dto.Condition) || p.Title.Contains(dto.Condition));
+                }
+            }
+            else//指定分类
+            {
+                sugar.WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
+                    .Where(p => p.BulletinTypeId == dto.NoticeTypeId);
+            }
+
+            var items1 = sugar.Select(it => new ArticleDetailDataDto
+            {
+                Page = SqlFunc.RowNumber($"{it.CreationTime} desc "),// SqlFunc.MappingColumn(default(int), "  row_number()  over( order by 'NoticeCreateDate'  ) "),
+                NoticeID = it.Id,
+                NoticeTitle = it.Title,
+                NoticeCreateDate = it.CreationTime
+            });
+
+            List<ArticleDetailDataDto> list = new List<ArticleDetailDataDto>();
+            if (dto.NoticeTypeId == "6")
+            {
+                //知识库
+                var items2 = _knowledgeRepository.Queryable()
+                    .Where(k => k.IsPublic == true)
+                    .Where(k => k.Status == EKnowledgeStatus.OnShelf)
+                    .Where(k => k.Attribution == "部门知识库")
+                    .WhereIF(!string.IsNullOrEmpty(dto.Condition), k => k.Content.Contains(dto.Condition) || k.Title.Contains(dto.Condition))
+                    .Select(it => new ArticleDetailDataDto
+                    {
+                        Page = 0,
+                        NoticeID = it.Id,
+                        NoticeTitle = it.Title,
+                        NoticeCreateDate = it.CreationTime
+                    });
+
+                list = await _orderRepository.UnionAll(items1, items2)
+                    .Select(x => new ArticleDetailDataDto
+                    {
+                        Page = SqlFunc.RowNumber($"{x.NoticeCreateDate} desc "),
+                        NoticeID = x.NoticeID,
+                        NoticeTitle = x.NoticeTitle,
+                        NoticeCreateDate = x.NoticeCreateDate
+                    })
+                    .OrderByDescending(x => x.NoticeCreateDate)
+                    .ToListAsync();
+            }
+            else
+            {
+                list = await items1.OrderByDescending(x => x.NoticeCreateDate).ToListAsync();
+            }
+
+            //数据为空返回空数据
+            if (list == null || list.Count == 0)
+                return OpenResponse.Ok(WebPortalDeResponse<List<ArticlePreviousAndNextDataDto>>.Success(null));
+            else
+            {
+                var temp = list.Find(p => p.NoticeID == dto.ID);
+                if (temp != null)
+                {
+                    List<ArticlePreviousAndNextDataDto> returnDto = new();
+                    //上一条
+                    var pTemp = list.Find(p => p.Page == temp.Page - 1);
+                    if (pTemp != null)
+
+                        returnDto.Add(new()
+                        {
+                            NoticeID = pTemp.NoticeID,
+                            NoticeTitle = pTemp.NoticeTitle,
+                            pntype = "p"
+                        });
+
+                    //下一条
+                    var nTemp = list.Find(p => p.Page == temp.Page + 1);
+                    if (nTemp != null)
+                        returnDto.Add(new()
+                        {
+                            NoticeID = nTemp.NoticeID,
+                            NoticeTitle = nTemp.NoticeTitle,
+                            pntype = "n"
+                        });
+                    return OpenResponse.Ok(WebPortalDeResponse<List<ArticlePreviousAndNextDataDto>>.Success(returnDto));
+                }
+                else
+                    return OpenResponse.Ok(WebPortalDeResponse<List<ArticlePreviousAndNextDataDto>>.Success(null));
+            }
+        }
+
+        /// <summary>
+        /// 全文检索
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost("getfulltextsearchlist_yibin")]
+        public async Task<OpenResponse> GetFullTextSearchList_YiBin([FromBody] QueryArticleListDto dto)
+        {
+            if (string.IsNullOrEmpty(dto.PushRanges))
+                dto.PushRanges = "2";
+
+            if (string.IsNullOrEmpty(dto.Condition))
+                return OpenResponse.Ok(WebPortalDeResponse<FullTextSearchListDataDto>.Success(null));
+
+            RefAsync<int> total = 0;
+            var items1 = _bulletinRepository.Queryable()
+                 .Where(p => p.LoseEfficacyTime >= DateTime.Now)
+                 .Where(p => p.IsArrive == true)
+                 .Where(p => SqlFunc.JsonListObjectAny(p.PushRanges, "Key", dto.PushRanges))
+                 .WhereIF(_appOptions.Value.IsYiBin, p => p.BulletinTypeId == "1" || p.BulletinTypeId == "5" || p.BulletinTypeId == "6" || p.BulletinTypeId == "7" || p.BulletinTypeId == "3" || p.BulletinTypeId == "4")
+                 .WhereIF(_appOptions.Value.IsZiGong, p => p.BulletinTypeId == "5013" || p.BulletinTypeId == "5016" || p.BulletinTypeId == "5011" || p.BulletinTypeId == "5015" || p.BulletinTypeId == "5017")
+                 .WhereIF(!string.IsNullOrEmpty(dto.Condition), p => p.Title.Contains(dto.Condition))
+                 .OrderByDescending(p => p.CreationTime)
+                 .Select(it => new FullTextSearchListDto
+                 {
+                     Page = 0,
+                     NoticeID = it.Id,
+                     //Content = it.Content,
+                     NoticeTypeID = it.BulletinTypeId,
+                     NoticeTypeName = it.BulletinTypeName,
+                     NoticeTitle = it.Title,
+                     NoticeBMName = it.SourceOrgName,
+                     NoticeCreateDate = it.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+                     TypeCode = ""
+                 });
+
+            List<FullTextSearchListDto> items = new List<FullTextSearchListDto>();
+            if (dto.NoticeType == "6")
+            {
+                //知识库
+                var items2 = _knowledgeRepository.Queryable()
+                    .Where(k => k.IsPublic == true)
+                    .Where(k => k.Status == EKnowledgeStatus.OnShelf)
+                    .Where(k => k.Attribution == "部门知识库")
+                    .WhereIF(!string.IsNullOrEmpty(dto.Condition), k => k.Content.Contains(dto.Condition) || k.Title.Contains(dto.Condition))
+                    .Select(it => new FullTextSearchListDto
+                    {
+                        Page = 0,
+                        NoticeID = it.Id,
+                        //NoticeContent = it.Content,
+                        NoticeTypeID = "6",
+                        NoticeTypeName = "知识库",
+                        NoticeTitle = it.Title,
+                        NoticeBMName = it.CreatorOrgName,
+                        NoticeCreateDate = it.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"),
+                        TypeCode = ""
+                    });
+
+                items = await _orderRepository.UnionAll(items1, items2)
+                  .Select(x => new FullTextSearchListDto
+                  {
+                      Page = SqlFunc.RowNumber($"{x.NoticeCreateDate} desc "),
+                      NoticeID = x.NoticeID,
+                      //NoticeContent = it.Content,
+                      NoticeTypeID = x.NoticeTypeID,
+                      NoticeTypeName = x.NoticeTypeName,
+                      NoticeTitle = x.NoticeTitle,
+                      NoticeBMName = x.NoticeBMName,
+                      NoticeCreateDate = x.NoticeCreateDate,
+                      TypeCode = ""
+                  })
+                  .OrderByDescending(p => p.NoticeCreateDate)
+                  .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+            }
+            else
+            {
+                items = await items1
+                  .OrderByDescending(p => p.NoticeCreateDate)
+                  .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
+            }
+
+            //计算总页数
+            int nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(total) / dto.PageSize));
+            FullTextSearchListDataDto dataDto = new()
+            {
+                PageCount = nPageCount,
+                data = _mapper.Map<IReadOnlyList<FullTextSearchListDto>>(items)
+            };
+            return OpenResponse.Ok(WebPortalDeResponse<FullTextSearchListDataDto>.Success(dataDto));
+        }
+
+        #endregion
+
         #region 用户
         /// <summary>
         /// 添加统一认证用户数据

+ 2 - 1
src/Hotline.Application.Tests/Controller/SnapshotControllerTest.cs

@@ -70,7 +70,7 @@ public class SnapshotControllerTest : TestBase
         inDto.County = "沿滩区";
         inDto.Description = "单元测试添加的时间描述";
         inDto.IsSecret = false;
-        //inDto.JobType = 
+        inDto.JobType = 1;
         foreach (var item in inDto.Files)
         {
             item.FileName = DateTime.Now.ToShortTimeString() + "文件.doc";
@@ -85,5 +85,6 @@ public class SnapshotControllerTest : TestBase
         orderEntity.Content.ShouldNotBeNullOrEmpty();
         var orderSnapshotEntity = await _orderSnapshotRepository.GetAsync(order.Id);
         orderSnapshotEntity.ShouldNotBeNull();
+        orderSnapshotEntity.JobType.ShouldBe(inDto.JobType);
     }
 }

+ 7 - 5
src/Hotline.Application/Orders/OrderApplication.cs

@@ -739,7 +739,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
     /// <returns></returns>
     public ISugarQueryable<Order> GetPublishOrderList(QueryOrderPublishDto dto)
     {
-        var query = _orderRepository.Queryable();
+        var query = _orderRepository.Queryable().Includes(d=>d.OrderTags);
         if (_appOptions.Value.IsLuZhou)
             query = query.Includes(d => d.FwCallRecord);
         //.Includes(d => d.OrderPublish)
@@ -750,8 +750,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
               //.WhereIF(dto.PubState == EPubState.Pub, d => d.Status >= EOrderStatus.Published)
               //.WhereIF(dto.PubState == EPubState.NoPub, d => d.Status == EOrderStatus.Filed)
               .WhereIF(!string.IsNullOrEmpty(dto.Channel), d => d.SourceChannelCode == dto.Channel)
-              .WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
-              .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName.Contains(dto.CenterToOrgHandlerName)) //派单人
+			  //.WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTagCode == dto.OrderTag!) //工单标签
+			  .WhereIF(!string.IsNullOrEmpty(dto.OrderTag), d => d.OrderTags.Any(ot => ot.DicDataValue == dto.OrderTag)) //工单标签
+			  .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName.Contains(dto.CenterToOrgHandlerName)) //派单人
               .WhereIF(!string.IsNullOrEmpty(dto.NameOrNo), d => d.AcceptorName.Contains(dto.NameOrNo) || d.AcceptorStaffNo.Contains(dto.NameOrNo)) //受理人/坐席
               .WhereIF(!string.IsNullOrEmpty(dto.ActualHandleOrgName), d => d.ActualHandleOrgName.Contains(dto.ActualHandleOrgName)) //接办部门(综合查询模糊)
               .WhereIF(!string.IsNullOrEmpty(dto.AcceptType), d => d.AcceptTypeCode == dto.AcceptType) //受理类型
@@ -1385,7 +1386,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
                                step.HandlerOrgId.StartsWith(_sessionContextProvider.SessionContext.RequiredOrgId)).Any());
         }
 
-        query = query.Includes(x => x.OrderScreens);
+        query = query.Includes(d => d.OrderScreens).Includes(d=>d.OrderTags);
 
         //if (!_appOptions.Value.IsYiBin)
         //{
@@ -1464,7 +1465,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
          .WhereIF(dto.IsSgin.HasValue && dto.IsSgin == false, d => d.CurrentStepAcceptTime == null)
          .WhereIF(dto.FiledType is FiledType.CenterFiled, d => d.FileOrgIsCenter == true)//d => d.ProcessType == EProcessType.Zhiban
          .WhereIF(dto.FiledType is FiledType.OrgFiled, d => d.FileOrgIsCenter == false)//d => d.ProcessType == EProcessType.Jiaoban
-         .WhereIF(!string.IsNullOrEmpty(dto.OrderTagCode), d => d.OrderTagCode == dto.OrderTagCode)
+         //.WhereIF(!string.IsNullOrEmpty(dto.OrderTagCode), d => d.OrderTagCode == dto.OrderTagCode)// 工单标签
+         .WhereIF(!string.IsNullOrEmpty(dto.OrderTagCode), d => d.OrderTags.Any(ot=>ot.DicDataValue == dto.OrderTagCode)) //工单标签
          .WhereIF(!string.IsNullOrEmpty(dto.FocusOnEvents), d => SqlFunc.SplitIn(d.FocusOnEvents, dto.FocusOnEvents))
          .OrderByIF(string.IsNullOrEmpty(dto.SortField), d => d.CreationTime, OrderByType.Desc)//默认排序时间为创建时间
          .OrderByIF(dto is { SortField: "no", SortRule: 0 }, d => d.No, OrderByType.Asc) //工单编号升序

+ 1 - 1
src/Hotline.Repository.SqlSugar/Orders/OrderRepository.cs

@@ -74,7 +74,7 @@ namespace Hotline.Repository.SqlSugar.Orders
             //弥补AddNav方法没有自动指派到创建人
             order.AssignToCreator(_dataPermissionFilterBuilder.DataPermissionManager);
 
-            await AddNav(order).Include(d => d.OrderExtension).ExecuteCommandAsync();
+            await AddNav(order).Include(d => d.OrderExtension).Include(d=>d.OrderTags).ExecuteCommandAsync();
 
             return order.Id;
         }

+ 17 - 8
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -2,6 +2,7 @@
 using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Hotspots;
+using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Enums.FlowEngine;
 using Hotline.Share.Enums.Order;
 using Hotline.Share.Enums.Settings;
@@ -88,12 +89,12 @@ namespace Hotline.Share.Dtos.Order
 
         public string? TagNames { get; set; }
 
-        /// <summary>
-        /// 工单标签(自贡)
-        /// </summary>
-        public string? OrderTag { get; set; }
+        ///// <summary>
+        ///// 工单标签(自贡)
+        ///// </summary>
+        //public string? OrderTag { get; set; }
 
-        public string? OrderTagCode { get; set; }
+        //public string? OrderTagCode { get; set; }
 
         #region 流程信息
 
@@ -1153,9 +1154,10 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 工单标签(自贡)
         /// </summary>
-        public string? OrderTag { get; set; }
+        public string? OrderTag => OrderTags != null && OrderTags.Any() ? string.Join(",", OrderTags.Select(x => x.DicDataName)) : string.Empty;
+
 
-        public string? OrderTagCode { get; set; }
+		public string? OrderTagCode { get; set; }
 
         #region 热点
 
@@ -1432,7 +1434,14 @@ namespace Hotline.Share.Dtos.Order
         ///知识库引用
         /// </summary>
         public List<Kv>? KnowledgeQuote { get; set; }
-    }
+
+        /// <summary>
+        /// 工单标签
+        /// </summary>
+        public List<OrderRelationTagDto>?  Tags { get; set; }
+
+        public List<SystemDicDataOutDto>? OrderTags { get; set; }
+	}
 
     public record CanLinkCallRecordOrderDto : PagedKeywordRequest
     {

+ 18 - 0
src/Hotline.Share/Dtos/Order/OrderFlowDto.cs

@@ -49,8 +49,26 @@ namespace Hotline.Share.Dtos.Order
 
     public class OrderSearchDelayDto
     {
+        /// <summary>
+        /// 延期申请Id
+        /// </summary>
+        public string Id { get; set; }
+
+        /// <summary>
+        /// 流程ID
+        /// </summary>
+        public string? WorkflowId { get; set; }
+
+        /// <summary>
+        /// 工单Id
+        /// </summary>
         public string OrderId { get; set; }
 
+        /// <summary>
+        /// 工单编号(冗余)
+        /// </summary>
+        public string No { get; set; }
+
         /// <summary>
         /// 申请部门Code
         /// </summary>

+ 16 - 0
src/Hotline.Share/Dtos/Order/OrderRelationTagDto.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Dtos.Order
+{
+	public class OrderRelationTagDto
+	{
+		/// <summary>
+		/// 标签ID
+		/// </summary>
+		public string Id { get; set; }
+	}
+}

+ 1 - 1
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -108,7 +108,7 @@ public class AddSnapshotOrderInDto : Position
     /// 1: 气割;
     /// 2: 其他;
     /// </summary>
-    public EJobType? JobType { get; set; }
+    public int? JobType { get; set; }
 
     /// <summary>
     /// 经营单位类别

+ 21 - 1
src/Hotline.Share/Dtos/WebPortal/ArticleDetailsDto.cs

@@ -21,6 +21,11 @@ namespace Hotline.Share.Dtos.WebPortal
         /// 公告ID
         /// </summary>
         public string Id { get; set; }
+
+        /// <summary>
+        /// 分类名称
+        /// </summary>
+        public string TypeName { get; set; }
     }
 
     public class ArticleIdByNumDto
@@ -58,7 +63,7 @@ namespace Hotline.Share.Dtos.WebPortal
         /// <summary>
         /// 公告范围,不传默认查询门户网站  0:全部;1:微信小程序;2:门户网站;4:市民APP;8:部门APP
         /// </summary>
-        public string? PushRanges {  get; set; }
+        public string? PushRanges { get; set; }
     }
 
     /// <summary>
@@ -190,6 +195,21 @@ namespace Hotline.Share.Dtos.WebPortal
         public IReadOnlyList<ArticleListDto> data { get; set; }
     }
 
+    public class ArticleDetailDataDto
+    {
+        /// <summary>
+        /// 总条数
+        /// </summary>
+        public int Page { get; set; }
+
+        /// <summary>
+        /// 总页数
+        /// </summary>
+        public string NoticeID { get; set; }
+        public string NoticeTitle { get; set; }
+        public DateTime NoticeCreateDate { get; set; }
+    }
+
     /// <summary>
     /// 公告列表
     /// </summary>

+ 0 - 29
src/Hotline.Share/Enums/Snapshot/EJobType.cs

@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Hotline.Share.Enums.Snapshot;
-public enum EJobType
-{
-
-    /// <summary>
-    /// 电焊
-    /// </summary>
-    [Description("电焊")]
-    Electric,
-
-    /// <summary>
-    /// 气割
-    /// </summary>
-    [Description("气割")]
-    Gas,
-
-    /// <summary>
-    /// 其他
-    /// </summary>
-    [Description("其他")]
-    Othoer
-}

+ 1 - 1
src/Hotline.Share/Hotline.Share.csproj

@@ -7,7 +7,7 @@
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>$(NoWarn);1591;8618;</NoWarn>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.115</Version>
+    <Version>1.0.116</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 24 - 12
src/Hotline/Orders/Order.cs

@@ -16,6 +16,7 @@ using XF.Domain.Exceptions;
 using XF.Domain.Extensions;
 using XF.Domain.Repository;
 using XF.Utility.EnumExtensions;
+using Hotline.KnowledgeBase;
 
 namespace Hotline.Orders
 {
@@ -172,21 +173,32 @@ namespace Hotline.Orders
         [SugarColumn(ColumnDescription = "标题")]
         public string Title { get; set; }
 
-        /// <summary>
-        /// 工单标签(自贡)
-        /// </summary>
-        [SugarColumn(ColumnDescription = "工单标签")]
-        public string? OrderTag { get; set; }
+		#region 工单标签(自贡)
+		/// <summary>
+		/// 工单标签(自贡)-- 弃用
+		/// </summary>
+		[SugarColumn(ColumnDescription = "工单标签-- 弃用")]
+		public string? OrderTag { get; set; }
 
-        [SugarColumn(ColumnDescription = "工单标签代码")]
-        public string? OrderTagCode { get; set; }
+		[SugarColumn(ColumnDescription = "工单标签代码-- 弃用")]
+		public string? OrderTagCode { get; set; }
 
-        #region 热点
 
-        /// <summary>
-        /// 热点
-        /// </summary>
-        [SugarColumn(ColumnDescription = "热点ID")]
+
+		/// <summary>
+		/// 工单标签
+		/// </summary>
+		[Navigate(typeof(OrderRelationTag), nameof(OrderRelationTag.OrderId), nameof(OrderRelationTag.TagId))]
+		public List<SystemDicData> OrderTags { get; set; }
+
+		#endregion
+
+		#region 热点
+
+		/// <summary>
+		/// 热点
+		/// </summary>
+		[SugarColumn(ColumnDescription = "热点ID")]
         public string? HotspotId { get; set; }
 
         //public string? HotspotCode { get; set; }

+ 24 - 0
src/Hotline/Orders/OrderRelationTag.cs

@@ -0,0 +1,24 @@
+using Hotline.KnowledgeBase;
+using SqlSugar;
+using System.ComponentModel;
+using XF.Domain.Entities;
+
+namespace Hotline.Orders
+{
+	[Description("工单关联标签")]
+	public class OrderRelationTag : ITable, IEntity
+	{
+
+		/// <summary>
+		/// 工单ID
+		/// </summary>
+		[SugarColumn(IsPrimaryKey = true)]
+		public string OrderId { get; set; }
+
+		/// <summary>
+		/// 标签ID
+		/// </summary>
+		[SugarColumn(IsPrimaryKey = true)]
+		public string TagId { get; set; }
+	}
+}

+ 2 - 2
src/Hotline/SeedData/SystemDicDataSeedData.cs

@@ -120,8 +120,8 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
         if (dicTypeCode == SysDicTypeConsts.JobType)
         {
             return [
-                new() { Id = "08dc3c1e-470f-4a7d-8433-3fed9bb59c95", DicDataValue = "dianhan", DicDataName = "电焊"},
-                new() { Id = "08dc3cc4-aa8b-41ad-8807-ba1571e00628", DicDataValue = "qige", DicDataName = "气割"},
+                new() { Id = "08dc3c1e-470f-4a7d-8433-3fed9bb59c95", DicDataValue = "0", DicDataName = "电焊"},
+                new() { Id = "08dc3cc4-aa8b-41ad-8807-ba1571e00628", DicDataValue = "1", DicDataName = "气割"},
                 ];
         }
         if (dicTypeCode == SysDicTypeConsts.BusinessUnitType)

+ 6 - 1
src/Hotline/Snapshot/OrderSnapshot.cs

@@ -45,7 +45,12 @@ public class OrderSnapshot : CreationSoftDeleteEntity
     /// 作业类型
     /// </summary>
     [SugarColumn(ColumnDescription = "作业类型")]
-    public EJobType? JobType { get; set; }
+    public int? JobType { get; set; }
+
+    /// <summary>
+    /// 作业类型
+    /// </summary>
+    public string? JobTypeName { get; set; }
 
     /// <summary>
     /// 经营单位类别