| | |
| | | } |
| | | tasks.ForEach(x => |
| | | { |
| | | x.Grade = 99; |
| | | x.Grade = 1; |
| | | }); |
| | | stockInfos.ForEach(x => |
| | | { |
| | |
| | | item.StockLength = 0; |
| | | item.MaterielWeight = 0; |
| | | item.MaterielThickness = 0; |
| | | item.MaterielWide = 0; |
| | | item.StockOutLength = 0; |
| | | item.IsFull = WhetherEnum.True.ObjToInt(); |
| | | item.IsPick = WhetherEnum.True.ObjToInt(); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// å建éå®åºåº |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CreateProDeliveryTasks(List<int> ids) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | ////è·åéå®åºåºåæ® |
| | | //List<Dt_ProDeliveryOrder> deliveryOrders = BaseDal.Db.Queryable<Dt_ProDeliveryOrder>().Where(x=> ids.Contains(x.Id)).Includes(x=>x.Details).ToList(); |
| | | //Dt_ProDeliveryOrder? proDeliveryOrder = deliveryOrders.FirstOrDefault(x => x.ProDeliveryStatus != OutOrderStatusEnum.æªå¼å§.ObjToInt()); |
| | | //if (proDeliveryOrder != null) |
| | | //{ |
| | | // return content.Error($"åå·{proDeliveryOrder.DeliveryCode},订åç¶æ{(OutOrderStatusEnum)proDeliveryOrder.ProDeliveryStatus}"); |
| | | //} |
| | | //List<Dt_ProDeliveryOrderDetail> proDeliveryOrderDetails = deliveryOrders.SelectMany(x=>x.Details).ToList(); |
| | | //if (!proDeliveryOrderDetails.Any()) |
| | | //{ |
| | | // throw new Exception($"æªæ¾å°éåºåºçæç»ä¿¡æ¯"); |
| | | //} |
| | | //_unitOfWorkManage.BeginTran(); |
| | | //List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | //List<Dt_ProStockInfo>? stockInfos = null; |
| | | //List<Dt_ProDeliveryOrder>? Orders = null; |
| | | //List<Dt_ProDeliveryOrderDetail>? OrderDetails = null; |
| | | //List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | //List<Dt_LocationInfo>? locationInfos = null; |
| | | //{ |
| | | // //åé
åºå |
| | | // (List<Dt_ProStockInfo>, List<Dt_ProDeliveryOrder>, List<Dt_ProDeliveryOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.ProDeliveryOrderService.AssignProStockOutbound(deliveryOrders, proDeliveryOrderDetails); |
| | | // if (result.Item1 != null && result.Item1.Count > 0) |
| | | // { |
| | | // //åå»ºä»»å¡ |
| | | // tasks = GetTasks(result.Item1, result.Item3); |
| | | // result.Item3.ForEach(x => |
| | | // { |
| | | // x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | | // }); |
| | | // stockInfos = result.Item1; |
| | | // Orders = result.Item2; |
| | | // outStockLockInfos = result.Item3; |
| | | // locationInfos = result.Item4; |
| | | // } |
| | | //} |
| | | //if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0 && tasks.Count > 0) |
| | | //{ |
| | | // BaseDal.AddData(tasks); |
| | | // stockInfos.ForEach(x => |
| | | // { |
| | | // x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | // }); |
| | | // WebResponseContent contentResponse = _outboundService.OutMESOrderService.LockOutboundStockDataUpdate(stockInfos, Orders, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | // if (!contentResponse.Status) |
| | | // { |
| | | // _unitOfWorkManage.RollbackTran(); |
| | | // return content.Error(contentResponse.Message); |
| | | // } |
| | | //} |
| | | //_unitOfWorkManage.CommitTran(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | List<string> GradeCodes = new List<string> |
| | | { |
| | | "001" |