From ab046e10303c631bcabb99e155cda3320983491e Mon Sep 17 00:00:00 2001 From: ddlucky Date: Thu, 9 Feb 2023 15:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E8=B4=B8=E7=A9=BA=E8=BF=90=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E5=88=86=E5=8D=95?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=B8=BB=E5=8D=95=E6=97=B6=E7=9A=84=E7=87=83?= =?UTF-8?q?=E6=B2=B9=E8=B4=B9=E7=94=9F=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MsOpAirnController.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpAirnController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpAirnController.cs index 6373e792..8d29ed41 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpAirnController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpAirnController.cs @@ -299,7 +299,7 @@ namespace DSWeb.MvcShipping.Controllers //增加一个判断 如无揽货人sale则报警不保存 - BasicDataRefDAL.SaveLog("opstatus="+ opstatus+":"+JsonConvert.Serialize(headData)+"//"+ JsonConvert.Serialize(CargobodyList), Convert.ToString(Session["USERID"]),"内贸空运","主单保存"); + BasicDataRefDAL.SaveLog("opstatus="+ opstatus+":"+JsonConvert.Serialize(headData)+"//"+ JsonConvert.Serialize(CargobodyList), Convert.ToString(Session["SHOWNAME"]),"内贸空运","主单保存"); var modb = new ModelObjectRepository(); DBResult result = modb.Save(headData, @@ -333,6 +333,7 @@ namespace DSWeb.MvcShipping.Controllers weight += Convert.ToDouble(item.WEIGHT); } double fuelFee = 0; + var updstr = ""; switch (headData.AIRLINES) { case "山东航空": @@ -341,7 +342,8 @@ namespace DSWeb.MvcShipping.Controllers int shFuelFee = (int)(Math.Round(fuelFee, 0)); if (shFuelFee < 10) shFuelFee = 10; - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" +shFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + shFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; + break; case "青岛航空": fuelFee = 0.2 * weight; @@ -349,13 +351,13 @@ namespace DSWeb.MvcShipping.Controllers int qhFuelFee = (int)(Math.Round(fuelFee, 0)); if (qhFuelFee < 10) qhFuelFee = 10; - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + qhFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + qhFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; case "南方航空": fuelFee = 0.2 * weight; //燃油费向上取整 int nfFuelFee = (int)(Math.Ceiling(fuelFee)); - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + nfFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + nfFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; case "吉祥航空": @@ -368,7 +370,7 @@ namespace DSWeb.MvcShipping.Controllers { fuelFee = Math.Round(fuelFee, 2); } - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; case "深圳航空": fuelFee = 0.2 * weight; @@ -380,7 +382,7 @@ namespace DSWeb.MvcShipping.Controllers { fuelFee = Math.Round(fuelFee, 2); } - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; case "春秋航空": //燃油费四舍五入取整 @@ -389,7 +391,7 @@ namespace DSWeb.MvcShipping.Controllers { fuelFee = 1; } - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; case "厦门航空": //燃油费四舍五入 改为取整 @@ -398,17 +400,21 @@ namespace DSWeb.MvcShipping.Controllers { fuelFee = 1; } - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + fuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; default: fuelFee = 0.2 * weight; //燃油费四舍五入取整,前端用的tofixed() int otherFuelFee = (int)(Math.Round(fuelFee, 0)); - MsOpAirnDAL.ExecSql(" update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + otherFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "); + updstr = " update Op_Airn set OTFEE1='燃油费',OTFEE1AMOUNT='" + otherFuelFee + "' where BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' and isnull(ISVOID,0)=0 "; break; } + if (updstr!="") { + BasicDataRefDAL.SaveLog(updstr, Convert.ToString(Session["SHOWNAME"]), "内贸空运", "主单费用"); + MsOpAirnDAL.ExecSql(updstr); + } //20220914 然后更新杂费和合计数 var 主单 = MsOpAirnDAL.GetData(" BLTYPE='国内主单' and HBLNO='" + headData.HBLNO + "' ");