|
|
@ -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
|
|
|
|