| | |
| | | /// <param name="areaCode">区域编码</param> |
| | | /// <param name="roadways">巷道编码集合</param> |
| | | /// <returns>返回结果集</returns> |
| | | public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways) |
| | | public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, string productionLine) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | // 根据托盘类型查询库存信息 |
| | | DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound |
| | | ? QueryStockInfoForRealTrayAsync(areaCode, roadways).Result |
| | | : QueryStockInfoForEmptyTrayAsync(areaCode, roadways).Result; |
| | | ? QueryStockInfoForRealTrayAsync(areaCode, productionLine).Result |
| | | : QueryStockInfoForEmptyTrayAsync(areaCode).Result; |
| | | |
| | | if (stockInfo == null) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 查询实盘库存信息 |
| | | /// </summary> |
| | | private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, List<string> roadways) |
| | | private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, string productionLine) |
| | | { |
| | | var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode); |
| | | |
| | |
| | | .Includes(x => x.LocationInfo) // 预加载LocationInfo |
| | | .Includes(x => x.StockInfoDetails) // 预加载StockInfoDetails |
| | | .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件 |
| | | .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 过滤条件 |
| | | .OrderBy(x => x.OutboundTime) // 排序 |
| | | .FirstAsync(); // 获取第一个元素 |
| | |
| | | /// <summary> |
| | | /// 查询空盘库存信息 |
| | | /// </summary> |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode, List<string> roadways) |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode) |
| | | { |
| | | var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode); |
| | | |