lihao 4 years ago
parent
commit
23c6c61535

+ 42 - 42
gx_api/GxPress/Model/GxPress.Entity/Middle/Middle.cs

@@ -99,54 +99,54 @@ namespace GxPress.Entity.Middle
         /// <value></value>
         [DataColumn]
         public bool IsUpload { get; set; }
-        /// <summary>
-        /// 标题
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string Title { get; set; }
+        // /// <summary>
+        // /// 标题
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string Title { get; set; }
 
-        /// <summary>
-        /// 长标题标题
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string TitleLong { get; set; }
+        // /// <summary>
+        // /// 长标题标题
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string TitleLong { get; set; }
 
-        /// <summary>
-        /// 长标题 长内容
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string Content { get; set; }
+        // /// <summary>
+        // /// 长标题 长内容
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string Content { get; set; }
 
-        /// <summary>
-        /// 收件人
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string AddressUser { get; set; }
+        // /// <summary>
+        // /// 收件人
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string AddressUser { get; set; }
 
-        /// <summary>
-        /// 抄送人
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string CcUser { get; set; }
+        // /// <summary>
+        // /// 抄送人
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string CcUser { get; set; }
 
-        /// <summary>
-        /// 完整收件人
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string AddressUserComplete { get; set; }
+        // /// <summary>
+        // /// 完整收件人
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string AddressUserComplete { get; set; }
 
-        /// <summary>
-        /// 完整抄送人
-        /// </summary>
-        /// <value></value>
-        [DataColumn]
-        public string CcUserComplete { get; set; }
+        // /// <summary>
+        // /// 完整抄送人
+        // /// </summary>
+        // /// <value></value>
+        // [DataColumn]
+        // public string CcUserComplete { get; set; }
         /// <summary>
         /// 是否撤回
         /// </summary>

+ 35 - 35
gx_api/GxPress/Model/GxPress.Request/App/Middle/MiddleInsertRequest.cs

@@ -117,42 +117,42 @@ namespace GxPress.Request.App.Middle
         /// 是否阅读
         /// </summary>
         public bool IsRead { get; set; }
-        /// <summary>
-        /// 标题
-        /// </summary>
-        /// <value></value>
-        public string Title { get; set; }
+        // /// <summary>
+        // /// 标题
+        // /// </summary>
+        // /// <value></value>
+        // public string Title { get; set; }
 
-        /// <summary>
-        /// 长标题标题
-        /// </summary>
-        /// <value></value>
-        public string TitleLong { get; set; }
+        // /// <summary>
+        // /// 长标题标题
+        // /// </summary>
+        // /// <value></value>
+        // public string TitleLong { get; set; }
 
-        /// <summary>
-        /// 长标题 长内容
-        /// </summary>
-        /// <value></value>
-        public string Content { get; set; }
-        /// <summary>
-        /// 收件人
-        /// </summary>
-        /// <value></value>
-        public string AddressUser { get; set; }
-        /// <summary>
-        /// 抄送人
-        /// </summary>
-        /// <value></value>
-        public string CcUser { get; set; }
-        /// <summary>
-        /// 完整收件人
-        /// </summary>
-        /// <value></value>
-        public string AddressUserComplete { get; set; }
-        /// <summary>
-        /// 完整抄送人
-        /// </summary>
-        /// <value></value>
-        public string CcUserComplete { get; set; }
+        // /// <summary>
+        // /// 长标题 长内容
+        // /// </summary>
+        // /// <value></value>
+        // public string Content { get; set; }
+        // /// <summary>
+        // /// 收件人
+        // /// </summary>
+        // /// <value></value>
+        // public string AddressUser { get; set; }
+        // /// <summary>
+        // /// 抄送人
+        // /// </summary>
+        // /// <value></value>
+        // public string CcUser { get; set; }
+        // /// <summary>
+        // /// 完整收件人
+        // /// </summary>
+        // /// <value></value>
+        // public string AddressUserComplete { get; set; }
+        // /// <summary>
+        // /// 完整抄送人
+        // /// </summary>
+        // /// <value></value>
+        // public string CcUserComplete { get; set; }
     }
 }

+ 2 - 9
gx_api/GxPress/Repository/GxPress.Repository.Implement/MiddleRepository.cs

