李昊 4 jaren geleden
bovenliggende
commit
d6e553a40b

+ 26 - 0
gx_api/GxPress/Model/GxPress.Result/Notice/NoticeListPageResult.cs

@@ -1,4 +1,5 @@
 using System;
+using GxPress.EnumConst;
 using GxPress.Result.App.Middle;
 
 namespace GxPress.Result.Notice
@@ -157,5 +158,30 @@ namespace GxPress.Result.Notice
         /// </summary>
         /// <value></value>
         public bool IsMyFlowRead { get; set; }
+        /// <summary>
+        /// 是否撤销
+        /// </summary>
+        /// <value></value>
+        public bool IsRecall { get; set; }
+        /// <summary>
+        /// 是否处理
+        /// </summary>
+        /// <value></value>
+        public bool IsDone { get; set; }
+        /// <summary>
+        /// 是否审核通过
+        /// </summary>
+        /// <value></value>
+        public bool IsChecked { get; set; }
+        /// <summary>
+        ///  处理状态 1 上会 2 待定
+        /// </summary>
+        /// <value></value>
+        public int DoneType { get; set; }
+        /// <summary>
+        /// 工作状态
+        /// </summary>
+        /// <value></value>
+        public FlowState FlowState { get; set; }
     }
 }

+ 25 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/NoticeRepository.cs

@@ -424,6 +424,31 @@ namespace GxPress.Repository.Implement
                                                 tede_flow
                                             WHERE
                                                 id = b.SourceId AND UserId = b.UserId) AS IsMyFlowRead,
+                                        (select IsRecall from tede_notice where id=a.MiddleId) as IsRecall,
+                                        (SELECT 
+                                                IsDone
+                                            FROM
+                                                tede_flow_todo
+                                            WHERE
+                                                type = 'ApproverCheck'
+                                                    AND UserId = a.UserId
+                                            LIMIT 1) AS IsDone,
+                                        (SELECT 
+                                                IsChecked
+                                            FROM
+                                                tede_flow_todo
+                                            WHERE
+                                                type = 'ApproverCheck'
+                                                    AND UserId = a.UserId
+                                            LIMIT 1) AS IsChecked,
+                                            (SELECT 
+                                                DoneType
+                                            FROM
+                                                tede_flow_todo
+                                            WHERE
+                                                type = 'ApproverCheck'
+                                                    AND UserId = a.UserId
+                                            LIMIT 1) AS DoneType,
                         (SELECT 
                             COUNT(1)
                         FROM

+ 19 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Notice/NoticeService.cs

@@ -353,6 +353,23 @@ namespace GxPress.Service.Implement.Notice
                     if (item.TypeValue == AllTypeConst.MyChecked.GetHashCode())
                         item.IsRead = item.IsFlowChecked;
                 }
+                if (item.IsDone && item.IsChecked)
+                    item.FlowState = FlowState.Checked;
+                else if (item.IsDone && !item.IsChecked)
+                {
+                    if (item.DoneType == 1)
+                        item.FlowState = FlowState.Meeting;
+                    else if (item.DoneType == 2)
+                        item.FlowState = FlowState.Wait;
+                    else
+                        item.FlowState = FlowState.Denied;
+                }
+                else if (item.IsDone && !item.IsChecked)
+                    item.FlowState = FlowState.Denied;
+                else
+                {
+                    item.FlowState = FlowState.Checking;
+                }
                 item.Title = _contentJsonService.GetTitile(item.Title, item.Content);
                 if (item.IsDelete == true)
                     item.NoticeStatus = 0;
@@ -375,10 +392,10 @@ namespace GxPress.Service.Implement.Notice
             {
                 using (TransactionScope transactionScope = new TransactionScope())
                 {
+                    //获取通知
+                    await _noticeRepository.UpdateAsync(Q.Where(nameof(Entity.Notice.Id), id).Set(nameof(Entity.Notice.IsRecall), true));
                     //删除middle
                     await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), id).Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.AllTypeConst.Inbox.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), false));
-                    //修改为撤销
-                    await _middleRepository.UpdateAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), id).Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.AllTypeConst.Inbox.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), true).Set(nameof(Entity.Middle.Middle.IsRecall), true));
                     //修改为草稿箱
                     await _middleRepository.UpdateAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), id).Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), true).Set(nameof(Entity.Middle.Middle.NoticeAddresseeType), 2));
                     //修改