Преглед изворни кода

产能检查取数添加isDelete条件

heteng пре 3 година
родитељ
комит
42f4865862

+ 8 - 5
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -392,6 +392,9 @@ namespace Business.ResourceExamineManagement
             SnowFlake snow = new SnowFlake();
             long bangid = snow.NextId();
 
+            string bom_number = "BOM00042070";
+            int packages = 1000;
+
             input.tenantId = 102;
             input.factoryId = 10201;
 
@@ -402,7 +405,7 @@ namespace Business.ResourceExamineManagement
             //await SyncData(input.tenantId, input.factoryId, bangid);
 
             //产能检查
-            //await ProductiveExamine(1353957529328291842, 1000);
+            await ProductiveExamine(bom_number, packages);
             var id = Save(input.tenantId, input.factoryId);
             await GenerateMorder(id);
             return null;
@@ -573,14 +576,14 @@ namespace Business.ResourceExamineManagement
             }
             #region 1、数据准备
             //1.1、获取工艺路径数据
-            mes_technique tech = _mes_technique.Find(p => p.bom == bom_number).Result.FirstOrDefault();
+            mes_technique tech = _mes_technique.Find(p => p.bom == bom_number && p.IsDeleted == false).Result.FirstOrDefault();
             if (tech == null)
             {
                 throw new NotImplementedException("请先配置工艺路径!");
             }
 
             //1.2、获取工艺路径关联工序数据
-            List<mes_tech_process> tech_Processes = await _mes_tech_process.GetManyByCondition(x => x.tech_id == tech.Id);
+            List<mes_tech_process> tech_Processes = await _mes_tech_process.GetManyByCondition(p => p.tech_id == tech.Id && p.IsDeleted == false);
             if (tech_Processes.Count == 0)
             {
                 throw new NotImplementedException("请先配置工序!");
@@ -590,11 +593,11 @@ namespace Business.ResourceExamineManagement
             //FilterDefinition<mes_process> filter = Builders<mes_process>.Filter.In(s => s.Id, tech_Processes.Select(m => m.proc_id).ToList());
             //List<mes_process> process = await _mes_process.GetManyByIds(filter);
             List<long> procIds = tech_Processes.Select(m => m.proc_id).ToList();
-            List<mes_process> process = await _mes_process.GetManyByCondition(p => procIds.Contains(p.Id));
+            List<mes_process> process = await _mes_process.GetManyByCondition(p => procIds.Contains(p.Id) && p.IsDeleted == false);
 
             //1.3、获取工艺工序关联工位信息
             List<long> techProcIds = tech_Processes.Select(m => m.Id).ToList();
-            List<mes_tech_proc_workshop> tech_Proc_Workshops = await _mes_tech_proc_workshop.GetManyByCondition(p => techProcIds.Contains(p.tech_proc_id));
+            List<mes_tech_proc_workshop> tech_Proc_Workshops = await _mes_tech_proc_workshop.GetManyByCondition(p => techProcIds.Contains(p.tech_proc_id) && p.IsDeleted == false);
             #endregion
 
             #region 计算产能,得到耗时