@@ -66,7 +66,7 @@ namespace GxPress.Repository.Implement
         {
             if (middles.Count == 0)
                 return false;
-            var sql = "INSERT INTO `tede_middle`(`Guid`,`CreatedDate`,`LastModifiedDate`,`FolderName`,`FolderType`,`IsTop`,`RoleId`,`Sort`,`MiddleId`,`ParentId`,`UserId`,`MiddleSonId`,`IsRead`,`NoticeAddresseeType`,`IsAdmin`,`IsDelete`,`AttributeValue`,`IsDefault`,`IsUpload`,`Title`,`TitleLong`,`Content`,`AddressUser`,`CcUser`,`AddressUserComplete`,`CcUserComplete`,`IsRecall`)VALUES";
+            var sql = "INSERT INTO `tede_middle`(`Guid`,`CreatedDate`,`LastModifiedDate`,`FolderName`,`FolderType`,`IsTop`,`RoleId`,`Sort`,`MiddleId`,`ParentId`,`UserId`,`MiddleSonId`,`IsRead`,`NoticeAddresseeType`,`IsAdmin`,`IsDelete`,`AttributeValue`,`IsDefault`,`IsUpload`,`IsRecall`)VALUES";
             foreach (var item in middles)
             {
                 var guId = Guid.NewGuid().ToString();
@@ -76,7 +76,7 @@ namespace GxPress.Repository.Implement
                 var isDelete = item.IsDelete == true ? 1 : 0;
                 var isAdmin = item.IsAdmin == true ? 1 : 0;
                 var isRecall = item.IsRecall == true ? 1 : 0;
-                sql += $"('{guId}','{createdDate}','{createdDate}','{item.FolderName}',{item.FolderType},{item.IsTop},{item.RoleId},{item.Sort},{item.MiddleId},{item.ParentId},{item.UserId},{item.MiddleSonId},{isRead},{item.NoticeAddresseeType.GetHashCode()},{isAdmin},{isDelete},{item.AttributeValue},{isDefault},0,'{item.Title}','{item.TitleLong}','{item.Content}','{item.AddressUser}','{item.CcUser}','{item.AddressUserComplete}','{item.CcUserComplete}',{isRecall}),";
+                sql += $"('{guId}','{createdDate}','{createdDate}','{item.FolderName}',{item.FolderType},{item.IsTop},{item.RoleId},{item.Sort},{item.MiddleId},{item.ParentId},{item.UserId},{item.MiddleSonId},{isRead},{item.NoticeAddresseeType.GetHashCode()},{isAdmin},{isDelete},{item.AttributeValue},{isDefault},0,{isRecall}),";
             }
             sql = sql.Remove(sql.Length - 1, 1);
             var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
@@ -280,13 +280,6 @@ namespace GxPress.Repository.Implement
                 var listType = new List<int> { GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Missive.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Submitted.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Approval.GetHashCode(), GxPress.EnumConst.FolderTypeConst.Cc.GetHashCode() };
                 query.WhereIn(nameof(Middle.FolderType), listType);
             }
-            if (!string.IsNullOrWhiteSpace(request.KeyWord))
-            {
-                query.OrWhere(nameof(Middle.TitleLong), request.KeyWord);
-                query.OrWhere(nameof(Middle.AddressUserComplete), request.KeyWord);
-                query.OrWhere(nameof(Middle.CcUserComplete), request.KeyWord);
-                query.OrWhere(nameof(Middle.Content), request.KeyWord);
-            }
             query.Where(nameof(Middle.UserId), request.UserId);
             return await _repository.GetAllAsync(query.Select("Id", "Guid", "CreatedDate", "LastModifiedDate", "FolderName", "FolderType", "IsTop", "RoleId", "Sort", "MiddleId", "ParentId", "UserId", "MiddleSonId", "IsRead", "NoticeAddresseeType", "IsAdmin", "IsDelete", "AttributeValue", "IsDefault", "IsUpload", "Title", "AddressUser", "CcUser"));
         }

+ 2 - 16
gx_api/GxPress/Service/GxPress.Service.Implement/Flow/FlowService.Inbox.cs

@@ -34,14 +34,7 @@ namespace GxPress.Service.Implement
                 MiddleSonId = 0,
                 IsAdmin = false,
                 NoticeAddresseeType = 0,
