| | |
| | | { |
| | | agvstation.IsOccupied = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | //å çä»»å¡åç¬å®æ |
| | | if (task.TaskType==TaskTypeEnum.EmptyStackPlate.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (agvstation != null) |
| | | { |
| | | _basicRepository.AGVStationInfoRepository.UpdateData(agvstation); |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x=>x.proStockInfoDetails).First(); |
| | | if (proStockInfo != null && proStockInfo.StockStatus == StockStatusEmun.MES空æéåº.ObjToInt()) |
| | | { |
| | |
| | | /// <summary> |
| | | /// æå空æååº |
| | | /// </summary> |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint) |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint,int target) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld!=null) |
| | | Dt_Task newTask = null; |
| | | Dt_ProStockInfo proStockInfo = null; |
| | | if (target==WhetherEnum.False.ObjToInt())//å ç空æä»»å¡ |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = agvstation.AGVStationCode.StartsWith("PNT_1") ? "StackPlate1": "StackPlate2", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.EmptyStackPlate.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = WarehouseEnum.LLDFL.ObjToInt(), |
| | | PalletType = 1 |
| | | }; |
| | | } |
| | | //åé
å··é |
| | | string roadWay=AssignCPRoadwayNo(); |
| | | |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | else //ç«åºç©ºæä»»å¡ |
| | | { |
| | | PalletCode=barCode, |
| | | ProStockAttribute=ProStockAttributeEnum.空æ.ObjToInt(), |
| | | PalletType=1, |
| | | LocationCode="", |
| | | WarehouseId= WarehouseEnum.LLDFL.ObjToInt(), |
| | | StockStatus=StockStatusEmun.MES空æéåº.ObjToInt() |
| | | }; |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.EmptyProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = WarehouseEnum.LLDFL.ObjToInt(), |
| | | PalletType = 1 |
| | | }; |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProStockAttribute = ProStockAttributeEnum.空æ.ObjToInt(), |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = WarehouseEnum.LLDFL.ObjToInt(), |
| | | StockStatus = StockStatusEmun.MES空æéåº.ObjToInt() |
| | | }; |
| | | newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.EmptyProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = WarehouseEnum.LLDFL.ObjToInt(), |
| | | PalletType = 1 |
| | | }; |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | _stockRepository.ProStockInfoRepository.AddData(proStockInfo); |
| | | if (proStockInfo!=null) |
| | | { |
| | | _stockRepository.ProStockInfoRepository.AddData(proStockInfo); |
| | | } |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |