| | |
| | | using log4net.Core; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using Masuit.Tools.Models; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IStorageBasicRepository; |
| | |
| | | var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString()); |
| | | stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime; |
| | | stock.SpecialParameterDuration = respone.SpecialParameterDuration; |
| | | //2024年11月16日:新增字段计算应出库时间 |
| | | stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration)); |
| | | |
| | | // 记录日志 |
| | | LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务完成", $"货位地址:{task.TargetAddress},修改后货位数据:{locationInf}"); |
| | |
| | | //return _stockInfoRepository.QueryFirstNavAsync(x => x.AreaCode == areaCode && Convert.ToDateTime(x.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(x.SpecialParameterDuration)) < DateTime.Now |
| | | // && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && roadways.Contains(x.LocationInfo.RoadwayNo) && x.StockInfoDetails.Any(x => x.Status == (int)StockStateEmun.已入库) && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).Result; |
| | | |
| | | var result = await _stockInfoRepository.QueryFirstNavAsync(x => |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>().Where(x => |
| | | x.AreaCode == areaCode && |
| | | Convert.ToDateTime(x.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(x.SpecialParameterDuration)) < DateTime.Now && |
| | | x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && |
| | | roadways.Contains(x.LocationInfo.RoadwayNo) && |
| | | x.StockInfoDetails != null && x.StockInfoDetails.Any(detail => detail.Status == (int)StockStateEmun.已入库)); |
| | | Convert.ToDateTime(x.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(x.SpecialParameterDuration)) < DateTime.Now) |
| | | .Includes(x => x.LocationInfo) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && roadways.Contains(x.LocationInfo.RoadwayNo)) |
| | | .Includes(x => x.StockInfoDetails) |
| | | .Where(x => x.StockInfoDetails.Any(detail => detail.Status == (int)StockStateEmun.已入库)) |
| | | .OrderBy(x => x.CreateDate) |
| | | .FirstAsync(); |
| | | return result; |
| | | } |
| | | |
| | |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode, List<string> roadways) |
| | | { |
| | | //return _stockInfoRepository.QueryFirstNavAsync(x => x.StockInfoDetails.Any(x => x.MaterielCode == "空托盘") && roadways.Contains(x.LocationInfo.RoadwayNo) && x.StockInfoDetails.Any(x => x.Status == (int)StockStateEmun.已入库) && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).Result; |
| | | var result = await _stockInfoRepository.QueryFirstNavAsync(x => |
| | | x.StockInfoDetails != null && x.StockInfoDetails.Any(detail => detail.MaterielCode == "空托盘") && |
| | | roadways.Contains(x.LocationInfo.RoadwayNo) && |
| | | x.StockInfoDetails.Any(detail => detail.Status == (int)StockStateEmun.已入库) && |
| | | x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock); |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && roadways.Contains(x.LocationInfo.RoadwayNo)) |
| | | .Includes(x => x.StockInfoDetails) |
| | | .Where(x => x.StockInfoDetails.Any(detail => detail.Status == (int)StockStateEmun.已入库 && detail.MaterielCode == "空托盘")) |
| | | .OrderBy(x => x.CreateDate) |
| | | .FirstAsync(); |
| | | return result; |
| | | } |
| | | |
| | |
| | | /// <param name="areaId">区域主键</param> |
| | | /// <param name="roadWay">巷道</param> |
| | | /// <returns></returns> |
| | | public async Task<DtLocationInfo> GetLocationDistributeAsync(string roadWay) |
| | | public async Task<DtLocationInfo> GetLocationDistributeAsync(string roadWay, bool IsFull = true) |
| | | { |
| | | #region 获取货位 |
| | | |
| | | try |
| | | { |
| | | var locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay); |
| | | List<DtLocationInfo> locations; |
| | | if (IsFull) |
| | | { |
| | | locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay); |
| | | } |
| | | else |
| | | { |
| | | locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadWay /*&& x.LocationType ==*/); |
| | | } |
| | | |
| | | if (locations == null) |
| | | { |
| | | return null; |