Pārlūkot izejas kodu

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

Dun.Jason 12 stundas atpakaļ
vecāks
revīzija
aff0452707

+ 1 - 1
src/Hotline.Api/Controllers/FwThirdController.cs

@@ -533,7 +533,7 @@ namespace Hotline.Api.Controllers
                 .Where(p => p.IsPublic == true && p.Status == EKnowledgeStatus.OnShelf)
                 .WhereIF(!string.IsNullOrEmpty(dto.Title), p => p.Title.Contains(dto.Title))
                 .WhereIF(!string.IsNullOrEmpty(typeSpliceNameTags), p => SqlFunc.JsonArrayAny(p.Keywords, typeSpliceNameTags) == true)
-                .WhereIF(dto.KnowledgeType == 1, x => x.KnowledgeType.Any(t => t.KnowledgeTypeSpliceName.EndsWith("营商环境")))
+                .WhereIF(dto.KnowledgeType == 1, p => p.KnowledgeType.Any(t => t.KnowledgeTypeSpliceName.EndsWith("营商环境")))
                 .OrderByDescending(p => p.CreationTime)
                 .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
 

+ 0 - 1
src/Hotline.Api/Controllers/IdentityController.cs

@@ -121,7 +121,6 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
     public async Task<Dictionary<string, object>> GetThirdTokenAsync([FromBody] ThirdTokenInDto dto)
         => await _identityAppService.GetThirdTokenAsync(dto, HttpContext.RequestAborted);
 
-
     /// <summary>
     /// 第三方登录
     /// </summary>

+ 10 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -376,7 +376,7 @@ public class SnapshotController : BaseController
     }
 
     /// <summary>
-    /// 获取消息
+    /// 获取消息集合
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
@@ -384,6 +384,15 @@ public class SnapshotController : BaseController
     public async Task<IList<GetNotifyOutDto>> GetNotificationAsync([FromQuery] GetNotifyInDto dto)
         => await _snapshotApplication.GetNotificationAsync(dto, HttpContext.RequestAborted);
 
+    /// <summary>
+    /// 获取消息详情
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet("notification/{id}")]
+    public async Task<BulletinOutDto> GetNotificationDetailsAsync(string id)
+        => await _snapshotApplication.GetNotificationDetailsAsync(id, HttpContext.RequestAborted);
+
+
     #region 积分
     /// <summary>
     /// 积分榜

+ 2 - 2
src/Hotline.Api/config/appsettings.Development.json

@@ -68,13 +68,13 @@
     }
   },
     "ConnectionStrings": {
-        "Hotline": "PORT=5432;DATABASE=hotline_dev;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;"
+        "Hotline": "PORT=5432;DATABASE=hotline;HOST=110.188.24.182;PASSWORD=fengwo11!!;USER ID=dev;"
     },
   "Cache": {
     "Host": "110.188.24.182",
     "Port": 50179,
     "Password": "fengwo123!$!$",
-    "Database": 5 //hl:3, dev:5, test:2, demo:4
+    "Database": 3 //hl:3, dev:5, test:2, demo:4
   },
   "Swagger": true,
   "AccLog":  false,

+ 8 - 0
src/Hotline.Application/Snapshot/Contracts/ISnapshotApplication.cs

@@ -236,4 +236,12 @@ public interface ISnapshotApplication
     Task<int> GetPointsTotalAsync(PointItemsInDto dto, CancellationToken requestAborted);
 
     Task<IList<GetNotifyOutDto>> GetNotificationAsync(GetNotifyInDto dto, CancellationToken requestAborted);
+
+    /// <summary>
+    /// 获取通知详情
+    /// </summary>
+    /// <param name="id"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    Task<BulletinOutDto> GetNotificationDetailsAsync(string id, CancellationToken requestAborted);
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/Hotline.Application/Snapshot/DefaultSnapshotApplication.cs


+ 46 - 6
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -42,6 +42,7 @@ using Microsoft.Extensions.Options;
 using XF.Utility.MQ;
 using System.Threading;
 using BulletinOutDto = Hotline.Share.Dtos.Article.BulletinOutDto;
+using Hotline.Article;
 using NPOI.SS.Formula.Functions;
 
 namespace Hotline.Application.Snapshot;
