库存表列表
This commit is contained in:
@@ -297,15 +297,25 @@ namespace ZR.Service.mes.wms
|
||||
)
|
||||
.ToList();
|
||||
//TODO 取出库存表 wm_polish_inventory 最小CreatedTime时间
|
||||
|
||||
//TODO 根据时间范围取出所有记录数据
|
||||
var wmPolishInventory = Context.Queryable<WmPolishInventory>().ToList();
|
||||
DateTime mindatetime = wmPolishInventory.Select(o => o.CreatedTime.Value).Min();
|
||||
|
||||
|
||||
// TODO 匹配记录(partnumber零件号,时间范围)
|
||||
foreach (WmPolishInventoryDto item in list)
|
||||
//TODO 根据时间范围取出所有记录数据
|
||||
List<WmPolishRecord> wmPolishRecords = Context
|
||||
.Queryable<WmPolishRecord>()
|
||||
.Where(it => it.Code == "自动")
|
||||
.Where(it => it.ActionTime >= mindatetime )
|
||||
.ToList();
|
||||
|
||||
// TODO 匹配记录(partnumber零件号,时间范围)
|
||||
foreach (WmPolishInventoryDto item in list)
|
||||
{
|
||||
// TODO 获取实际库存 item.quantity(盘点开始数量) + recourd 记录的入库数量 - 出库数量(筛选条件是 时间区间【item.CreatedTime】 + partnumber[item.partnumber])
|
||||
item.RealQuantity = 0;
|
||||
int? runum = wmPolishRecords.Where(o => o.ActionTime >= item.CreatedTime && o.Partnumber == item.Partnumber && o.ChangeType == 1).Select(o => o.ChangeQuantity).Sum();
|
||||
int? chunum= wmPolishRecords.Where(o => o.ActionTime >= item.CreatedTime && o.Partnumber == item.Partnumber && o.ChangeType == 2).Select(o => o.ChangeQuantity).Sum();
|
||||
|
||||
item.RealQuantity = item.Quantity.Value+(runum.Value-chunum.Value);
|
||||
|
||||
/*List<string> partnumbers = new() { item.Partnumber };
|
||||
Dictionary<string, int> dict = GetBatchPolishRealPartNum(partnumbers);*/
|
||||
|
||||
Reference in New Issue
Block a user