| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //string palletCode = saveModel.MainData["palletCode"].ToString(); |
| | | //string station = saveModel.MainData["station"].ToString(); |
| | | |
| | | // è°ç¨BaseDal.QueryFirstAsyncæ¹æ³ï¼æ¥è¯¢ä»»å¡ |
| | | var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); |
| | | if (task != null) |
| | | { |
| | |
| | | { |
| | | throw new Exception($"ç«å°{input.Position}ä¸åå¨"); |
| | | } |
| | | |
| | | |
| | | var carBody = _carBodyRepository.QueryFirst(x => x.PalletCode == input.PalletCode); |
| | | |
| | | //BDCManager bDCManager = new BDCManager(_bdcConfigurationService, _locationRepository, _roadWayInfoRepository); |
| | | |
| | | //await bDCManager.AddToBDC(carBody); |
| | | |
| | | // è·ååºä½ |
| | | var location = RequestLocation(stationInfo.Roadway); |
| | | if (location == null) |
| | | { |
| | | return content.Error("æ æ³è·åè´§ä½ä¿¡æ¯æåºä½å·²æ»¡"); |
| | | } |
| | | |
| | | |
| | | var newtask = new Dt_Task |
| | | { |
| | | CurrentAddress = input.Position, |
| | |
| | | Roadway = stationInfo.Roadway, |
| | | TargetAddress = location.LocationCode, |
| | | Dispatchertime = DateTime.Now, |
| | | |
| | | NextAddress = stationInfo.Roadway, |
| | | OrderNo = null, |
| | | PalletCode = input.PalletCode, |
| | |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam", |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | BaseDal.AddData(newtask); |
| | |
| | | _locationRepository.UpdateData(location); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | content.OK("ç³è¯·å
¥åºæå",data: newtask); |
| | | content.OK("ç³è¯·å
¥åºæå", data: newtask); |
| | | } |
| | | catch (Exception er) |
| | | { |
| | |
| | | #endregion 请æ±ä»»å¡å
¥åº |
| | | |
| | | #region åºä½åé
|
| | | |
| | | #region è·åè´§ä½ |
| | | object objLOCK = new object(); |
| | | /// <summary> |
| | | /// åååºä½åé
|
| | | /// åºä½åé
|
| | | /// </summary> |
| | | /// <param name="requestTask"></param> |
| | | /// <param name="locationInfos"></param> |
| | |
| | | return location; |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | { |
| | | Console.WriteLine(err.Message.ToString()); |
| | | return null; |
| | | } |
| | |
| | | private DtLocationInfo GetEmptyLocation(List<DtLocationInfo> dtLocationInfos) |
| | | { |
| | | var locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Column).ThenBy(x => x.Row).ThenBy(x => x.Layer).FirstOrDefault(); //.ThenByDescending(x => x.Depth) |
| | | |
| | | return locationinfo; |
| | | } |
| | | |
| | | |
| | | #endregion è·åè´§ä½ |
| | | #endregion åºä½åé
|
| | | |