From a3a69a1397a66d0db25e255a63efeda146bd95e5 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Wed, 3 Jul 2024 18:46:27 +0800 Subject: [PATCH] 20240703 --- DSWeb.Common/DB/Comm.cs | 13 + DSWeb.Common/DB/CommonDataContext.cs | 3 + DSWeb.DJYMQ/DS7Service.cs | 13 +- DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs | 128 ++ DSWeb/Areas/CommMng/DAL/PubSysDAL.cs | 8 +- DSWeb/Areas/CommMng/Models/BasicDataModel.cs | 1473 +++++++++++++++-- .../Controllers/MsOpSeaeController.cs | 14 +- .../DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs | 14 +- .../DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs | 100 +- .../DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs | 28 +- 10 files changed, 1635 insertions(+), 159 deletions(-) diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index 99a62bb3..8f05fdff 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -3877,5 +3877,18 @@ namespace DSWeb.Common.DB public DateTime? CREATETIME { get; set; } } + [Table("code_ctn_edi")] + public partial class code_ctn_edi_md + { + [Key] + public string GID { get; set; } + public string CTN { get; set; } + public string EDICODE { get; set; } + public string EDINAME { get; set; } + public string REMARK { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + } + } \ No newline at end of file diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 9d086076..23982729 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -133,6 +133,9 @@ namespace DSWeb.Common.DB public DbSet t_PublicInterface_Log { get; set; } public DbSet code_disport_edi { get; set; } + + public DbSet code_ctn_edi { get; set; } + } diff --git a/DSWeb.DJYMQ/DS7Service.cs b/DSWeb.DJYMQ/DS7Service.cs index 5d1536d0..d42507ce 100644 --- a/DSWeb.DJYMQ/DS7Service.cs +++ b/DSWeb.DJYMQ/DS7Service.cs @@ -14,6 +14,7 @@ using Quartz.Util; using RabbitMQ.Client; using RabbitMQ.Client.Events; using System; +using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; @@ -3639,13 +3640,21 @@ SELECT @ps_BillNo as N'billno'"; } var 海关放行_时间 = Get状态时间("海关放行"); - if (海关放行_时间 != null) result.海关放行 = 海关放行_时间; + if (海关放行_时间 != null) + { + result.海关放行 = 海关放行_时间; + result.是否海关放行 = true; + } var 码头放行_时间 = Get状态时间("码放"); if (码头放行_时间 != null) result.码头放行 = 码头放行_时间; var 装载放行_时间 = Get状态时间("装载"); - if (装载放行_时间 != null) result.装载放行 = 装载放行_时间; + if (装载放行_时间 != null) + { + result.装载放行 = 装载放行_时间; + result.是否装载放行 = true; + } var 预配日期_时间 = Get状态时间("舱单"); if (预配日期_时间 != null) result.预配日期 = 预配日期_时间; diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index f26ec477..e6935800 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -66,6 +66,7 @@ using DSWeb.Areas.MvcShipping.Models.Message.VGM; using DSWeb.MvcShipping.Models.MsSysThirdPartyAccount; using System.Collections.Specialized; using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount; +using DSWeb.MvcShipping.Models.CodeCtnEdi; namespace DSWeb.Areas.CommMng.DAL { @@ -3112,6 +3113,7 @@ namespace DSWeb.Areas.CommMng.DAL return SetCodeDisportData(strSql); } + static public List GetCodeRailwayPortList(string condition) { String strSql = "SELECT PORTENAME PORT,PORTCNAME CNAME,'' EDICODE,(PORTENAME+'-'+PORTCNAME) as CodeAndName,'' LANE from code_railwayport where "; @@ -3232,6 +3234,122 @@ namespace DSWeb.Areas.CommMng.DAL } #endregion + #region edi代码对应 + + static public List GetCustList(string strCondition, string sort = null) + { + + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append("GID,CUST as CTN,EDICODE,EDINAME,REMARK"); + strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97012 and EnumValueID=code_cust_edi.EDINAME) as EDINAMEREF,'' as PORTID"); + strSql.Append(" from code_cust_edi where 1=1 "); + + if (!string.IsNullOrEmpty(strCondition)) + { + strSql.Append(" and " + strCondition); + } + var sortstring = DatasetSort.Getsortstring(sort); + if (!string.IsNullOrEmpty(sortstring)) + { + strSql.Append(" order by " + sortstring); + } + else + { + strSql.Append(" order by EDINAME,CUST"); + + } + return SetData(strSql); + } + + private static List SetData(StringBuilder strSql) + { + var headList = new List(); + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + CodeCtnEdi data = new CodeCtnEdi(); + #region Set DB data to Object + data.GID = Convert.ToString(reader["GID"]); + data.CTN = Convert.ToString(reader["CTN"]); + data.EDICODE = Convert.ToString(reader["EDICODE"]); + data.EDINAME = Convert.ToString(reader["EDINAME"]); + data.EDINAMEREF = Convert.ToString(reader["EDINAMEREF"]); + data.REMARK = Convert.ToString(reader["REMARK"]); + data.PORTID = Convert.ToString(reader["PORTID"]); + #endregion + headList.Add(data); + } + reader.Close(); + } + return headList; + } + + public static string GetCustEdiNameByName(string CUSTOMERNAME, string EDINAME) + { + var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'"; + var result = GetCustList(condition); + + if (result != null && result.Count > 0) + { + return result[0].CTN; + } + else + { + return CUSTOMERNAME; + } + } + + public static string GetCustEdiNameByEdiCode(string EDICODE, string EDINAME) + { + var condition = $"code_cust_edi.EDICODE='{EDICODE}' and EDINAME='{EDINAME}'"; + var result = GetCustList(condition); + + if (result != null && result.Count > 0) + { + return result[0].CTN; + } + else + { + return EDICODE; + } + } + + + + static public string GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(string PORTNAME, string EDINAME) + { + var cdc = new CommonDataContext(); + var info = cdc.code_disport_edi.Where(x => (x.PORTDISCHARGE == PORTNAME || x.PORTID == PORTNAME) && x.EDINAME == EDINAME).ToList(); + + if (info == null || info.Count == 0) + { + return PORTNAME; + } + else { + return info[0].EDICODE; + } + } + + + static public string GetCtnEDICODEByCtnallAndEDIName(string CTNALL, string EDINAME) + { + var cdc = new CommonDataContext(); + var info = cdc.code_ctn_edi.Where(x => x.CTN == CTNALL && x.EDINAME == EDINAME).ToList(); + + if (info == null || info.Count == 0) + { + return CTNALL; + } + else + { + return info[0].EDICODE; + } + } + #endregion + #region 品名类型 static public List Getsys_templateList() { @@ -7441,6 +7559,16 @@ namespace DSWeb.Areas.CommMng.DAL return result; } + + public static void CheckWebconfig(string itemname, ref DBResult result) + { + var item = ConfigurationManager.AppSettings[itemname]; + if (string.IsNullOrWhiteSpace(item)) + { + result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目"); + } + } + } public class BarCodeDrawing diff --git a/DSWeb/Areas/CommMng/DAL/PubSysDAL.cs b/DSWeb/Areas/CommMng/DAL/PubSysDAL.cs index af35fdc7..1b2df815 100644 --- a/DSWeb/Areas/CommMng/DAL/PubSysDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/PubSysDAL.cs @@ -843,7 +843,7 @@ namespace DSWeb.Areas.CommMng.DAL // 船公司 = 船公司edi代码List[0].CUST; //} - 船公司 = MsCodeCtnEdiDAL.GetCustEdiNameByName(carrier, "DJY"); + 船公司 = BasicDataRefDAL.GetCustEdiNameByEdiCode(carrier, "DJY"); //var carrier_clientList = cdc.info_client.Where(x => x.SHORTNAME == 船公司).ToList(); //if (carrier_clientList != null && carrier_clientList.Count > 0) @@ -858,12 +858,12 @@ namespace DSWeb.Areas.CommMng.DAL 签单方式 = issutypeedicode.BLTYPE; } - var 委托单位 =MsCodeCtnEdiDAL.GetCustEdiNameByName(customername, "DJY"); + var 委托单位 = BasicDataRefDAL.GetCustEdiNameByEdiCode(customername, "DJY"); - var 船代 = MsCodeCtnEdiDAL.GetCustEdiNameByName(shipagency, "DJY"); + var 船代 = BasicDataRefDAL.GetCustEdiNameByEdiCode(shipagency, "DJY"); - var 场站 = MsCodeCtnEdiDAL.GetCustEdiNameByName(yard, "DJY"); + var 场站 = BasicDataRefDAL.GetCustEdiNameByEdiCode(yard, "DJY"); //int? 申请箱使天数 = null; diff --git a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs index 7caa58b4..86269b97 100644 --- a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs +++ b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs @@ -25,6 +25,10 @@ using DSWeb.MvcShipping.Models.MsSysParamSet; using DSWeb.MvcShipping.Models.MsInfoClient; using DSWeb.Areas.MvcShipping.Models.MsCodeVesselSetModel; using DSWeb.Areas.MvcShipping.DAL.code_vesselModelDal; +using DSWeb.MvcShipping.Models.MsOpApply; +using DSWeb.MvcShipping.DAL.MsOpSeaeDAL; +using DSWeb.Areas.MvcShipping.Helper; +using com.sun.jndi.dns; namespace DSWeb.Areas.CommMng.Models { @@ -89,7 +93,7 @@ namespace DSWeb.Areas.CommMng.Models get { if (_INDATABASE == "True" || _INDATABASE == "true") { return true; - }return false; + } return false; } } @@ -123,7 +127,7 @@ namespace DSWeb.Areas.CommMng.Models #endregion - public static string _urlbase= "../../UploadFiles"; + public static string _urlbase = "../../UploadFiles"; private string getSQL() { var sql = String.Format("update {0} set {1}='{2}' where {3}='{4}'", TableName, UrlName, UrlValue, KeyName, KeyValue); @@ -161,19 +165,19 @@ namespace DSWeb.Areas.CommMng.Models setModelValue(ModelName, path); } - public FileUrlModel(string head,string ModelName,string ChildName="") { + public FileUrlModel(string head, string ModelName, string ChildName = "") { var _Info = DSWeb.TruckMng.Helper.JsonConvert.Deserialize(head); var path = System.Web.HttpContext.Current.Server.MapPath(FileUrlModel._urlbase); - setModelValue(ModelName, path, ChildName); + setModelValue(ModelName, path, ChildName); //ChildName用于表示在某一模块下的多种类型文件 如info_client(往来单位)下添加电子章 或其他种类图片 this.SetValue(_Info); } - private void setModelValue(string ModelName,string path, string ChildName = "") { + private void setModelValue(string ModelName, string path, string ChildName = "") { if (ModelName == "FactoryCargoname_TAGPIC") {//进口贸易-厂号商品名称管理 @@ -202,7 +206,7 @@ namespace DSWeb.Areas.CommMng.Models } if (ModelName == "SysUser_Head") - { + { //系统用户 头像 TableName = "USER_BASEINFO"; KeyName = "USERID"; @@ -226,7 +230,7 @@ namespace DSWeb.Areas.CommMng.Models this.ModelName = ModelName; this.ChildName = ChildName; - INDATABASE ="True"; + INDATABASE = "True"; } if (ModelName == "Price_Quotation") { @@ -234,7 +238,7 @@ namespace DSWeb.Areas.CommMng.Models TableName = "Op_SeaPrice_Quotation"; KeyName = "BSNO"; UrlName = "PDFURL"; - + FilePath = path + "\\" + ModelName; this.ModelName = ModelName; this.ChildName = ChildName; @@ -287,7 +291,7 @@ namespace DSWeb.Areas.CommMng.Models /// /// /// - public string SaveFile(System.Web.HttpPostedFileBase file,string savetype="") + public string SaveFile(System.Web.HttpPostedFileBase file, string savetype = "") { //获得文件扩展名 ExName = getexname(file); @@ -316,7 +320,7 @@ namespace DSWeb.Areas.CommMng.Models //} //保存文件 file.SaveAs(filename); - + if (File.Exists(filename)) { @@ -397,7 +401,7 @@ namespace DSWeb.Areas.CommMng.Models } [JsonObject] - public class StoreModifyStatusMb: ModelObjectBillHead + public class StoreModifyStatusMb : ModelObjectBillHead { public static List StoreModifyStatusList { get { @@ -411,7 +415,7 @@ namespace DSWeb.Areas.CommMng.Models { var result = new List(); - var StoreModifyStatusList = (List) BasicDataRefDAL.GetStoreModifyStatusCache(); + var StoreModifyStatusList = (List)BasicDataRefDAL.GetStoreModifyStatusCache(); foreach (var item in StoreModifyStatusList) { var status = new StoreModifyResultStatus(); @@ -446,7 +450,7 @@ namespace DSWeb.Areas.CommMng.Models private string _CONDITION = string.Empty; private string _MODIFIEDTIME = string.Empty; - + public List PubStoreList = new List(); @@ -598,103 +602,103 @@ namespace DSWeb.Areas.CommMng.Models //if (StoreModifyStatusList.Exists(x => x.STORENAME == STORENAME)) //{ - - //var _t = StoreModifyStatusList.Find(t => t.STORENAME == STORENAME); - //if (!string.IsNullOrWhiteSpace(_t.VALUEFIELD)) - //{//有VALUEFIELD的使用通用查询方法 - // if (string.IsNullOrWhiteSpace(_t.DISPLAYFIELD2)) _t.DISPLAYFIELD2 = "''"; + //var _t = StoreModifyStatusList.Find(t => t.STORENAME == STORENAME); - // result = "select " + _t.VALUEFIELD + " as GID," + _t.DISPLAYFIELD + " as GVALUE , " + _t.DISPLAYFIELD2 + " as GVALUE2 from " + _t.TABLENAME; + //if (!string.IsNullOrWhiteSpace(_t.VALUEFIELD)) + //{//有VALUEFIELD的使用通用查询方法 + // if (string.IsNullOrWhiteSpace(_t.DISPLAYFIELD2)) _t.DISPLAYFIELD2 = "''"; - // var _condition = _t.CONDITION; + // result = "select " + _t.VALUEFIELD + " as GID," + _t.DISPLAYFIELD + " as GVALUE , " + _t.DISPLAYFIELD2 + " as GVALUE2 from " + _t.TABLENAME; + // var _condition = _t.CONDITION; - // if (!string.IsNullOrWhiteSpace(modcondition)) - // { - // if (!string.IsNullOrWhiteSpace(_condition)) - // { - // _condition += " and " + modcondition; - // } - // else - // { - // _condition = modcondition; - // } - // } + // if (!string.IsNullOrWhiteSpace(modcondition)) + // { + // if (!string.IsNullOrWhiteSpace(_condition)) + // { + // _condition += " and " + modcondition; + // } + // else + // { + // _condition = modcondition; + // } + // } - // if (!string.IsNullOrWhiteSpace(_condition)) - // { - // result += " where " + _condition.Replace("[[USERID]]", "'" + USERINFO.USERID + "'"); - // } - // result += " order by " + _t.DISPLAYFIELD; - //} - //else { - //没有valuefield的使用独立方法 - if (STORENAME == "IMPORT_SELLER") { - //进口贸易 贸易商 isagent=1 + // if (!string.IsNullOrWhiteSpace(_condition)) + // { + // result += " where " + _condition.Replace("[[USERID]]", "'" + USERINFO.USERID + "'"); + // } - result = BasicDataRefDAL.GetTrader_Getsqlstr(" isagent=1 ").ToString(); - } - if (STORENAME == "IMPORT_BUYER") - { - //进口贸易 客户 isagentcn=1 + // result += " order by " + _t.DISPLAYFIELD; + //} + //else { + //没有valuefield的使用独立方法 + if (STORENAME == "IMPORT_SELLER") { + //进口贸易 贸易商 isagent=1 - result = BasicDataRefDAL.GetTrader_Getsqlstr(" isagentcn=1 ").ToString(); - } + result = BasicDataRefDAL.GetTrader_Getsqlstr(" isagent=1 ").ToString(); + } + if (STORENAME == "IMPORT_BUYER") + { + //进口贸易 客户 isagentcn=1 - if (STORENAME == "HSCODE") - { - - result = BasicDataRefDAL.GetCargoTax_Sqlstr("").ToString(); - } - if (STORENAME == "CIQCODE") - { + result = BasicDataRefDAL.GetTrader_Getsqlstr(" isagentcn=1 ").ToString(); + } - result = BasicDataRefDAL.GetCargociqRefList_Sqlstr("").ToString(); - } - //往来单位开票信息 - if (STORENAME == "INFOCLIENT_INV") - { - result = BasicDataRefDAL.GetCustomInvRefList_SqlStr("", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); - } + if (STORENAME == "HSCODE") + { - //国内港口信息 - if (STORENAME == "CODE_PORTLOAD") - { - result = BasicDataRefDAL.GetCodeLoadportList_Sqlstr("").ToString(); - } + result = BasicDataRefDAL.GetCargoTax_Sqlstr("").ToString(); + } + if (STORENAME == "CIQCODE") + { - //国际港口信息 - if (STORENAME == "CODE_PORTDISCHARGE") - { - result = BasicDataRefDAL.GetCodeDisportList_DisplayWithCNAME_Sqlstr("").ToString(); - } + result = BasicDataRefDAL.GetCargociqRefList_Sqlstr("").ToString(); + } + //往来单位开票信息 + if (STORENAME == "INFOCLIENT_INV") + { + result = BasicDataRefDAL.GetCustomInvRefList_SqlStr("", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); + } + //国内港口信息 + if (STORENAME == "CODE_PORTLOAD") + { + result = BasicDataRefDAL.GetCodeLoadportList_Sqlstr("").ToString(); + } - //场站信息 - if (STORENAME == "OPSEAE_YARD") - { - result = BasicDataRefDAL.GetCustomInvRefList_SqlStr(" ISYARD=1 ").ToString(); - } + //国际港口信息 + if (STORENAME == "CODE_PORTDISCHARGE") + { + result = BasicDataRefDAL.GetCodeDisportList_DisplayWithCNAME_Sqlstr("").ToString(); + } - if (STORENAME == "CODE_FEE") - { - result = MsChFeeDAL.GetFeeTypeRefList_Sqlstr("","").ToString(); - } + //场站信息 + if (STORENAME == "OPSEAE_YARD") + { + result = BasicDataRefDAL.GetCustomInvRefList_SqlStr(" ISYARD=1 ").ToString(); + } - if (STORENAME == "INFOCLIENT_ALL") - { - result = BasicDataRefDAL.GetCustomInvRefList_SqlStr("", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); - } + if (STORENAME == "CODE_FEE") + { + result = MsChFeeDAL.GetFeeTypeRefList_Sqlstr("", "").ToString(); + } - if (STORENAME == "INFOCLIENT_CARRIER") - { - result = BasicDataRefDAL.GetCustomInvRefList_SqlStr(" ISCARRIER=1 ", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); - } + + if (STORENAME == "INFOCLIENT_ALL") + { + result = BasicDataRefDAL.GetCustomInvRefList_SqlStr("", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); + } + + if (STORENAME == "INFOCLIENT_CARRIER") + { + result = BasicDataRefDAL.GetCustomInvRefList_SqlStr(" ISCARRIER=1 ", USERINFO.ISENABLECUSTRANGE, USERINFO.USERID).ToString(); + } if (STORENAME == "INFOCLIENT_ISCONTROLLER") { @@ -989,7 +993,7 @@ namespace DSWeb.Areas.CommMng.Models public string requestAction { get; set; } } - public class CargoList + public class CargoList { public decimal? pKGs { get; set; } public string kindPKGs { get; set; } @@ -1730,7 +1734,7 @@ namespace DSWeb.Areas.CommMng.Models /// /// /// - public List projectCode { get; set; }=new List(); + public List projectCode { get; set; } = new List(); /// /// /// @@ -1742,11 +1746,11 @@ namespace DSWeb.Areas.CommMng.Models /// /// /// - public Head head { get; set; }=new Head(); + public Head head { get; set; } = new Head(); /// /// /// - public Main main { get; set; }=new Main(); + public Main main { get; set; } = new Main(); } @@ -1756,7 +1760,7 @@ namespace DSWeb.Areas.CommMng.Models #region 云港通实时接口 - public class 云港通实时接口Helper { + public class 云港通实时接口Helper { public string user_key { get; set; } public string user_secret { get; set; } public string bno { get; set; } @@ -1767,7 +1771,7 @@ namespace DSWeb.Areas.CommMng.Models public string email { get; set; } public string ServerUrl { get; set; } - public virtual string apiurl { get; set; } + public virtual string apiurl { get; set; } public DBResult GetUrl(string USERID) { @@ -1806,7 +1810,7 @@ namespace DSWeb.Areas.CommMng.Models return result; } - public void SetSearch(string _bno, string _vessel, string _voyage, string _email = "") + public void SetSearch(string _bno, string _vessel, string _voyage, string _email = "") { bno = _bno; vessel = _vessel; @@ -1814,8 +1818,8 @@ namespace DSWeb.Areas.CommMng.Models email = _email; } - public DBResult DoSend() - { + public DBResult DoSend() + { DBResult result = new DBResult(); var dic = new Dictionary(); @@ -1830,25 +1834,25 @@ namespace DSWeb.Areas.CommMng.Models var json = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(dic); BasicDataRefDAL.SaveLog($"url:{ServerUrl + apiurl},json:{json}", "", "委托结算_查询", "发送"); - var rtn= WebRequestHelper.DoPost(ServerUrl+apiurl, json, 10000); + var rtn = WebRequestHelper.DoPost(ServerUrl + apiurl, json, 10000); BasicDataRefDAL.SaveLog($"json:{rtn}", "", "委托结算_查询", "返回"); result.OK("", rtn); return result; } } - public class 云港通实时接口_进口单票 : 云港通实时接口Helper + public class 云港通实时接口_进口单票 : 云港通实时接口Helper { //public string apiurl { get; set; } = "/import/v1/ygt/single/vote"; public 云港通实时接口_进口单票() { - apiurl= "/import/v1/ygt/single/vote"; + apiurl = "/import/v1/ygt/single/vote"; } } - public class 云港通实时接口_结果 - { - public int? code { get; set; } + public class 云港通实时接口_结果 + { + public int? code { get; set; } public virtual object data { get; set; } public string msg { get; set; } public string request { get; set; } @@ -1864,7 +1868,7 @@ namespace DSWeb.Areas.CommMng.Models } } - public class 云港通实时接口_进口单票data + public class 云港通实时接口_进口单票data { public 船舶计划 containerShipScheme { get; set; } public 海关放行 customsRelease { get; set; } @@ -2044,14 +2048,14 @@ namespace DSWeb.Areas.CommMng.Models { public ContactListItem() { } - public ContactListItem(info_client_contact_mb contact) + public ContactListItem(info_client_contact_mb contact) { roleCode = ""; roleName = ""; name = contact.SHOWNAME; tel = contact.TEL; - email=contact.EMAIL; - qq=contact.QQ; + email = contact.EMAIL; + qq = contact.QQ; sort = 0; remark = remark; } @@ -2105,16 +2109,16 @@ namespace DSWeb.Areas.CommMng.Models public DJY_InfoClient() { } - public DJY_InfoClient(MsClient headData) + public DJY_InfoClient(MsClient headData) { var cdc = new CommonDataContext(); var banklist = cdc.info_client_bank.Where(x => x.LINKID == headData.GID).ToList(); - if (banklist != null && banklist.Count > 0 ) { + if (banklist != null && banklist.Count > 0) { - if (banklist.Exists(x => x.CURRENCY == "RMB")) + if (banklist.Exists(x => x.CURRENCY == "RMB")) { var rmbbank = banklist.First(x => x.CURRENCY == "RMB"); rmbBank = rmbbank.BANKNAME; @@ -2168,7 +2172,7 @@ namespace DSWeb.Areas.CommMng.Models // doc = headData.DOC; // docid = user.GID; //} - doc= headData.DOC; + doc = headData.DOC; docid = getUserId(headData.DOC); } if (!string.IsNullOrWhiteSpace(headData.SALE)) @@ -2221,9 +2225,9 @@ namespace DSWeb.Areas.CommMng.Models contactList = new List(); - if (CurrcontactList != null && CurrcontactList.Count > 0) + if (CurrcontactList != null && CurrcontactList.Count > 0) { - + foreach (var contact in CurrcontactList) { var djycontact = new ContactListItem(contact); contactList.Add(djycontact); @@ -2413,17 +2417,17 @@ namespace DSWeb.Areas.CommMng.Models public DJY_VesselVoyno() { } - public DJY_VesselVoyno(code_voynoModel head,string _carrier="", string _carrierid = "") + public DJY_VesselVoyno(code_voynoModel head, string _carrier = "", string _carrierid = "") { bsno = head.VOID; id = 0; vessel = head.VESSEL; voyno = head.VOYNO; - var _portload= MsOpSeaeEdiPortDAL.GetPortEDI_DJY(head.PORTLOAD); + var _portload = MsOpSeaeEdiPortDAL.GetPortEDI_DJY(head.PORTLOAD); if (_portload != null && _portload.Count > 0) { portLoading = _portload[0].PORTDISCHARGE; - portLoadingId= _portload[0].EDICODE; + portLoadingId = _portload[0].EDICODE; } var _ENTREPORT = MsOpSeaeEdiPortDAL.GetPortEDI_DJY(head.ENTREPORT); if (_ENTREPORT != null && _ENTREPORT.Count > 0) @@ -2580,4 +2584,1239 @@ namespace DSWeb.Areas.CommMng.Models } #endregion + + #region 向大简云上传用实体类 + public class CtnDetailInputsItem + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public int ctnid { get; set; } + /// + /// + /// + public int pkgs { get; set; } + /// + /// + /// + public string kindpkgs { get; set; } + /// + /// + /// + public int kgs { get; set; } + /// + /// + /// + public int cbm { get; set; } + /// + /// + /// + public string hscode { get; set; } + /// + /// + /// + public string marks { get; set; } + /// + /// + /// + public string description { get; set; } + /// + /// + /// + public string remark { get; set; } + } + + public class CtnInputsItem + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public int billid { get; set; } + /// + /// + /// + public string ctncode { get; set; } + /// + /// + /// + public string ctnall { get; set; } + /// + /// + /// + public int ctnnum { get; set; } + /// + /// + /// + public int teu { get; set; } + /// + /// + /// + public string cntrno { get; set; } + /// + /// + /// + public string sealno { get; set; } + /// + /// + /// + public int pkgs { get; set; } + /// + /// + /// + public string kindpkgs { get; set; } + /// + /// + /// + public int kgs { get; set; } + /// + /// + /// + public int cbm { get; set; } + /// + /// + /// + public int tareweight { get; set; } + /// + /// + /// + public string ctnstatus { get; set; } + /// + /// + /// + public string weightype { get; set; } + /// + /// + /// + public int weighkgs { get; set; } + /// + /// + /// + public string weighattn { get; set; } + /// + /// + /// + public string vgmconncom { get; set; } + /// + /// + /// + public string weightel { get; set; } + /// + /// + /// + public string weighdate { get; set; } + /// + /// + /// + public string vgmaddr { get; set; } + /// + /// + /// + public string vgmemail { get; set; } + /// + /// + /// + public string remark { get; set; } + /// + /// + /// + public List ctnDetailInputs { get; set; } + } + + public class BookingEDIExt + { + /// + /// + /// + public string weiTuoFang { get; set; } + /// + /// + /// + public string sendCode { get; set; } + /// + /// + /// + public string receiveCode { get; set; } + /// + /// + /// + public string notifyCdoe { get; set; } + /// + /// + /// + public string salerCode { get; set; } + /// + /// + /// + public string masterBolIndicator { get; set; } + /// + /// + /// + public string emanifestHbl { get; set; } + /// + /// + /// + public string consigneeEdiCode { get; set; } + /// + /// + /// + public string shipperEdiCode { get; set; } + /// + /// + /// + public string ediAttn { get; set; } + /// + /// + /// + public string ediAttnTel { get; set; } + /// + /// + /// + public string ediAttnMail { get; set; } + /// + /// + /// + public string amsConsignee { get; set; } + /// + /// + /// + public string amsNotifyParty { get; set; } + /// + /// + /// + public string opEName { get; set; } + /// + /// + /// + public string opTel { get; set; } + /// + /// + /// + public string opEmail { get; set; } + /// + /// + /// + public string acihbl { get; set; } + /// + /// + /// + public string s0CC0C { get; set; } + /// + /// + /// + public string goodsName { get; set; } + /// + /// + /// + public string masterBolIndicatorName { get; set; } + /// + /// + /// + public string salerCodeName { get; set; } + /// + /// + /// + public string ckhi { get; set; } + /// + /// + /// + public string cncm { get; set; } + /// + /// + /// + public string wncm { get; set; } + /// + /// + /// + public string orderRemark { get; set; } + /// + /// + /// + public string exRemark1 { get; set; } + /// + /// + /// + public string exRemark2 { get; set; } + /// + /// + /// + public string exRemark3 { get; set; } + /// + /// + /// + public string exRemark4 { get; set; } + /// + /// + /// + public int kingTareweight { get; set; } + /// + /// + /// + public string cnptNo { get; set; } + /// + /// + /// + public string xmcywy { get; set; } + /// + /// + /// + public string emcNameAccount { get; set; } + } + + public class ExtendState + { + /// + /// + /// + public int id { get; set; } + /// + /// + /// + public int bookingId { get; set; } + /// + /// + /// + public int noApply { get; set; } + /// + /// + /// + public int applyNoPrint { get; set; } + /// + /// + /// + public int print { get; set; } + /// + /// + /// + public string isLockBooking { get; set; } + /// + /// + /// + public string txxpBeginTime { get; set; } + /// + /// + /// + public string txxpEndTime { get; set; } + /// + /// + /// + public string txxpPdfUrl { get; set; } + } + + public class DjyShippingOrder + { + /// + /// 主键 + /// + public int id { get; set; } + /// + /// + /// + public string bsno { get; set; } + /// + /// + /// + public string bsstatus { get; set; } + /// + /// + /// + public string bsstatusname { get; set; } + /// + /// + /// + public string bsdate { get; set; } + /// + /// + /// + public string mblno { get; set; } + /// + /// + /// + public string hblno { get; set; } + /// + /// 业务编号 + /// + public string bookingno { get; set; } + /// + /// 合约号 + /// + public string contractno { get; set; } + /// + /// 客户合同号 + /// + public string servicecontractno { get; set; } + /// + /// + /// + public string shipperid { get; set; } + /// + /// + /// + public string consigneeid { get; set; } + /// + /// + /// + public string notifypartyid { get; set; } + /// + /// + /// + public string shipper { get; set; } + /// + /// + /// + public string consignee { get; set; } + /// + /// + /// + public string notifyparty { get; set; } + /// + /// + /// + public string notifypartY2 { get; set; } + /// + /// + /// + public string yardid { get; set; } + /// + /// + /// + public string yard { get; set; } + /// + /// + /// + public string vesselid { get; set; } + /// + /// + /// + public string vessel { get; set; } + /// + /// + /// + public string voyno { get; set; } + /// + /// + /// + public string voynoinner { get; set; } + /// + /// + /// + public string closingdate { get; set; } + /// + /// + /// + public string closedocdate { get; set; } + /// + /// + /// + public string closevgmdate { get; set; } + /// + /// + /// + public string placereceiptid { get; set; } + /// + /// + /// + public string placereceipt { get; set; } + /// + /// + /// + public string portloadid { get; set; } + /// + /// + /// + public string portload { get; set; } + /// + /// + /// + public string portdischargeid { get; set; } + /// + /// + /// + public string portdischarge { get; set; } + /// + /// + /// + public string placedeliveryid { get; set; } + /// + /// + /// + public string placedelivery { get; set; } + /// + /// + /// + public string destinationid { get; set; } + /// + /// + /// + public string destination { get; set; } + /// + /// + /// + public string nobill { get; set; } + /// + /// + /// + public string copynobill { get; set; } + /// + /// + /// + public string issuetype { get; set; } + /// + /// + /// + public string issuedate { get; set; } + /// + /// + /// + public string issueplaceid { get; set; } + /// + /// + /// + public string issueplace { get; set; } + /// + /// + /// + public string blfrt { get; set; } + /// + /// + /// + public string prepardat { get; set; } + /// + /// + /// + public string payableat { get; set; } + /// + /// + /// + public string service { get; set; } + /// + /// + /// + public string marks { get; set; } + /// + /// + /// + public string hscode { get; set; } + /// + /// + /// + public string description { get; set; } + /// + /// + /// + public int pkgs { get; set; } + /// + /// + /// + public string kindpkgs { get; set; } + /// + /// + /// + public int kgs { get; set; } + /// + /// + /// + public int cbm { get; set; } + /// + /// + /// + public string totalno { get; set; } + /// + /// + /// + public string cntrtotal { get; set; } + /// + /// + /// + public string carrierid { get; set; } + /// + /// + /// + public string carrier { get; set; } + /// + /// + /// + public string cargoid { get; set; } + /// + /// + /// + public string dclass { get; set; } + /// + /// + /// + public string dunno { get; set; } + /// + /// + /// + public string dpage { get; set; } + /// + /// + /// + public string dlabel { get; set; } + /// + /// + /// + public string linkman { get; set; } + /// + /// + /// + public string dtel { get; set; } + /// + /// + /// + public string tempid { get; set; } + /// + /// + /// + public string tempset { get; set; } + /// + /// + /// + public string reeferf { get; set; } + /// + /// + /// + public string humidity { get; set; } + /// + /// + /// + public string tempmin { get; set; } + /// + /// + /// + public string tempmax { get; set; } + /// + /// + /// + public string iscontainersoc { get; set; } + /// + /// + /// + public string soremark { get; set; } + /// + /// + /// + public string siremark { get; set; } + /// + /// + /// + public string yardremark { get; set; } + /// + /// + /// + public string compid { get; set; } + /// + /// + /// + public string compname { get; set; } + /// + /// + /// + public string shippername { get; set; } + /// + /// + /// + public string shipperaddR1 { get; set; } + /// + /// + /// + public string shipperaddR2 { get; set; } + /// + /// + /// + public string shipperaddR3 { get; set; } + /// + /// + /// + public string shippercity { get; set; } + /// + /// + /// + public string shipperprovince { get; set; } + /// + /// + /// + public string shipperpostcode { get; set; } + /// + /// + /// + public string shippercountry { get; set; } + /// + /// + /// + public string shipperattn { get; set; } + /// + /// + /// + public string shippertel { get; set; } + /// + /// + /// + public string consigneename { get; set; } + /// + /// + /// + public string consigneeaddR1 { get; set; } + /// + /// + /// + public string consigneeaddR2 { get; set; } + /// + /// + /// + public string consigneeaddR3 { get; set; } + /// + /// + /// + public string consigneecity { get; set; } + /// + /// + /// + public string consigneeprovince { get; set; } + /// + /// + /// + public string consigneepostcode { get; set; } + /// + /// + /// + public string consigneercountry { get; set; } + /// + /// + /// + public string consigneeattn { get; set; } + /// + /// + /// + public string consigneetel { get; set; } + /// + /// + /// + public string notifypartyname { get; set; } + /// + /// + /// + public string notifypartyaddR1 { get; set; } + /// + /// + /// + public string notifypartyaddR2 { get; set; } + /// + /// + /// + public string notifypartyaddR3 { get; set; } + /// + /// + /// + public string notifypartycity { get; set; } + /// + /// + /// + public string notifypartyprovince { get; set; } + /// + /// + /// + public string notifypartypostcode { get; set; } + /// + /// + /// + public string notifypartycountry { get; set; } + /// + /// + /// + public string notifypartyattn { get; set; } + /// + /// + /// + public string notifypartytel { get; set; } + /// + /// + /// + public string pono { get; set; } + /// + /// + /// + public string opid { get; set; } + /// + /// + /// + public string docid { get; set; } + /// + /// + /// + public string op { get; set; } + /// + /// + /// + public string doc { get; set; } + /// + /// + /// + public string saleid { get; set; } + /// + /// + /// + public string sale { get; set; } + /// + /// + /// + public string custserviceid { get; set; } + /// + /// + /// + public string custservice { get; set; } + /// + /// + /// + public string customername { get; set; } + /// + /// + /// + public string forwarder { get; set; } + /// + /// + /// + public string shipagency { get; set; } + /// + /// + /// + public string customser { get; set; } + /// + /// + /// + public string trucker { get; set; } + /// + /// + /// + public string agentid { get; set; } + /// + /// + /// + public int customerid { get; set; } + /// + /// + /// + public string forwarderid { get; set; } + /// + /// + /// + public string shipagencyid { get; set; } + /// + /// + /// + public string customserid { get; set; } + /// + /// + /// + public string truckerid { get; set; } + /// + /// + /// + public string agentname { get; set; } + /// + /// + /// + public string weituo { get; set; } + /// + /// + /// + public string consigneedooraddr { get; set; } + /// + /// + /// + public string shipperdooraddr { get; set; } + /// + /// + /// + public string scaccode { get; set; } + /// + /// + /// + public string itncode { get; set; } + /// + /// + /// + public string prepardatid { get; set; } + /// + /// + /// + public string payableatid { get; set; } + /// + /// + /// + public string custno { get; set; } + /// + /// + /// + public string transportid { get; set; } + /// + /// + /// + public string transport { get; set; } + /// + /// + /// + public string thirdpayaddr { get; set; } + /// + /// + /// + public string yardcontract { get; set; } + /// + /// + /// + public string yardcontracttel { get; set; } + /// + /// + /// + public string yardcontractemail { get; set; } + /// + /// + /// + public string feeself { get; set; } + /// + /// + /// + public string lanecode { get; set; } + /// + /// + /// + public string lanename { get; set; } + /// + /// + /// + public string freightpayer { get; set; } + /// + /// + /// + public int parentId { get; set; } + /// + /// + /// + public List ctnInputs { get; set; } + /// + /// + /// + public BookingEDIExt bookingEDIExt { get; set; } + /// + /// + /// + public string goodscode { get; set; } + /// + /// + /// + public string goodsname { get; set; } + /// + /// + /// + public string pkgstotal { get; set; } + /// + /// + /// + public string kgstotal { get; set; } + /// + /// + /// + public string cbmtotal { get; set; } + /// + /// + /// + public string routeid { get; set; } + /// + /// + /// + public string route { get; set; } + /// + /// + /// + public string warehouse { get; set; } + /// + /// + /// + public string warehouseID { get; set; } + /// + /// + /// + public string epCode { get; set; } + /// + /// + /// + public string lineName { get; set; } + /// + /// + /// + public string dzRemark { get; set; } + /// + /// + /// + public string czRemark { get; set; } + /// + /// + /// + public string tmblno { get; set; } + /// + /// + /// + public string shippingMethod { get; set; } + /// + /// + /// + public string lineManage { get; set; } + /// + /// + /// + public string lineManageID { get; set; } + /// + /// + /// + public string zhanCangFlag { get; set; } + /// + /// + /// + public string sourceCode { get; set; } + /// + /// + /// + public string sourceName { get; set; } + /// + /// + /// + public string etd { get; set; } + /// + /// + /// + public string ygtETD { get; set; } + /// + /// + /// + public string atd { get; set; } + /// + /// + /// + public string eta { get; set; } + /// + /// + /// + public string startETA { get; set; } + /// + /// + /// + public string startATA { get; set; } + /// + /// + /// + public string middleETA { get; set; } + /// + /// + /// + public string middleETD { get; set; } + /// + /// + /// + public string middleATA { get; set; } + /// + /// + /// + public string middleATD { get; set; } + /// + /// + /// + public string ata { get; set; } + /// + /// + /// + public string shenQingXiangShi { get; set; } + /// + /// + /// + public string thirdPay { get; set; } + /// + /// + /// + public string thirdPayCode { get; set; } + /// + /// + /// + public string foreignAgent { get; set; } + /// + /// + /// + public string version { get; set; } + /// + /// + /// + public int ctrnLength { get; set; } + /// + /// + /// + public int ctrnWidth { get; set; } + /// + /// + /// + public int ctrnHeight { get; set; } + /// + /// + /// + public string portloadcode { get; set; } + /// + /// + /// + public string portdischargecode { get; set; } + /// + /// + /// + public string destinationcode { get; set; } + /// + /// + /// + public string frtcode { get; set; } + /// + /// + /// + public string servicecode { get; set; } + /// + /// + /// + public ExtendState extendState { get; set; } + /// + /// + /// + public string isSplit { get; set; } + /// + /// + /// + public int subOpId { get; set; } + /// + /// + /// + public string subOp { get; set; } + /// + /// + /// + public int spliT_OR_MERGE_FLAG { get; set; } + /// + /// + /// + public string erpCode { get; set; } + } + + public class DjySendOrderHelper + { + const string APIURL = "/DataSync/UploadOrderData"; + + private string apiname = "接收其它系统上传订舱数据"; + public DjyShippingOrder HeadOrder { get; set; } + + public MsOpSeae opseaeHead { get; set; } + + public List opseaeCtnList { get; set; } + + public DBResult CanSend { get; set; } + + private string SendUserId { get; set; } + + public DjySendOrderHelper() { } + + public DjySendOrderHelper(string BSNO,string USERID) + { + + SendUserId = USERID; + var condition = $" B.BSNO='{BSNO}'"; + opseaeHead = MsOpSeaeDAL.GetData(condition, USERID); + + var cdc = new CommonDataContext(); + + opseaeCtnList = cdc.OP_CTN.Where(x => x.BSNO == BSNO).ToList(); + + //var ctncondition = $" BSNO='{BSNO}'"; + //opseaeCtnList = MsOpSeaeDAL.GetBodyList(ctncondition); + + GetInfo(); + } + + public DjySendOrderHelper(MsOpSeae SeaeHead, string USERID) + { + SendUserId = USERID; + opseaeHead = SeaeHead; + var cdc = new CommonDataContext(); + + opseaeCtnList = cdc.OP_CTN.Where(x => x.BSNO == SeaeHead.BSNO).ToList(); + + //var ctncondition = $" BSNO='{BSNO}'"; + //opseaeCtnList = MsOpSeaeDAL.GetBodyList(ctncondition); + + GetInfo(); + } + + public void GetInfo() + { + HeadOrder=new DjyShippingOrder(); + + HeadOrder = AutoMapperHelper.MapTo(opseaeHead); + + HeadOrder.erpCode = opseaeHead.CUSTNO; + + HeadOrder.placereceipt = BasicDataRefDAL.GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(HeadOrder.placereceipt, "DJY"); + HeadOrder.portload = BasicDataRefDAL.GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(HeadOrder.portload, "DJY"); + HeadOrder.portdischarge = BasicDataRefDAL.GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(HeadOrder.portdischarge, "DJY"); + HeadOrder.description = BasicDataRefDAL.GetPortEDICODEByPORTNAMEorPORTIDAndEDIName(HeadOrder.description, "DJY"); + + HeadOrder.ctnInputs = new List(); + + HeadOrder.ctnInputs = AutoMapperHelper.MapToList(opseaeCtnList); + + foreach (var ctn in HeadOrder.ctnInputs) + { + ctn.ctnall = BasicDataRefDAL.GetCtnEDICODEByCtnallAndEDIName(ctn.ctnall, "DJY"); + } + } + + public DBResult GetCanSend() + { + CanSend.OK(); + + return CanSend; + } + + public DBResult DoSend() + { + var result = new DBResult(); + try + { + var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'"); + if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE)) + { + BasicDataRefDAL.SaveLog(HeadOrder,SendUserId,"向大简云发订舱","发送"); + + var strJson = Newtonsoft.Json.JsonConvert.SerializeObject(HeadOrder); + + result = BasicDataRefDAL.SendToDJY(APIURL, strJson, SendUserId); + + //string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + APIURL, strJson); + + BasicDataRefDAL.SaveLog(HeadOrder, SendUserId, "向大简云发订舱", "返回"); + result.OK(); + } + + + return result; + } + catch (Exception ex) + { + + return result; + } + finally { + + } + } + } + + #endregion } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index 544725bf..67cb5bb9 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -1495,7 +1495,7 @@ namespace DSWeb.MvcShipping.Controllers //{ var djylist = new List(); djylist.Add(headData); - MsOpSeaeEdiPortDAL.SendToDJY(djylist, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(djylist, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); //} if (result.Success) { @@ -4315,7 +4315,7 @@ namespace DSWeb.MvcShipping.Controllers MsOpStatusNewDAL dal = new MsOpStatusNewDAL(); dal.UpdateMainStatus(bsnos, 4, uname); } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; @@ -4681,7 +4681,7 @@ namespace DSWeb.MvcShipping.Controllers // result.Success = false; // result.Message = aFtpWeb.err; //} - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } else { @@ -5025,7 +5025,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } else @@ -5194,7 +5194,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } else @@ -5969,7 +5969,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } else { @@ -7507,7 +7507,7 @@ namespace DSWeb.MvcShipping.Controllers } } - MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"])); + MsOpSeaeEdiPortDAL.SendToDJY(headList, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"])); } catch diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs index a17f99ce..db56f89c 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeCtnEdi/MsCodeCtnEdiDAL.cs @@ -7,6 +7,7 @@ using DSWeb.MvcShipping.Models.MsCodeAfrEdi; using Microsoft.Practices.EnterpriseLibrary.Data; using DSWeb.Areas.CommMng.Models; using HcUtility.Comm; +using Kingdee.BOS.WebApi.Client.Utils; namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi @@ -69,19 +70,6 @@ namespace DSWeb.MvcShipping.DAL.MsCodeCtnEdi return result; } - public static string GetCustEdiNameByName(string CUSTOMERNAME, string EDINAME) - { - var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'"; - var result = GetCustList(condition); - - if (result != null && result.Count > 0) - { - return result[0].CTN; - } - else { - return CUSTOMERNAME; - } - } static public List GetPkgsList(string strCondition, string sort = null) diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs index 589c1e9c..e823d2aa 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeae/MsOpSeaeEdiPortDAL.cs @@ -35,6 +35,8 @@ using System.Runtime.Remoting.Messaging; using DSWeb.Common.DB; using System.Web; using WinSCP; +using System.Configuration; +//using DSWeb.Areas.CommMng.Models; namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL { @@ -49325,13 +49327,68 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL #region 上传大简云 - public static DBResult SendToDJY(List headData, string companyid) + public static DBResult SendToDJY(List headData, string companyid,string USERID) { var result = new DBResult(); var DJYUPDATE = MsSysParamSetDAL.GetData("PARAMNAME='DJYUPDATE'"); if (DJYUPDATE.PARAMVALUE != "1") return result; try { + var usenew = false; + + var haveconfig = new DBResult(); + + BasicDataRefDAL.CheckWebconfig("DjyNewShippingOrder",ref haveconfig); + + if (haveconfig.Success) { + var 使用大简云新订舱上传接口 = ConfigurationManager.AppSettings["DjyNewShippingOrder"]; + + if (使用大简云新订舱上传接口 == "true") + { + usenew = true; + } + else + { + + } + } + + //T_ALL_DA T_ALL_DA = new T_ALL_DA(); + //string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'"); + //var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'"); + //if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE)) + //{ + // var orderlist = CreateEdiDjy(headData); + // var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist }); + // string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson); + //} + + if (!usenew) { + return SendToDJY_OLD(headData, companyid); + } + + if (usenew) + { + return SendToDJY_NEW(headData, companyid,USERID); + } + + } + catch(Exception e) + { + BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误"); + + + } + + return result; + } + + private static DBResult SendToDJY_OLD(List headData, string companyid) + { + var result = new DBResult(); + + try { + T_ALL_DA T_ALL_DA = new T_ALL_DA(); string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'"); var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'"); @@ -49340,9 +49397,47 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL var orderlist = CreateEdiDjy(headData); var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist }); string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson); + result.OK(); } } - catch(Exception e) + catch (Exception e) + { + BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误"); + } + + return result; + } + + private static DBResult SendToDJY_NEW(List headData, string companyid,string USERID) + { + var result = new DBResult(); + + try + { + + //T_ALL_DA T_ALL_DA = new T_ALL_DA(); + //string strCompanyName = T_ALL_DA.GetStrSQL("FULLNAME", "select top 1 FULLNAME from [company] where gid='" + companyid + "'"); + //var DJYURL = MsSysParamSetDAL.GetData("PARAMNAME='DJYURL'"); + //if (!string.IsNullOrEmpty(DJYURL.PARAMVALUE)) + //{ + // var orderlist = CreateEdiDjy(headData); + // var strJson = JsonConvert.SerializeObject(new { COMPANY_NAME = strCompanyName, BOOKINGS = orderlist }); + // string rtn = WebRequestHelper.DoPost(DJYURL.PARAMVALUE + "/booking/ReceiveBookingData", strJson); + // result.OK(); + //} + + foreach (var head in headData) + { + var hp = new DSWeb.Areas.CommMng.Models.DjySendOrderHelper(head, USERID); + + var cansend = hp.GetCanSend(); + + if (cansend.Success) { + hp.DoSend(); + } + } + } + catch (Exception e) { BasicDataRefDAL.SaveLog(JsonConvert.SerializeObject(e), "", "订舱上传大简云", "错误"); } @@ -49350,6 +49445,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL return result; } + public static bool DeductionFee(string _MBLNO, string bsType) { string KFCUSTCODE =MsSysParamSetDAL.GetData("PARAMNAME='KFCUSTCODE'").PARAMVALUE; diff --git a/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs b/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs index 3b5d9555..57cb4462 100644 --- a/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs @@ -747,13 +747,13 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL // result.SetErrorInfo($"{head.INPUTBY} 此用户基本信息当中没有配置【大简云UID】"); //} - CheckWebconfig("SERVICEBILL", ref result); - CheckWebconfig("SERVICEBILLCompanyid", ref result); - CheckWebconfig("SERVICEBILL_URL", ref result); - CheckWebconfig("SERVICEBILL_MQUri", ref result); - CheckWebconfig("SERVICEBILL_QueuePrefix", ref result); + BasicDataRefDAL.CheckWebconfig("SERVICEBILL", ref result); + BasicDataRefDAL.CheckWebconfig("SERVICEBILLCompanyid", ref result); + BasicDataRefDAL.CheckWebconfig("SERVICEBILL_URL", ref result); + BasicDataRefDAL.CheckWebconfig("SERVICEBILL_MQUri", ref result); + BasicDataRefDAL.CheckWebconfig("SERVICEBILL_QueuePrefix", ref result); - CheckWebconfig("DS7PATH", ref result); + BasicDataRefDAL.CheckWebconfig("DS7PATH", ref result); var 第三方账号 = GetThirdPartyInfo(head); @@ -769,14 +769,14 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL } - private static void CheckWebconfig(string itemname,ref DBResult result) - { - var item = ConfigurationManager.AppSettings[itemname]; - if (string.IsNullOrWhiteSpace(item)) - { - result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目"); - } - } + //private static void CheckWebconfig(string itemname,ref DBResult result) + //{ + // var item = ConfigurationManager.AppSettings[itemname]; + // if (string.IsNullOrWhiteSpace(item)) + // { + // result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目"); + // } + //} public static DBResult RefreshYunZong(string BSNO, string USERID) {