| | |
| | | { |
| | | x.AGVArea = agvDescription; |
| | | }); |
| | | string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize()); |
| | | string url = AppSettings.Get("WCS"); |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WCSApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize()); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | string response = HttpHelper.Post("http://127.0.0.1:9281/api/CTU_AGV/PutFinish", code); |
| | | string url = AppSettings.Get("WCS"); |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WCSAApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/CTU_AGV/PutFinish?code=" + code); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | } |
| | |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | |
| | | #region 空箱å
¥åº |
| | | if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()) |
| | | #region 空箱å
¥åº/æ£éååº |
| | | if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt()) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | task.TaskStatus = (int)TaskStatusEnum.Finish; |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | |
| | | |
| | | Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); |
| | | List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); |
| | | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); |
| | | if (stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | | //æ¨éå
¥åºå®æç»Erp |
| | | if (inboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"对åºå
¥åºåä¸åå¨"); |
| | | } |
| | | |
| | | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); |
| | | |
| | | foreach (var item in stockInfo.Details) |
| | | { |
| | | Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == item.InboundOrderRowNo); |
| | |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | } |
| | | if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status)//todo ä¿®æ¹å¤ç |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ¥Erp失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | if ((stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | | foreach (var model in stockInfo.Details) |
| | | { |
| | | TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, /*MaterialName = model.MaterielName,*/ Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); |
| | | TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, MaterialName = model.MaterielName, Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); |
| | | } |
| | | } |
| | | |
| | |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | if (stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | | _inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>(); |
| | | List<Dt_MesOutboundOrder> mesOutboundOrders = new List<Dt_MesOutboundOrder>(); |
| | | |
| | | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType != TaskTypeEnum.OutEmpty.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åºåºè¯¦æ
ä¿¡æ¯"); |
| | | } |
| | |
| | | { |
| | | if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) |
| | | { |
| | | Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.Id == item.OrderDetailId); |
| | | Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.TaskNo == item.OrderNo); |
| | | if (mesOutboundOrder != null) |
| | | { |
| | | mesOutboundOrder.OverOutQuantity = item.AssignQuantity; |
| | |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt()) |
| | | { |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) |
| | | { |
| | | _outboundService.MesOutboundOrderService.Repository.UpdateData(mesOutboundOrders); |