heteng 3 лет назад
Родитель
Сommit
471fa7e340

+ 11 - 10
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -239,15 +239,17 @@ namespace Business.ResourceExamineManagement
             ////await _ic_item_stock.DeleteByIds(136123);
             ////await _ic_item_stock.DeleteByIds(136123);
 
 
             ////根据id删除表数据
             ////根据id删除表数据
-            //List<long> aa= new List<long>();
-            //aa.Add(136126);
-            //aa.Add(136127);
-            //aa.Add(136128);
+            //List<long> aa = new List<long>();
+            //aa.Add(136131);
+            //aa.Add(136132);
+            //aa.Add(136133);
             //FilterDefinition<ic_item_stock> filter = Builders<ic_item_stock>.Filter.In(s => s.icitem_id, aa);
             //FilterDefinition<ic_item_stock> filter = Builders<ic_item_stock>.Filter.In(s => s.icitem_id, aa);
-            //await _ic_item_stock.DeleteManyByIds(filter);
-            
+            //await _ic_item_stock.Delete(filter);
+
             //根据条件删除数据
             //根据条件删除数据
-            await _ic_item_stock.DeleteManyByCondition(p=>p.icitem_name == "111");
+            //await _ic_item_stock.Delete(p=>p.icitem_name == "test");
+
+            //await _ic_item_stock.DeleteByIds(aa);
 
 
         }
         }
 
 
@@ -259,15 +261,14 @@ namespace Business.ResourceExamineManagement
         /// <exception cref="NotImplementedException"></exception>
         /// <exception cref="NotImplementedException"></exception>
         public async Task<PschedDto> ReceiveResult(SeorderentryDto input)
         public async Task<PschedDto> ReceiveResult(SeorderentryDto input)
         {
         {
-            await test();
             //数据库快照-同步mysql库数据到mongoDB中
             //数据库快照-同步mysql库数据到mongoDB中
             //await SyncData(input.factoryId);
             //await SyncData(input.factoryId);
             //生成当前计算bangid
             //生成当前计算bangid
             //SnowFlake snow = new SnowFlake();
             //SnowFlake snow = new SnowFlake();
             //long bangid = snow.NextId();
             //long bangid = snow.NextId();
 
 
-            ////产能检查
-            //await ProductiveExamine(1733221167209762816, 100);
+            //产能检查
+            await ProductiveExamine(1733221167209762816, 100);
             return null;
             return null;
             throw new NotImplementedException();
             throw new NotImplementedException();
         }
         }

+ 15 - 13
MicroServices/Business/Business.Core/MongoDBHelper/IMongoDB.cs

@@ -65,29 +65,31 @@ namespace Business.Core.MongoDBHelper
         Task<List<T>> GetManyByIds(FilterDefinition<T> filter);
         Task<List<T>> GetManyByIds(FilterDefinition<T> filter);
 
 
         /// <summary>
         /// <summary>
-        /// 根据id删除数据
+        /// 根据id删除对象
         /// </summary>
         /// </summary>
-        /// <returns></returns>
-        Task DeleteByIds(long id);
+        /// <param name="id"></param>
+        Task DeleteById(long id);
 
 
         /// <summary>
         /// <summary>
-        /// 根据条件删除数据
+        /// 根据id列表批量删除对象
         /// </summary>
         /// </summary>
-        /// <returns></returns>
-        Task DeleteManyByIds(FilterDefinition<T> filter);
+        /// <param name="ids">id列表</param>
+        Task DeleteByIds(IEnumerable<long> ids);
 
 
         /// <summary>
         /// <summary>
-        /// 根据条件删除数据
+        /// 删除数据
         /// </summary>
         /// </summary>
+        /// <param name="expression"></param>
+        /// <param name="isOne"></param>
         /// <returns></returns>
         /// <returns></returns>
-        Task DeleteManyByCondition(Expression<Func<T, bool>> filter);
-
-        Task DeleteById(long id);
-
-        Task DeleteByIds(IEnumerable<long> ids);
-
         Task<DeleteResult> Delete(Expression<Func<T, bool>> expression, bool isOne = false);
         Task<DeleteResult> Delete(Expression<Func<T, bool>> expression, bool isOne = false);
 
 
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="filter"></param>
+        /// <param name="isOne"></param>
+        /// <returns></returns>
         Task<DeleteResult> Delete(FilterDefinition<T> filter, bool isOne = false);
         Task<DeleteResult> Delete(FilterDefinition<T> filter, bool isOne = false);
 
 
     }
     }

+ 13 - 28
MicroServices/Business/Business.Core/MongoDBHelper/MongoDBTools.cs

@@ -114,33 +114,6 @@ namespace Business.Core.MongoDBHelper
             return mongoCollection.Find(filter).ToListAsync();
             return mongoCollection.Find(filter).ToListAsync();
         }
         }
 
 
-        /// <summary>
-        /// 根据id删除数据
-        /// </summary>
-        /// <returns></returns>
-        public Task DeleteByIds(long id)
-        {
-            return mongoCollection.DeleteOneAsync(p => p.Id == id);
-        }
-
-        /// <summary>
-        /// 根据条件删除数据
-        /// </summary>
-        /// <returns></returns>
-        public Task DeleteManyByIds(FilterDefinition<T> filter)
-        {
-            return mongoCollection.DeleteManyAsync(filter);
-        }
-
-        /// <summary>
-        /// 根据条件删除数据
-        /// </summary>
-        /// <returns></returns>
-        public Task DeleteManyByCondition(Expression<Func<T, bool>> filter)
-        {
-            return mongoCollection.DeleteManyAsync(filter);
-        }
-
         /// <summary>
         /// <summary>
         /// 根据id删除对象
         /// 根据id删除对象
         /// </summary>
         /// </summary>
@@ -151,7 +124,7 @@ namespace Business.Core.MongoDBHelper
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// 根据id列表批量删除 对象
+        /// 根据id列表批量删除对象
         /// </summary>
         /// </summary>
         /// <param name="ids">id列表</param>
         /// <param name="ids">id列表</param>
         public Task DeleteByIds(IEnumerable<long> ids)
         public Task DeleteByIds(IEnumerable<long> ids)
@@ -159,6 +132,12 @@ namespace Business.Core.MongoDBHelper
             return mongoCollection.DeleteManyAsync(s => ids.Contains(s.Id));
             return mongoCollection.DeleteManyAsync(s => ids.Contains(s.Id));
         }
         }
 
 
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="expression"></param>
+        /// <param name="isOne"></param>
+        /// <returns></returns>
         public Task<DeleteResult> Delete(Expression<Func<T, bool>> expression, bool isOne = false)
         public Task<DeleteResult> Delete(Expression<Func<T, bool>> expression, bool isOne = false)
         {
         {
             if (isOne)
             if (isOne)
@@ -167,6 +146,12 @@ namespace Business.Core.MongoDBHelper
                 return mongoCollection.DeleteManyAsync(expression);
                 return mongoCollection.DeleteManyAsync(expression);
         }
         }
 
 
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="filter"></param>
+        /// <param name="isOne"></param>
+        /// <returns></returns>
         public Task<DeleteResult> Delete(FilterDefinition<T> filter, bool isOne = false)
         public Task<DeleteResult> Delete(FilterDefinition<T> filter, bool isOne = false)
         {
         {
             if (isOne)
             if (isOne)