| | |
| | | private readonly IRepository<Dt_OutboundOrderDetail> _outboundOrderDetailRepository; |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | private readonly IRepository<Dt_OutStockLockInfo> _outStockLockInfoRepository; |
| | | public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService, IRepository<Dt_OutStockLockInfo> outStockLockInfoRepository) : base(BaseDal) |
| | | private readonly IFeedbackMesService _feedbackMesService; |
| | | public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService, IRepository<Dt_OutStockLockInfo> outStockLockInfoRepository, IFeedbackMesService feedbackMesService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _materialUnitService = materialUnitService; |
| | | _materielInfoService = materielInfoService; |
| | | _outStockLockInfoRepository = outStockLockInfoRepository; |
| | | _feedbackMesService = feedbackMesService; |
| | | } |
| | | |
| | | private int[] OrderTypes = new int[] { (int)InOrderTypeEnum.AllocatOutbound, (int)InOrderTypeEnum.InternalAllocat, (int)InOrderTypeEnum.ReCheck }; |
| | |
| | | _outboundOrderDetailRepository.UpdateData(updateoutboundOrderDetails); |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetails); |
| | | |
| | | if (outboundOrder.Details.All(x => x.OverOutQuantity >= x.OrderQuantity - x.MoveQty)) |
| | | var realLatestDetails = Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.OrderId == outboundOrder.Id).ToList(); |
| | | |
| | | if (realLatestDetails.All(x => x.OverOutQuantity >= x.OrderQuantity - x.MoveQty)) |
| | | { |
| | | outboundOrder.OrderStatus = (int)OutOrderStatusEnum.鍑哄簱瀹屾垚; |
| | | outboundOrder.ReturnToMESStatus = 1; |
| | | BaseDal.UpdateData(outboundOrder); |
| | | _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo); |
| | | } |
| | | BaseDal.UpdateData(outboundOrder); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |