perf(ProWorkorderQueryService): 按创建时间降序排序查询结果

添加对QcScrapRecords和ProWorkorder查询结果的排序,确保最新记录优先显示
This commit is contained in:
2026-03-10 18:53:08 +08:00
parent 424314732c
commit 3a6ca49b71

View File

@@ -237,6 +237,7 @@ namespace DOAN.Service.MES.product
var result = Context
.Queryable<QcScrapRecords>()
.Where(it => it.Status == "待审批")
.OrderByDescending(it => it.CreatedTime)
.Select(it => new ProWorkorderApprovalDto
{
Id = it.Id,
@@ -253,6 +254,7 @@ namespace DOAN.Service.MES.product
.Select(sub => sub.Type),
Content = $"有不良品待审批:{it.ScrapQuantity}个",
})
.ToPage(parm);
// 业务逻辑留空,暂时返回空列表
return result;
@@ -268,6 +270,7 @@ namespace DOAN.Service.MES.product
var result = Context
.Queryable<ProWorkorder>()
.Where(it => (it.ProductNum - it.ShipmentNum) > 0)
.OrderByDescending(it => it.CreatedTime)
.Select(it => new ProWorkorderStockDto
{
Id = it.Id,