| | |
| | | { |
| | | try |
| | | { |
| | | Dt_Task dbtask = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | Dt_Task dbtask = Repository.Db.Queryable<Dt_Task>().Where(x => x.PalletCode == palletCode).OrderByDescending(x=>x.CreateDate).First(); |
| | | if (dbtask != null) |
| | | { |
| | | _logger.LogInformation($"ä»»å¡ç±»å{dbtask.TaskType.ToString()} ,{dbtask.TaskNum} "); |
| | | if (dbtask.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåºå¾
忣任å¡"); |
| | | } |
| | | else if (dbtask.TaskType == TaskTypeEnum.OutAllocate.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåºå¾
忣任å¡"); |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²çæä»»å¡"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | |
| | | |
| | | |
| | | var newTask = new Dt_Task() |
| | | { |
| | | { |
| | | CurrentAddress = stationCode, |
| | | Grade = 0, |
| | | NextAddress = stations.GetValueOrDefault(stationCode) ?? "", |
| | |
| | | _stockRepository.UpdateData(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | TaskModel esstask = new TaskModel() |
| | | { |
| | | taskType = "putaway", |
| | | taskGroupCode = "", |
| | | groupPriority = 0, |
| | | tasks = new List<TasksType> |
| | | { |
| | | new() |
| | | { |
| | | taskCode=newTask.TaskNum.ToString(), |
| | | taskPriority=0, |
| | | taskDescribe=new TaskDescribeType{ |
| | | containerCode=palletCode, |
| | | containerType= "CT_KUBOT_STANDARD", |
| | | fromLocationCode=stations.GetValueOrDefault(stationCode)??"", |
| | | toStationCode="", |
| | | toLocationCode=locationInfo.LocationCode, |
| | | deadline=0,storageTag="" |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | //TaskModel esstask = new TaskModel() |
| | | //{ |
| | | // taskType = "putaway", |
| | | // taskGroupCode = "", |
| | | // groupPriority = 0, |
| | | // tasks = new List<TasksType> |
| | | // { |
| | | // new() |
| | | // { |
| | | // taskCode=newTask.TaskNum.ToString(), |
| | | // taskPriority=0, |
| | | // taskDescribe=new TaskDescribeType{ |
| | | // containerCode=palletCode, |
| | | // containerType= "CT_KUBOT_STANDARD", |
| | | // fromLocationCode=stations.GetValueOrDefault(stationCode)??"", |
| | | // toStationCode="", |
| | | // toLocationCode=locationInfo.LocationCode, |
| | | // deadline=0,storageTag="" |
| | | // } |
| | | // } |
| | | // } |
| | | //}; |
| | | |
| | | var result = await _eSSApiService.CreateTaskAsync(esstask); |
| | | //var result = await _eSSApiService.CreateTaskAsync(esstask); |
| | | |
| | | _logger.LogInformation("å建任å¡è¿å: " + result); |
| | | if (result) |
| | | //_logger.LogInformation("å建任å¡è¿å: " + result); |
| | | //if (result) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("ä¸åæºå¨äººä»»å¡å¤±è´¥ï¼"); |
| | | } |
| | | //else |
| | | //{ |
| | | // return WebResponseContent.Instance.Error("ä¸åæºå¨äººä»»å¡å¤±è´¥ï¼"); |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |