소스 검색

T1补货调整

heteng 2 년 전
부모
커밋
86754ab939
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      MicroServices/Business/Business.Application/SaleForecastManagement/MonthlyCapacityLoadAppService.cs

+ 5 - 4
MicroServices/Business/Business.Application/SaleForecastManagement/MonthlyCapacityLoadAppService.cs

@@ -477,7 +477,7 @@ namespace Business.SaleForecastManagement
             var nextMonDFcsts = domesticFcst.Where(p => p.PlanMonth == strN2).ToList();
             var nextMonT2Fcsts = T2Fcsts.Where(p => p.PlanMonth == strN2).ToList();
             var nextMonMonitors = monitorSettings.Where(p => p.PlanMonth == strN1).ToList();
-            var replenishs = MonthlyReplenish(input,strN1, nextMonPFcsts, nextMonDFcsts, nextMonT2Fcsts, standards, items, holidays, nextMonMonitors, sAPInvs);
+            var replenishs = MonthlyReplenish(input,strN1, nextMonPFcsts, nextMonDFcsts, nextMonT2Fcsts, standards, items, holidays, nextMonMonitors, locations);
 
             //保存数据
             using (var unitOfWork = _unitOfWorkManager.Begin(false, true))
@@ -648,9 +648,9 @@ namespace Business.SaleForecastManagement
         /// <param name="items">物料</param>
         /// <param name="holidays">节假日</param>
         /// <param name="monitorSettings">库存监控月份设置</param>
-        /// <param name="sAPInvs">SAP库存</param>
+        /// <param name="locations">SAP同步库存</param>
         /// <returns></returns>
-        public List<crm_planorder> MonthlyReplenish(InputDto input,string strN1, List<PlatformFcstCollect> platformFcsts, List<DomesticTerminalFcst> domesticFcsts, List<DomesticTerminalFcst> T2Fcsts, List<StandardItemModelSet> standards, List<ic_item> items, List<HolidayMaster> holidays, List<PlatStockMonitorSetting> monitorSettings, List<SAPInv> sAPInvs)
+        public List<crm_planorder> MonthlyReplenish(InputDto input,string strN1, List<PlatformFcstCollect> platformFcsts, List<DomesticTerminalFcst> domesticFcsts, List<DomesticTerminalFcst> T2Fcsts, List<StandardItemModelSet> standards, List<ic_item> items, List<HolidayMaster> holidays, List<PlatStockMonitorSetting> monitorSettings, List<LocationDetail> locations)
         { 
             List<crm_planorder> planorders = new List<crm_planorder>();
             //获取T1中规格型号对应的不同版本的物料编码
@@ -679,7 +679,8 @@ namespace Business.SaleForecastManagement
                 var curSkus = skus.Where(p => p.Model == item).ToList();
                 if (curSkus.Any())
                 {
-                    sumQty = sAPInvs.Where(p => curSkus.Select(p => p.ItemNum).Contains(p.MATNR)).Sum(p => Convert.ToDecimal(p.LABST));
+                    //sumQty = sAPInvs.Where(p => curSkus.Select(p => p.ItemNum).Contains(p.MATNR)).Sum(p => Convert.ToDecimal(p.LABST));
+                    sumQty = locations.Where(p => curSkus.Select(p => p.ItemNum).Contains(p.ItemNum) && p.Location == "8001").Sum(p => p.QtyOnHand);
                 }
                 //计算Rop
                 //当前规格型号对应标准SKU的最小包装单位、补货周期