| | |
| | | |
| | | using Admin.NET.Core.Service; |
| | | using Elastic.Clients.Elasticsearch; |
| | | using WCS.Application.Entity; |
| | | using WCS.Application.Service.WcsDevice.Dto; |
| | | |
| | | namespace WCS.Application; |
| | | |
| | |
| | | { |
| | | return await _wcsDeviceRep.Context.Queryable<WcsPlc>() |
| | | .Where(w => w.Type == PLCTypeEnum.RobotPalletizer || w.Type == PLCTypeEnum.StackingRobot) |
| | | .OrderBy(o => o.Type) |
| | | .OrderByDescending(o => o.Type) |
| | | .Select(u => new |
| | | { |
| | | id = u.Id, |
| | |
| | | } |
| | | ).ToListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取设备对应工位列表 |
| | | /// </summary> |
| | | /// <param name="entry"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [ApiDescriptionSettings(Name = "WcsPackStationPlcList")] |
| | | [DisplayName("获取设备对应工位列表")] |
| | | public async Task<List<WcsDeviceTaskOrderDto>> WcsPackStationPlcList([FromQuery]WcsDeviceBaseInput entry) |
| | | { |
| | | return await _wcsDeviceRep.Context.Queryable<WcsDevice>() |
| | | .LeftJoin<WcsCheckTask>((device, task) => device.StationNum == task.Port) |
| | | .Where((device, task) => device.PlcId == entry.PlcId) |
| | | .OrderBy((device, task) => device.CreateTime) |
| | | .Select((device, task) => new WcsDeviceTaskOrderDto() |
| | | { |
| | | Id=device.Id, |
| | | Text=device.Text, |
| | | OrderNo=task.OrderNo, |
| | | LotNo=task.LotNo, |
| | | SkuNo=task.SkuNo, |
| | | SkuName=task.SkuName, |
| | | LineNO=task.LineNO, |
| | | Status =task.Status, |
| | | Qty=task.Qty |
| | | }) |
| | | .ToListAsync(); |
| | | } |
| | | #endregion |
| | | } |