diff --git a/SlnMesnac.Repository/service/Impl/T_RP_ProductChangeInfoServiceImpl.cs b/SlnMesnac.Repository/service/Impl/T_RP_ProductChangeInfoServiceImpl.cs index 9737fc1..171c1e0 100644 --- a/SlnMesnac.Repository/service/Impl/T_RP_ProductChangeInfoServiceImpl.cs +++ b/SlnMesnac.Repository/service/Impl/T_RP_ProductChangeInfoServiceImpl.cs @@ -13,9 +13,17 @@ namespace SlnMesnac.Repository.service.Impl } public T_RP_ProductChangeInfo GetProductType() { - T_RP_ProductChangeInfo t_RP_Product = null; - t_RP_Product = _rep.GetFirst(x => x.id == 1); - return t_RP_Product; + try + { + T_RP_ProductChangeInfo t_RP_Product = null; + t_RP_Product = _rep.GetFirst(x => x.id == 1); + return t_RP_Product; + } + catch (Exception ex) + { + return null; + } + } } } \ No newline at end of file diff --git a/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs b/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs index 763ff5f..c3c60c0 100644 --- a/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/IndexPage/IndexContentViewModel.cs @@ -977,7 +977,13 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage string MBarcoe = _stationQualityInfoService.GetNewMainBarcode(); //_logger.LogInformation(MBarcoe); //查询型号 - string productID = _ProductChangeInfoService.GetProductType().productid.ToString(); + T_RP_ProductChangeInfo t_RP_ProductChangeInfo = _ProductChangeInfoService.GetProductType(); + string productID = ""; + if (t_RP_ProductChangeInfo != null) + { + productID = t_RP_ProductChangeInfo.productid.ToString(); + } + //插入关系表 if (StationCode == "80_3") { diff --git a/SlnMesnac.WPF/appsettings.json b/SlnMesnac.WPF/appsettings.json index 6a2ecda..e904a44 100644 --- a/SlnMesnac.WPF/appsettings.json +++ b/SlnMesnac.WPF/appsettings.json @@ -81,6 +81,6 @@ "ChangeTypeConfig": { "ProductType": "E34F", "KTProductType": "E34F", - "OpenFlag": "1" + "OpenFlag": "0" } }