| | |
| | | using SqlSugar; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | { |
| | | 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) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationCode == position); |
| | | if (locationInfo == null) throw new Exception("æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | //åé
ç©¿æ¢è½¦ç§»åºå°å |
| | | var locationInfos = BaseDal.QueryData(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && x.LocationCode != locationInfo.LocationCode);//éæ ¹æ®å
¥åºé»è¾æ¹å¨ |
| | | var location = locationInfos.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | //if (location != null) content.OK(message: location.LocationCode, data: location); |
| | | if (location != null) content.OK(location.LocationCode); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |