| | |
| | | _allocateOrderRepository = allocateOrderRepository; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto) |
| | | public async Task<WebResponseContent> |
| | | GroupPallet(GroupPalletDto palletDto) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | |
| | | if(inboundOrder.BusinessType != "11") |
| | | { |
| | | var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First(); |
| | | var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => (x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode)&& x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()).Select(x => x.WarehouseCode).First(); |
| | | |
| | | if (string.IsNullOrEmpty(warehouseType)) |
| | | { |
| | |
| | | stockInfo = new Dt_StockInfo() { PalletType = (int)PalletTypeEnum.None, LocationType = Convert.ToInt32(palletDto.locationType) }; |
| | | stockInfo.Details = new List<Dt_StockInfoDetail>(); |
| | | } |
| | | //else |
| | | //{ |
| | | // var allowStatus = new[] |
| | | // { |
| | | // (int)StockStatusEmun.ç»çæå, |
| | | // (int)StockStatusEmun.æºä»å
¥æºä»ç»çæå, |
| | | // (int)StockStatusEmun.æå¨ç»çæå |
| | | // }; |
| | | |
| | | // if (!allowStatus.Contains(stockInfo.StockStatus)) |
| | | // { |
| | | // return content.Error($"该æç{stockInfo.PalletCode}ç¶æä¸å
许ç»ç"); |
| | | // } |
| | | //} |
| | | |
| | | if (inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType) |
| | | { |
| | |
| | | { |
| | | return content.Error($"è¯¥åæ®ä¸ºè¯äº§ç©æï¼éè¦å
¥åºå°è¯äº§ä»ï¼è¯·éæ°æ ¹æ®ååºéæ©è¯äº§ä»åºè¿è¡ç»çå
¥åº"); |
| | | } |
| | | if (inboundOrder.IsTestMaterials == 0 && (palletDto.WarehouseType == "1076" || palletDto.WarehouseType == "5057")) |
| | | { |
| | | return content.Error($"è¯¥åæ®ä¸ºéè¯äº§ç©æï¼ä¸è½å
¥å°è¯äº§ä»ï¼è¯·éæ°æ ¹æ®ä»åºè¿è¡ç»çå
¥åº"); |
| | | } |
| | | if (!_locationInfoService.QueryLocationCount(Convert.ToInt32(palletDto.locationType))) |
| | | { |
| | | return content.Error($"该åºåº{palletDto.locationType}ä¸åå¨ç©ºé²åºä½"); |