| | |
| | | using MailKit.Search; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using Org.BouncyCastle.Asn1.X509; |
| | | using Org.BouncyCastle.Bcpg; |
| | | using SixLabors.ImageSharp; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | private readonly IRepository<Dt_MesReturnRecord> _mesReturnRecord; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder; |
| | | 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) |
| | | 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) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | InboundOrderDetailService = inboundOrderDetailService; |
| | |
| | | _mesReturnRecord = mesReturnRecord; |
| | | _locationInfoService = locationInfoService; |
| | | _takeStockOrder = takeStockOrder; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | } |
| | | |
| | | public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto) |
| | |
| | | |
| | | if (details.Count() <= 0) |
| | | { |
| | | return content.Error("请确认æ¯å¦å·²ç»ç»ç"); |
| | | var inbounddetail =_inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode); |
| | | if(inbounddetail == null) |
| | | { |
| | | return content.Error($"æ¡ç {palletDto.Barcode}ä¸åå¨"); |
| | | } |
| | | var inbound = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.Id == inbounddetail.OrderId).First(); |
| | | if (inbound == null) |
| | | { |
| | | return content.Error("åæ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | var detail = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().LeftJoin<Dt_InboundOrder>((d,o)=>d.OrderId==o.Id).Where((d, o) => d.OrderId == inbound.Id |
| | | && d.ReceiptQuantity != 0 |
| | | && d.OverInQuantity == 0).Select((d, o) => new |
| | | { |
| | | orderNo=o.InboundOrderNo, |
| | | d.Barcode, |
| | | d.MaterielCode, |
| | | d.BatchNo, |
| | | d.ReceiptQuantity, |
| | | d.Unit, |
| | | d.SupplyCode, |
| | | d.WarehouseCode |
| | | }).ToList(); |
| | | var palletId = _stockInfoDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode); |
| | | if (palletId == null) |
| | | { |
| | | return content.Error($"æ¡ç æ¡ç {palletDto.Barcode}ä¸åå¨"); |
| | | } |
| | | var pallet =_stockInfoRepository.QueryFirst(x => x.Id == palletId.StockId); |
| | | return content.Error($"æ¡ç {palletDto.Barcode}å·²ç»ç»å°{pallet.PalletCode}",detail); |
| | | } |
| | | inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Includes(x=>x.Details).Where(x => x.Id == details.First().OrderId).First(); |
| | | |