@@ -89,8 +90,9 @@ public abstract class SnapshotApplicationBase
     private readonly ISnapshotPointsRecordRepository _pointsRecordRepository;
     private readonly IOptionsSnapshot<MqConfiguration> _mqConfiguration;
     private readonly INotificationReceiverRepository _notificationReceiverRepository;
+    private readonly INotificationRepository _notificationRepository;
 
-    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IIndustryRepository industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRedPackRecordRepository redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository, ISystemLogRepository systemLog, IGuiderSystemService guiderSystemService, ICapPublisher capPublisher, Publisher publisher, IFileDomainService fileDomainService, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IOrderVisitRepository orderVisitRepository, IOrderVisitDetailRepository orderVisitDetailRepository, IRedPackGuiderAuditRepository redPackGuiderAuditRepository, IInviteCodeRecordRepository inviteCodeRecordRepository, IInviteCodeRepository inviteCodeRepository, ICitizenRepository citizenRepository, ISnapshotPointsRecordRepository snapshotPointsRecordRepository, IOptionsSnapshot<MqConfiguration> mqConfiguration, INotificationReceiverRepository notificationReceiverRepository)
+    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IIndustryRepository industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRedPackRecordRepository redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository, ISystemLogRepository systemLog, IGuiderSystemService guiderSystemService, ICapPublisher capPublisher, Publisher publisher, IFileDomainService fileDomainService, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IOrderVisitRepository orderVisitRepository, IOrderVisitDetailRepository orderVisitDetailRepository, IRedPackGuiderAuditRepository redPackGuiderAuditRepository, IInviteCodeRecordRepository inviteCodeRecordRepository, IInviteCodeRepository inviteCodeRepository, ICitizenRepository citizenRepository, ISnapshotPointsRecordRepository snapshotPointsRecordRepository, IOptionsSnapshot<MqConfiguration> mqConfiguration, INotificationReceiverRepository notificationReceiverRepository, INotificationRepository notificationRepository)
     {
         _thirdLoginService = thirdLoginService;
         _industryRepository = industryRepository;
@@ -126,6 +128,7 @@ public abstract class SnapshotApplicationBase
         _pointsRecordRepository = snapshotPointsRecordRepository;
         _mqConfiguration = mqConfiguration;
         _notificationReceiverRepository = notificationReceiverRepository;
+        _notificationRepository = notificationRepository;
     }
 
     #region 小程序
@@ -404,12 +407,41 @@ public abstract class SnapshotApplicationBase
             {
                 NotificationId = m.NotificationId,
                 Title = notify.Title ,
-                CreationTime = m.CreationTime
+                CreationTime = m.CreationTime,
+                IsRead = m.IsRead
             }, true)
             .ToFixedListAsync(dto, requestAborted);
         return items;
     }
 
+    /// <summary>
+    /// 获取通知详情
+    /// </summary>
+    /// <param name="id"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    public async Task<BulletinOutDto> GetNotificationDetailsAsync(string id, CancellationToken token)
+    {
+        var outDto = await _notificationRepository.Queryable()
+            .LeftJoin<SnapshotBulletin>((notify, bulletin) => notify.ExternalId == bulletin.Id)
+            .Where((notify, bulletin) => notify.Id == id)
+            .Select((notify, bulletin) => new BulletinOutDto
+            {
+                Id = bulletin.Id,
+                Title = bulletin.Title,
+                CreationTime = bulletin.CreationTime,
+                Content = bulletin.Content,
+                VideoPath = bulletin.VideoPath
+            })
+            .FirstAsync(token);
+        await _notificationReceiverRepository.Updateable()
+            .SetColumns(m => m.IsRead, true)
+            .Where(m => m.NotificationId == id && m.ReceiverId == _sessionContext.UserId)
+            .ExecuteCommandAsync(token);
+
+        return outDto;
+    }
+
     /// <summary>
     /// 获取工单详情
     /// </summary>
@@ -1064,7 +1096,7 @@ public abstract class SnapshotApplicationBase
         outDto.VideoBulletin = await _notificationReceiverRepository.Queryable()
             .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
             .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