-                Title = $"{user.Name}{process.Name}申请",
-                IsRead = false,
-                TitleLong = "",
-                Content = "",
-                AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addressUsers.Select(n => n.Name)),
-                AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addressUsers.Select(n => n.Name), 10),
-                CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name)),
-                CcUser = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name), 10),
+                IsRead = false
             };
             middles.Add(middle);
             var users = addressUsers.ToList();
@@ -59,14 +52,7 @@ namespace GxPress.Service.Implement
                     MiddleSonId = 0,
                     IsAdmin = false,
                     NoticeAddresseeType = 0,
-                    Title = $"{user.Name}{process.Name}申请",
-                    IsRead = false,
-                    TitleLong = "",
-                    Content = "",
-                    AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addressUsers.Select(n => n.Name)),
-                    AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addressUsers.Select(n => n.Name), 10),
-                    CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name)),
-                    CcUser = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name), 10),
+                    IsRead = false
                 };
                 middles.Add(middle);
             }

+ 7 - 7
gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

@@ -226,15 +226,15 @@ namespace GxPress.Service.Implement.Middle
                 MiddleSonId = request.MiddleSonId,
                 IsAdmin = request.IsAdmin,
                 NoticeAddresseeType = request.NoticeAddresseeType,
-                Title = request.Title,
+                //Title = request.Title,
                 IsRead = false,
                 IsUpload = false,
-                TitleLong = request.TitleLong,
-                Content = "",
-                AddressUser = request.AddressUser,
-                CcUser = request.CcUser,
-                CcUserComplete = request.CcUserComplete,
-                AddressUserComplete = request.AddressUserComplete,
+                //TitleLong = request.TitleLong,
+                //Content = "",
+                //AddressUser = request.AddressUser,
+                // CcUser = request.CcUser,
+                // CcUserComplete = request.CcUserComplete,
+                //AddressUserComplete = request.AddressUserComplete,
                 IsRecall = false
             };
             if (request.AttributeValue == 0)

+ 3 - 20
gx_api/GxPress/Service/GxPress.Service.Implement/Missive/MissiveService.cs

@@ -149,10 +149,7 @@ namespace GxPress.Service.Implement.Missive
                         UserId = request.UserId,
                         AttributeValue = 1,
                         NoticeAddresseeType = request.MissiveAttributeType,
-                        IsAdmin = true,
-                        Title = _contentJsonService.GetTitile(request.Title, request.Content),
-                        TitleLong = request.Title,
-                        Content = request.Content,
+                        IsAdmin = true
                     };
                     await _middleService.InsertAsync(result);
                     transactionScope.Complete();
@@ -188,10 +185,7 @@ namespace GxPress.Service.Implement.Missive
                         UserId = request.UserId,
                         AttributeValue = 1,
                         NoticeAddresseeType = request.MissiveAttributeType,
-                        IsAdmin = true,
-                        Title = _contentJsonService.GetTitile(request.Title, request.Content),
-                        TitleLong = request.Title,
-                        Content = request.Content,
+                        IsAdmin = true
                     };
                     await _middleService.InsertAsync(result);
                     request.Id = missiveId;
@@ -286,14 +280,7 @@ namespace GxPress.Service.Implement.Missive
                         MiddleSonId = 0,
                         IsAdmin = false,
                         NoticeAddresseeType = request.MissiveAttributeType,
-                        IsRead = false,
-                        Title = _contentJsonService.GetTitile(request.Title, request.Content),
-                        TitleLong = request.Title,
-                        Content = request.Content,
-                        AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name)),
-                        AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10),
-                        CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name)),
-                        CcUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10),
+                        IsRead = false
                     };
                     middles.Add(middle);
                 }
@@ -316,10 +303,6 @@ namespace GxPress.Service.Implement.Missive
             await _middleRepository.InsertAsync(middles);
             //
             var middleModel = await _middleRepository.GetMiddleAsync(Q.Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.FolderTypeConst.Missive.GetHashCode()).Where(nameof(Entity.Middle.Middle.MiddleId), missiveId));
-            middleModel.AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
-            middleModel.AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
-            middleModel.CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
-            middleModel.CcUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
             await _middleRepository.UpdateAsync(middleModel);
             return true;
         }

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

