| | |
| | | { nameof(Dt_LocationInfo.Row), OrderByType.Asc }, |
| | | }; |
| | | |
| | | public virtual Dt_LocationInfo? AssignLocation(string stationCode, int inboundType) |
| | | public virtual Dt_LocationInfo? AssignLocation(ref string stationCode, int inboundType) |
| | | { |
| | | try |
| | | { |
| | | Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == stationCode) ?? throw new Exception("æªæ¾å°è¯¥ç«å°å¯¹åºçå··éï¼è¯·æ£æ¥åºç¡é
置信æ¯!"); |
| | | string StationCode = stationCode; |
| | | Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == StationCode) ?? throw new Exception("æªæ¾å°è¯¥ç«å°å¯¹åºçå··éï¼è¯·æ£æ¥åºç¡é
置信æ¯!"); |
| | | stationCode = roadwayInfo.InSCStationCode; |
| | | if (roadwayInfo.EnableStatus != EnableStatusEnum.Normal.ObjToInt() && roadwayInfo.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt()) |
| | | { |
| | | throw new Exception("该巷éä¸å¯å
¥åºï¼è¯·æ£æ¥å··éç¦ç¨ä¿¡æ¯!"); |
| | |
| | | ///æ ¹æ®å··éè¿è¡æåº |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusA == EnableStatusEnum.Normal.ObjToInt()|| x.EnableStatusA == EnableStatusEnum.OnlyIn.ObjToInt()); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusA == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatusA == EnableStatusEnum.OnlyIn.ObjToInt()); |
| | | int id = locationGroup?.IdA ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.Free); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusB == EnableStatusEnum.Normal.ObjToInt()||x.EnableStatusB == EnableStatusEnum.OnlyIn.ObjToInt()); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusB == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatusB == EnableStatusEnum.OnlyIn.ObjToInt()); |
| | | int id = locationGroup?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()||x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | } |
| | | |
| | | private Dt_LocationInfo StoredAssignLocation(string roadway) |
| | |
| | | locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.Free); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | if (roadway.Contains("SC02")) locationGroups = locationGroups.OrderByDescending(x => x.Column).ToList(); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusB == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusB == EnableStatusEnum.Normal.ObjToInt()); |
| | | int id = locationGroup?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | |
| | | |
| | | public Dt_LocationInfo AdjacentDepthLocation(Dt_LocationInfo locationInfo) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo && x.Layer == locationInfo.Layer && x.Depth != locationInfo.Depth && x.Row != locationInfo.Row && (SqlFunc.Abs(x.Row - locationInfo.Row) == 1)); |
| | | return BaseDal.QueryFirst(x => x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo && x.Layer == locationInfo.Layer && x.Depth != locationInfo.Depth && x.Row != locationInfo.Row && (SqlFunc.Abs(x.Row - locationInfo.Row) == 1)); |
| | | } |
| | | public void UpdateLocationLock(Dt_LocationInfo locations, int TaskNum,int changType,bool black) |
| | | public void UpdateLocationLock(Dt_LocationInfo locations, int TaskNum, int changType, bool black) |
| | | { |
| | | try |
| | | { |
| | |
| | | int beforeStatusEnd = 0; |
| | | if (black) |
| | | { |
| | | if (result != null && (result.LocationStatus == LocationStatusEnum.Free.ObjToInt()|| result.LocationStatus == LocationStatusEnum.Lock.ObjToInt())) |
| | | if (result != null && (result.LocationStatus == LocationStatusEnum.Free.ObjToInt() || result.LocationStatus == LocationStatusEnum.Lock.ObjToInt())) |
| | | { |
| | | beforeStatusEnd = result.LocationStatus; |
| | | |
| | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(result, beforeStatusEnd, changType, "", TaskNum); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | public void UpdateLocationFree(Dt_LocationInfo locations, int TaskNum, int changType,bool black) |
| | | public void UpdateLocationFree(Dt_LocationInfo locations, int TaskNum, int changType, bool black) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if (result != null&&(result.LocationStatus== LocationStatusEnum.Lock.ObjToInt()|| result.LocationStatus==LocationStatusEnum.PalletLock.ObjToInt())) |
| | | if (result != null && (result.LocationStatus == LocationStatusEnum.Lock.ObjToInt() || result.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt())) |
| | | { |
| | | int beforeStatusEnd = result.LocationStatus; |
| | | |