-            .Where((receiver, notify) => receiver.ReceiverId == _sessionContext.UserId)
+            .Where((receiver, notify, bulletin) => receiver.ReceiverId == _sessionContext.UserId && bulletin.Shape == EBulletinShape.Video)
             .GroupBy((receiver, notify, bulletin) => new 
             {
                 notify.Title,
@@ -1087,7 +1119,10 @@ public abstract class SnapshotApplicationBase
         {
             Items = await _notificationReceiverRepository.Queryable()
                 .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
-                .Select((receiver, notify) => new PointsBulletinItemsOutDto
+                .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
+                .Where((receiver, notify, bulletin) => bulletin.Shape == EBulletinShape.Message)
+                .GroupBy((receiver, notify, bulletin) => new { notify.ExternalId, notify.Title})
+                .Select((receiver, notify, bulletin) => new PointsBulletinItemsOutDto
                 {
                     BulletinId = notify.ExternalId,
                     Title = notify.Title,
@@ -1095,8 +1130,13 @@ public abstract class SnapshotApplicationBase
                 .Take(2)
                 .ToListAsync(),
             UnReadCount = await _notificationReceiverRepository.Queryable()
-            .Where(m => m.IsRead == false && m.ReceiverId == _sessionContext.UserId)
-            .CountAsync()
+                .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
+                .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
+                .Where((receiver, notify, bulletin) => receiver.IsRead == false 
+                && receiver.ReceiverId == _sessionContext.UserId 
+                && bulletin.Shape == EBulletinShape.Message)
+                .GroupBy((receiver, notify, bulletin) => new { receiver.ReceiverId, receiver.NotificationId})
+                .CountAsync()
         };
 
         return outDto;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
src/Hotline.Application/Snapshot/ZiGongSnapshotApplication.cs


+ 1 - 1
src/Hotline.Repository.SqlSugar/CallCenter/TrCallRecordRepository.cs

@@ -285,7 +285,7 @@ namespace Hotline.Repository.SqlSugar.CallCenter
                  .WhereIF(!string.IsNullOrEmpty(dto.SensitiveWord), d => SqlFunc.JsonArrayAny(d.Sensitive, dto.SensitiveWord))
                  .WhereIF(dto.IsAiAnswered == true, x => string.IsNullOrEmpty(x.UserId) == true && x.BeginIvrTime.HasValue && x.EndIvrTime.HasValue)
                  .WhereIF(dto.PhoneTypes != null, x => x.PhoneTypes == dto.PhoneTypes)
-                 .WhereIF(dto.QuerySelf == 1, x => x.UserId == _sessionContext.UserId)
+                 .WhereIF(dto.QuerySelf == "true", x => x.UserId == _sessionContext.UserId)
                  .OrderByDescending(x => x.CreatedTime);
         }
 

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

@@ -586,6 +586,11 @@ namespace Hotline.Share.Dtos.Article
         /// </summary>
         public string Content { get; set; }
 
+        /// <summary>
+        /// 视频地址
+        /// </summary>
+        public string? VideoPath { get; set; }
+
         public DateTime CreationTime { get; set; }
     }
 }

+ 5 - 0
src/Hotline.Share/Dtos/Snapshot/NotifyDto.cs

@@ -63,4 +63,9 @@ public class GetNotifyOutDto
     /// 创建时间
     /// </summary>
     public DateTime CreationTime { get; set; }
+
+    /// <summary>
+    /// 是否已读
+    /// </summary>
+    public bool IsRead { get; set; }
 }

+ 1 - 1
src/Hotline.Share/Dtos/TrCallCenter/TrTelDao.cs

@@ -581,7 +581,7 @@ namespace Hotline.Share.Dtos.TrCallCenter
         /// <summary>
         /// 是否自己的通话记录
         /// </summary>
-        public int? QuerySelf { get; set; }
+        public string? QuerySelf { get; set; }
     }
 
 

+ 23 - 0
src/Hotline/SeedData/SystemMenuSeedData.cs

@@ -0,0 +1,23 @@
+using Hotline.Settings;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Entities;
+
+namespace Hotline.SeedData;
+
+public class SystemMenuSeedData : ISeedData<SystemDicData>
+{
+    public IEnumerable<SystemDicData> HasData()
+    {
+        return new List<SystemDicData>();
+    }
+
+    public IEnumerable<SystemMenu> GetData()
+    {
+         throw new  NotImplementedException();
+        //return [new() { Id = }];
+    }
+}

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels