| | |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder; |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository; |
| | | public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfoDetail> stockInfoDetailRepository) |
| | | private readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository; |
| | | public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | InboundOrderDetailService = inboundOrderDetailService; |
| | |
| | | _locationInfoService = locationInfoService; |
| | | _takeStockOrder = takeStockOrder; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _allocateOrderRepository = allocateOrderRepository; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto) |
| | |
| | | return content.Error($"å½åååºä¸ä¸è´"); |
| | | } |
| | | |
| | | if(inboundOrder.BusinessType != "11"&& inboundOrder.Details.FirstOrDefault().WarehouseCode != palletDto.WarehouseType) |
| | | if(inboundOrder.BusinessType != "11") |
| | | { |
| | | return content.Error($"该æ¡ç æå±ä»åºä¸º{inboundOrder.Details.FirstOrDefault().WarehouseCode}ä¸å½åä»åº{palletDto.WarehouseType}ä¸ä¸è´ï¼ä¸å
许ç»ç"); |
| | | var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First(); |
| | | |
| | | if (string.IsNullOrEmpty(warehouseType)) |
| | | { |
| | | return content.Error($"æªæ¥è¯¢å°æ¡ç [{palletDto.Barcode}]对åºçä»åºä¿¡æ¯ï¼ä¸å
许ç»ç"); |
| | | } |
| | | |
| | | if (!warehouseType.Equals(palletDto.WarehouseType)) |
| | | { |
| | | return content.Error($"该æ¡ç æå±ä»åºä¸º{warehouseType}ä¸å½åä»åº{palletDto.WarehouseType}ä¸ä¸è´ï¼ä¸å
许ç»ç"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Dt_StockInfo? stockInfo = await _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.PalletCode == palletDto.PalletCode).FirstAsync(); |
| | | |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>() |
| | | Dt_InboundOrder inboundOrder = null; |
| | | var allocateOrder = _allocateOrderRepository.Db.Queryable<Dt_AllocateOrder>().Where(x => x.Id == id).First(); |
| | | if (allocateOrder != null) |
| | | { |
| | | inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == allocateOrder.OrderNo).First(); |
| | | if (inboundOrder.IsBatch == 0 && inboundOrder.OrderStatus == InOrderStatusEnum.å
¥åºä¸.ObjToInt()) |
| | | { |
| | | return content = WebResponseContent.Instance.OK($"è¯¥åæ®å±äºä¸åæ¹èªå¨åä¼ ï¼ä¸å¯æå¨åæ¹åä¼ "); |
| | | } |
| | | }else |
| | | { |
| | | inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>() |
| | | .Where(x => x.Id == id) |
| | | .First(); |
| | | if (inboundOrder.IsBatch == 0 && inboundOrder.OrderStatus == InOrderStatusEnum.å
¥åºä¸.ObjToInt()) |
| | | { |
| | | return content = WebResponseContent.Instance.OK($"è¯¥åæ®å±äºä¸åæ¹èªå¨åä¼ ï¼ä¸å¯æå¨åæ¹åä¼ "); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | List<Dt_MesReturnRecord> returnRecords = _mesReturnRecord.QueryData(x => x.OrderNo == inboundOrder.InboundOrderNo && x.OrderId == inboundOrder.Id && x.ReturnStatus == 2); |
| | | foreach (var item in returnRecords) |
| | |
| | | inboundOrder.ReturnToMESStatus = 2; |
| | | } |
| | | _inboundOrderRepository.UpdateData(inboundOrder); |
| | | return WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼å¤±è´¥æ°æ®åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x => x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | return WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x => x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | } |
| | | |
| | | var response = responseModel(inboundOrder, 3, null, allocatefeedmodel); |
| | |
| | | inboundOrder.ReturnToMESStatus = 2; |
| | | } |
| | | _inboundOrderRepository.UpdateData(inboundOrder); |
| | | return WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼å¤±è´¥æ°æ®åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x => x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | return WebResponseContent.Instance.OK($"è¯¥åæ®æ²¡æéè¦åä¼ æç»ï¼åä¼ {returnRecords.Count()}æ¡ï¼åä¼ æå{returnRecords.Count(x => x.ReturnStatus == 1)}æ¡ï¼åä¼ å¤±è´¥{returnRecords.Count(x => x.ReturnStatus == 2)}æ¡"); |
| | | } |
| | | var response = responseModel(inboundOrder, 3, feedmodel); |
| | | |