出库单计划:发运清单
物料清单:发运单 数据对应完成,交由客户测试
This commit is contained in:
@@ -275,7 +275,7 @@ namespace ZR.Service.mes.wms
|
||||
//现有零件数
|
||||
int? num = Context.Queryable<WmGoodsNowProduction>()
|
||||
.Where(it => it.Partnumber == stock.Partnumber)
|
||||
.Sum(it => it.GoodsNumLogic);
|
||||
.Sum(it => it.GoodsNumAction);
|
||||
stock.ItemNum = num ?? 0;
|
||||
}
|
||||
}
|
||||
@@ -311,14 +311,18 @@ namespace ZR.Service.mes.wms
|
||||
// 该物料下 ,现有货物列表,零件号相同,根据批次号从小到大排序
|
||||
List<WmGoodsNowProduction> wmGoodsNowsList = Context.Queryable<WmGoodsNowProduction>()
|
||||
.Where(it => it.Partnumber == partnumber)
|
||||
.OrderByDescending(it => it.PackageCodeClient)
|
||||
.OrderBy(it => it.PackageCodeClient)
|
||||
.ToList();
|
||||
// 计算批次零件总数
|
||||
//int totalPartnumberNum = Context.Queryable<WmGoodsNowProduction>()
|
||||
//.Where(it => it.Partnumber == partnumber)
|
||||
//.Sum(it => it.GoodsNumAction) ?? 0;
|
||||
// 判断要出多少批次的货
|
||||
List<WmOutOrderPlan> wmOutOrderPlans = new List<WmOutOrderPlan>();
|
||||
// 当前累计批次货物总数
|
||||
int accumulation_num = 0;
|
||||
foreach (var witem in wmGoodsNowsList)
|
||||
{
|
||||
// 当前累计批次货物总数
|
||||
int accumulation_num = 0;
|
||||
if (require_num >= accumulation_num)
|
||||
{
|
||||
WmOutOrderPlan orderPlan = new WmOutOrderPlan();
|
||||
@@ -328,7 +332,8 @@ namespace ZR.Service.mes.wms
|
||||
orderPlan.MaterialCode = witem.Partnumber;
|
||||
orderPlan.WarehouseCode = witem.LocationCode;
|
||||
orderPlan.PackageNum = material.PackageNum;
|
||||
orderPlan.PartnumberNum = material.ItemNum;
|
||||
// 获得批次的总零件数
|
||||
orderPlan.PartnumberNum = witem.GoodsNumAction;
|
||||
orderPlan.RequireNum = require_num;
|
||||
orderPlan.Patchtime = Resolution_bath(witem.PackageCodeOriginal);
|
||||
wmOutOrderPlans.Add(orderPlan);
|
||||
@@ -344,12 +349,12 @@ namespace ZR.Service.mes.wms
|
||||
WmOutOrderPlan
|
||||
{
|
||||
FkOutOrderId = g.Max(p => p.FkOutOrderId),
|
||||
Patchcode = g.Max(p => p.Patchcode),
|
||||
Patchcode = g.Max(p => p.Patchcode_short),
|
||||
Patchcode_short = g.Max(p => p.Patchcode_short),
|
||||
WarehouseCode = g.Max(p => p.WarehouseCode),
|
||||
MaterialCode = g.Max(p => p.MaterialCode),
|
||||
PackageNum = g.Count(),
|
||||
PartnumberNum = g.Max(p => p.PartnumberNum),
|
||||
PartnumberNum = g.Sum(p=>p.PartnumberNum),
|
||||
RequireNum = g.Max(p => p.RequireNum),
|
||||
Patchtime = g.Max(p => p.Patchtime),
|
||||
}).ToList();
|
||||
|
||||
Reference in New Issue
Block a user