hwh
2024-09-14 f735e389c01eed24d6b9792b35d2f98d15f3ecbb
Admin.NET/WCS.Application/Service/WcsTaskMonitor/WcsTaskMonitorService.cs
@@ -1,4 +1,6 @@

using WCS.Application.Service.WcsTaskMonitor.Dto;
namespace WCS.Application;
/// <summary>
@@ -21,7 +23,7 @@
    [HttpPost]
    [ApiDescriptionSettings(Name = "Page")]
    [DisplayName("分页查询任务明细监控表")]
    public async Task<SqlSugarPagedList<WcsTaskMonitorOutput>> Page(PageWcsTaskMonitorInput input)
    public async Task<SqlSugarPagedList<WcsTaskMonitorOutput2>> Page(PageWcsTaskMonitorInput input)
    {
      input.SearchKey = input.SearchKey?.Trim();
        var query = _wcsTaskMonitorRep.AsQueryable()
@@ -29,8 +31,17 @@
                u.TaskNo.Contains(input.SearchKey)
            )
            .WhereIF(!string.IsNullOrWhiteSpace(input.TaskNo), u => u.TaskNo.Contains(input.TaskNo.Trim()))
            .Select<WcsTaskMonitorOutput>();
      return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
            .LeftJoin<WcsDevice>((u, plcid) => u.PlcId == plcid.Id)
            .Select((u, plcid) => new WcsTaskMonitorOutput2
            {
                Id = u.Id,
                TaskNo = u.TaskNo,
                PlcName = plcid.StationNum + "工位," + plcid.Text,
                InteractiveMsg = u.InteractiveMsg,
                CreateTime = u.CreateTime
            })
            .OrderByDescending(u=>u.CreateTime);
        return await query.OrderBuilder(input,"","").ToPagedListAsync(input.Page, input.PageSize);
    }
    /// <summary>