| | |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ESSæ«ç 请æ±å
¥åº |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="stationCode"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> RequestInboundTask(string palletCode, string stationCode) |
| | | { |
| | | try |
| | |
| | | Dt_Task dbtask = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (dbtask != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²çæä»»å¡"); |
| | | if (dbtask.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåºå¾
忣任å¡"); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²çæä»»å¡"); |
| | | } |
| | | } |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | |
| | | Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(); |
| | | Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(stockInfo.LocationType); |
| | | if (locationInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½åé
失败,æªæ¾å°å¯åé
è´§ä½"); |
| | |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | |
| | | OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo |
| | | |
| | | }; |
| | | //空箱 |
| | | if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()) |
| | |
| | | } |
| | | } |
| | | }; |
| | | _logger.LogInformation("å建任å¡Request: " + JsonConvert.SerializeObject(esstask)); |
| | | |
| | | var result = await _eSSApiService.CreateTaskAsync(esstask); |
| | | |
| | | _logger.LogInformation("å建任å¡è¿å: " + result); |
| | | if (result) |
| | | { |
| | | try |
| | | { |
| | | await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest |
| | | { |
| | | slotCode = stationCode, |
| | | containerCode = palletCode |
| | | }); |
| | | } |
| | | catch (Exception ex) { |
| | | |
| | | |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |