lihao před 4 roky
rodič
revize
901f57ce51

+ 24 - 4
gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

@@ -308,6 +308,7 @@ namespace GxPress.Service.Implement.Middle
         {
             try
             {
+                var query = Q.NewQuery();
                 using TransactionScope transactionScope = new TransactionScope();
                 var middleIds = request.MiddleIds;
                 //获取
@@ -361,7 +362,11 @@ namespace GxPress.Service.Implement.Middle
                             var analyze = await analyzeService.GetAnalyzeAsync(analyzeRequest);
                             if (analyze != null)
                                 await _analyzeRepository.DeleteAsync(analyze.Id);
-                            await _addresseeRepository.UpdateAsync(Q.Where(nameof(Entity.Addressee.UserId), request.UserId).WhereIn(nameof(Entity.Addressee.SourceId), ids).Set(nameof(Entity.Addressee.IsDelete), true));
+                            query = Q.NewQuery();
+                            query.Where(nameof(Entity.Addressee.UserId), request.UserId);
+                            query.WhereIn(nameof(Entity.Addressee.SourceId), ids);
+                            query.Set(nameof(Entity.Addressee.IsDelete), true);
+                            await _addresseeRepository.UpdateAsync(query);
                         }
                         //删除站内信收藏
                         if (item.CollectionType == AllTypeConst.Missive.GetHashCode())
@@ -370,7 +375,11 @@ namespace GxPress.Service.Implement.Middle
                             var analyze = await analyzeService.GetAnalyzeAsync(analyzeRequest);
                             if (analyze != null)
                                 await _analyzeRepository.DeleteAsync(analyze.Id);
-                            await _addresseeRepository.UpdateAsync(Q.Where(nameof(Entity.Addressee.UserId), request.UserId).WhereIn(nameof(Entity.Addressee.SourceId), ids).Set(nameof(Entity.Addressee.IsDelete), true));
+                            query = Q.NewQuery();
+                            query.Where(nameof(Entity.Addressee.UserId), request.UserId);
+                            query.WhereIn(nameof(Entity.Addressee.SourceId), ids);
+                            query.Set(nameof(Entity.Addressee.IsDelete), true);
+                            await _addresseeRepository.UpdateAsync(query);
                         }
                         //删除收藏会议
                         if (item.CollectionType == AllTypeConst.Meeting.GetHashCode())
@@ -407,7 +416,12 @@ namespace GxPress.Service.Implement.Middle
                 //删除收件箱
                 if (request.FolderType == AllTypeConst.Inbox.GetHashCode())
                 {
-                    await _addresseeRepository.UpdateAsync(Q.Where(nameof(Entity.Addressee.UserId), request.UserId).WhereIn(nameof(Entity.Addressee.SourceId), ids).Set(nameof(Entity.Addressee.IsDelete), true).Set(nameof(Entity.Addressee.IsRead), true));
+                    query = Q.NewQuery();
+                    query.Where(nameof(Entity.Addressee.UserId), request.UserId);
+                    query.WhereIn(nameof(Entity.Addressee.SourceId), ids);
+                    query.Set(nameof(Entity.Addressee.IsDelete), true);
+                    query.Set(nameof(Entity.Addressee.IsRead), true);
+                    await _addresseeRepository.UpdateAsync(query);
                     //request.IsDelete = true;
                 }
                 if (request.FolderType == AllTypeConst.Inbox.GetHashCode())
@@ -430,7 +444,13 @@ namespace GxPress.Service.Implement.Middle
                     {
                         //判断是否文件夹
                         if (middle.AttributeValue == 2)
-                            await _middleRepository.UpdateAsync(Q.Set(nameof(Entity.Middle.Middle.ParentId), 0).Where(nameof(Entity.Middle.Middle.ParentId), middle.Id).Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Wechat.GetHashCode()));
+                        {
+                             query = Q.NewQuery();
+                             query.Set(nameof(Entity.Middle.Middle.ParentId), 0);
+                             query.Where(nameof(Entity.Middle.Middle.ParentId), middle.Id);
+                             query.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Wechat.GetHashCode());
+                            await _middleRepository.UpdateAsync(query);
+                        }
                     }
                 }
                 await _middleRepository.DeleteAsync(request);