Browse Source

添加库存汇总默认排序

master
wanggang 1 year ago
parent
commit
8dd99169f6
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/sum.js
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/sum.js

@ -116,6 +116,7 @@ export default function () {
},
sorting: {
hidden: true,
default: "RealPartCode",
},
},
},

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -191,9 +191,9 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) });
var totalCount = query2.Count();
query2 = string.IsNullOrEmpty(input.Sorting) ? query2 : DynamicQueryableExtensions.OrderBy(query2, input.Sorting);
var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
return new PagedResultDto<VmiBalanceSumDto>(totalCount, entities);
}

Loading…
Cancel
Save