| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取空闲货位信息(根据巷道查询) |
| | | /// </summary> |
| | | /// <param name="RoadwayNo">巷道</param> |
| | | /// <returns></returns> |
| | | public async Task<Dt_LocationInfo?> GetLocationInfo(string RoadwayNo) |
| | | { |
| | | try |
| | | { |
| | | var locations = await BaseDal.QueryDataAsync(x => x.EnableStatus == EnableStatusEnum.Normal.GetHashCode() && x.RoadwayNo == RoadwayNo && x.LocationStatus == LocationStatusEnum.Free.GetHashCode()); |
| | | |
| | | if (locations == null || locations.Count == 0) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return locations.OrderBy(x => x.Layer).ThenBy(x => x.Depth).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取空闲货位信息(根据巷道查询) |
| | | /// </summary> |
| | | /// <param name="RoadwayNo">巷道</param> |
| | | /// <returns></returns> |
| | | public async Task<Dt_LocationInfo?> GetLocationInfo(string RoadwayNo,string locationCode) |
| | | { |
| | | try |
| | | { |
| | | var locations = await BaseDal.QueryFirstAsync(x => x.RoadwayNo == RoadwayNo && x.LocationCode == locationCode); |
| | | |
| | | if (locations == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return locations; |
| | | } |
| | | catch (Exception) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新货位信息 |
| | | /// </summary> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | public async Task<bool> UpdateLocationInfoAsync(Dt_LocationInfo locationInfo) |
| | | { |
| | | try |
| | | { |
| | | return await BaseDal.UpdateDataAsync(locationInfo); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |