| | |
| | | using SqlSugar; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | |
| | | EnableStatus = EnableStatusEnum.Normal.GetHashCode(), |
| | | LocationStatus = LocationStatusEnum.Free.GetHashCode(), |
| | | LocationType = LocationTypeEnum.Undefined.GetHashCode(), |
| | | LocationCode = $"{roadwayNo}-{row:D3}-{col:D3}-{layer:D3}-{depth:D2}", |
| | | LocationCode = $"{row:D3}-{col:D3}-{layer:D3}", //$"{roadwayNo}-{row:D3}-{col:D3}-{layer:D3}-{depth:D2}" |
| | | LocationName = $"{roadwayNo}巷道{row:D3}行{col:D3}列{layer:D3}层{depth:D2}深" |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取空闲货位信息(根据巷道查询) |
| | |
| | | |
| | | return locations? |
| | | .OrderBy(x => x.Layer) |
| | | .ThenBy(x => x.Depth) |
| | | .ThenByDescending(x => x.Depth) |
| | | .ThenBy(x => x.Column) |
| | | .ThenBy(x => x.Row) |
| | | .FirstOrDefault(); |
| | |
| | | return await BaseDal.QueryFirstAsync(x => x.RoadwayNo == roadwayNo && x.LocationCode == locationCode); |
| | | } |
| | | |
| | | public async Task<Dt_LocationInfo> GetLocationInfoAsync( string locationCode) |
| | | public async Task<Dt_LocationInfo> GetLocationInfoAsync(string locationCode) |
| | | { |
| | | return await BaseDal.QueryFirstAsync(x=>x.LocationCode == locationCode); |
| | | return await BaseDal.QueryFirstAsync(x => x.LocationCode == locationCode); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return await BaseDal.UpdateDataAsync(locationInfo); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 检查并生成移库任务或返回出库任务 |
| | | /// </summary> |
| | | /// <param name="locationID">任务号</param> |
| | | /// <returns>任务对象</returns> |
| | | public async Task<Dt_Task> TransferCheckAsync(int taskNum) |
| | | public async Task<WebResponseContent> TransferCheckAsync(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | // 根据任务号获取任务 |
| | |
| | | // 如果新的库位没有找到对应的任务 |
| | | if (internalTransferTask == null) |
| | | { |
| | | return await HandleNoTaskAtLocation(outboundTask.SourceAddress, newLocationID, outboundTask); |
| | | return content.OK("获取到移库任务", await HandleNoTaskAtLocation(outboundTask.SourceAddress, newLocationID, outboundTask)); |
| | | } |
| | | |
| | | // 直接返回一深位出库任务 |
| | | return internalTransferTask; |
| | | return content.OK("获取到一深位出库任务", internalTransferTask); |
| | | } |
| | | |
| | | // 返回当前库位的出库任务 |
| | | return outboundTask; |
| | | return content.OK("当前出库任务", outboundTask); |
| | | } |
| | | catch (Exception) |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | return content.Error($"发生错误:{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | #region 移库方法 |
| | | |
| | |
| | | } |
| | | |
| | | #endregion 移库方法 |
| | | |
| | | } |
| | | } |
| | | } |