| | |
| | | using AngleSharp.Io; |
| | | using Mapster; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Core.Const; |
| | |
| | | |
| | | if (boxing.ProcessCode == "OCV1") |
| | | area = _areaInfoRepository.QueryFirst(x => x.AreaID == 6); |
| | | |
| | | else if (boxing.ProcessCode == "OCVB") |
| | | area = _areaInfoRepository.QueryFirst(x => x.AreaID == 7); |
| | | |
| | |
| | | |
| | | #endregion æå®ä»»å¡åºåº |
| | | |
| | | #region éç½®å¼å¸¸å£å
¥åº |
| | | #region éç½®å¼å¸¸å£å
¥åº |
| | | |
| | | #endregion |
| | | public async Task<WebResponseContent> CreateAndSendInboundTask(string locationCode, string palletCode, string position) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | // æ¥è¯¢åºåä¿¡æ¯ |
| | | var stockInfo = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == palletCode); |
| | | if (stockInfo == null) |
| | | { |
| | | var area = _areaInfoRepository.QueryFirst(x => x.AreaID == 2); |
| | | var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == position); |
| | | TrayCellsStatusDto trayCells = CreateTrayCellsStatusDto(area, palletCode); |
| | | content = await GetTrayCellStatusAsync(trayCells); |
| | | if (!content.Status) return content; |
| | | |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | if (!result.Success) |
| | | { |
| | | if (result.SerialNos.Count <= 0) |
| | | { |
| | | var location = await GetLocationDistributeAsync(station.Roadway); |
| | | // å建æ°ä»»å¡å®ä¾ |
| | | var task = new Dt_Task |
| | | { |
| | | CurrentAddress = locationCode, |
| | | Grade = 1, |
| | | Roadway = station.Roadway, |
| | | TargetAddress = location.LocationCode, |
| | | Dispatchertime = DateTime.Now, |
| | | MaterialNo = "", |
| | | NextAddress = location.LocationCode, |
| | | OrderNo = null, |
| | | PalletCode = palletCode, |
| | | SourceAddress = locationCode, |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | }; |
| | | |
| | | // å建WMSä»»å¡ |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | }; |
| | | |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | // æ·»å ä»»å¡å°æ°æ®åº |
| | | await BaseDal.AddDataAsync(task); |
| | | // æ´æ°åºåä½ç½®ç¶æä¸ºä¸å¯ç¨ |
| | | location.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | await _locationRepository.UpdateDataAsync(location); |
| | | }); |
| | | |
| | | content.OK(data: taskDTO); |
| | | } |
| | | else |
| | | content.Error(result.MOMMessage); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // TODOè´¨æ£ååº |
| | | var area = _areaInfoRepository.QueryFirst(x => x.AreaID == 2); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion éç½®å¼å¸¸å£å
¥åº |
| | | |
| | | #endregion å¤é¨æ¥å£æ¹æ³ |
| | | |