质量看板的倒车雷达去除,抛光,一次仓库数据优化
This commit is contained in:
@@ -44,25 +44,24 @@ namespace ZR.Service.mes.wms
|
||||
)
|
||||
.Where((m, p) => m.Status == 1)
|
||||
.Where((m, p) => m.Type == 1)
|
||||
.WhereIF(parm.Status > -1, (m, p) => p.Status == parm.Status)
|
||||
.WhereIF(parm.Type > 0, (m, p) => p.Type == parm.Type)
|
||||
.WhereIF(string.IsNullOrEmpty(parm.Partnumber), (m, p) => p.Status == 1)
|
||||
.OrderBy((m, p) => m.Description)
|
||||
.Select(
|
||||
(m, p) =>
|
||||
new WmOneTimeInventoryDto
|
||||
{
|
||||
RealQuantity = 0,
|
||||
Partnumber = m.Partnumber,
|
||||
Color = m.Color,
|
||||
Specification = m.Specification,
|
||||
Description = m.Description,
|
||||
Id = p.Id,
|
||||
Id = p.Id ?? m.Id,
|
||||
BlankNum = p.BlankNum,
|
||||
Partnumber = p.Partnumber,
|
||||
Quantity = p.Quantity,
|
||||
Quantity = p.Quantity ?? 0,
|
||||
MaxNum = p.MaxNum,
|
||||
MinNum = p.MinNum,
|
||||
WarnNum = p.WarnNum,
|
||||
Type = p.Type,
|
||||
Type = p.Type ?? 1,
|
||||
Status = p.Status,
|
||||
Remark = p.Remark,
|
||||
CreatedBy = p.CreatedBy,
|
||||
@@ -75,10 +74,7 @@ namespace ZR.Service.mes.wms
|
||||
foreach (WmOneTimeInventoryDto item in list)
|
||||
{
|
||||
// 获取实际库存
|
||||
List<string> partnumbers = new()
|
||||
{
|
||||
item.Partnumber
|
||||
};
|
||||
List<string> partnumbers = new() { item.Partnumber };
|
||||
Dictionary<string, int> dict = GetBatchOneTimeRealPartNum(partnumbers);
|
||||
item.RealQuantity = dict.TryGetValue(item.Partnumber, out int value) ? value : 0;
|
||||
}
|
||||
@@ -96,14 +92,17 @@ namespace ZR.Service.mes.wms
|
||||
int QuantitySum = list.Sum(it => it.Quantity) ?? 0;
|
||||
// 仓库当前查询实际零件数
|
||||
int RealQuantitySum = list.Sum(it => it.RealQuantity);
|
||||
WmOneTimeInventoryTableDto response = new()
|
||||
{
|
||||
Total = total,
|
||||
StocktakingTotal = StocktakingTotal,
|
||||
QuantitySum = QuantitySum,
|
||||
RealQuantitySum = RealQuantitySum,
|
||||
Result = list.Skip((parm.PageNum - 1) * parm.PageSize).Take(parm.PageSize).ToList(),
|
||||
};
|
||||
WmOneTimeInventoryTableDto response =
|
||||
new()
|
||||
{
|
||||
Total = total,
|
||||
StocktakingTotal = StocktakingTotal,
|
||||
QuantitySum = QuantitySum,
|
||||
RealQuantitySum = RealQuantitySum,
|
||||
Result = list.Skip((parm.PageNum - 1) * parm.PageSize)
|
||||
.Take(parm.PageSize)
|
||||
.ToList(),
|
||||
};
|
||||
return response;
|
||||
|
||||
/*List<string> partnumberByDescription = new();
|
||||
|
||||
Reference in New Issue
Block a user