From 5bff1b629723e86b444d182d91daca826317ef4b Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 19 Dec 2022 16:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=B8=AA=E5=A3=B9?= =?UTF-8?q?=E6=B2=93=E7=A7=91=E6=8A=80OCR=E6=97=B6ETD=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E5=BC=95=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B=E8=A7=A3?= =?UTF-8?q?=E5=86=B3MsCodeOpStatusDetail=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs | 64 ++++++++++--------- .../DAL/MsCodeOpStatus/MsCodeOpStatusDAL.cs | 2 +- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs index 50ce1b7b..b79654c1 100644 --- a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs @@ -519,7 +519,7 @@ namespace DSWeb.Areas.CommMng.DAL /// /// /// - public DateTime ETD { get; set; } + public DateTime? ETD { get; set; } /// /// 海运托书 /// @@ -620,15 +620,18 @@ namespace DSWeb.Areas.CommMng.DAL { //将识别数据与现有数据合并 //如识别数据有内容 则用其代替现有字段内容 - var _result = data.commitResult; - - if (!string.IsNullOrWhiteSpace(_result.发货人)) + if (data != null && data.commitResult != null) { - //headdata. - } - //发货人 SHIPPER - PropNameList = new Dictionary + var _result = data.commitResult; + + if (!string.IsNullOrWhiteSpace(_result.发货人)) + { + //headdata. + } + + //发货人 SHIPPER + PropNameList = new Dictionary { @@ -671,42 +674,43 @@ namespace DSWeb.Areas.CommMng.DAL { "HSCODE", "HSCODE" } }; - foreach (var item in PropNameList) - { - //var value = _result.GetType().GetProperty("发货人").GetValue(_result, null); + foreach (var item in PropNameList) + { + //var value = _result.GetType().GetProperty("发货人").GetValue(_result, null); - //headdata.SetPropertyValue("") - var value = _result.GetType().GetProperty(item.Key).GetValue(_result, null); + //headdata.SetPropertyValue("") + var value = _result.GetType().GetProperty(item.Key).GetValue(_result, null); - if (value != null && !string.IsNullOrWhiteSpace(value.ToString())) - { - headdata.SetPropertyValue(item.Value, value.ToString()); + if (value != null && !string.IsNullOrWhiteSpace(value.ToString())) + { + headdata.SetPropertyValue(item.Value, value.ToString()); + } } - } - //不规则的数据 + //不规则的数据 - var cdc = new CommonDataContext(); + var cdc = new CommonDataContext(); - headdata.CNTRTOTAL = _result.GetCntrtotal(); + headdata.CNTRTOTAL = _result.GetCntrtotal(); - var _customername = headdata.CUSTOMERNAME; + var _customername = headdata.CUSTOMERNAME; - //如果CUSTOMERNAME在info_client.SHORTNAME当中不存在 则尝试用info_client.FULLNAME对应后修改之 + //如果CUSTOMERNAME在info_client.SHORTNAME当中不存在 则尝试用info_client.FULLNAME对应后修改之 - var _infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == _customername); - - if (_infoclient == null || string.IsNullOrWhiteSpace(_infoclient.SHORTNAME)) - { - var _tempinfoclient = cdc.info_client.FirstOrDefault(x => x.EnFullName == _customername || x.DESCRIPTION == _customername); + var _infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == _customername); - if (_tempinfoclient == null || string.IsNullOrWhiteSpace(_tempinfoclient.SHORTNAME)) + if (_infoclient == null || string.IsNullOrWhiteSpace(_infoclient.SHORTNAME)) { - headdata.CUSTOMERNAME = _tempinfoclient.SHORTNAME; + var _tempinfoclient = cdc.info_client.FirstOrDefault(x => x.EnFullName == _customername || x.DESCRIPTION == _customername); + + if (_tempinfoclient == null || string.IsNullOrWhiteSpace(_tempinfoclient.SHORTNAME)) + { + headdata.CUSTOMERNAME = _tempinfoclient.SHORTNAME; + } } + } } - private Dictionary PropNameList { get; set; } = new Dictionary(); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeOpStatus/MsCodeOpStatusDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeOpStatus/MsCodeOpStatusDAL.cs index acb67c1f..0dfd6553 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeOpStatus/MsCodeOpStatusDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeOpStatus/MsCodeOpStatusDAL.cs @@ -83,7 +83,7 @@ namespace DSWeb.MvcShipping.DAL.MsCodeOpStatusDAL strSql.Append("SELECT "); strSql.Append("GID,SerialNo,OPTYPE,OPSTATUS,STTYPE,CORPID,REMARKS,COLOR"); strSql.Append(" from code_op_status_detail "); - if (strCondition.Trim() != String.Empty) + if (!string.IsNullOrWhiteSpace(strCondition)) { strSql.Append(" where " + strCondition); }