提交代码
This commit is contained in:
@ -122,6 +122,32 @@ namespace WCS.BLL.Services.Service
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<ResponseCommon<List<MatInventorySummaryModel>>> getMatInventorySummary(GetMatInventorySummaryRequest request)
|
||||
{
|
||||
var inventortyDetails = await DbHelp.db.Queryable<InventoryDetail>()
|
||||
.WhereIF(!string.IsNullOrEmpty(request.MatName), t => t.MatName.Contains(request.MatName))
|
||||
.WhereIF(!string.IsNullOrEmpty(request.MatCode), t => t.MatCode.Contains(request.MatCode))
|
||||
.GroupBy(t => t.MatCode)
|
||||
.GroupBy(t => t.MatBatch)
|
||||
.Select(t => new MatInventorySummaryModel
|
||||
{
|
||||
MatCode = t.MatCode,
|
||||
MatName = t.MatName,
|
||||
MatBatch = t.MatBatch,
|
||||
MatSpec = t.MatSpec,
|
||||
MatCustomer = t.MatCustomer,
|
||||
MatSupplier = t.MatSupplier,
|
||||
TotalQty = SqlFunc.AggregateSum(t.MatQty)
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return new ResponseCommon<List<MatInventorySummaryModel>>()
|
||||
{
|
||||
Code = 200,
|
||||
Message = inventortyDetails.Count().ToString(),
|
||||
Data = inventortyDetails
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user