| | |
| | | try |
| | | { |
| | | var mode = _dt_storagemode.QueryFirst(v=>v.Id==1); |
| | | if (mode.storagemode==(int)StorageModeEnum.Out) |
| | | if (InMode == 6) |
| | | { |
| | | var locations = BaseDal.QueryData(v=>v.EnableStatus== (int)EnableStatusEnum.Normal && v.LocationStatus==(int)LocationStatusEnum.Free).OrderBy(v=>v.Row).ToList(); |
| | | var locations = BaseDal.QueryData(v => v.EnableStatus == (int)EnableStatusEnum.Normal && v.LocationStatus == (int)LocationStatusEnum.Free && v.LocationType==(int)LocationTypeEnum.Cube).OrderBy(v => v.Row).ToList(); |
| | | if (locations.Count <= 0) |
| | | { |
| | | throw new Exception($"å
¥åºä¼å
è´§ä½åé
失败ï¼å½åæ 空é²è´§ä½"); |
| | | } |
| | | location = locations[0]; |
| | | } |
| | | else if (mode.storagemode==(int)StorageModeEnum.Out) |
| | | { |
| | | var locations = BaseDal.QueryData(v=>v.EnableStatus== (int)EnableStatusEnum.Normal && v.LocationStatus==(int)LocationStatusEnum.Free && v.LocationType == (int)LocationTypeEnum.Flat).OrderBy(v=>v.Row).ToList(); |
| | | if (locations.Count<=0) |
| | | { |
| | | throw new Exception($"åºåºä¼å
è´§ä½åé
失败ï¼å½åæ 空é²è´§ä½"); |
| | |
| | | } |
| | | else if(mode.storagemode == (int)StorageModeEnum.In) |
| | | { |
| | | var locations = BaseDal.QueryData(v => v.EnableStatus == (int)EnableStatusEnum.Normal && v.LocationStatus == (int)LocationStatusEnum.Free).OrderByDescending(v => v.Row).ToList(); |
| | | var locations = BaseDal.QueryData(v => v.EnableStatus == (int)EnableStatusEnum.Normal && v.LocationStatus == (int)LocationStatusEnum.Free && v.LocationType == (int)LocationTypeEnum.Flat).OrderByDescending(v => v.Row).ToList(); |
| | | if (locations.Count <= 0) |
| | | { |
| | | throw new Exception($"å
¥åºä¼å
è´§ä½åé
失败ï¼å½åæ 空é²è´§ä½"); |
| | |
| | | } |
| | | if (location!=null) |
| | | { |
| | | //æ¥æ¾ç¸é»çåºä½ |
| | | Dt_LocationInfo Towlocation = new Dt_LocationInfo(); |
| | | |
| | | var Onelocation = BaseDal.QueryFirst(v => v.LocationCode == location.LocationCode); |
| | | |
| | | if (Onelocation.Depth == 1) |
| | | if (InMode == 6) |
| | | { |
| | | Towlocation = BaseDal.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); |
| | | location.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | BaseDal.UpdateData(location); |
| | | } |
| | | else |
| | | { |
| | | Towlocation = BaseDal.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); |
| | | //æ¥æ¾ç¸é»çåºä½ |
| | | Dt_LocationInfo Towlocation = new Dt_LocationInfo(); |
| | | |
| | | var Onelocation = BaseDal.QueryFirst(v => v.LocationCode == location.LocationCode); |
| | | |
| | | if (Onelocation.Depth == 1) |
| | | { |
| | | Towlocation = BaseDal.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); |
| | | } |
| | | else |
| | | { |
| | | Towlocation = BaseDal.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); |
| | | } |
| | | location.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | Towlocation.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | BaseDal.UpdateData(location); |
| | | BaseDal.UpdateData(Towlocation); |
| | | } |
| | | location.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | Towlocation.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | BaseDal.UpdateData(location); |
| | | BaseDal.UpdateData(Towlocation); |
| | | } |
| | | } |
| | | catch (Exception ex) |