|
|
@@ -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的最小包装单位、补货周期
|