lihao 4 years ago
parent
commit
541435df4f

+ 1 - 1
gx_api/GxPress/Model/GxPress.Entity/Notice.cs

@@ -45,7 +45,7 @@ namespace GxPress.Entity
         [DataColumn]
         public NoticeTypeConst NoticeType { get; set; }
         /// <summary>
-        ///  5 通知 6站内信 15 我审批的 16 我发出的 17 抄送我的 
+        ///  5 通知 6站内信 15 我审批的 16 我发出的 17 抄送我的 18匿名
         /// </summary>
         /// <value></value>
         [DataColumn]

+ 3 - 0
gx_api/GxPress/Service/GxPress.Service.Implement/CommonSqlKata/CommonSqlKataService.cs

@@ -118,6 +118,7 @@ namespace GxPress.Service.Implement.CommonSqlKataService
             IsMyFlowRead.Select("IsRead");
             query.Select(IsMyFlowRead, "IsMyFlowRead");
             var IsDone = new SqlKata.Query("tede_flow_todo");
+            IsDone.WhereColumns("tede_flow_todo.FlowId", "=", "tede_notice.SourceId");
             IsDone.WhereColumns("tede_flow_todo.UserId", "=", "tede_middle.UserId");
             IsDone.Where("tede_flow_todo.type", "ApproverCheck");
             IsDone.Limit(1);
@@ -125,12 +126,14 @@ namespace GxPress.Service.Implement.CommonSqlKataService
             query.Select(IsDone, "IsDone");
             var IsChecked = new SqlKata.Query("tede_flow_todo");
             IsChecked.WhereColumns("tede_flow_todo.UserId", "=", "tede_middle.UserId");
+            IsChecked.WhereColumns("tede_flow_todo.FlowId", "=", "tede_notice.SourceId");
             IsChecked.Where("tede_flow_todo.type", "ApproverCheck");
             IsChecked.Limit(1);
             IsChecked.Select("IsChecked");
             query.Select(IsChecked, "IsChecked");
             var DoneType = new SqlKata.Query("tede_flow_todo");
             DoneType.WhereColumns("tede_flow_todo.UserId", "=", "tede_middle.UserId");
+            DoneType.WhereColumns("tede_flow_todo.FlowId", "=", "tede_notice.SourceId");
             DoneType.Where("tede_flow_todo.type", "ApproverCheck");
             DoneType.Limit(1);
             DoneType.Select("DoneType");

+ 14 - 9
gx_api/GxPress/Service/GxPress.Service.Implement/Notice/NoticeService.cs

@@ -480,24 +480,29 @@ namespace GxPress.Service.Implement.Notice
                 using (TransactionScope transactionScope = new TransactionScope())
                 {
                     var query = Q.NewQuery();
-                    //获取通知
+                    //修改通知
                     await _noticeRepository.UpdateAsync(Q.Where(nameof(Entity.Notice.Id), id).Set(nameof(Entity.Notice.IsRecall), true));
                     //删除middle
                     query.Where(nameof(Entity.Middle.Middle.MiddleId), id);
                     query.Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.AllTypeConst.Inbox.GetHashCode());
                     query.Where(nameof(Entity.Middle.Middle.IsAdmin), false);
-                    query.Set(nameof(Entity.Middle.Middle.IsRecall), true);
-                    await _middleRepository.UpdateAsync(query);
-                    //删除收件人和抄送人
-                    await _addresseeRepository.DeleteAsync(id, AllTypeConst.Notice.GetHashCode(), 0);
-                    //修改为草稿箱
+                    //query.Set(nameof(Entity.Middle.Middle.IsRecall), true);
+                    await _middleRepository.DeleteAsync(query);
+                    //修改middle
                     query = Q.NewQuery();
                     query.Where(nameof(Entity.Middle.Middle.MiddleId), id);
-                    query.Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode());
+                    query.Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.AllTypeConst.Inbox.GetHashCode());
                     query.Where(nameof(Entity.Middle.Middle.IsAdmin), true);
-                    query.Set(nameof(Entity.Middle.Middle.NoticeAddresseeType), 2);
+                    query.Set(nameof(Entity.Middle.Middle.IsRecall), true);
                     await _middleRepository.UpdateAsync(query);
-                    //修改
+                    // //修改为草稿箱
+                    // query = Q.NewQuery();
+                    // query.Where(nameof(Entity.Middle.Middle.MiddleId), id);
+                    // query.Where(nameof(Entity.Middle.Middle.FolderType), GxPress.EnumConst.FolderTypeConst.Notice.GetHashCode());
+                    // query.Where(nameof(Entity.Middle.Middle.IsAdmin), true);
+                    // query.Set(nameof(Entity.Middle.Middle.NoticeAddresseeType), 2);
+                    // await _middleRepository.UpdateAsync(query);
+                    //修改未撤回状态
                     await _noticeRepository.UpdateAsync(Q.Where(nameof(Entity.Notice.Id), id).Set(nameof(Entity.Notice.NoticeType), NoticeTypeConst.Draft.GetHashCode()));
                     transactionScope.Complete();
                 }