lihao 4 vuotta sitten
vanhempi
commit
224a5dabd9

+ 7 - 2
gx_api/GxPress/Model/GxPress.Entity/Notice.cs

@@ -14,7 +14,12 @@ namespace GxPress.Entity
         /// </summary>
         [DataColumn]
         public string Title { get; set; }
-
+        /// <summary>
+        /// 简单标题
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string SimplenessTtile { get; set; }
         /// <summary>
         /// 用户ID
         /// </summary>
@@ -96,6 +101,6 @@ namespace GxPress.Entity
         [DataColumn]
         public bool IsRecall { get; set; }
 
-        
+
     }
 }

+ 6 - 2
gx_api/GxPress/Model/GxPress.Request/Notice/NoticeInRequest.cs

@@ -17,9 +17,13 @@ namespace GxPress.Request.Notice
         /// <summary>
         /// 标题
         /// </summary>
-
         public string Title { get; set; }
         /// <summary>
+        /// 简单标题
+        /// </summary>
+        /// <value></value>
+        public string SimplenessTitle { get; set; }
+        /// <summary>
         /// 用户ID
         /// </summary>
 
@@ -96,7 +100,7 @@ namespace GxPress.Request.Notice
         /// </summary>
         /// <value></value>
         public int SonId { get; set; }
-         /// <summary>
+        /// <summary>
         /// 发件人
         /// </summary>
         /// <value></value>

+ 2 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/NoticeRepository.cs

@@ -91,7 +91,8 @@ namespace GxPress.Repository.Implement
                         SourceId = request.SoureId,
                         IsDelete = false,
                         IsTop = false,
-                        SonId = request.SonId
+                        SonId = request.SonId,
+                        SimplenessTtile = request.SimplenessTitle
                     };
                     noticeId = await _repository.InsertAsync(notice);
                     transactionScope.Complete();

+ 3 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/Notice/NoticeService.Insert.cs

@@ -7,7 +7,6 @@ using GxPress.Request.App.Middle;
 using GxPress.Request.Notice;
 using GxPress.EnumConst;
 using System.Linq;
-using System.Transactions;
 using System.Collections.Generic;
 using Datory;
 
@@ -28,15 +27,15 @@ namespace GxPress.Service.Implement.Notice
                     var userEntity = await _userRepository.GetAsync(request.UserId);
                     if (userEntity == null)
                         throw new BusinessException("用户不存在");
+                    //获取简单标题
+                    request.SimplenessTitle = _contentJsonService.GetTitile(request.Title, request.Content);
                     var noticeId = 0;
                     var middleId = 0;
                     var addresseeUsers = new List<User>();
                     var ccUsers = new List<User>();
-                    request.Title = _contentJsonService.GetTitile(request.Title, request.Content);
                     //添加通知
                     if (request.Id == 0)
                     {
-
                         noticeId = await _noticeRepository.InsertAsync(request);
                         if (noticeId == 0) return false;
                         var middleInsertTypes = new MiddleInsertTypeRequest
@@ -62,6 +61,7 @@ namespace GxPress.Service.Implement.Notice
                         notice.Title = request.Title;
                         notice.HtmlContent = request.HtmlContent;
                         notice.SourceId = request.SoureId;
+                        notice.SimplenessTtile = request.SimplenessTitle;
                         await _noticeRepository.UpdateNoticeAsync(notice);
                         //删除middle
                         await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), noticeId).Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Inbox.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), false));