diff --git a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs index 5d0a7d25..015a2796 100644 --- a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs +++ b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs @@ -3056,8 +3056,18 @@ string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" opapplyhead.VESSEL = preDecHeadVo.trafName; opapplyhead.VOYNO = preDecHeadVo.cusVoyageNo; opapplyhead.PORTDISCHARGE = preDecHeadVo.distinatePortName; - if (string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) - opapplyhead.ENTERP = preDecHeadVo.consigneeCname; + if (preDecHeadVo.cusTradeCountry == "CHN") + { + if (string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) + opapplyhead.ENTERP = DecHead_Local.TradeName; + } + else + { + if (string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) + opapplyhead.ENTERP = preDecHeadVo.consigneeCname; + } + + if (string.IsNullOrEmpty(opapplyhead.MBLNO.Trim())) opapplyhead.MBLNO = preDecHeadVo.billNo; if (string.IsNullOrEmpty(opapplyhead.CUSTOMNO.Trim())) @@ -3280,6 +3290,8 @@ string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" var port_decMergeListVoList = preDecHeadVo.getdecMergeListVo(); var goodstr = ""; decimal goodsvalue = 0; + var GoodsList = new List(); + int goodnum = 0; if (port_decMergeListVoList.Count > 0) foreach (var port_decMergeListVo in port_decMergeListVoList) { @@ -3318,6 +3330,20 @@ string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" goodstr = goodstr + port_decMergeListVo.codeTs + " " + port_decMergeListVo.gModel + " " + port_decMergeListVo.gName + " " + port_decMergeListVo.hsCodeDesc; } + goodnum = goodnum + 1; + var opapplygood = new MsOpApplyDetail(); + opapplygood.BsNo = "*"; + opapplygood.SerialNo = goodnum; + opapplygood.GoodsName= port_decMergeListVo.gName; + if (!string.IsNullOrWhiteSpace(port_decMergeListVo.declPrice)) + opapplygood.Price= Convert.ToDecimal(port_decMergeListVo.declPrice); + if (!string.IsNullOrWhiteSpace(port_decMergeListVo.declTotal)) + opapplygood.Total = Convert.ToDecimal(port_decMergeListVo.declTotal); + opapplygood.GOODSMODEL = port_decMergeListVo.gModel; + if (!string.IsNullOrWhiteSpace(port_decMergeListVo.gQty)) + opapplygood.Pkgs =Convert.ToDecimal(port_decMergeListVo.gQty); + opapplygood.Currency = port_decMergeListVo.tradeCurr; + GoodsList.Add(opapplygood); opapplyhead.ARCOUNTRY = port_decMergeListVo.cusOriginCountryName; } @@ -3334,7 +3360,7 @@ string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" var modb3 = new ModelObjectDB(); modb3.Save(opapplyhead); - + MsOpApplyDAL.SaveDetail(opapplyhead, GoodsList, Convert.ToString(Session["USERID"])); var Declist = lbll.GetModelList(0, 99, "PID='" + DecHead_Local.GID + "'", String.Format("{0}", "gNo", "")); var count = lbll.GetRecordCount("PID='" + DecHead_Local.GID + "'");