@@ -46,10 +46,7 @@ namespace GxPress.Service.Implement.Notice
                             MiddleSonId = 0,
                             NoticeAddresseeType = request.NoticeType,
                             AttributeValue = 1,
-                            Title = _contentJsonService.GetTitile(request.Title, request.Content),
-                            IsAdmin = true,
-                            TitleLong = request.Title,
-                            Content = request.Content,
+                            IsAdmin = true
                         };
                         //添加自己
                         middleId = await _middleService.InsertAsync(middleInsertTypes);
@@ -65,7 +62,7 @@ namespace GxPress.Service.Implement.Notice
                         notice.SourceId = request.SoureId;
                         await _noticeRepository.UpdateNoticeAsync(notice);
                         //删除middle
-                        await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), noticeId).Where(nameof(Entity.Middle.Middle.FolderType), 1).Where(nameof(Entity.Middle.Middle.IsAdmin), false));
+                        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));
                         //删除收件人
                         await _addresseeRepository.DeleteAsync(noticeId, GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode(), 2);
                         //删除抄送人
@@ -115,7 +112,7 @@ namespace GxPress.Service.Implement.Notice
                         NoticeAddresseeType = request.NoticeType,
                         IsTop = false,
                         IsRead = true,
-                        SourceType =  request.TypeValue
+                        SourceType = request.TypeValue
                     };
                     var noticeAddresseeId = await _addresseeRepository.InsertAsync(addresseeEntity);
                     request.NoticeAddresseeUserIds = request.NoticeAddresseeUserIds.Distinct().ToList();
@@ -176,7 +173,7 @@ namespace GxPress.Service.Implement.Notice
                             var middle = new Entity.Middle.Middle
                             {
                                 MiddleId = noticeId,
-                                FolderType = GxPress.EnumConst.AllTypeConst.Inbox.GetHashCode(),
+                                FolderType = AllTypeConst.Inbox.GetHashCode(),
                                 IsTop = false,
                                 AttributeValue = 1,
                                 ParentId = 0,
@@ -184,29 +181,22 @@ namespace GxPress.Service.Implement.Notice
                                 MiddleSonId = item.Id,
                                 IsAdmin = false,
                                 NoticeAddresseeType = request.NoticeType,
-                                Title = _contentJsonService.GetTitile(request.Title, request.Content),
                                 IsRead = false,
-                                TitleLong = request.Title,
-                                Content = "",
-                                AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name)),
-                                AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10),
-                                CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name)),
-                                CcUser = Common.Tools.StringUtils.ObjectCollectionToString(ccUsers.Select(n => n.Name), 10),
-                                IsRecall=false
+                                IsRecall = false
                             };
                             middles.Add(middle);
                         }
                     }
-                    //修改middler
-                    if (middleId > 0)
-                    {
-                        var middle = await _middleRepository.GetMiddleAsync(middleId);
-                        middle.AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
-                        middle.AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
-                        middle.CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
-                        middle.CcUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
-                        await _middleRepository.UpdateAsync(middle);
-                    }
+                    // //修改middler
+                    // if (middleId > 0)
+                    // {
+                    //     var middle = await _middleRepository.GetMiddleAsync(middleId);
+                    //     middle.AddressUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
+                    //     middle.AddressUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
+                    //     middle.CcUserComplete = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name));
+                    //     middle.CcUser = Common.Tools.StringUtils.ObjectCollectionToString(addresseeUsers.Select(n => n.Name), 10);
+                    //     await _middleRepository.UpdateAsync(middle);
+                    // }
                     //添加文件
                     if (request.NoticeType == NoticeTypeConst.Send)
                         //添加收件人
@@ -243,10 +233,10 @@ namespace GxPress.Service.Implement.Notice
                         MiddleSonId = 0,
                         NoticeAddresseeType = request.NoticeType,
                         AttributeValue = 1,
-                        Title = _contentJsonService.GetTitile(request.Title, request.Content),
+                        //Title = _contentJsonService.GetTitile(request.Title, request.Content),
                         IsAdmin = true,
-                        TitleLong = request.Title,
-                        Content = request.Content,
+                        //TitleLong = request.Title,
+                        //Content = request.Content,
                     };
                     //添加自己
                     var middleId = await _middleService.InsertAsync(middleInsertTypes);