From 88aa4689da74c24e1ab1867780a6ec6c0bc85a86 Mon Sep 17 00:00:00 2001 From: xusc Date: Fri, 22 Nov 2024 09:23:26 +0800 Subject: [PATCH] .. --- .../计划管理/IcsMo/IcsMoAppService.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs b/src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs index e371d04f..faa2eeac 100644 --- a/src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs +++ b/src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs @@ -510,12 +510,21 @@ namespace ICS.Application.Business.Service #region //验证工艺路线 if (item.MoRoute.IsNullOrEmpty()) { - var itemRoute = _itemRouteRepository.GetAll().AsNoTracking().FirstOrDefault(x => x.ItemCode == item.ItemCode && x.IsRef == YesORNoEnum.Y.ToString()); - if (itemRoute == null) + //var itemRoute = _itemRouteRepository.GetAll().AsNoTracking().FirstOrDefault(x => x.ItemCode == item.ItemCode && x.IsRef == YesORNoEnum.Y.ToString()); + //if (itemRoute == null) + //{ + // throw new UserFriendlyException(L("NoExistsCurrentCode", "产品途程,当前产品代码" + item.ItemCode)); + //} + + var route = _routeRepository.GetAll().AsNoTracking().FirstOrDefault(); + if (route == null) { + item.MoRoute = "9999"; + } + else { - throw new UserFriendlyException(L("NoExistsCurrentCode", "产品途程,当前产品代码" + item.ItemCode)); + item.MoRoute = route.RouteCode; } - item.MoRoute = itemRoute.RouteCode; + // AddMoRoute(item); } //else