From 9f2ab594ee7c937bef2176494b0c240acddae956 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Tue, 6 Jun 2023 11:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E5=8D=95=E4=B8=80=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=97=B6=EF=BC=8C=E6=98=AF=E5=90=A6=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E8=BF=9B=E5=8F=A3=E4=B8=9A=E5=8A=A1=E5=B9=B6=E5=86=99=E5=85=A5?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E4=B8=BA=E9=80=9A=E8=BF=87=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=BF=9B=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DAL/MsSysParamSet/MsSysParamSetDAL.cs | 1 + .../SoftMng/Controllers/ExportController.cs | 42 ++++++++++++++++--- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/DSWeb/Areas/MvcShipping/DAL/MsSysParamSet/MsSysParamSetDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsSysParamSet/MsSysParamSetDAL.cs index 4d92d31a..fa728d88 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsSysParamSet/MsSysParamSetDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsSysParamSet/MsSysParamSetDAL.cs @@ -91,6 +91,7 @@ namespace DSWeb.MvcShipping.DAL.MsSysParamSet static public string GetSysParamValue(string PARAMNAME) { var param = GetData("PARAMNAME = '" + PARAMNAME + "'"); + if (param == null) return ""; return param.PARAMVALUE; } diff --git a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs index 634ab00f..daab3ee3 100644 --- a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs +++ b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs @@ -3282,16 +3282,48 @@ string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" } MBLNO = opapplyhead.MBLNO; var updateseai = false; - var opseaiheadList = MsOpSeaiDAL.GetDataAll(" ((isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "' ) or (isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "') )"); + + //20230606 根据系统配置值 + var updopseaiType = MsSysParamSetDAL.GetSysParamValue("ApplySaveToOpseai"); + //0不保存 1提单号 2报关单号 3提单号或报关单号 + + var opseaiheadList = new List(); + //MsOpSeaiDAL.GetDataAll(" ((isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "' ) or (isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "') )"); //if (!string.IsNullOrEmpty(opseaihead.CUSTNO) && !opseaihead.BSSTATUS) updateseai = true; var opseaihead = new MsOpSeai(); - if (opseaiheadList == null || opseaiheadList.Count==0 ||(opseaiheadList != null && opseaiheadList.Count > 1)) + + if (updopseaiType != "0") { - updateseai = false; + var condition = "1=2"; + + if (updopseaiType == "1") { + condition = " ((isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "' ) "; + } + + if (updopseaiType == "2") + { + condition = " ((isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + MBLNO + "' ) "; + } + + if (updopseaiType == "3") + { + condition = " ((isnull(MBLNO,'')<>'' and MBLNO='" + MBLNO + "' ) or (isnull(CUSTOMNO,'')<>'' and CUSTOMNO='" + CUSTOMNO + "') )"; + } + + opseaiheadList = MsOpSeaiDAL.GetDataAll(condition); + + if (opseaiheadList == null || opseaiheadList.Count == 0 || (opseaiheadList != null && opseaiheadList.Count > 1)) + { + updateseai = false; + } + else + { + opseaihead = opseaiheadList[0]; + updateseai = true; + } } else { - opseaihead = opseaiheadList[0]; - updateseai = true; + updateseai = false; }