| | |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | return BaseDal.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo && x.Column == locationInfo.Column && x.Layer == locationInfo.Layer && x.Depth != locationInfo.Depth && x.Row != locationInfo.Row && (SqlFunc.Abs(x.Row - locationInfo.Row) == 1)); |
| | | } |
| | | |
| | | public WebResponseContent GetPosition(string position) |
| | | public WebResponseContent GetPosition(string position, string position1) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_LocationInfo? locationInfo = null; |
| | | //Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (x.Row == 1 || x.Row == 3), _emptyAssignOrderBy); |
| | | Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.CurrentQty < x.MaxQty && x.LocationCode != position, _emptyAssignOrderBy); |
| | | string position2 = string.Empty; |
| | | string[] Codes = position1.Split("-"); |
| | | var row = Convert.ToInt16(Codes[0]); |
| | | if (row < 3) |
| | | { |
| | | position2 = row == 1 ? "002" + "-" + Codes[1] + "-" + Codes[2] : "001" + "-" + Codes[1] + "-" + Codes[2]; |
| | | } |
| | | if (string.IsNullOrEmpty(position2)) |
| | | { |
| | | locationInfo = BaseDal.QueryFirst(x => x.CurrentQty < x.MaxQty && x.LocationCode != position && x.LocationCode != position1, _emptyAssignOrderBy); |
| | | } |
| | | else |
| | | { |
| | | locationInfo = BaseDal.QueryFirst(x => x.CurrentQty < x.MaxQty && x.LocationCode != position && x.LocationCode != position1 && x.LocationCode != position2, _emptyAssignOrderBy); |
| | | } |
| | | if (locationInfo != null) content.OK(locationInfo.LocationCode); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// è·åè´§ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetLocationInfo(SaveModel model) |
| | | { |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = BaseDal.QueryData(x => true); |
| | | var Freelocations = locationInfos.Where(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).ToList(); |
| | | var Palletlocations = locationInfos.Where(x => x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()).ToList(); |
| | | var InStocklocations = locationInfos.Where(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.LocationStatus != LocationStatusEnum.Pallet.ObjToInt()).ToList(); |
| | | //Dictionary<string, object> keyValuePairs = new Dictionary<string, object>(); |
| | | //keyValuePairs.Add("空货ä½", Freelocations.Count); |
| | | //keyValuePairs.Add("空æç", Palletlocations.Count); |
| | | //keyValuePairs.Add("æè´§", InStocklocations.Count); |
| | | response.OK(data: new |
| | | { |
| | | FreeQty = Freelocations.Count, |
| | | PalletQty = Palletlocations.Count, |
| | | InStockQty = InStocklocations.Count, |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | response.Error(ex.Message); |
| | | } |
| | | return response; |
| | | } |
| | | } |
| | | } |