| | |
| | | taskType = outStockLockInfo.MachineName.ObjToInt() switch |
| | | { |
| | | (int)StationAreaEnum.äºæ¥¼çº¸è¢ => TaskTypeEnum.PaperYLOutZDGL, |
| | | (int)StationAreaEnum.äºæ¥¼æ 纺å¸è¢ => TaskTypeEnum.OutWFBGL, |
| | | (int)StationAreaEnum.䏿¥¼æ 纺æ·è => TaskTypeEnum.OutWFBLM, |
| | | (int)StationAreaEnum.䏿¥¼å°å· => TaskTypeEnum.PrintYLOutbound, |
| | | (int)StationAreaEnum.䏿¥¼åå => TaskTypeEnum.OutFenQie, |
| | | (int)StationAreaEnum.䏿¥¼çº¸å¼ æ·è => TaskTypeEnum.OutPaperLM, |
| | | _ => throw new Exception($"æªæ¾å°å å·¥ä¸å¿ä»»å¡ç±»ååé
") |
| | | }; |
| | | Dt_Task task = new() |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æä½æ°æ®ï¼å¹¶åé
éæ±åºå |
| | | _outboundRepository.OutMESOrderRepository.AddData(AddoutMESOrders); |
| | | //List<Dt_OutMESOrder> mESOrders = _outboundRepository.OutMESOrderRepository.QueryData(x => AddoutMESOrders.Select(x => x.OutDetailId).Contains(x.OutDetailId)); |
| | | //{ |
| | | // List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | // List<Dt_ProStockInfo>? stockInfos = null; |
| | | // List<Dt_OutMESOrder>? Orders = null; |
| | | // List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | // List<Dt_LocationInfo>? locationInfos = null; |
| | | // { |
| | | // if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList().Count>0) |
| | | // { |
| | | // //åé
åºå |
| | | // (List<Dt_ProStockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignProStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList()); |
| | | // 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); |
| | | List<Dt_OutMESOrder> mESOrders = _outboundRepository.OutMESOrderRepository.QueryData(x => AddoutMESOrders.Select(x => x.OutDetailId).Contains(x.OutDetailId)); |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_ProStockInfo>? stockInfos = null; |
| | | List<Dt_OutMESOrder>? Orders = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | { |
| | | if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList().Count > 0) |
| | | { |
| | | //åé
åºå |
| | | (List<Dt_ProStockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignProStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()).ToList()); |
| | | 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); |
| | | // } |
| | | // } |
| | | //} |
| | | //{ |
| | | // List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | // List<Dt_StockInfo>? stockInfos = null; |
| | | // List<Dt_OutMESOrder>? Orders = null; |
| | | // List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | // List<Dt_LocationInfo>? locationInfos = null; |
| | | // { |
| | | // if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList().Count > 0) |
| | | // { |
| | | // //åé
åºå |
| | | // (List<Dt_StockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList()); |
| | | // 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); |
| | | // } |
| | | // } |
| | | //} |
| | | if (!contentResponse.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(contentResponse.Message); |
| | | } |
| | | } |
| | | } |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_StockInfo>? stockInfos = null; |
| | | List<Dt_OutMESOrder>? Orders = null; |
| | | List<Dt_OutStockLockInfo>? outStockLockInfos = null; |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | { |
| | | if (mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList().Count > 0) |
| | | { |
| | | //åé
åºå |
| | | (List<Dt_StockInfo>, List<Dt_OutMESOrder>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutMESOrderService.AssignStockOutbound(mESOrders.Where(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()).ToList()); |
| | | 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(); |
| | | return content.OK(ErrorMsg.IsNullOrEmpty()? "æ¥æ¶æå" : $"ä¿¡æ¯ï¼{ErrorMsg}"); |
| | | } |