| | |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | private readonly IDt_OrderOutDetailsRepository _outDetailsRepository; |
| | | private readonly IDt_AreaInfoRepository _areaInfoRepository; |
| | | private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository; |
| | | |
| | | public Dt_AllocateOutboundOrderService(IDt_AllocateOutboundOrderRepository BaseDal, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | |
| | | IDt_TaskRepository taskRepository, |
| | | ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, |
| | | IDt_OrderOutDetailsRepository outDetailsRepository, |
| | | IDt_AreaInfoRepository areaInfoRepository) : base(BaseDal) |
| | | IDt_AreaInfoRepository areaInfoRepository, |
| | | IDt_WareAreaInfoRepository wareAreaInfoRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _allocateoutboundOrderDetailRepository = allocateoutboundOrderDetailRepository; |
| | |
| | | _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; |
| | | _outDetailsRepository = outDetailsRepository; |
| | | _areaInfoRepository = areaInfoRepository; |
| | | _wareAreaInfoRepository = wareAreaInfoRepository; |
| | | } |
| | | public WebResponseContent GetAllocateOutboundOrder(OutboundOrderGetDTO outboundOrderGetDTO) |
| | | { |
| | |
| | | { |
| | | foreach (var orderId in requestOut.orderIds) |
| | | { |
| | | Dt_AreaInfo areaInfo = null; |
| | | Dt_WareAreaInfo? wareAreaInfo = null; |
| | | if (requestOut.Warehouse != "") |
| | | areaInfo = _areaInfoRepository.QueryFirst(x => x.AreaCode == requestOut.Warehouse); |
| | | wareAreaInfo = _wareAreaInfoRepository.QueryFirst(x => x.WareAreaCode == requestOut.Warehouse); |
| | | else |
| | | return content.Error("è¯·éæ©è°æ¨ä»åº"); |
| | | |
| | | |
| | | List<RequestTaskDto> taskDtos = new List<RequestTaskDto>(); |
| | | List<RequestTaskDto> taskDtos = new List<RequestTaskDto>(); |
| | | Dt_AllocateOutboundOrderDetail allocateoutboundOrderdetail = _allocateoutboundOrderDetailRepository.QueryFirst(x => x.Id == orderId); |
| | | Dt_AllocateOutboundOrder outboundOrder = BaseDal.QueryFirst(x => x.Id == allocateoutboundOrderdetail.OrderId); |
| | | |
| | |
| | | MaterielCode = allocateoutboundOrderdetail.MaterielCode, |
| | | Position = item.LocationCode, |
| | | PalletCode = item.PalletCode, |
| | | AreaId = Convert.ToInt32(requestOut.AreaId), |
| | | //AreaId = Convert.ToInt32(requestOut.AreaId), |
| | | AreaId = Convert.ToInt32(2), |
| | | }; |
| | | taskDtos.Add(task); |
| | | item.StockInfoDetails.Where(x => x.MaterielCode == allocateoutboundOrderdetail.MaterielCode).FirstOrDefault().Status = (int)StockStateEmun.åºåºéå®; |
| | | item.StockStatus = (int)StockStateEmun.åºåºéå®; |
| | | item.OrderNo = outboundOrder.UpperOrderNo; |
| | | |
| | |
| | | ERPOrderId = allocateoutboundOrderdetail.ERPOrderId, |
| | | MaterielCode = allocateoutboundOrderdetail.MaterielCode, |
| | | MaterielName = allocateoutboundOrderdetail.MaterielName, |
| | | AllocateWarehouse = areaInfo == null ? item.StockInfoDetails.Where(x => x.MaterielCode == allocateoutboundOrderdetail.MaterielCode).FirstOrDefault().Warehouse : areaInfo.AreaName, |
| | | AllocateWarehouseId = areaInfo == null ? item.StockInfoDetails.Where(x => x.MaterielCode == allocateoutboundOrderdetail.MaterielCode).FirstOrDefault().WareHouseId : areaInfo.AreaCode, |
| | | AllocateWarehouse = wareAreaInfo.WareAreaName, |
| | | AllocateWarehouseId = wareAreaInfo.WareAreaCode, |
| | | Warehouse = "æºè½ç«åº", |
| | | WareHouseId = "107", |
| | | OutboundQuantity = x.OutboundQuantity, |
| | |
| | | locations.AddRange(result1.Item2); |
| | | locations.AddRange(result2.Item2); |
| | | } |
| | | |
| | | outboundOrder.OrderStatus = (int)OrderStateEmun.å¼å§; |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | BaseDal.UpdateData(outboundOrder); |
| | | _taskRepository.AddData(taskNews); |
| | | _stockInfoRepository.UpdateDataNav(result.Item1); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(locationStatusChangeRecords); |
| | |
| | | |
| | | } |
| | | allocateoutboundOrderdetail.OverOutQuantity = allocateoutboundOrderdetail.OrderQuantity - needQuantity; |
| | | allocateoutboundOrderdetail.NotOutQuantity = allocateoutboundOrderdetail.OrderQuantity - allocateoutboundOrderdetail.OverOutQuantity; |
| | | |
| | | if (allocateoutboundOrderdetail.OverOutQuantity != 0) |
| | | { |
| | | allocateoutboundOrderdetail.OrderDetailStatus = (int)OrderStateEmun.å¼å§; |
| | | } |
| | | if (allocateoutboundOrderdetail.OverOutQuantity == allocateoutboundOrderdetail.OrderQuantity) |
| | | { |
| | | allocateoutboundOrderdetail.OrderDetailStatus = (int)OrderStateEmun.已宿; |
| | | } |
| | | return (outStockNews, allocateoutboundOrderdetail); |
| | | } |
| | | |