| | |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | TaskLength = (int)stockInfo.MaterielWide |
| | | TaskLength = (int)stockInfo.MaterielWide, |
| | | MaterielCode=stockInfo.MaterielCode, |
| | | Quantity=stockInfo.StockLength |
| | | }; |
| | | //æ´æ°ç¶æ |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.åºåºå®æ.ObjToInt() && stockInfoOld.IsPick==WhetherEnum.False.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | { |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | decimal oldQty = stockInfoOld.StockLength; |
| | | //è°ç¨æ´æ°éæåºå |
| | | stockInfoOld = ReturnStockUp(stockInfoOld, thickness); |
| | | //æ´æ°æ°æ® |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"èåæªé¢æéåº{stockInfoOld.RfidCode}"); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoOld, oldQty, oldQty < stockInfoOld.StockLength ? stockInfoOld.StockLength - oldQty : oldQty - stockInfoOld.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK($"èåæªé¢æéåºRFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.èåéææå.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | { |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | decimal oldQty = stockInfoOld.StockLength; |
| | | //è°ç¨æ´æ°éæåºå |
| | | stockInfoOld = ReturnStockUp(stockInfoOld, thickness); |
| | | //æ´æ°æ°æ® |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"èå颿éåº{stockInfoOld.RfidCode}"); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoOld, oldQty, oldQty < stockInfoOld.StockLength ? stockInfoOld.StockLength- oldQty: oldQty- stockInfoOld.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK($"èå颿éåºRFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null) |
| | | { |
| | |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"éè´å
¥åº{ExistStockInfo.RfidCode}"); |
| | | return content.OK($"éè´å
¥åºRFID{ExistStockInfo.RfidCode}ç»å®{ExistStockInfo.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°éæåºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dt_StockInfo ReturnStockUp(Dt_StockInfo stockInfoOld,decimal thickness) |
| | | { |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(stockInfoOld.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {stockInfoOld.PalletCode}䏿ERPåºåä¸åå¨"); |
| | | } |
| | | |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{stockInfoOld.PalletCode}çåºåä¿¡æ¯"); |
| | | if (stockInfoOld.StockStatus == StockStatusEmun.èåéææå.ObjToInt()) |
| | | { |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.MaterielThickness = bSTStockInfoDTO.Thick; |
| | | stockInfoOld.MaterielWeight = bSTStockInfoDTO.Qty; |
| | | stockInfoOld.MaterielWide = bSTStockInfoDTO.W; |
| | | stockInfoOld.StockLength = bSTStockInfoDTO.StockMeter; |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | if (thickness < 800) |
| | | { |
| | | throw new Exception($"RFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}ç´å¾å°äº800mm"); |
| | | } |
| | | return stockInfoOld; |
| | | } |
| | | public void UpdateStock(Dt_StockInfo stockInfo, decimal weight = 0, decimal thickness = 0, decimal wide = 0) |
| | | { |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | if (stockInfo.MaterielThickness >= 300 && stockInfo.MaterielThickness <= 1300 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2700) |
| | | { |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt(): x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt(): x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | | } |
| | |
| | | else |
| | | { |
| | | //éå¶ |
| | | if (stockInfo.MaterielThickness >= 800 && stockInfo.MaterielThickness <= 1500 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) |
| | | if ((stockInfo.MaterielThickness >= 800 || (stockInfo.CheckThickness >= 800 && stockInfo.StockStatus==StockStatusEmun.èåéåº.ObjToInt())) && stockInfo.MaterielThickness <= 1500 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) |
| | | { |
| | | bool LayerLimit = false; |
| | | if (stockInfo.MaterielThickness>1300) |
| | |
| | | LayerLimit = true; |
| | | } |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | if (stockInfo.MaterielWide > 2200) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | } |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.MaterielGroup); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.Inbound); |
| | | } |
| | | else |
| | | { |
| | |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum); |
| | | //䏿¥èåERP |
| | | if (stockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && task.TaskType==TaskTypeEnum.Inbound.ObjToInt()) |
| | | { |
| | |
| | | RfidUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | BSTResponse<object> bSTResponse = _invokeERPService.BSTPurchaseUp(bSTPurchaseUpModel).DeserializeObject<BSTResponse<object>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"BST䏿ERP忥å
¥åºä¿¡æ¯å¤±è´¥,é误信æ¯ï¼{bSTResponse.Msg}"); |
| | | content.Message = bSTResponse?.Msg; |
| | | } |
| | | content.Message = bSTResponse.Msg; |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum); |
| | | } |
| | | return content.OK(); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | InOrderTypeEnum inOrderTypeEnum = (InOrderTypeEnum)orderType; |
| | | if (inOrderTypeEnum == InOrderTypeEnum.InventoryIn) |
| | | { |
| | | //è·å主å |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderType == orderType).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | |
| | | if (inboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}å
¥åºåæ®ä¿¡æ¯"); |
| | |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProInOrderNo = inboundOrder.UpperOrderNo, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | |
| | | //çæä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | PalletType = 1, |
| | | Remark="åæå
¥åº" |
| | | OrderNo = inboundOrder.UpperOrderNo, |
| | | MaterielCode = inboundOrderDetail.MaterialCode, |
| | | Quantity = inboundOrderDetail.OrderQuantity, |
| | | PalletType = 1 |
| | | }; |
| | | inboundOrderDetail.OrderDetailStatus=InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | } |
| | | else if (inOrderTypeEnum == InOrderTypeEnum.PurchaseIn) |
| | | { |
| | | //è·å主å |
| | | Dt_PurchaseOrder inboundOrder = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | |
| | | if (inboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}éè´å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_PurchaseOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BarCode == bindCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.PurchaseOrderNo}æ¡ç {bindCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.PurchaseDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {bindCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == startPoint); |
| | | if (agvstation == null) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.AGV_Executing.ObjToInt())); |
| | | if (taskOldPoint != null) |
| | | { |
| | | return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | } |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId && x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail() |
| | | { |
| | | ProductCode = materielInfo.MaterielCode, |
| | | ProductNo = bindCode, |
| | | ProductName = materielInfo.MaterielName, |
| | | ProductSpec = materielInfo.MaterielSpec, |
| | | LotNumber = inboundOrderDetail.MaterialLot, |
| | | ProductUnit = materielInfo.MaterielUnit, |
| | | StockQty = inboundOrderDetail.PurchaseDetailQuantity, |
| | | ProStockDetailStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() |
| | | }; |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProInOrderNo = inboundOrder.PurchaseOrderNo, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | //çæä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | OrderNo = inboundOrder.PurchaseOrderNo, |
| | | MaterielCode=inboundOrderDetail.MaterialCode, |
| | | Quantity=inboundOrderDetail.PurchaseDetailQuantity, |
| | | PalletType = 1 |
| | | }; |
| | | inboundOrderDetail.PurchaseDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrder.PurchaseOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.PurchaseOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.PurchaseOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _inboundRepository.PurchaseOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºåæ®ç±»å"); |
| | | } |
| | | |
| | | content.OK("åéæå"); |
| | | |
| | | } |