| | |
| | | } |
| | | #endregion å
¥åºä»»å¡å®æ |
| | | |
| | | #region AGVæ¬è¿ä»»å¡å®æ |
| | | public async Task<WebResponseContent> CompleteCarryTaskAsync(Dt_Task task,DtStockInfo stockInfo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var Sourcelocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.SourceAddress); |
| | | var Targetlocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | //UpdateLocationStatus(Sourcelocation, LocationEnum.Free); |
| | | //UpdateLocationStatus(Targetlocation, LocationEnum.InStock); |
| | | |
| | | task.TaskState = (int)TaskAGVCarryStatusEnum.CarryFinish; |
| | | var taskHty = task.Adapt<Dt_Task_Hty>(); |
| | | taskHty.FinishTime = DateTime.Now; |
| | | taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.äººå·¥å®æ : (int)OperateTypeEnum.èªå¨å®æ; |
| | | taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System"; |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await DeleteTaskAsync(task.TaskId); |
| | | await AddTaskHtyAsync(taskHty); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region AGV跨楼å±ä»»å¡å®æ |
| | | public async Task<WebResponseContent> CompleteAcrossFloorTaskAsync(Dt_Task task, DtStockInfo stockInfo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | task.TaskState = (int)TaskAcrossFloorStatusEnum.CarryFinish; |
| | | var taskHty = task.Adapt<Dt_Task_Hty>(); |
| | | taskHty.FinishTime = DateTime.Now; |
| | | taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.äººå·¥å®æ : (int)OperateTypeEnum.èªå¨å®æ; |
| | | taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System"; |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await DeleteTaskAsync(task.TaskId); |
| | | await AddTaskHtyAsync(taskHty); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ä»»å¡å®æ |
| | | |
| | | /// <summary> |
| | |
| | | return content.Error("æçä¿¡æ¯ä¸åå¨ï¼è¯·ç¡®è®¤æçå·²ç»çæå"); |
| | | } |
| | | |
| | | foreach (var item in boxingInfo.BoxingInfoDetails) |
| | | { |
| | | var ERPStock = SqlSugarHelper.DBERP.Queryable<ç¨å峿¶åºå_ST>().Where(x => x.åå¨å°ç¹åç§° == item.Warehouse && x.æå· == item.MaterielCode && x.åå == item.MaterielName && x.åºåæ°é >= item.Quantity).ToList().FirstOrDefault(); |
| | | if (ERPStock == null) |
| | | { |
| | | return content.Error($"ç»çæ°æ®æªå¨ERPåºåæ°æ®ä¸ï¼è¯·äººå·¥ç¡®è®¤æ°æ®æ¯å¦æ£ç¡®"); |
| | | } |
| | | } |
| | | //foreach (var item in boxingInfo.BoxingInfoDetails) |
| | | //{ |
| | | // var ERPStock = SqlSugarHelper.DBERP.Queryable<ç¨å峿¶åºå_ST>().Where(x => x.åå¨å°ç¹åç§° == item.Warehouse && x.æå· == item.MaterielCode && x.åå == item.MaterielName && x.åºåæ°é >= item.Quantity).ToList().FirstOrDefault(); |
| | | // if (ERPStock == null) |
| | | // { |
| | | // return content.Error($"ç»çæ°æ®æªå¨ERPåºåæ°æ®ä¸ï¼è¯·äººå·¥ç¡®è®¤æ°æ®æ¯å¦æ£ç¡®"); |
| | | // } |
| | | //} |
| | | |
| | | var StartAddress = await _locationRepository.QueryFirstAsync(x => x.LocationCode == taskDto.Position); |
| | | if (StartAddress == null) |
| | |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark) |
| | | public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark,int doubleTray) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | return content.Error("该æçåºåå·²å¨åºåºç¼ååº"); |
| | | } |
| | | |
| | | Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound }); |
| | | Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound, DoubleTray= doubleTray }); |
| | | List<Dt_InventoryRecord> records = new List<Dt_InventoryRecord>(); |
| | | stcok.StockInfoDetails.ForEach(x => |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»åºåº |
| | | /// </summary> |
| | | /// <param name="details"></param> |
| | | /// <returns></returns> |
| | | |
| | | public async Task<WebResponseContent> OtherOutBoundTaskAsync(List<DtStockInfoDetail> details) |
| | | { |
| | |
| | | Remark = StartAddress.AreaId.ToString(), |
| | | AGVTaskNum = GenerateUniqueId(), |
| | | Floor = StartAddress.Floor, |
| | | DoubleTray = taskDto.DoubleTray, |
| | | }; |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | else if (location.AreaId == 2) |
| | | else if (location.AreaId == 2 || location.AreaId == 7) |
| | | { |
| | | var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark); |
| | | if (locationLateral.Count > 0) |
| | |
| | | TaskType = task.TaskType, |
| | | Floor =task.Floor, |
| | | AGVTaskNum = task.AGVTaskNum, |
| | | DoubleTray = task.DoubleTray, |
| | | } }; |
| | | } |
| | | |
| | |
| | | AGVTaskNum = task.AGVTaskNum, |
| | | Remark = task.Remark, |
| | | Floor = task.Floor, |
| | | DoubleTray = task.DoubleTray, |
| | | }; |
| | | } |
| | | private List<WMSTaskDTO> CreateTaskDTO(List<Dt_Task> task) |
| | |
| | | AGVTaskNum = item.AGVTaskNum, |
| | | Remark = item.Remark, |
| | | Floor = item.Floor, |
| | | DoubleTray = item.DoubleTray, |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | else if (location.AreaId == 2) |
| | | else if (location.AreaId == 2 || location.AreaId == 7) |
| | | { |
| | | var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark); |
| | | |