| | |
| | | input.SearchKey = input.SearchKey?.Trim(); |
| | | var query = _wcsPlcRep.AsQueryable() |
| | | .WhereIF(!string.IsNullOrEmpty(input.SearchKey), u => |
| | | u.IP.Contains(input.SearchKey) |
| | | u.IP.Contains(input.SearchKey) && u.Text.Contains(input.SearchKey) |
| | | ) |
| | | .WhereIF(input.PLCType.HasValue, u => u.PLCType == input.PLCType) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(input.IP), u => u.IP.Contains(input.IP.Trim())) |
| | | .WhereIF(input.Type.HasValue, u => u.Type == input.Type) |
| | | .WhereIF(input.Enable.HasValue, u => u.Enable == input.Enable) |
| | | .Select<WcsPlcOutput>(); |
| | | return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize); |
| | | } |
| | |
| | | [DisplayName("获取PLC列表")] |
| | | public async Task<List<WcsPlcOutput>> List([FromQuery] PageWcsPlcInput input) |
| | | { |
| | | return await _wcsPlcRep.AsQueryable().Select<WcsPlcOutput>().ToListAsync(); |
| | | return await _wcsPlcRep.AsQueryable().WhereIF(input.Type != null, s => s.Type == input.Type).Select<WcsPlcOutput>().ToListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | //服务状态 |
| | | var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh }; |
| | | var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh, PLCTaskAction.boDemo, PLCTaskAction.boDrumReversal, PLCTaskAction.boOutLock, PLCTaskAction.boEnterLock }; |
| | | return new { listPlc, modService }; |
| | | } |
| | | /// <summary> |
| | |
| | | [DisplayName("获取位置信息")] |
| | | public List<PlcPositionInfo> ListPosition() |
| | | { |
| | | //测试用 |
| | | //return new List<PlcPositionInfo>() |
| | | //{ |
| | | // new PlcPositionInfo(){ Type=PLCTypeEnum.ConveyorLine, StationNum="147", BoHaveItem=true }, |
| | | // new PlcPositionInfo(){ Type=PLCTypeEnum.ConveyorLine, StationNum="143", BoHaveItem=true }, |
| | | |
| | | // new PlcPositionInfo(){ Type=PLCTypeEnum.StackingMachine, StationNum="002", BoxHeight=30 }, |
| | | //}; |
| | | |
| | | var list = PLCTaskAction.listPositionInfo.ToList(); |
| | | return list; |
| | | } |