Просмотр исходного кода

年度考虑O库库存,其他不考虑

Murphy 2 лет назад
Родитель
Сommit
fe42401eb8

+ 7 - 4
MicroServices/Business/Business.Application/ReplenishmentManagement/ReplenishmentAppService.cs

@@ -4831,7 +4831,7 @@ namespace Business.Replenishment
             }
             var pretreatList = pretreatments.Select(x => x.item_number).Distinct().ToList();
             itemNums.AddRange(pretreatList);
-            AsyncItemStockFromWMS(itemNums);
+            AsyncItemStockFromWMS(itemNums, analogCalcVersion);
 
             //数据库快照-同步mysql库数据到mongoDB中
             await DbSnapShot(input.company_id, input.factoryId, bangid, pretreatments, analogCalcVersion);
@@ -5587,7 +5587,10 @@ namespace Business.Replenishment
                         }
                         item.sqty += lctQty;
                     }
-                    item.sqty += sapInvList.Where(x => x.MATNR == item.icitem_number && x.SOBKZ.ToUpper() == "O").Sum(p => p.LABST + p.INSME);
+                    if(!string.IsNullOrEmpty(analogCalcVersion))
+                    {
+                        item.sqty += sapInvList.Where(x => x.MATNR == item.icitem_number && x.SOBKZ.ToUpper() == "O").Sum(p => p.LABST + p.INSME);
+                    }
                 });
                 var moIcitemStokc = ObjectMapper.Map<List<ic_item_stock>, List<mo_ic_item_stock>>(icitemStokc);
                 moIcitemStokc.ForEach(item => { item.GenerateNewId(help.NextId()); });
@@ -6556,7 +6559,7 @@ namespace Business.Replenishment
             return result;
         }
 
-        public void AsyncItemStockFromWMS(List<string> itemList)
+        public void AsyncItemStockFromWMS(List<string> itemList,string analogCalcVersion)
         {
             //产品编码
             //var itemList = bom_Pretreatments.Select(a => a.item_number).Distinct().ToList();
@@ -6624,7 +6627,7 @@ namespace Business.Replenishment
                         }
                         item.sqty += lctQty;
                     }
-                    if (param.checkPlan)
+                    if (!string.IsNullOrEmpty(analogCalcVersion))
                     {
                         item.sqty += sapInvList.Where(x => x.MATNR == item.icitem_number && x.SOBKZ.ToUpper() == "O").Sum(p => p.LABST + p.INSME);
                     }