| | |
| | | using WIDESEA_IStorageTaskRepository; |
| | | using WIDESEA_IStorageTaskServices; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.ERP; |
| | | using WIDESEA_Model.Models.Order; |
| | | using WIDESEA_OrderRepository; |
| | | |
| | | namespace WIDESEA_OrderServices |
| | | { |
| | |
| | | private readonly IDt_TaskService _taskService; |
| | | private readonly ILocationInfoRepository _locationRepository; |
| | | private readonly IDt_TaskRepository _taskRepository; |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; |
| | | private readonly IDt_OrderOutDetailsRepository _outDetailsRepository; |
| | | |
| | | public Dt_ProductionOutboundOrderService(IDt_ProductionOutboundOrderRepository BaseDal, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | |
| | | IDt_TaskService taskService, |
| | | ILocationInfoRepository locationRepository, |
| | | IDt_TaskRepository taskRepository, |
| | | ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository) : base(BaseDal) |
| | | ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, |
| | | IDt_OrderOutDetailsRepository outDetailsRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _productionoutboundOrderDetailRepository = productionoutboundOrderDetailRepository; |
| | |
| | | _locationRepository = locationRepository; |
| | | _taskRepository = taskRepository; |
| | | _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; |
| | | _outDetailsRepository = outDetailsRepository; |
| | | } |
| | | |
| | | public WebResponseContent GetProductOutboundOrder(OutboundOrderGetDTO outboundOrderGetDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | |
| | | if (result.Item1.Count <= 0) |
| | | { |
| | | return content.Error("æªæ¾å°åºååé
ï¼è¯·ç¡®è®¤æ¯å¦åå¨åºåæåæ®æ°éå·²åºå®"); |
| | | return content.Error($"订å{outboundOrder.UpperOrderNo}ç©æç¼ç {outboundOrderdetail.MaterielCode}æªæ¾å°åºååé
ï¼è¯·ç¡®è®¤æ¯å¦åå¨åºåæåæ®æ°éå·²åºå®"); |
| | | } |
| | | |
| | | List<Dt_OrderOutDetails> outDetails = new List<Dt_OrderOutDetails>(); |
| | | result.Item1.Distinct().ForEach(item => |
| | | { |
| | | RequestTaskDto task = new RequestTaskDto |
| | |
| | | taskDtos.Add(task); |
| | | item.StockInfoDetails.Where(x => x.MaterielCode == outboundOrderdetail.MaterielCode).FirstOrDefault().Status = (int)StockStateEmun.åºåºéå®; |
| | | item.StockStatus = (int)StockStateEmun.åºåºéå®; |
| | | |
| | | outDetails.Add(new Dt_OrderOutDetails() |
| | | { |
| | | OrderNo = outboundOrder.UpperOrderNo, |
| | | PalletCode = item.PalletCode, |
| | | OrderType = outboundOrder.OrderType, |
| | | ERPOrderId = outboundOrderdetail.ERPOrderId, |
| | | MaterielCode = outboundOrderdetail.MaterielCode, |
| | | MaterielName = outboundOrderdetail.MaterielName, |
| | | AllocateWarehouse = requestOut.Warehouse == null ? item.StockInfoDetails.Where(x => x.MaterielCode == outboundOrderdetail.MaterielCode).FirstOrDefault().Warehouse : requestOut.Warehouse, |
| | | Warehouse = "æºè½ç«åº", |
| | | WareHouseId = outboundOrderdetail.WareHouseId, |
| | | OutboundQuantity = item.StockInfoDetails.Where(x => x.MaterielCode == outboundOrderdetail.MaterielCode).Sum(x => x.Quantity), |
| | | }); |
| | | |
| | | }); |
| | | List<Dt_Task> taskNews = new List<Dt_Task>(); |
| | | List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO>(); |
| | |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(locationStatusChangeRecords); |
| | | await _locationRepository.UpdateDataAsync(locations); |
| | | _productionoutboundOrderDetailRepository.UpdateData(result.Item2); |
| | | _outDetailsRepository.AddData(outDetails); |
| | | }); |
| | | content = await _taskService.SendWCSTask(taskDTOs); |
| | | } |