| | |
| | | private readonly IESSApiService _eSSApiService; |
| | | private readonly IInvokeMESService _invokeMESService; |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IAllocateService _allocateService; |
| | | private readonly IRepository<Dt_InboundOrder> _inboundOrderRepository; |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | |
| | | |
| | | private readonly ILogger<OutboundPickingService> _logger; |
| | | |
| | |
| | | public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, |
| | | IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, |
| | | IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService) : base(BaseDal) |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository,IInboundOrderDetailService inboundOrderDetailService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | |
| | | _logger = logger; |
| | | _invokeMESService = invokeMESService; |
| | | _dailySequenceService = dailySequenceService; |
| | | _allocateService = allocateService; |
| | | _inboundOrderRepository = inboundOrderRepository; |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | } |
| | | |
| | | |
| | |
| | | PickQuantity = result.ActualPickedQty, |
| | | PickTime = DateTime.Now, |
| | | Operator = App.User.UserName, |
| | | OutStockLockId = result.FinalLockInfo.Id |
| | | OutStockLockId = result.FinalLockInfo.Id, |
| | | BarcodeUnit=result.FinalLockInfo.BarcodeUnit, |
| | | BarcodeQty=result.FinalLockInfo.BarcodeQty, |
| | | BatchNo= result.FinalLockInfo.BatchNo, |
| | | lineNo= result.FinalLockInfo.lineNo , |
| | | SupplyCode= result.FinalLockInfo.SupplyCode , |
| | | WarehouseCode = result.FinalLockInfo.WarehouseCode , |
| | | |
| | | |
| | | }; |
| | | |
| | | await Db.Insertable(pickingHistory).ExecuteCommandAsync(); |
| | |
| | | return WebResponseContent.Instance.Error($"åºåºåæç»æ°é溢åº{matchedCode.LockQuantity - matchedCode.OrderQuantity}"); |
| | | } |
| | | matchedDetail.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt(); |
| | | matchedCode.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | matchedCode.OrderDetailStatus = OrderDetailStatusEnum.AssignOver.ObjToInt(); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundOrderDetailService.UpdateData(matchedDetail); |
| | |
| | | } |
| | | matchedDetail.NoStockOutQty = 0; |
| | | |
| | | if(matchedDetail.ReceiptQuantity==0 && matchedDetail.OverInQuantity==0) |
| | | { |
| | | matchedDetail.OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(); |
| | | } |
| | | |
| | | Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == noStockOut.outOder && x.OrderStatus != OutOrderStatusEnum.åºåºå®æ.ObjToInt()).Includes(x => x.Details).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error($"å¨åºåºåçç©æç¼ç 䏿ªæ¾å°ä¸éè´åä¸ç{matchedDetail.MaterielCode} 对åºçç©æã"); |
| | | } |
| | | matchedCode.NoStockOutQty = 0; |
| | | if (matchedCode.LockQuantity == 0 && matchedCode.OverOutQuantity == 0) |
| | | { |
| | | matchedCode.OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundOrderDetailService.UpdateData(matchedDetail); |
| | | _outboundOrderDetailService.UpdateData(matchedCode); |
| | |
| | | |
| | | } |
| | | //夿å
¥åºåæ®æç»æ¯å¦å
¨é¨æ¯å®æç¶æ |
| | | bool inoderOver = inboundOrder.Details.Count() == inboundOrder.Details.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | int e = inboundOrder.Details.Count(); |
| | | int w = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | bool inoderOver = inboundOrder.Details.Count() == inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | if (inoderOver) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | } |
| | | //夿åºåºåæ®æç»æ¯å¦å
¨é¨æ¯å®æç¶æ |
| | | bool outOderOver = outboundOrder.Details.Count() == outboundOrder.Details.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | bool outOderOver = outboundOrder.Details.Count() == outboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | if (outOderOver) |
| | | { |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºå®æ.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | } |
| | | //æ°æ®å¤ç |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundOrderDetailService.UpdateData(inboundOrderDetails); |