From 859d097977e3cadb50bf35e47e6c692e670bc062 Mon Sep 17 00:00:00 2001 From: CaesarBao <445720029@qq.com> Date: Fri, 27 Dec 2024 11:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=A5=A5=E7=89=B9=E4=BD=B3?= =?UTF-8?q?=E7=89=A9=E6=96=99=E7=BB=91=E5=AE=9A=E5=B7=A5=E4=BD=8D=E6=BA=90?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/T_RP_ProductChangeInfoServiceImpl.cs | 14 +++++++++++--- .../ViewModel/IndexPage/IndexContentViewModel.cs | 8 +++++++- SlnMesnac.WPF/appsettings.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) 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" } }