Browse Source

..

Branch_PaiNaWeiS
xusc 3 days ago
parent
commit
88aa4689da
  1. 17
      src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs

17
src/aspnet-core/ICS.Application/Business/Service/计划管理/IcsMo/IcsMoAppService.cs

@ -510,12 +510,21 @@ namespace ICS.Application.Business.Service
#region //验证工艺路线 #region //验证工艺路线
if (item.MoRoute.IsNullOrEmpty()) 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); // AddMoRoute(item);
} }
//else //else

Loading…
Cancel
Save