diff --git a/DSWeb/Areas/Account/Controllers/Chfee_AuditController.cs b/DSWeb/Areas/Account/Controllers/Chfee_AuditController.cs index 0e7dc095..1d749d9e 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_AuditController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_AuditController.cs @@ -1263,7 +1263,7 @@ namespace DSWeb.Areas.Account.Controllers } var cust = MsInfoClientDAL.GetData("SHORTNAME='" + customername + "'"); - + List pslist = new List(); var crfeesum = new List(); var drfeesum = new List(); var feeCurrlist = MsChFeeDAL.GetFeeDateCurrList(optype, bsno, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"])); @@ -1276,10 +1276,12 @@ namespace DSWeb.Areas.Account.Controllers foreach (var crfee in CrChfeeList) { line = line + 1; - - if (feeCurrlist.Find(x => x.CURR == crfee.Currency && crfee.ExChangerate != x.CRDEFRATE) != null) + if (crfee.BsNo == bsno) { - error = error + "
应付汇率与设置汇率不一致"; + if (feeCurrlist.Find(x => x.CURR == crfee.Currency && crfee.ExChangerate != x.CRDEFRATE) != null) + { + error = error + "
应付汇率与设置汇率不一致"; + } } if (crfee.FeeName == "P/S" || crfee.FeeName == "HP/S") { @@ -1302,6 +1304,7 @@ namespace DSWeb.Areas.Account.Controllers { isps = true; pscust = crfee.CustomerName; + pslist.Add(pscust); } } @@ -1350,9 +1353,12 @@ namespace DSWeb.Areas.Account.Controllers foreach (var crfee in DrChfeeList) { - if (feeCurrlist.Find(x => x.CURR == crfee.Currency && crfee.ExChangerate != x.CRDEFRATE) != null) + if (crfee.BsNo == bsno) { - error = error + "
应收汇率与设置汇率不一致"; + if (feeCurrlist.Find(x => x.CURR == crfee.Currency && crfee.ExChangerate != x.CRDEFRATE) != null) + { + error = error + "
应收汇率与设置汇率不一致"; + } } var feesum = drfeesum.Find(x => x.FeeName == crfee.FeeName); if (feesum == null) @@ -1377,22 +1383,29 @@ namespace DSWeb.Areas.Account.Controllers } decimal psbl = 0; - if (!string.IsNullOrEmpty(pscust)) + if (pslist!=null&& pslist.Count!=0) { - //var clientpslist = MsInfoClientDAL.GetPSDataList("CUSTNAME='" + pscust + "'"); - //if (clientpslist.Count == 1) { psbl = clientpslist[0].PS; } - //else - //{ - // foreach (var clientps in clientpslist) - // { - // if (!string.IsNullOrEmpty(clientps.SALEDEPT) && clientps.SALEDEPT == saledept) - // { - // psbl = clientps.PS; - // break; - // } - // } - // if (clientpslist.Count > 1 && psbl == 0) psbl = clientpslist[0].PS; - //} + + foreach (var ps in pslist) { + decimal tmppsbl = 0; + var clientpslist = MsInfoClientDAL.GetPSDataList("CUSTNAME='" + ps + "'"); + if (clientpslist.Count == 1) { tmppsbl = clientpslist[0].PS; } + else + { + foreach (var clientps in clientpslist) + { + if (!string.IsNullOrEmpty(clientps.SALEDEPT) && clientps.SALEDEPT == saledept) + { + tmppsbl = clientps.PS; + break; + } + } + if (clientpslist.Count > 1 && tmppsbl == 0) tmppsbl = clientpslist[0].PS; + } + if (tmppsbl > psbl) psbl = tmppsbl; + + } + } var feettlsum = MsChFeeDAL.GetttlGainList("BSNO='" + pbsno + "'"); diff --git a/DSWeb/Areas/Account/Controllers/Chfee_invoiceapplicationController.cs b/DSWeb/Areas/Account/Controllers/Chfee_invoiceapplicationController.cs index 7f76e84e..b5415f10 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_invoiceapplicationController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_invoiceapplicationController.cs @@ -1004,7 +1004,7 @@ namespace DSWeb.Areas.Account.Controllers } DBResult result = ChinvoiceapplicationDAL.DelFeeDo(feelist, headdata.GID); if (result.Success) { - result = ChinvoiceapplicationDAL.DelpartFeeDo(feelist, headdata.GID); + result = ChinvoiceapplicationDAL.DelpartFeeDo(feepartlist, headdata.GID); var bodyList = ChinvoiceapplicationDAL.GetApplicationDetailList("LINKGID='"+ headdata.GID + "'"); var detaillist = new List(); foreach (var body in bodyList) @@ -1015,7 +1015,7 @@ namespace DSWeb.Areas.Account.Controllers } result = ChinvoiceapplicationDAL.DelInvAppDetail(detaillist); } - + if (result.Success) { ChinvoiceapplicationDAL.p_update_Amount(headdata.BILLNO, headdata.GID); } var json = JsonConvert.Serialize(result); return new ContentResult() { Content = json }; } diff --git a/DSWeb/Areas/Account/DAL/Chfee_Audit/Chfee_AuditDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_Audit/Chfee_AuditDAL.cs index f65a102c..328c1be3 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_Audit/Chfee_AuditDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_Audit/Chfee_AuditDAL.cs @@ -306,16 +306,19 @@ namespace DSWeb.MvcShipping.DAL.Chfee_AuditDAL { var strSql = new StringBuilder(); - var rangstr = GetListRangDAStr("index", userid, username, companyid); - if (!string.IsNullOrEmpty(rangstr)) + if (!all) { - if (!string.IsNullOrEmpty(strCondition)) - { - strCondition = strCondition + " and " + rangstr; - } - else + var rangstr = GetListRangDAStr("index", userid, username, companyid); + if (!string.IsNullOrEmpty(rangstr)) { - strCondition = rangstr; + if (!string.IsNullOrEmpty(strCondition)) + { + strCondition = strCondition + " and " + rangstr; + } + else + { + strCondition = rangstr; + } } } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index ffbb276f..d36a3ea0 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -840,7 +840,13 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult GetMblIsRepeat(string bsno, string mblno) { - var ct = MsOpSeaeDAL.GetRdCount("MASTERNO<>'" + bsno + "' AND MBLNO='" + mblno + "' and CORPID='" + Convert.ToString(Session["COMPANYID"]) + "'"); + var dept = Convert.ToString(Session["DEPTNAME"]).ToString().Trim(); + + if (dept == "市场部") { + var json = JsonConvert.Serialize(new { Success = false, Message = "查询成功" }); + return new ContentResult() { Content = json }; + } + var ct = MsOpSeaeDAL.GetRdCount("MASTERNO<>'" + bsno + "' AND MBLNO='" + mblno + "' and CORPID='" + Convert.ToString(Session["COMPANYID"]) + "' and SALEDEPT='"+ dept + "'"); if (ct != 0) { var json = JsonConvert.Serialize(new { Success = true, Message = "提单号重复!" }); @@ -3690,7 +3696,7 @@ namespace DSWeb.MvcShipping.Controllers { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); @@ -3700,25 +3706,25 @@ namespace DSWeb.MvcShipping.Controllers Directory.CreateDirectory(path); } - var headEdiList = new List(); + //var headEdiList = new List(); - foreach (var bill in headList) - { - headEdiList.Add(bill); - if (bill.BLTYPE == "拼箱主票") - { - var billfenlist = MsOpSeaeDAL.GetFenList(" MASTERNO<>BSNO AND MASTERNO='" + bill.BSNO + "'", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); - if (billfenlist.Count > 0) - { - foreach (var billfen in billfenlist) - { - headEdiList.Add(billfen); - } + //foreach (var bill in headList) + //{ + // headEdiList.Add(bill); + // if (bill.BLTYPE == "拼箱主票") + // { + // var billfenlist = MsOpSeaeDAL.GetFenList(" MASTERNO<>BSNO AND MASTERNO='" + bill.BSNO + "'", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + // if (billfenlist.Count > 0) + // { + // foreach (var billfen in billfenlist) + // { + // headEdiList.Add(billfen); + // } - } - } + // } + // } - } + //} var result = new DBResult(); var error = ""; @@ -3729,8 +3735,9 @@ namespace DSWeb.MvcShipping.Controllers } else - error = MsOpSeaeEdiPortDAL.IsCreateEdi(headEdiList, type, filetype, filerole); + error = MsOpSeaeEdiPortDAL.IsCreateEdi(headList, type, filetype, filerole); var ftpcount = 0; + var totalcount = headList.Count; if (error == "") { var ediname = ""; @@ -3751,7 +3758,7 @@ namespace DSWeb.MvcShipping.Controllers if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) { - foreach (var bill in headEdiList) + foreach (var bill in headList) { mblno = bill.MBLNO; var edilist = new List(); @@ -3774,9 +3781,9 @@ namespace DSWeb.MvcShipping.Controllers else result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset); - ftpcount = ftpcount + 1; + if (result.Success) ftpcount = ftpcount + 1; var afilename = Path.GetFileName(filename); - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, type, filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + MsOpSeaeEdiPortDAL.InsertEdiLog(bill.BSNO, type, filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); if (filetype == "B") @@ -3809,7 +3816,9 @@ namespace DSWeb.MvcShipping.Controllers } if (result.Success) { - result.Message = "已发送成功"+ ftpcount.ToString()+"票!"; + if (totalcount== ftpcount) + result.Message = "共选择"+ totalcount + "票,已发送成功"+ ftpcount.ToString()+"票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票,"+ (totalcount-ftpcount) + "票未发送成功!"; } @@ -4030,13 +4039,14 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult CreateINTTRList(string bsnos, string mblno, string filetype, string filerole, int isbill, string carrier, int IsNADFW, string tbNADFWID, string tbNADFW) { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } var ftpcount = 0; + var totalcount = headList.Count; var result = new DBResult(); if (filetype == "V") @@ -4095,22 +4105,20 @@ namespace DSWeb.MvcShipping.Controllers var afilename = Path.GetFileName(filename); if (result.Success) ftpcount = ftpcount + 1; - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + MsOpSeaeEdiPortDAL.InsertEdiLog(headdata.BSNO, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); - foreach (var bill in ediheadlist) - { if (filetype == "B") { - var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; + var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + headdata.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + headdata.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); } else { - var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; + var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + headdata.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + headdata.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); } - } + } else if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) @@ -4119,22 +4127,19 @@ namespace DSWeb.MvcShipping.Controllers var afilename = Path.GetFileName(filename); if (result.Success) ftpcount = ftpcount + 1; - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + MsOpSeaeEdiPortDAL.InsertEdiLog(headdata.BSNO, "INTTR", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); - foreach (var bill in ediheadlist) - { if (filetype == "B") { - var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; + var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + headdata.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + headdata.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); } else { - var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; + var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + headdata.BSNO + "' AND COVERTITLE='发送SI') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + headdata.BSNO + "','发送SI','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); } - } } else @@ -4169,9 +4174,11 @@ namespace DSWeb.MvcShipping.Controllers } MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); } - if (result.Success&&ftpcount!=0) + if (result.Success) { - result.Message = "已发送成功" + ftpcount.ToString() + "票!"; + if (totalcount == ftpcount) + result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票," + (totalcount - ftpcount) + "票未发送成功!"; } var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; @@ -4282,7 +4289,7 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult CreateHANJINList(string bsnos, string mblno, string filetype, string filerole, int isbill) { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); if (!Directory.Exists(path)) @@ -4290,6 +4297,9 @@ namespace DSWeb.MvcShipping.Controllers Directory.CreateDirectory(path); } + var ftpcount = 0; + var totalcount = headList.Count; + var result = new DBResult(); if (filetype == "V") { @@ -4330,7 +4340,7 @@ namespace DSWeb.MvcShipping.Controllers var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='HANJIN'", Convert.ToString(Session["COMPANYID"])); var filename = ""; - + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) { @@ -4349,9 +4359,11 @@ namespace DSWeb.MvcShipping.Controllers } result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset); - var afilename = Path.GetFileName(filename); + if (result.Success) ftpcount = ftpcount + 1; - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "HANJIN", filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + var afilename = Path.GetFileName(filename); + + MsOpSeaeEdiPortDAL.InsertEdiLog(bill.BSNO, "HANJIN", filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); if (filetype == "B") @@ -4366,7 +4378,7 @@ namespace DSWeb.MvcShipping.Controllers } } - + } else @@ -4382,6 +4394,14 @@ namespace DSWeb.MvcShipping.Controllers } #endregion } + + if (result.Success) + { + if (totalcount == ftpcount) + result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票," + (totalcount - ftpcount) + "票未发送成功!"; + + } var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } @@ -4497,13 +4517,15 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult CreateYTList(string bsnos, string mblno, string filetype, string filerole, int isbill, string carrier) { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } + var ftpcount = 0; + var totalcount = headList.Count; var result = new DBResult(); if (filetype == "V") { @@ -4557,17 +4579,23 @@ namespace DSWeb.MvcShipping.Controllers { var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='"+ type + "' AND CARRIERID='" + carrier + "'", Convert.ToString(Session["COMPANYID"])); var filename = ""; - filename = MsOpSeaeEdiPortDAL.CreateEdi(headList, Convert.ToString(Session["USERID"]), path, mblno, filerole, ftpset, type, isbill, 0, carrier, "", "", filetype); - + if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) { - result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset, true); - var afilename = Path.GetFileName(filename); - - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "YTEDI", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); foreach (var bill in headList) { + var ediheadlist = new List(); + ediheadlist.Add(bill); + filename = MsOpSeaeEdiPortDAL.CreateEdi(ediheadlist, Convert.ToString(Session["USERID"]), path, mblno, filerole, ftpset, type, isbill, 0, carrier, "", "", filetype); + + + result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset, true); + if (result.Success) ftpcount = ftpcount + 1; + var afilename = Path.GetFileName(filename); + + MsOpSeaeEdiPortDAL.InsertEdiLog(bill.BSNO, "YTEDI", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + if (filetype == "B") { var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; @@ -4580,7 +4608,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + } else @@ -4596,6 +4624,13 @@ namespace DSWeb.MvcShipping.Controllers } #endregion } + if (result.Success) + { + if (totalcount == ftpcount) + result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票," + (totalcount - ftpcount) + "票未发送成功!"; + + } var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } @@ -4692,7 +4727,7 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult CreateESLList(string bsnos, string mblno, string filetype, string filerole, int isbill, string carrier) { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); if (!Directory.Exists(path)) { @@ -4700,57 +4735,66 @@ namespace DSWeb.MvcShipping.Controllers } var result = new DBResult(); - //if (filetype == "V") - //{ - // #region VGM - // var error = MsOpSeaeEdiPortDAL.IsCreateVGM(headList, "YTVGM", filetype, filerole, "", "", "", "", ""); - // if (error == "") - // { - // var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='YTVGM'", Convert.ToString(Session["COMPANYID"]));// AND CARRIERID='" + carrier + "' - // var filename = ""; - // filename = MsOpSeaeEdiPortDAL.CreateVGM(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, "YTVGM", isbill, 0, carrier, "", "", filetype, "", "", "", "", ""); - // if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) - // { - // result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset, true); - // var afilename = Path.GetFileName(filename); + var ftpcount = 0; + var totalcount = headList.Count; + //if (filetype == "V") + //{ + // #region VGM + // var error = MsOpSeaeEdiPortDAL.IsCreateVGM(headList, "YTVGM", filetype, filerole, "", "", "", "", ""); + // if (error == "") + // { + // var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='YTVGM'", Convert.ToString(Session["COMPANYID"]));// AND CARRIERID='" + carrier + "' + // var filename = ""; + // filename = MsOpSeaeEdiPortDAL.CreateVGM(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filerole, ftpset, "YTVGM", isbill, 0, carrier, "", "", filetype, "", "", "", "", ""); + // if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) + // { + // result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset, true); + // var afilename = Path.GetFileName(filename); - // MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "YTVGM", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + // MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "YTVGM", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); - // } - // else - // { - // result.Success = false; - // result.Message = "FTP参数没有设置,请先设置FTP参数!"; - // } - // } - // else - // { - // result.Success = false; - // result.Message = error; - // } - // #endregion - //} - //else - //{ - #region 订舱、确认 + // } + // else + // { + // result.Success = false; + // result.Message = "FTP参数没有设置,请先设置FTP参数!"; + // } + // } + // else + // { + // result.Success = false; + // result.Message = error; + // } + // #endregion + //} + //else + //{ + #region 订舱、确认 var error = MsOpSeaeEdiPortDAL.IsCreateEdi(headList, "ESLEDI", filetype, filerole, 0,carrier); if (error == "") { var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='ESLEDI' ", Convert.ToString(Session["COMPANYID"])); - var filename = ""; - filename = MsOpSeaeEdiPortDAL.CreateEdi(headList, Convert.ToString(Session["USERID"]), path, mblno, filerole, ftpset, "ESLEDI", isbill, 0, carrier, "", "", filetype); - if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) { + foreach (var bill in headList) + { + var ediheadlist = new List(); + ediheadlist.Add(bill); + + var filename = ""; + filename = MsOpSeaeEdiPortDAL.CreateEdi(ediheadlist, Convert.ToString(Session["USERID"]), path, mblno, filerole, ftpset, "ESLEDI", isbill, 0, carrier, "", "", filetype); + + + result = MsOpSeaeEdiPortDAL.FtpFile(filename, ftpset, true); + if (result.Success) ftpcount = ftpcount + 1; var afilename = Path.GetFileName(filename); - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "ESLEDI", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + MsOpSeaeEdiPortDAL.InsertEdiLog(bill.BSNO, "ESLEDI", filetype, carrier, ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); - foreach (var bill in headList) - { + if (filetype == "B") { var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; @@ -4763,7 +4807,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + } else @@ -4777,8 +4821,15 @@ namespace DSWeb.MvcShipping.Controllers result.Success = false; result.Message = error; } - #endregion + #endregion //} + if (result.Success) + { + if (totalcount == ftpcount) + result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票," + (totalcount - ftpcount) + "票未发送成功!"; + + } var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } @@ -4863,13 +4914,14 @@ namespace DSWeb.MvcShipping.Controllers public ContentResult CreateHMMList(string bsnos, string mblno, string filetype, string filerole, int isbill,int isyard) { bsnos = bsnos.Replace(",", "','"); - var headList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"])); + var headList = MsOpSeaeDAL.GetDataAllList("BSNO IN ('" + bsnos + "')"); var path = Server.MapPath("../../EDIFiles/SeaeEdi"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } - + var ftpcount = 0; + var totalcount = headList.Count; var result = new DBResult(); if (filetype == "V") { @@ -4910,35 +4962,39 @@ namespace DSWeb.MvcShipping.Controllers if (error == "") { var ftpset = MsCodeFtpSetDAL.GetData("EDINAME='HMMEDI'", Convert.ToString(Session["COMPANYID"])); - var filename = ""; - if (filetype == "E") - { - ftpset = MsCodeFtpSetDAL.GetData("EDINAME='HMMESI'", Convert.ToString(Session["COMPANYID"])); - filename = MsOpSeaeEdiPortDAL.CreateEdiHMMSI(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filetype, filerole, ftpset, "HMMEDI", isbill); - } - else - { - - filename = MsOpSeaeEdiPortDAL.CreateEdiHMM(headList, Convert.ToString(Session["USERCODE"]), path, mblno, filetype, filerole, ftpset, "HMMEDI", isbill); - } if (ftpset.SERVERIP != "" && ftpset.SERVERIP != null) { - if (filetype != "Y") + foreach (var bill in headList) { - result = MsOpSeaeEdiPortDAL.FtpFileTmp(filename, ftpset); + var ediheadlist = new List(); + ediheadlist.Add(bill); + var filename = ""; + + if (filetype == "E") + { + ftpset = MsCodeFtpSetDAL.GetData("EDINAME='HMMESI'", Convert.ToString(Session["COMPANYID"])); + filename = MsOpSeaeEdiPortDAL.CreateEdiHMMSI(ediheadlist, Convert.ToString(Session["USERCODE"]), path, mblno, filetype, filerole, ftpset, "HMMEDI", isbill); + } + else + { + + filename = MsOpSeaeEdiPortDAL.CreateEdiHMM(ediheadlist, Convert.ToString(Session["USERCODE"]), path, mblno, filetype, filerole, ftpset, "HMMEDI", isbill); + } + + if (filetype != "Y") + { + result = MsOpSeaeEdiPortDAL.FtpFileTmp(filename, ftpset); if (isyard==1) if (ftpset.SERVERIP2 != "" && ftpset.USERNAME2 != "" && ftpset.PASSWORD2 != "") MsOpSeaeEdiPortDAL.FtpFile2(filename, ftpset); - } - else if (ftpset.SERVERIP2 != "" && ftpset.USERNAME2 != "" && ftpset.PASSWORD2 != "") result = MsOpSeaeEdiPortDAL.FtpFile2(filename, ftpset); + } + else if (ftpset.SERVERIP2 != "" && ftpset.USERNAME2 != "" && ftpset.PASSWORD2 != "") result = MsOpSeaeEdiPortDAL.FtpFile2(filename, ftpset); + if (result.Success) ftpcount = ftpcount + 1; - + var afilename = Path.GetFileName(filename); - var afilename = Path.GetFileName(filename); + MsOpSeaeEdiPortDAL.InsertEdiLog(bill.BSNO, "HMMEDI", filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); - MsOpSeaeEdiPortDAL.InsertEdiLog(bsnos, "HMMEDI", filetype, "", ftpset.SERVERIP, afilename, "../../EDIFiles/SeaeEdi/" + afilename, Convert.ToString(Session["SHOWNAME"])); - T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); - foreach (var bill in headList) - { if (filetype == "B") { var blUpSQL = " if (select CID from Op_SeaCover where bsno='" + bill.BSNO + "' AND COVERTITLE='发送SO') is null insert into Op_SeaCover(CID,BSNO,COVERTITLE,COVERCONTEXT,OPERATOR,OPTIME,ISSYS) values(NEWID(),'" + bill.BSNO + "','发送SO','','" + Session["SHOWNAME"] + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','1')"; @@ -4967,6 +5023,14 @@ namespace DSWeb.MvcShipping.Controllers } #endregion } + if (result.Success) + { + if (totalcount == ftpcount) + result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票!"; + else result.Message = "共选择" + totalcount + "票,已发送成功" + ftpcount.ToString() + "票," + (totalcount - ftpcount) + "票未发送成功!"; + + } + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCwAccitemsDaterp/MsCwAccitemsDaterpDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCwAccitemsDaterp/MsCwAccitemsDaterpDAL.cs index ffbbcddc..0b245b44 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCwAccitemsDaterp/MsCwAccitemsDaterpDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCwAccitemsDaterp/MsCwAccitemsDaterpDAL.cs @@ -137,7 +137,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwAccitemsDaterp static public List GetBodyList(string strCondition, string sort = null) { var strSql = new StringBuilder(); - strSql.Append("select GID,LINKGID,ACCNAME,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR"); + strSql.Append("select GID,LINKGID,ACCNAME,ACCPROP,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR"); strSql.Append(" from cw_accitems_daterp_detail "); if (!string.IsNullOrEmpty(strCondition)) { @@ -160,7 +160,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwAccitemsDaterp static public List GetBodyAllList(string strCondition, string sort = null) { var strSql = new StringBuilder(); - strSql.Append("select GID,LINKGID,ACCNAME,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR"); + strSql.Append("select GID,LINKGID,ACCNAME,ACCPROP,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR"); strSql.Append(" from cw_accitems_daterp_detail "); if (!string.IsNullOrEmpty(strCondition)) { @@ -192,6 +192,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwAccitemsDaterp data.GID = Convert.ToString(reader["GID"]); data.LINKGID = Convert.ToString(reader["LINKGID"]); data.ACCNAME = Convert.ToString(reader["ACCNAME"]); + data.ACCPROP = Convert.ToString(reader["ACCPROP"]); if (reader["AMTDR"] != DBNull.Value) data.AMTDR = Convert.ToDecimal(reader["AMTDR"]); if (reader["AMTCR"] != DBNull.Value) @@ -236,8 +237,8 @@ namespace DSWeb.MvcShipping.DAL.MsCwAccitemsDaterp var cmdInsert = db.GetSqlStringCommand( - @"insert into cw_accitems_daterp_detail (GID,LINKGID,ACCNAME,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR) - values (@GID,@LINKGID,@ACCNAME,@AMTDR,@AMTCR,@USDAMTDR,@USDAMTCR,@HKDAMTDR,@HKDAMTCR) "); + @"insert into cw_accitems_daterp_detail (GID,LINKGID,ACCNAME,AMTDR,AMTCR,USDAMTDR,USDAMTCR,HKDAMTDR,HKDAMTCR,ACCPROP) + values (@GID,@LINKGID,@ACCNAME,@AMTDR,@AMTCR,@USDAMTDR,@USDAMTCR,@HKDAMTDR,@HKDAMTCR,@ACCPROP) "); if (bodyList != null) { @@ -248,6 +249,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwAccitemsDaterp db.AddInParameter(cmdInsert, "@GID", DbType.String, Guid.NewGuid().ToString()); db.AddInParameter(cmdInsert, "@LINKGID", DbType.String,headData.GID); db.AddInParameter(cmdInsert, "@ACCNAME", DbType.String, enumValue.ACCNAME); + db.AddInParameter(cmdInsert, "@ACCPROP", DbType.String, enumValue.ACCPROP); db.AddInParameter(cmdInsert, "@AMTDR", DbType.Decimal, enumValue.AMTDR); db.AddInParameter(cmdInsert, "@AMTCR", DbType.String, enumValue.AMTCR); db.AddInParameter(cmdInsert, "@USDAMTDR", DbType.Decimal, enumValue.USDAMTDR); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs index 6a285c0c..d5299f41 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeDAL.cs @@ -156,6 +156,75 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL return SetData(strSql); } + static public List GetDataAllList(string strCondition) + { + + + // + var strSql = new StringBuilder(); + //if (load == "true") + //{ + // strSql.Append("SELECT top 200 B.BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,"); + // strSql.Append("CONSIGNEEID,NOTIFYPARTYID,'' SHIPPER,'' CONSIGNEE,'' NOTIFYPARTY,AGENTID,'' AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,"); + //} + //else + //{ + strSql.Append("SELECT OP_SEAE.BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,APPLYNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,"); + strSql.Append("CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,VESSEL2N,VOYNO2N,VESSELID2N,"); + //} + strSql.Append("PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,COPYNOBILL,"); + strSql.Append("NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,BLFRT,PREPARDAT,PREPARDATID,PAYABLEAT,[SERVICE],MARKS,CNTRSEALNO,NOPKGS,[DESCRIPTION],GOODSNAME,"); + strSql.Append("GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,"); + strSql.Append("TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,FRCUSTSERVICE,LANE,SALE,CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,DPAGE,DLABEL,LINKMAN,"); + strSql.Append("REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,HUMIDITY,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,INSURANCEER,INSURANCENO,INAMOUT,ISVOU,VOUNO,REMARK,STATUS1,"); + strSql.Append("STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,"); + strSql.Append("WAREHOUSE,CLOSEDOCDATE,INTOPORTDATE,CORPID,SALEDEPT,MBLFRT,CREATETIME,STLNAME,dbo.trimdate(STLDATE) STLDATE,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,"); + strSql.Append("FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PLACERECEIPTID,SOURCECODE,ISCONTAINERSOC,VESSELID,ISSUEPLACEID,HSCODE"); + strSql.Append(",TRANSTATUS,EDIREMARK,SERVICECONTRACTNO,(CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF "); + strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,TRANSPORT,DFLASH,DTEL,ISMP,PKGTYPE "); + //strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS "); + strSql.Append(",(SELECT TOP 1 STATUS FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS"); + strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97018 and EnumValueID=OP_SEAE.MANIFESTSTATUS) as MANIFESTSTATUSREF"); + strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,ISGAIQIAN,WARNCOUNT"); + + strSql.Append(",dbo.F_GetBillDrFeeStatus(OP_SEAE.BSNO) DRFEESTATUS"); + strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT"); + // strSql.Append(",S.STATUS as OPSTATUS "); + strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY "); + strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY"); + strSql.Append(",ISNULL((SELECT SORT FROM op_audit WHERE BSNO=OP_SEAE.BSNO),0) as APPLYCOUNT "); + + //20161117 邓羽 增加对提单签发状态的查询 + strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=OP_SEAE.BSNO) BLISSUESTATUS,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD "); + + strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION "); + strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP"); + strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY "); + strSql.Append(" from OP_SEAE "); + strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=OP_SEAE.BSNO) "); + // strSql.Append(" left join V_OP_STATUS S ON (S.BSNO=B.BSNO) "); + + if (!string.IsNullOrEmpty(strCondition)) + { + strSql.Append(" where MASTERNO=OP_SEAE.BSNO AND EXISTS ( select 1 from OP_SEAE B WHERE OP_SEAE.BSNO=B.MASTERNO AND " + strCondition + " )"); + } + else + { + strSql.Append(" where MASTERNO=OP_SEAE.BSNO "); + + } + // + + var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'"); + if (SeaeDefaultSort.PARAMVALUE != "") + strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE); + else + strSql.Append(" order by BSDATE desc"); + + return SetData(strSql); + } + + static public List GetDataList(int start, int limit, string strCondition, string userid, string usercode, string companyid, string sort = null, string load = null) { var rangstr = GetRangDAStr("index", userid, usercode, companyid); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs index 2480e2fb..9f3c0097 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs @@ -3536,14 +3536,14 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL //if (carrier != "MAEU") //if ((bill.HSCODE == null || bill.HSCODE == "")) //{ error = error + "
提单号:" + bill.MBLNO + " HSCODE不能为空"; } - if (carrier != "MCCQ"&&carrier!= "MAEU" && carrier != "SUDU") - { + //if (carrier != "MCCQ"&&carrier!= "MAEU" && carrier != "SUDU") + //{ if (bill.VESSEL == null || bill.VESSEL == "") { error = error + "
提单号:" + bill.MBLNO + " 船名不能为空"; } if (bill.VOYNO == null || bill.VOYNO == "") { error = error + "
提单号:" + bill.MBLNO + " 航次不能为空"; } - } + //} //} if (filetype == "E") { @@ -4117,12 +4117,12 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { if (carrier == "YML") { - if (bill.PREPARDATID=="") + if (GetPortEDICode(bill.PREPARDATID, "YML") == "") { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } else { - if ((bill.PREPARDATID == "")) + if ((GetPortEDICode(bill.PREPARDATID, "INTTR") == "")) { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } } @@ -4518,13 +4518,13 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { if (bill.PAYABLEAT != "") { - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + formatEdiStr("txt",bill.PAYABLEAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "INTTR") + "::6:" + formatEdiStr("txt",bill.PAYABLEAT) + "'"); icount = icount + 1; } } else { - r.WriteLine("LOC+57+" + bill.PREPARDATID+ "::6:" + formatEdiStr("txt",bill.PREPARDAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "INTTR") + "::6:" + formatEdiStr("txt",bill.PREPARDAT) + "'"); icount = icount + 1; } @@ -5158,7 +5158,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL else r.WriteLine("DGS+IMD+" + bill.DCLASS + "+" + bill.DUNNO + "+" + tmp + ":'"); - if (string.IsNullOrEmpty(bill.LINKMAN)) + if (string.IsNullOrEmpty(bill.LINKMAN.Trim())) { if (dsUserOp != null) { @@ -5172,8 +5172,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL } else { - r.WriteLine("CTA+HG+:" + bill.LINKMAN + "'"); - r.WriteLine("COM+" + bill.DTEL + ":TE'"); + r.WriteLine("CTA+HG+:" +formatEdiStr("txt",bill.LINKMAN.Trim()) + "'"); + r.WriteLine("COM+" + formatEdiStr("txt", bill.DTEL.Trim()) + ":TE'"); icount = icount + 2; } icount = icount + 1; @@ -5433,13 +5433,13 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { if (bill.PAYABLEAT != "") { - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + formatEdiStr("txt",bill.PAYABLEAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "INTTR") + "::6:" + formatEdiStr("txt",bill.PAYABLEAT) + "'"); icount = icount + 1; } } else { - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + formatEdiStr("txt",bill.PREPARDAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "INTTR") + "::6:" + formatEdiStr("txt",bill.PREPARDAT) + "'"); icount = icount + 1; } @@ -6321,8 +6321,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL } else { - r.WriteLine("CTA+HG+:" + bill.LINKMAN + "'"); - r.WriteLine("COM+" + bill.DTEL + ":TE'"); + r.WriteLine("CTA+HG+:" + formatEdiStr("txt", bill.LINKMAN.Trim()) + "'"); + r.WriteLine("COM+" + formatEdiStr("txt", bill.DTEL.Trim()) + ":TE'"); icount = icount + 2; } icount = icount + 1; @@ -6898,13 +6898,13 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL if (bill.BLFRT.IndexOf("PREPAID") >= 0) { - if (bill.PREPARDAT == "" || bill.PREPARDATID == "") + if (bill.PREPARDAT == "" || GetPortEDICode(bill.PREPARDATID, "HANJIN") == "") { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } if (bill.BLFRT.IndexOf("COLLECT") >= 0) { - if (bill.PAYABLEAT == "" || bill.PREPARDATID == "") + if (bill.PAYABLEAT == "" || GetPortEDICode(bill.PREPARDATID, "HANJIN") == "") { error = error + "
提单号:" + bill.MBLNO + " 到付地点或到付地点EDI代码不能为空"; } } @@ -7720,7 +7720,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL if (bill.CARGOID == "D") { strR += "DGS+IMD+" + bill.DLABEL + ":" + bill.DPAGE + "+" + bill.DUNNO + "+" + sTEMPSET + ":" + bill.TEMPID + "+" + bill.DCLASS + "'"; - strR += "CTA+HG+:" + bill.LINKMAN + "'"; + strR += "CTA+HG+:" + bill.LINKMAN.Trim() + "'"; icount = icount + 2; } #endregion @@ -7924,11 +7924,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL #region LOC 付费地址 if (bill.BLFRT == "FREIGHT COLLECT") { - r.WriteLine("LOC+57+" + bill.PREPARDATID + ":139:6:" + bill.PAYABLEAT + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "HANJIN") + ":139:6:" + bill.PAYABLEAT + "'"); } else { - r.WriteLine("LOC+57+" + bill.PREPARDATID + ":139:6:" + bill.PREPARDAT + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "HANJIN") + ":139:6:" + bill.PREPARDAT + "'"); } r.WriteLine("LOC+73+" + GetPortEDICodeByEname(bill.ISSUEPLACEID, "HANJIN") + ":139:6:" + bill.ISSUEPLACE + "'"); icount = icount + 2; @@ -11602,9 +11602,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL if (bill.BLFRT == "FREIGHT COLLECT") - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + formatEdiStr("txt", bill.PAYABLEAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "YML") + "::6:" + formatEdiStr("txt", bill.PAYABLEAT) + "'"); else - r.WriteLine("LOC+57+" + bill.PREPARDATID + "::6:" + formatEdiStr("txt", bill.PREPARDAT) + "'"); + r.WriteLine("LOC+57+" + GetPortEDICode(bill.PREPARDATID, "YML") + "::6:" + formatEdiStr("txt", bill.PREPARDAT) + "'"); r.WriteLine("LOC+73+" + GetPortEDICode(bill.ISSUEPLACEID, "YML") + "::6:" + formatEdiStr("txt",bill.ISSUEPLACE) + "'"); icount = icount + 2; @@ -19587,12 +19587,12 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { if (carrier == "YML") { - if (bill.PREPARDATID == "") + if (GetPortEDICode(bill.PREPARDATID, "YML") == "") { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } else { - if ((bill.PREPARDATID == "")) + if ((GetPortEDICode(bill.PREPARDATID, "YML") == "")) { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } } @@ -28269,12 +28269,12 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { if (carrier == "YML") { - if (bill.PREPARDATID == "") + if (GetPortEDICode(bill.PREPARDATID, "YML") == "") { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } else { - if ((bill.PREPARDATID == "")) + if ((GetPortEDICode(bill.PREPARDATID, "YML") == "")) { error = error + "
提单号:" + bill.MBLNO + " 预付地点或预付地点EDI代码不能为空"; } } } diff --git a/DSWeb/Areas/MvcShipping/Models/MsCwAccitemsDaterp/CwAccitemsDaterp.cs b/DSWeb/Areas/MvcShipping/Models/MsCwAccitemsDaterp/CwAccitemsDaterp.cs index ddce1325..d7df198e 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsCwAccitemsDaterp/CwAccitemsDaterp.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsCwAccitemsDaterp/CwAccitemsDaterp.cs @@ -95,6 +95,9 @@ namespace DSWeb.MvcShipping.Models.MsCwAccitemsDaterp [ModelDB] public string ACCNAME { get; set; } + [ModelDB] + public string ACCPROP { get; set; } + [ModelDB] public decimal AMTDR { get; set; } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsChDui/MsChDuiBLEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsChDui/MsChDuiBLEdit.js index df68ff90..87751a98 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsChDui/MsChDuiBLEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsChDui/MsChDuiBLEdit.js @@ -1270,7 +1270,8 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'RMBCR', header: 'RMB', //应付RMB - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) + { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { @@ -1282,7 +1283,7 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'USDCR', header: 'USD', //应付USD - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { @@ -1294,7 +1295,7 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'OTCR', header: 'OT', //应付OT - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { @@ -1310,7 +1311,7 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'DUIRMBCR', header: 'RMB', //应收RMB - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { @@ -1322,7 +1323,7 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'DUIUSDCR', header: 'USD', //应收RMB - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { @@ -1334,7 +1335,7 @@ Ext.extend(Shipping.MsChDuiEdit, Ext.Panel, { sortable: true, dataIndex: 'DUIOTCR', header: 'OT', //应收RMB - renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return '' + lsValue + ''; } } catch (e) { return '' + lsValue + ''; } return '' + lsValue + ''; }, align: 'right', summaryType: 'sum', summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeAmendDrCrGrid.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeAmendDrCrGrid.js index 1e75b42e..7e4f1ac8 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeAmendDrCrGrid.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsChFee/FeeAmendDrCrGrid.js @@ -5691,6 +5691,15 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, { return; } + for (i = 0; i < this.storeAmendBill.getCount(); i += 1) { + var memberyf = this.storeAmendBill.getAt(i); + if (memberyf.data.BillFeeStatus != "2") { + Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: "所有更改单必须都整票审核通过,才能添加更改单!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); + return; + + } + } + if (this.ADDAMENDNOTFEECLOSE != 1) { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpEdit.js index e5adbf0a..219092a3 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpEdit.js @@ -272,6 +272,20 @@ Ext.extend(Shipping.MsCwAccitemsDaterpEdit, Ext.Panel, { displayField: 'EnumValueName' }); + this.storeACCPROP = Ext.create('Ext.data.Store', { + fields: ['FSTATUS', 'NAME'] + }); + this.storeACCPROP.add({ "FSTATUS": '现金', "NAME": '现金' }); + this.storeACCPROP.add({ "FSTATUS": '银行', "NAME": '银行' }); + + this.comboxACCPROP = Ext.create('DsExt.ux.RefTableCombox', { + store: this.storeACCPROP, + valueField: 'FSTATUS', + displayField: 'NAME', + forceSelection: true, + name: 'ACCPROP' + }); + this.gridList = new Ext.grid.GridPanel({ store: this.storeBodyList, @@ -311,6 +325,12 @@ Ext.extend(Shipping.MsCwAccitemsDaterpEdit, Ext.Panel, { header: Zi.LAN.ACCID, //'模板名称', editor: this.comboxOFFICEADDR, width: 160 + }, { + sortable: true, + dataIndex: 'ACCPROP', + header: '科目属性', //'模板名称', + editor: this.comboxACCPROP, + width: 60 }, { sortable: true, dataIndex: 'AMTDR', diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpModel.js index 4ac4db8e..7a0aedb1 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/MsCwAccitemsDaterpModel.js @@ -23,6 +23,7 @@ Ext.define('MsCwAccitemsDaterpDetail', { fields: [ { name: 'GID', type: 'string' }, { name: 'LINKGID', type: 'string' }, + { name: 'ACCPROP', type: 'string' }, { name: 'ACCNAME', type: 'string' }, { name: 'AMTDR', type: 'number' }, { name: 'AMTCR', type: 'number' }, diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_en-us.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_en-us.js index 17404579..f97f29fd 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_en-us.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_en-us.js @@ -63,6 +63,7 @@ Zi.LAN.btnClearCUSTOMERNAME = 'Clear Customer'; Zi.LAN.ACCTAXRATE = 'Acc Taxrate'; Zi.LAN.FeeDescription = 'FeeDescription'; Zi.LAN.UNITPRICEDESCRPTION = '单价公式'; +Zi.LAN.ACCPROP = "科目属性"; //#endregion diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_zh-cn.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_zh-cn.js index dcd97309..7023047d 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_zh-cn.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCwAccitemsDaterp/Zi_zh-cn.js @@ -45,7 +45,7 @@ Zi.LAN.btnClearCUSTOMERNAME = '清空结算对象'; Zi.LAN.ACCTAXRATE = '财务税率'; Zi.LAN.FeeDescription = '费用英文名称'; Zi.LAN.UNITPRICEDESCRPTION = '单价公式'; - +Zi.LAN.ACCPROP = "科目属性"; //#endregion //Zi.LAN. = ""; diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeAmendIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeAmendIndex.js index deeab2e1..27890a12 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeAmendIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeAmendIndex.js @@ -189,25 +189,32 @@ Ext.extend(Shipping.MsOpSeaeAmendIndex, Ext.Panel, { id: '', dataIndex: 'BillFeeStatus', header: '整票状态', //'整票状态', - width: 60, + width: 60, renderer: function (value, meta, record) { - if (value == '0') { - return "未提交"; - } else if (value == '1') { - if (record.data.ISAPPLY == '1') - return "整票提交"; - else - return "审核中"; - } else if (value == '2') { - //meta.tdCls = 'feestatus_pass'; - return "审核通过"; - } else if (value == '4') { - //meta.tdCls = 'feestatus_nopass'; - return "整票驳回"; - } else { - return ""; + if (value == '0') { + value = "未提交"; + } else if (value == '1') { + if (record.data.ISAPPLY == '1') { + meta.tdCls = 'bs_referF'; + value = "整票提交"; } + else { + meta.tdCls = 'bs_auditpart'; + value = "审核中"; + } + } else if (value == '2') { + + meta.tdCls = 'bs_passF'; + value = "审核通过"; + + } else if (value == '4') { + meta.tdCls = 'bs_nopassF'; + value = "整票驳回"; + } else { + value = ""; } + return value; + } }, { sortable: true, diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index b6dbfda4..1bd56288 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -671,14 +671,57 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { this.formAMSPIL.getForm().findField('MasterBOLIndicator').setValue('3'); var ISSUETYPE = this.formEdit.getForm().findField('ISSUETYPE').getValue(); if (ISSUETYPE == '正本') { - this.formEdit.getForm().findField('NOBILL').getValue('THREE'); - this.formEdit.getForm().findField('COPYNOBILL').getValue('ONE'); + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); } - } if (combo.value == '现代') { + } else if (combo.value == '现代') { this.formHead.getForm().findField('CONTRACTNO').setValue('081546'); + if (ISSUETYPE != '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } + + } else if (combo.value == '海洋网联') { + var ISSUETYPE = this.formEdit.getForm().findField('ISSUETYPE').getValue(); + if (ISSUETYPE == '正本') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (ISSUETYPE == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } else if (ISSUETYPE == 'WAYBILL') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } + } else if (combo.value == '以星') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } else if (combo.value == '达飞' || combo.value == '正利航运' || combo.value == 'ANL CONTAINER LINE' + || combo.value == '赫伯罗特' || combo.value == '汉堡南美' || combo.value == 'MCC' || combo.value == '青岛马士基') { + var ISSUETYPE = this.formEdit.getForm().findField('ISSUETYPE').getValue(); + if (ISSUETYPE == '正本' || ISSUETYPE == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (ISSUETYPE == 'WAYBILL') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } + } else if (combo.value == '海洋网联') { + var ISSUETYPE = this.formEdit.getForm().findField('ISSUETYPE').getValue(); + if (ISSUETYPE == '正本') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (ISSUETYPE == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } + + } else { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); } this.storeCodePackage.load({ params: { CARRIER: combo.value } }); this.storeCodeCtn.load({ params: { CARRIER: combo.value } }); @@ -1615,6 +1658,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { scope: this, blur: function (field, The, eOpts) { _this.formHead.getForm().findField('MBLNO').setValue(field.value.toUpperCase().trim()); + _this.GetMblIsRepeat(); } } @@ -1868,6 +1912,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, + keyNavEnabled: false, mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -1895,6 +1940,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, + keyNavEnabled: false, decimalPrecision: 3, mouseWheelEnabled: false, enableKeyEvents: true, @@ -1919,6 +1965,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { selectOnFocus: true, hideTrigger: true, decimalPrecision: 3, + keyNavEnabled: false, mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -1927,6 +1974,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { _this.onNextKeyClick(10); } else if (e.getKey() == 38) { _this.onUpKeyClick(10); + } } @@ -1982,7 +2030,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, - mouseWheelEnabled: false, + keyNavEnabled: false, + mouseWheelEnabled: false, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { @@ -2017,7 +2066,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, - mouseWheelEnabled: false, + keyNavEnabled: false, + mouseWheelEnabled: false, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { @@ -2272,7 +2322,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, - hideTrigger: true, + keyNavEnabled: false, + hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -2293,7 +2344,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { editor: { xtype: 'numberfield', allowBlank: false, - selectOnFocus: true, + keyNavEnabled: false, + selectOnFocus: true, hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true, @@ -2316,7 +2368,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { xtype: 'numberfield', allowBlank: false, selectOnFocus: true, - hideTrigger: true, + keyNavEnabled: false, + hideTrigger: true, mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -2350,7 +2403,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, - mouseWheelEnabled: false, + keyNavEnabled: false, + mouseWheelEnabled: false, enableKeyEvents: true, listeners: { keydown: function (textfield, e) { @@ -2372,7 +2426,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { keyNavEnabled: false, selectOnFocus: true, hideTrigger: true, - mouseWheelEnabled: false, + keyNavEnabled: false, + mouseWheelEnabled: false, decimalPrecision: 2, enableKeyEvents: true, listeners: { @@ -2396,7 +2451,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { xtype: 'numberfield', keyNavEnabled: false, selectOnFocus: true, - hideTrigger: true, + keyNavEnabled: false, + hideTrigger: true, mouseWheelEnabled: false, decimalPrecision: 2, enableKeyEvents: true, @@ -2422,7 +2478,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { keyNavEnabled: false, selectOnFocus: true, hideTrigger: true, - mouseWheelEnabled: false, + keyNavEnabled: false, + mouseWheelEnabled: false, decimalPrecision: 2, enableKeyEvents: true, listeners: { @@ -3023,7 +3080,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var selectrecords = DsStoreQueryBy(_this.storeCodeLoadport, 'CodeAndName', _this.comboxPORTLOAD.rawValue); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; - this.formEdit.getForm().findField('PORTLOAD').setValue(selectdata.PORT); + var PORTLOAD = this.formEdit.getForm().findField('PORTLOAD').getValue(); + if (PORTLOAD.trim() == "") { + this.formEdit.getForm().findField('PORTLOAD').setValue(selectdata.PORT); + } } @@ -3134,7 +3194,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var selectrecords = DsStoreQueryBy(_this.storeCodeDisport, 'CodeAndName', _this.comboxPORTDISCHARGE.rawValue); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; - this.formEdit.getForm().findField('PORTDISCHARGE').setValue(selectdata.PORT); + var PORTDISCHARGE = this.formEdit.getForm().findField('PORTDISCHARGE').getValue(); + if (PORTDISCHARGE.trim() == "") { + this.formEdit.getForm().findField('PORTDISCHARGE').setValue(selectdata.PORT); + } } @@ -3295,7 +3358,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var selectrecords = DsStoreQueryBy(_this.storeCodeDisport2, 'CodeAndName', _this.comboxDESTINATION.rawValue); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; - this.formEdit.getForm().findField('DESTINATION').setValue(selectdata.PORT); + var DESTINATION = this.formEdit.getForm().findField('DESTINATION').getValue(); + if (DESTINATION.trim() == "") { + this.formEdit.getForm().findField('DESTINATION').setValue(selectdata.PORT); + } } @@ -3369,7 +3435,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var selectrecords = DsStoreQueryBy(_this.storeCodeDisport3, 'CodeAndName', _this.comboxPLACEDELIVERY.rawValue); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; - this.formEdit.getForm().findField('PLACEDELIVERY').setValue(selectdata.PORT); + var PLACEDELIVERY = this.formEdit.getForm().findField('PLACEDELIVERY').getValue(); + if (PLACEDELIVERY.trim() == "") { + this.formEdit.getForm().findField('PLACEDELIVERY').setValue(selectdata.PORT); + } } @@ -3427,7 +3496,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var selectrecords = DsStoreQueryBy(_this.storeCodeDisport4, 'CodeAndName', _this.comboxPLACERECEIPT.rawValue); if (selectrecords.getCount() > 0) { var selectdata = selectrecords.getAt(0).data; - this.formEdit.getForm().findField('PLACERECEIPT').setValue(selectdata.PORT); + var PLACERECEIPT = this.formEdit.getForm().findField('PLACERECEIPT').getValue(); + if (PLACERECEIPT.trim() == "") { + this.formEdit.getForm().findField('PLACERECEIPT').setValue(selectdata.PORT); + } } @@ -3705,17 +3777,69 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { scope: this, 'select': function (combo, records, eOpts) { if (records.length > 0) { - if (records[0].data.NOBILL!='') { - this.formEdit.getForm().findField('NOBILL').setValue(records[0].data.NOBILL); - this.formEdit.getForm().findField('COPYNOBILL').setValue(records[0].data.COPYNOBILL); - } else { - if (combo.value == "正本") { + var CARRIER = this.formEdit.getForm().findField('CARRIER').getValue(); + if (CARRIER== '太平船务') { + if (combo.value == '正本') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } + + } else if (CARRIER == '现代') { + if (combo.value != '电放') { this.formEdit.getForm().findField('NOBILL').setValue('THREE'); this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); - } else if (combo.value == "电放") { + } + + } else if (CARRIER == '海洋网联') { + if (combo.value== '正本') { this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (combo.value == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } else if (combo.value == 'WAYBILL') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } + + } else if (CARRIER == '以星') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } else if (CARRIER == '达飞' || CARRIER == '正利航运' || CARRIER== 'ANL CONTAINER LINE' + || CARRIER == '赫伯罗特' || CARRIER == '汉堡南美' || CARRIER == 'MCC' || CARRIER == '青岛马士基') { + if (CARRIER == '正本' || CARRIER == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (combo.value == 'WAYBILL') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } + + } else if (CARRIER == '海洋网联') { + if (combo.value == '正本') { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('THREE'); + } else if (combo.value == '电放') { + this.formEdit.getForm().findField('NOBILL').setValue('ONE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ONE'); + } + + } else { + if (records[0].data.NOBILL != '') { + this.formEdit.getForm().findField('NOBILL').setValue(records[0].data.NOBILL); + this.formEdit.getForm().findField('COPYNOBILL').setValue(records[0].data.COPYNOBILL); + } else { + if (combo.value == "正本") { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + this.formEdit.getForm().findField('COPYNOBILL').setValue('ZERO'); + } else if (combo.value == "电放") { + this.formEdit.getForm().findField('NOBILL').setValue('THREE'); + } } } + + + } } } @@ -11094,6 +11218,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, + keyNavEnabled: false, + mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -11129,6 +11255,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { allowBlank: false, selectOnFocus: true, hideTrigger: true, + keyNavEnabled: false, + mouseWheelEnabled: false, enableKeyEvents: true, listeners: { @@ -13619,7 +13747,12 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { this.FormatTextarea(35, "SHIPPER"); this.FormatTextarea(35, "CONSIGNEE"); this.FormatTextarea(35, "NOTIFYPARTY"); - + this.FormatTextarea(35, "SHIPPER"); + this.FormatTextarea(35, "CONSIGNEE"); + this.FormatTextarea(35, "NOTIFYPARTY"); + this.FormatTextarea(35, "SHIPPER"); + this.FormatTextarea(35, "CONSIGNEE"); + this.FormatTextarea(35, "NOTIFYPARTY"); // var jsonBody = ConvertRecordsToJsonAll(bodydatas); //var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel); @@ -20165,6 +20298,36 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { //#endregion //#region 清空委托编号 + GetMblIsRepeat: function () { + var BSNO = this.formHead.getForm().findField('BSNO').getValue(); + var MBLNO = this.formHead.getForm().findField('MBLNO').getValue(); + Ext.Ajax.request({ + waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询委托编号状态...', + url: '/MvcShipping/MsOpSeae/GetMblIsRepeat', + params: { + bsno: BSNO, + mblno: MBLNO + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + } else { + Ext.MessageBox.alert('注意!',"主提单号重复,不允许保存!"); + + } + } else { + Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); + } + }, + scope: this + }); + + + }, + + ClearCustNo: function () { var CUSTNO = this.formHead.getForm().findField('CUSTNO').getValue(); Ext.Ajax.request({ @@ -21674,6 +21837,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { FormatTextarea: function (len, name) { var textareaFiled = _this.formEdit.getForm().findField(name); var value = textareaFiled.getValue(); + //value = value.replace(/\s+/ig, " "); + //var value = value.replaceAll(' ',' '); //var textArr = value.match(/([\w]+[ ]*)|([^u4e00-u9fa5|\r|\n]+[ ]*)|([@|=|^|<|>]+[ ]*)/g);//匹配字母数字汉字及特殊字符{Array} var textArr = value.match(/.+[\n]*/g);//按行匹配 var subValue = "";