diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index fbdb5f93..ca322ea3 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -24,6 +24,15 @@ namespace DSWeb.Common.DB //public string PARAMVALUE2 { get; set; } //public string PARAMVALUE3 { get; set; } //public string PARAMVALUE4 { get; set; } + + public sys_param_set_md() { } + + public sys_param_set_md(string paramname,string description) + { + GID = Guid.NewGuid().ToString(); + PARAMNAME = paramname; + PARAMDESCRIPTION = description; + } } [Table("sys_parameter_value")] @@ -3712,6 +3721,12 @@ namespace DSWeb.Common.DB [NotMapped] public string OT4 { get; set; } + public string CangDanShiJian { get; set; } + public string HaiFangShiJian { get; set; } + public string TiHuo { get; set; } + public string TiHuoInfo { get; set; } + public string FanKong { get; set; } + public string FanKongInfo { get; set; } public class SearchParam { public string BSNO { get; set; } = ""; diff --git a/DSWeb.Common/DB/EDIFTPInfo.cs b/DSWeb.Common/DB/EDIFTPInfo.cs index 91889de4..439371ca 100644 --- a/DSWeb.Common/DB/EDIFTPInfo.cs +++ b/DSWeb.Common/DB/EDIFTPInfo.cs @@ -73,7 +73,7 @@ namespace DSWeb.Common.DB public string CTNCODE { get; set; } public string SIZE { get; set; } public string CTN { get; set; } - public int? CTNNUM { get; set; } + public int? CTNNUM { get; set; } public int? TEU { get; set; } public string CTNALL { get; set; } public string CNTRNO { get; set; } @@ -122,6 +122,30 @@ namespace DSWeb.Common.DB public string PCTN_ID { get; set; } public string ISTEMP { get; set; } public long? DJYCTNID { get; set; } + + public op_ctn_md() { } + + public op_ctn_md(string _BSNO) + { + CTN_ID = Guid.NewGuid().ToString(); + BSNO= _BSNO; + CTNNUM = 0; + TEU = 0; + PKGS = 0; + KGS = 0; + CBM = 0; + TAREWEIGHT = 0; + WEIGHKGS = 0; + TRUCKFEE = 0; + STORAGEPRICE = 0; + STORAGEFEE = 0; + FREECTNDAY = 0; + CTNDAY = 0; + CTNPRICE = 0; + CTNFEE = 0; + ISWMS = false; + DJYCTNID = 0; + } } diff --git a/DSWeb/Areas/Account/Controllers/Chfee_invoice_HangXinController.cs b/DSWeb/Areas/Account/Controllers/Chfee_invoice_HangXinController.cs index 9dce314e..d392d7f8 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_invoice_HangXinController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_invoice_HangXinController.cs @@ -2146,14 +2146,14 @@ namespace DSWeb.Areas.Account.Controllers //此时head.billUuid如果不为空 代表已有红字申请单 if (!string.IsNullOrWhiteSpace(head.billUuid))//&& { - redhead.BILLNO = redhead.billUuid; - + //redhead.BILLNO = redhead.billUuid; + redhead.GID = redhead.billUuid; var _r = hx.ReadRedConfirm(ref redhead, detailList); if (!_r.Success) { - if (_r.Message != "红字确认单申请中") { + if (_r.Message != "红字确认单申请中" && _r.Message != "提交失败,请先完成扫脸身份认证后再试。") { head.billUuid = ""; modb.Save(head); } @@ -2227,11 +2227,11 @@ namespace DSWeb.Areas.Account.Controllers } else { - //head.billUuid如果不为空 代表还没发红字申请单 + //head.billUuid如果为空 代表还没发红字申请单 //获取红票信息并发出 redhead.BILLNO = PubSysDAL.GetBillNo("0308"); - head.billUuid = redhead.BILLNO; + head.billUuid = redhead.GID.Replace("-",""); result = hx.PostRedConfirm(redhead, ref head, detailList,Session); diff --git a/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs b/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs index 96b9df1a..de292650 100644 --- a/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs +++ b/DSWeb/Areas/Account/Models/Chfee_invoice_HangXin/Chfee_Invoice.cs @@ -946,8 +946,10 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin /// /// 红字确认单申请号,需要保持唯一,不传的话系统自动生成一个; /// 此处使用蓝票的billno + /// 20240423 改为使用红票的GID 并去除- + /// 在初次冲红时记录在蓝票的billUuid /// - public string billId { get { return ChInvoice_HangXin.BILLNO; } } + public string billId { get { return ChInvoice_HangXin.GID.Replace("-",""); } } /// /// 对应蓝票发票种类: bs:电子发票(增值税专用发票), pc:电子发票(普通发票),es:全电纸质发票(增值税专用发票), ec:全电纸质发票(普通发票 @@ -1083,8 +1085,10 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin public string billStatus { get; set; } /// /// 红字确认单申请号 ds7当中红票的billno + /// 20240423 改为使用红票的GID 并去除- + /// 在初次冲红时记录在蓝票的billUuid /// - public string billId { get { return ChInvoice_HangXin.BILLNO; } } + public string billId { get { return ChInvoice_HangXin.billUuid; } } /// /// 红字确认单编号 /// @@ -2320,6 +2324,130 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin } } + public DBResult ReadRedInvoice(ChInvoice_HangXin head) + { + if (string.IsNullOrEmpty(head.INVOICESERIALNUM) && !head.全电发票()) + { + var result = new DBResult { Success = false, Message = "还未成功进行平台开票,无可读数据", Data = "" }; + return result; + } + + string method = "nuonuo.OpeMplatform.queryInvoiceResult"; + var json = "{" + "\"serialNos\":[\"" + head.INVOICESERIALNUM + "\"]," + "\"orderNo\":[]," + "\"isOfferInvoiceDetail\":0 }"; + + + if (string.IsNullOrWhiteSpace(head.INVOICESERIALNUM)) + { + //如果流水号为空 则改为按业务编号读取 + method = "nuonuo.OpeMplatform.queryInvoiceResult"; + json = "{" + "\"orderNos\":[\"" + head.GID.Replace("-","") + "\"]," + "\"serialNos\":[]," + "\"isOfferInvoiceDetail\":0 }"; + } + + //读取业务 + //string method = "nuonuo.electronInvoice.querySerialNum"; + //var json = "{" + "\"orderNo\":[\"" + head.BILLNO + "\"]" + "}"; + + + BasicDataRefDAL.SaveLog("URL=" + URL + ";appKey=" + appKey + ";appSecret=" + appSecret + ";accessToken=" + accessToken + ";taxnum=" + taxnum + ";method=" + method + ";content=" + json, "诺诺平台", "读取发票信息", "发送值"); + string _r = NNOpenSDK.sendPostSyncRequest(URL, getSendid(), appKey, appSecret, accessToken, taxnum, method, json); + BasicDataRefDAL.SaveLog(_r, "诺诺平台", "读取发票信息", "返回值"); + var _return = dealresponse_Read(_r); + + if (_return.code == "070101" || _return.code == "070301") + { + //appkey与token问题 需要重新认证 + //HangXinRequestHelper.clear(accessToken); + var result = new DBResult(false, "需要重新认证", null); + return result; + } + if (_return.code == "070302") + { + //appkey与token问题 需要重新认证 + //HangXinRequestHelper.clear(accessToken); + var result = new DBResult(false, "需要联系诺诺平台开通相关权限", null); + return result; + } + + + if (_return.code == "E0000") + { + //开票信息读取成功 + var returndate = new ChInvoice_HangXin(); + + if (!head.全电发票()) + { + returndate = ChinvoiceDAL.GetData("cm.INVOICESERIALNUM='" + head.INVOICESERIALNUM + "'"); + } + if (head.全电发票()) + { + returndate = ChinvoiceDAL.GetData("cm.BILLNO='" + head.BILLNO + "'"); + } + head = returndate; + + //var invoiceSerialNum = _return.result[0].invoiceSerialNum; + var info = _return.result[0]; + //立即调用读取发票信息的方法 将返回值设置进head 并保存 + //head.INVOICESERIALNUM = invoiceSerialNum; + head.INVOICECODE = info.invoiceCode; + head.INVOICENO = info.invoiceNo; + head.EINVOICESTATE = info.status; + head.INVOICEINFOURL = info.pdfUrl; + head.INVOICEPDFURL = info.pdfUrl; + + head.INVOICEMAKETIME = BasicDataRefDAL.Timestamp2Datetime(info.invoiceTime).ToString("yyyy-MM-dd HH:mm:ss"); + //if (!string.IsNullOrWhiteSpace(info.invoiceSerialNum)) + //{ + // head.INVOICESERIALNUM = info.invoiceSerialNum; + //} + //head.REMARK = head.REMARK.Replace(info.remark,"")+ info.remark; + + head.DbOperationType = DbOperationType.DbotUpd; + head.ModelUIStatus = "E"; + //head.INVOICEMAKETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + var modb = new ModelObjectDB(); + var result = modb.Save(head); + if (!result.Success) + return result; + + result.Message = info.statusMsg; + if (result.Message.IndexOf("失败") >= 0) + { + result.Success = false; + result.Message += ":" + info.failCause; + + //此处调用一次重推 + var hx = getHelper(head); + hx.重推(head); + } + else + { + result.Message += ":" + info.failCause; + } + result.Data = head; + return result; + + } + else + { + var failCause = ""; + + try + { + var info = _return.result[0]; + failCause = "[" + info.failCause + "]"; + } + catch + { + + } + + var msg = _return.code + ":" + _return.describe + failCause; + var result = new DBResult { Success = false, Message = DSWeb.TruckMng.Helper.JsonConvert.Serialize(msg), Data = "" }; + return result; + + } + } + public DBResult 重推(ChInvoice_HangXin head) { @@ -2536,7 +2664,6 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin BasicDataRefDAL.SaveLog(rtn, "诺诺全电", "红字确认单", "返回值"); - var _return = DSWeb.TruckMng.Helper.JsonConvert.Deserialize<红字申请单发送返回值>(rtn.Trim('"')); var result = new DBResult(); diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js index ceea5f39..751a8d77 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js @@ -559,13 +559,19 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, { value: '1', name: 'INVOICETYPE', flex: 0, hidden: true, margins: '0' }, - { - fieldLabel: Zi.LAN.BIANHAO, - readOnly: true, - hidden: true, - flex: 1.5, - name: 'BILLNO' - }, + { + fieldLabel: "billUuid", + hidden: true, + readOnly: true, + name: 'billUuid' + }, + { + fieldLabel: Zi.LAN.BIANHAO, + readOnly: true, + hidden: true, + flex: 1.5, + name: 'BILLNO' + }, { fieldLabel: Zi.LAN.INVOICETYPEREF, readOnly: true, @@ -607,7 +613,7 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, { flex: 1, readOnly: true, name: 'ISDELETE' - } + } ] } ]//end items(fieldset 1) diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceModel.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceModel.js index b1aaf5dc..b4b44eff 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceModel.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceModel.js @@ -66,7 +66,10 @@ { name: 'PTORRED', type: 'string' }, { name: 'SETRED', type: 'string' }, { name: 'INVSHENNO', type: 'string' }, - { name: 'VOUNO', type: 'string' } + { name: 'VOUNO', type: 'string' }, + { name: 'billUuid', type: 'string' } + + ] }); diff --git a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs index ad6a17eb..868e296d 100644 --- a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs +++ b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs @@ -15,6 +15,13 @@ using DSWeb.Areas.MvcShipping.DB; using DSWeb.MvcShipping.Models.MsOpSeae; using DSWeb.Areas.MvcShipping.Models.Message.VGM; using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL; +using NPOI.SS.Formula.Functions; +using DSWeb.Areas.MvcShipping.Comm; +using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount; +using DSWeb.MvcShipping.Models.MsCwVouchersGl; +using DSWeb.Common.DB; +using System.Linq; +using DSWeb.MvcShipping.Models.MsSysParamSet; namespace DSWeb.Areas.CommMng.Models { @@ -1741,5 +1748,288 @@ namespace DSWeb.Areas.CommMng.Models + #endregion + + + #region 云港通实时接口 + + public class 云港通实时接口Helper { + public string user_key { get; set; } + public string user_secret { get; set; } + public string bno { get; set; } + public string web_user { get; set; } + public string web_psw { get; set; } + public string vessel { get; set; } + public string voyage { get; set; } + public string email { get; set; } + + public string ServerUrl { get; set; } + public virtual string apiurl { get; set; } + + + public DBResult GetUrl(string USERID) { + var result = new DBResult(); + result.OK(); + CommonDataContext commonData = new CommonDataContext(); + var pUserKey = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewUserKey"); + var pUserSecret = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewUserSecret"); + if (pUserKey == null || string.IsNullOrEmpty(pUserKey.PARAMVALUE) || pUserSecret == null || string.IsNullOrEmpty(pUserSecret.PARAMVALUE)) + { + result.SetErrorInfo("运踪爬虫用户KEY和SECRET参数未正确配置"); + } + else { + user_key = pUserKey.PARAMVALUE; + user_secret = pUserSecret.PARAMVALUE; + } + + var pServerUrl = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewServerUrl"); + if (pServerUrl == null || string.IsNullOrEmpty(pServerUrl.PARAMVALUE)) + { + result.SetErrorInfo("运踪爬虫服务地址参数未正确配置"); + } + else { + ServerUrl = pServerUrl.PARAMVALUE; + } + + var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='运港通' and USERID ='{USERID}' "); + if (!accCfg.HaveAccount()) + { + result.SetErrorInfo("需要为该用户在第三方账号中设置【运港通】的账号密码。"); + } + else { + web_user = accCfg.ACCOUNT; + web_psw = accCfg.ACCOUNTPSW; + } + return result; + } + + public void SetSearch(string _bno, string _vessel, string _voyage, string _email = "") + { + bno = _bno; + vessel = _vessel; + voyage = _voyage; + email = _email; + } + + public DBResult DoSend() + { + DBResult result = new DBResult(); + + var dic = new Dictionary(); + dic.Add("user_key", user_key); + dic.Add("user_secret", user_secret); + dic.Add("bno", bno); + dic.Add("web_user", web_user); + dic.Add("web_psw", web_psw); + dic.Add("vessel", vessel); + dic.Add("voyage", voyage); + dic.Add("email", email); + + var json = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(dic); + + var rtn= WebRequestHelper.DoPost(ServerUrl+apiurl, json, 10000); + result.OK("", rtn); + return result; + } + } + + public class 云港通实时接口_进口单票 : 云港通实时接口Helper + { + //public string apiurl { get; set; } = "/import/v1/ygt/single/vote"; + + public 云港通实时接口_进口单票() { + apiurl= "/import/v1/ygt/single/vote"; + } + } + + public class 云港通实时接口_结果 + { + public int? code { get; set; } + public virtual object data { get; set; } + public string msg { get; set; } + public string request { get; set; } + + public string getErrorName() { + if (code == 200) return "成功"; + if (code == 1000) return "查询失败, 没有查询到相关信息"; + if (code == 1001) return "参数错误,具体原因参照 msg"; + if (code == 1002) return "数据提交错误"; + if (code == 1003) return "权限错误"; + if (code == 999) return "内部未知错误"; + return code.ToString(); + } + } + + public class 云港通实时接口_进口单票data + { + public 船舶计划 containerShipScheme { get; set; } + public 海关放行 customsRelease { get; set; } + public List<进口原始舱单> originalInfos { get; set; } + public List<外理理货> tallyInfos { get; set; } + public List<提单放行> tdReleaseInfos { get; set; } + public List<进口码头信息> wharfInfos { get; set; } + } + + /// + /// 进口码头信息 + /// + public class 进口码头信息 + { + public string wharfName { get; set; } // 码头名称 + public string bno { get; set; } // 单号 + public string vesselCN { get; set; } // 中文船名 + public string vesselEN { get; set; } // 英文船名 + public string voyage { get; set; } // 航次 + public string boxStationCode { get; set; } // 箱站代码 + public string ctnNO { get; set; } // 箱号 + public string boxIS { get; set; } // 箱属 + public string boxSize { get; set; } // 箱尺寸 + public string boxPile { get; set; } // 箱型 + public string sealNO { get; set; } // 铅封号 + public string grossWeight { get; set; } // 整箱重 + public string bareWeight { get; set; } // 空重 + public string wharfPermit { get; set; } // 码头放行 + public string loadingPort { get; set; } // 装货港 + public string currentStatus { get; set; } // 当前状态 + public string entryCategory { get; set; } // 入港类别 + public string entryTime { get; set; } // 入港时间 + public string entryDetails { get; set; } // 入港明细 + public string clearanceCategory { get; set; } // 出港类别 + public string clearanceTime { get; set; } // 出港时间 + public string clearanceDetails { get; set; } // 出港明细 + public string stockpilingDays { get; set; } // 堆存天数 + public string geographicPosition { get; set; } // 地理位置 + public string foreignTrade { get; set; } // 内外贸 + public string dischargingPort { get; set; } // 卸货港 + public string destinationPort { get; set; } // 目的港 + } + /// + /// 进口原始舱单 + /// + public class 进口原始舱单 + { + public string bno { get; set; } // 提单号 + public string fbno { get; set; } // 分提单号 + public string vesselCN { get; set; } // 中文船名 + public string vesselEN { get; set; } // 英文船名 + public string voyage { get; set; } // 航次 + public string ctnNO { get; set; } // 箱号 + public string bareWeight { get; set; } // 空重 + public string boxSize { get; set; } // 箱尺寸 + public string boxPile { get; set; } // 箱型 + public string sealNO { get; set; } // 铅封号 + public string quantity { get; set; } // 件数 + public string weight { get; set; } // 重量 + public string volume { get; set; } // 体积 + } + /// + /// 外理理货 + /// + public class 外理理货 + { + public string bno { get; set; } // 提单号 + public string vesselEN { get; set; } // 英文船名 + public string voyage { get; set; } // 航次 + public string IMO { get; set; } // IMO + public string customsCode { get; set; } // 关区代码 + public string ctnNO { get; set; } // 箱号 + public string quantity { get; set; } // 件数 + public string weight { get; set; } // 重量 + public string volume { get; set; } // 体积 + public string sendTime { get; set; } // 发送时间 + public string receiptExplain { get; set; } // 回执说明 + public string receiptTime { get; set; } // 回执时间 + public string deletedMarker { get; set; } // 删除标志 + } + /// + /// 海关放行 + /// + public class 海关放行 + { + public string customsNO { get; set; } // 报关单号 + public string fbno { get; set; } // 分单号 + public string vesselEN { get; set; } // 英文船名 + public string voyage { get; set; } // 航次 + public string IMO { get; set; } // IMO + public string customsCode { get; set; } // 关区代码 + public string permitTime { get; set; } // 放行时间 + public string permitNum { get; set; } // 放行件数 + public string ctnNO { get; set; } // 箱号 + public string weight { get; set; } // 净重 + public string roughWeight { get; set; } // 毛重 + public string customsStatus { get; set; } // 海关状态 + public string permitType { get; set; } // 放行类别 + } + /// + /// 提单放行 + /// + public class 提单放行 + { + public string bno { get; set; } // 主单号 + public string vesselEN { get; set; } // 英文船名 + public string voyage { get; set; } // 航次 + public string IMO { get; set; } // IMO + public string vesselEnBranch { get; set; } // 支线英文船名 + public string voyageBranch { get; set; } // 支线航次 + public string customsNO { get; set; } // 报关单号 + public string permitTime { get; set; } // 放行时间 + public string permitNum { get; set; } // 放行件数 + public string ctnNO { get; set; } // 箱号 + public string weight { get; set; } // 净重 + public string roughWeight { get; set; } // 毛重 + public string customsStatus { get; set; } // 海关状态 + public string permitType { get; set; } // 放行类别 + } + /// + /// 集装箱船舶计划 字段说明 + /// + public class 船舶计划 + { + public string vesselCode { get; set; } //船名代码 + public string vesselCN { get; set; } //中文船名 + public string vesselEN { get; set; } //英文船名 + public string importVoyage { get; set; } //进口航次 + public string exportVoyage { get; set; } //出口航次 + public string estimatedArrivalTime { get; set; } //预计到港时间 + public string estimatedDepartureTime { get; set; } //预计离港时间 + public string actualArrivalTime { get; set; } //实际到港时间 ATA + public string actualDepartureTime { get; set; } //实际离港时间 + public string receivingStartTime { get; set; } //收箱开始时间 + public string receivingEndTime { get; set; } //收箱结束时间 + public string airlineCode { get; set; } //航线代码 + public string location { get; set; } //位置 + public string importAgency { get; set; } //进口代理 + public string arrivalStatus { get; set; } //抵港状态 + public string carrier { get; set; } //承运人 + public string airline { get; set; } //航线 + public string berth { get; set; } //泊位 + public string foreignTrade { get; set; } //内外贸 + public string IMO { get; set; } //IMO + } + + public class 云港通实时接口_集装箱进口空箱返场 : 云港通实时接口Helper + { + //public string apiurl { get; set; } = "/import/v1/ygt/box/empty_return"; + public 云港通实时接口_集装箱进口空箱返场() + { + apiurl = "/import/v1/ygt/box/empty_return"; + } + } + + + + public class 云港通实时接口_集装箱进口空箱返场data + { + public string bno { get; set; } // 单号 + public string ctnNO { get; set; } // 箱号 + public string boxSize { get; set; } // 尺寸 + public string boxType { get; set; } // 箱型 + public string actualRecStation { get; set; } // 还空场站 + public string returnCarNo { get; set; } // 还空车号 + public string emptyReturnTime { get; set; } // 还空时间 + public string stationConfirmFlag { get; set; } // 场站确认标志, '1'为以确认 + public string driverConfirmFlag { get; set; } // 司机确认标志, '1'为以确认 + } + #endregion } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index b89e31bd..bea40d75 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -8107,11 +8107,11 @@ namespace DSWeb.MvcShipping.Controllers return Json(resp); } - var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='青岛港物流信息网' and USERID ='{userid}') "); + var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='运港通' and USERID ='{userid}' "); if (!accCfg.HaveAccount()) { resp.Success = false; - resp.Message = "需要为该用户在第三方账号中设置【青岛港物流信息网】的账号密码。"; + resp.Message = "需要为该用户在第三方账号中设置【运港通】的账号密码。"; return Json(resp); } diff --git a/DSWeb/Areas/MvcShipping/Controllers/OP_SERVICEBILLController.cs b/DSWeb/Areas/MvcShipping/Controllers/OP_SERVICEBILLController.cs index c3e496b8..a44760a7 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/OP_SERVICEBILLController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/OP_SERVICEBILLController.cs @@ -61,6 +61,12 @@ namespace DSWeb.MvcShipping.Controllers var count = 0; + var canlogin = BasicDataRefDAL.CheckLogin(Session); + if (!canlogin.Success) + { + return (ContentResult)canlogin.Data; + } + var uid = Session["USERID"].ToString(); CommonDataContext cdc = new CommonDataContext(); var _user = cdc.VW_user.AsNoTracking().FirstOrDefault(u => u.USERID == uid); @@ -212,19 +218,16 @@ namespace DSWeb.MvcShipping.Controllers var seaefield = MsSoftSysTableDAL.GetDefTableDetailList("info_client"); foreach (var enumValue in seaefield) { - if (enumValue.FIELDNAME == "MBLNO" && headData.MBLNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户代码超长,字段长度限制" + enumValue.FIELDLEN; } - - if (enumValue.FIELDNAME == "CUSTNO" && headData.CUSTNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户简称超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "CUSTOMNO" && headData.CUSTOMNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户全称超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "CONTRACTNO" && headData.CONTRACTNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "英文全称超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "SERVICETYPE" && headData.SERVICETYPE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "地址超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "VESSEL" && headData.VESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "邮件地址超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "VOYNO" && headData.VOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "网址超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "FORWARDER" && headData.FORWARDER.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "TEL超长,字段长度限制" + enumValue.FIELDLEN; } - if (enumValue.FIELDNAME == "CARRIER" && headData.CARRIER.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "英文地址超长,字段长度限制" + enumValue.FIELDLEN; } - - if (enumValue.FIELDNAME == "CUSTOMERNAME" && headData.CUSTOMERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "负责人超长,字段长度限制" + enumValue.FIELDLEN; } - + if (enumValue.FIELDNAME == "MBLNO" && headData.MBLNO.Length > 25) { isPost = false; errorstr = "提单号超长,字段长度限制" + 25; } + + + //if (enumValue.FIELDNAME == "CUSTOMERNAME" && headData.CUSTOMERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "负责人超长,字段长度限制" + enumValue.FIELDLEN; } + + if (enumValue.FIELDNAME == "TEL" && headData.TEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "电话超长,字段长度限制" + enumValue.FIELDLEN; } + if (enumValue.FIELDNAME == "VESSEL" && headData.VESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船名超长,字段长度限制" + enumValue.FIELDLEN; } + if (enumValue.FIELDNAME == "VOYNO" && headData.VOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "航次超长,字段长度限制" + enumValue.FIELDLEN; } + if (enumValue.FIELDNAME == "REMARK" && headData.REMARK.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "备注超长,字段长度限制" + enumValue.FIELDLEN; } + } } @@ -270,6 +273,14 @@ namespace DSWeb.MvcShipping.Controllers // return BasicDataRefDAL.GetContentResult(canchange); //} + //不改变原值的字段 + headData.CangDanShiJian = oldheaddata.CangDanShiJian; + headData.HaiFangShiJian = oldheaddata.HaiFangShiJian; + headData.TiHuo = oldheaddata.TiHuo; + headData.TiHuoInfo = oldheaddata.TiHuoInfo; + headData.FanKong = oldheaddata.FanKong; + headData.FanKongInfo = oldheaddata.FanKongInfo; + BasicDataRefDAL.CopyProperties(headData, oldheaddata); @@ -429,6 +440,56 @@ namespace DSWeb.MvcShipping.Controllers return result; } + public ContentResult RefreshYunZong( string BSNOList) + { + var result = new DBResult(); + var canlogin = BasicDataRefDAL.CheckLogin(Session); + if (!canlogin.Success) + { + return (ContentResult)canlogin.Data; + } + + var count = 0; + + var uid = Session["USERID"].ToString(); + CommonDataContext cdc = new CommonDataContext(); + var _user = cdc.VW_user.AsNoTracking().FirstOrDefault(u => u.USERID == uid); + + var BSNOlist = new List(); + + BSNOlist = BSNOList.Split(',').ToList(); + + foreach (var BSNO in BSNOlist) + { + result=OP_SERVICEBILLDAL.RefreshYunZong(BSNO, uid); + if (!result.Success) { + break; + } + } + + return BasicDataRefDAL.GetContentResult(result); + } + + public ContentResult GetCtnList(string condition) + { + + var canlogin = BasicDataRefDAL.CheckLogin(Session); + if (!canlogin.Success) + { + return (ContentResult)canlogin.Data; + } + + var uid = Session["USERID"].ToString(); + + CommonDataContext cdc = new CommonDataContext(); + + var ctnlist = cdc.OP_CTN.AsNoTracking().Where(x => x.BSNO == condition); + + + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = ctnlist.Count(), data = ctnlist.ToList() }); + return new ContentResult() { Content = json }; + } + //private ContentResult DoSend_File(OP_SERVICEBILL_md head) //{ diff --git a/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs b/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs index 7846f58a..ce6fd754 100644 --- a/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/OP_SERVICEBILL/OP_SERVICEBILLDAL.cs @@ -38,6 +38,7 @@ using DSWeb.MvcShipping.Models.MsSysThirdPartyAccount; using System.Web.Mvc; using System.Reflection; using NPOI.SS.Formula.Functions; +using com.sun.org.apache.bcel.@internal.generic; //using java.lang; namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL @@ -46,7 +47,7 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL { #region 查询 - const string HeadSql = " SELECT BSNO,PARENTID,CORPID,SALECORPID,DEPT,SALEDEPT,SALE,BILLSTATUS,BSSTATUS,FEESTATS,MBLNO,CUSTNO,CUSTOMNO,CONTRACTNO,SERVICETYPE,INPUTBY,TEL,ACCDATE,BSDATE,MODIFIEDUSER,MODIFIEDTIME,ETA,ATA,VESSEL,VOYNO,FORWARDER,SHIPAGENCY,CARRIER,CUSTOMERNAME,FEE_1 ,FEE_2,REMARK,SERVICE,DJYID,''OT1,''OT2,''OT3,''OT4 FROM OP_SERVICEBILL where 1=1 "; + const string HeadSql = " SELECT BSNO,PARENTID,CORPID,SALECORPID,DEPT,SALEDEPT,SALE,BILLSTATUS,BSSTATUS,FEESTATS,MBLNO,CUSTNO,CUSTOMNO,CONTRACTNO,SERVICETYPE,INPUTBY,TEL,ACCDATE,BSDATE,MODIFIEDUSER,MODIFIEDTIME,ETA,ATA,VESSEL,VOYNO,FORWARDER,SHIPAGENCY,CARRIER,CUSTOMERNAME,FEE_1 ,FEE_2,REMARK,SERVICE,DJYID,''OT1,''OT2,''OT3,''OT4,CangDanShiJian,HaiFangShiJian,TiHuo,TiHuoInfo,FanKong,FanKongInfo FROM OP_SERVICEBILL where 1=1 "; public static List GetDataList(int start, int limit, string sort, string condition, VW_user_md userinfo, ref int count) @@ -92,18 +93,6 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL public static string GetDataListStr( string condition, VW_user_md userinfo) { - var cdc = new CommonDataContext(); - - var Condition = new OP_SERVICEBILL_md.SearchParam(); - try - { - Condition = JsonConvert.Deserialize(condition); - } - catch - { - - } - //range @@ -111,7 +100,7 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL //condition - var strCondition = ""; + var strCondition = condition; var sortstring = ""; @@ -190,7 +179,12 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL if (reader["DJYID"] != DBNull.Value) data.DJYID = Convert.ToInt64(reader["DJYID"]); - + data.CangDanShiJian = Convert.ToString(reader["CangDanShiJian"]); + data.HaiFangShiJian = Convert.ToString(reader["HaiFangShiJian"]); + data.TiHuo = Convert.ToString(reader["TiHuo"]); + data.TiHuoInfo = Convert.ToString(reader["TiHuoInfo"]); + data.FanKong = Convert.ToString(reader["FanKong"]); + data.FanKongInfo = Convert.ToString(reader["FanKongInfo"]); #endregion @@ -722,6 +716,211 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目"); } } + + public static DBResult RefreshYunZong(string BSNO, string USERID) + { + var result = new DBResult(); + + /* + ATA:云港通实时接口 进口单票查询-船舶计划 containerShipScheme里 actualArrivalTime + + 舱单:云港通实时接口 进口单票查询-进口原始舱单originalInfos + originalInfos 进口原始舱单 中 有数据(bno不为空) 即认为《有》舱单 + + 海放:云港通实时接口 进口单票查询-海关放行,有数据即代表有放行状态。(customsRelease 海关放行 中 permitTime | String | 放行时间) + + 提货:云港通实时接口 进口单票查询 wharfInfos(进口码头信息) + ( + wharfInfos 进口码头信息 中 + | clearanceCategory | String | 出港类别 | = "T" + + 时的 + + | clearanceTime | String | 出港时间 | + ) + + 返空:调用 集装箱进口空箱返场查询:(结果中的:emptyReturnTime | str | 还空时间) + */ + + //1 调用 云港通实时接口 进口单票查询 + + 云港通实时接口_进口单票 hp = new 云港通实时接口_进口单票(); + + result = hp.GetUrl(USERID); + if (!result.Success) { + return result; + } + + var cdc = new CommonDataContext(); + + var head = cdc.OP_SERVICEBILL.FirstOrDefault(x => x.BSNO == BSNO); + + if (head == null) { + result.SetErrorInfo("没有找到业务"); + return result; + } + + hp.SetSearch(head.MBLNO,head.VESSEL,head.VOYNO,""); + + result = hp.DoSend(); + + //2 处理返回的结果 + + if (!result.Success) return result; + + var 单票结果Head = JsonConvert.Deserialize<云港通实时接口_结果>(result.Data.ToString()); + + if (单票结果Head.code != 200) { + result.SetErrorInfo(单票结果Head.getErrorName()+":"+ 单票结果Head.msg); + return result; + } + + var 单票结果 = JsonConvert.Deserialize < 云港通实时接口_进口单票data>(单票结果Head.data.ToString()); + + //1.1 ATA + var ATAStr = 单票结果.containerShipScheme.actualArrivalTime; + if(!string.IsNullOrWhiteSpace(ATAStr)) + head.ATA = Convert.ToDateTime(ATAStr); + + //cdc.OP_SERVICEBILL.AddOrUpdate(head); + + //1.2 舱单 + if (单票结果.originalInfos != null && 单票结果.originalInfos.Count > 0) { + if (!string.IsNullOrWhiteSpace(单票结果.originalInfos[0].bno)) + { + head.CangDanShiJian = "已有舱单"; + } + else { + head.CangDanShiJian = ""; + } + } + + //1.3 海关放行 + if (单票结果.customsRelease!=null && !string.IsNullOrWhiteSpace( 单票结果.customsRelease.permitTime)) + { + head.HaiFangShiJian = 单票结果.customsRelease.permitTime; + } + + //1.4 提货 + if (单票结果.wharfInfos != null && 单票结果.wharfInfos.Count>0) + { + head.TiHuo = ""; + + if (单票结果.wharfInfos.Exists(x => x.clearanceCategory == "T")) { + + if (单票结果.wharfInfos.Exists(x => x.clearanceCategory != "T")) + { + head.TiHuo = "部分提货"; + } + else { + head.TiHuo = "已提货"; + } + + var currctnList = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList(); + + foreach (var item in 单票结果.wharfInfos) + { + //if (currctnList.Exists(x=>x.CNTRNO== item.ctnNO)) + + if (currctnList.Exists(x => x.CNTRNO == item.ctnNO)) + { + var currctn = currctnList.First(x=>x.CNTRNO == item.ctnNO); + if (item.clearanceCategory == "T") + { + currctn.TiHuoShiJian = item.clearanceTime; + cdc.OP_CTN.AddOrUpdate(currctn); + } + } + else + { + var newrec = new op_ctn_md(head.BSNO); + newrec.CNTRNO = item.ctnNO; + if (item.clearanceCategory == "T") + { + newrec.CNTRNO = item.ctnNO; + newrec.TiHuoShiJian = item.clearanceTime; + cdc.OP_CTN.Add(newrec); + } + else + { + + } + + } + } + } + } + + cdc.SaveChanges(); + + //3 调用 集装箱进口空箱返场查询 + + var 空箱返场hp = new 云港通实时接口_集装箱进口空箱返场(); + result = 空箱返场hp.GetUrl(USERID); + if (!result.Success) + { + return result; + } + 空箱返场hp.SetSearch(head.MBLNO, "", "", ""); + result = 空箱返场hp.DoSend(); + + //4 处理返回结果 + if (!result.Success) return result; + var 空箱返场Head = JsonConvert.Deserialize<云港通实时接口_结果>(result.Data.ToString()); + + if (空箱返场Head.code != 200) + { + result.SetErrorInfo(空箱返场Head.getErrorName() + ":" + 空箱返场Head.msg); + return result; + } + + var 空箱返场 = JsonConvert.Deserialize>(空箱返场Head.data.ToString()); + + if (空箱返场 != null && 空箱返场.Count > 0) + { + head.FanKong = ""; + + var currctnList = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList(); + + foreach (var item in 空箱返场) + { + if (currctnList.Exists(x => x.CNTRNO == item.ctnNO)) + { + var updrec = currctnList.First(x => x.CNTRNO == item.ctnNO); + updrec.FanKongShiJian = item.emptyReturnTime; + cdc.OP_CTN.AddOrUpdate(updrec); + } + else { + var newrec = new op_ctn_md(head.BSNO); + newrec.CNTRNO = item.ctnNO; + newrec.FanKongShiJian = item.emptyReturnTime; + cdc.OP_CTN.Add(newrec); + } + } + } + cdc.SaveChanges(); + + head.FanKong = ""; + var currctnList3 = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList(); + + if (currctnList3.Exists(x => !string.IsNullOrWhiteSpace(x.FanKongShiJian))) + { + + if (currctnList3.Exists(x => string.IsNullOrWhiteSpace(x.FanKongShiJian))) + { + head.FanKong = "部分返空"; + } + else { + head.FanKong = "已返空"; + } + } + + cdc.OP_SERVICEBILL.AddOrUpdate(head); + cdc.SaveChanges(); + result.OK("查询成功"); + return result; + } + } public class SERVICEBILL_RTN { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLEdit.js index 9aedd071..ed8815b7 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLEdit.js @@ -142,11 +142,12 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' } }); this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', { - fieldLabel: '船公司', + fieldLabel: "*" + '船公司', store: this.storeCARRIER, //queryMode: 'remote', //minChars: 1, //queryParam: 'CODENAME', + allowBlank:false, name: 'CARRIER', valueField: 'CustName', displayField: 'CodeAndName', @@ -247,8 +248,9 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' } }); this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', { - fieldLabel: '所属分部', + fieldLabel: "*"+'所属分部', store: this.storeCompany, + allowBlank:false, flex:1, name: 'CORPID', valueField: 'gid', @@ -279,9 +281,10 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { }); this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', { - fieldLabel: '操作', + fieldLabel: "*" + '操作', //renderTo: 'basicBoxselect', //autoHeight:true, + allowBlank: false, name: 'INPUTBY', autosize: true, bodyPadding: 1, @@ -499,6 +502,24 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { }, { fieldLabel: 'DJYID', name: 'DJYID' + }, { + fieldLabel: 'CangDanShiJian', + name: 'CangDanShiJian' + }, { + fieldLabel: 'HaiFangShiJian', + name: 'HaiFangShiJian' + }, { + fieldLabel: 'TiHuo', + name: 'TiHuo' + }, { + fieldLabel: 'TiHuoInfo', + name: 'TiHuoInfo' + }, { + fieldLabel: 'FanKong', + name: 'FanKong' + }, { + fieldLabel: 'FanKongInfo', + name: 'FanKongInfo' } ] } @@ -526,8 +547,8 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { defaultType: 'textfield', items: [ { - fieldLabel: Zi.LAN.TEL, - allowBlank: true, + fieldLabel: "*" +Zi.LAN.TEL, + allowBlank: false, name: 'TEL' } ] @@ -538,8 +559,8 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { defaultType: 'textfield', items: [ { - fieldLabel: Zi.LAN.MBLNO, - allowBlank: true, + fieldLabel: "*" +Zi.LAN.MBLNO, + allowBlank: false, name: 'MBLNO' } , this.comboxCARRIER @@ -585,7 +606,10 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { , { id: 'ServiceGroup', xtype: 'checkboxgroup', - fieldLabel: Zi.LAN.SERVICEBILLService, //'费用项目', + + + fieldLabel: "*" + Zi.LAN.SERVICEBILLService, //'费用项目', + allowBlank:false, columns: 4, name: 'SERVICE', items: [] @@ -786,7 +810,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { scope: this }, { - id: 'btnESaveAndClose', + id: 'btnESaveAndClose',hidden:true, text: "下单并关闭", handler: function (button, event) { this.Save('1'); @@ -1156,8 +1180,15 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { this.Editdata = result.data; //this.LoadInit(data); - if (this.Editdata.ETA) - this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", ""); + //去除eta字段中的时分秒 + if (this.Editdata.ETA) { + this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", ""); + } + + + if (opstatus == 'add') { + this.Editdata.SERVICETYPE = "码头堆存缴费"; + } this.formHead.getForm().reset(); this.formHead.getForm().setValues(this.Editdata); @@ -1403,7 +1434,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { LoadDefValue: function () { this.storeDefValue.load({ - params: { condition: "BSTYPE='内贸海运管理'" }, + params: { condition: "BSTYPE='委托结算管理'" }, callback: function (r, options, success) { if (success) { if (this.storeDefValue.getCount() > 0) { @@ -1470,7 +1501,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { if (enable) { btnESave.enable(); - btnESaveAndClose.enable(); + //btnESaveAndClose.enable(); //btndeletedetail.enable(); } else { btnESave.disable(); @@ -1499,7 +1530,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { Ext.getCmp('btnESave').show(); - Ext.getCmp('btnESaveAndClose').show(); + //Ext.getCmp('btnESaveAndClose').show(); Ext.getCmp('btnESave2').hide(); Ext.getCmp('btnESaveAndClose2').hide(); @@ -1529,7 +1560,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, { Ext.getCmp('REMARK2').show(); Ext.getCmp('btnESave').hide(); - Ext.getCmp('btnESaveAndClose').hide(); + //Ext.getCmp('btnESaveAndClose').hide(); Ext.getCmp('btnESave2').show(); Ext.getCmp('btnESaveAndClose2').show(); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLIndex.js index ff7d999d..a6c39162 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLIndex.js @@ -184,6 +184,63 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { dataIndex: 'FEE_1', header: Zi.LAN.FEETITLE, width: 80 + }, { + dataIndex: 'CangDanShiJian', + header: '舱单', + align: 'center', + width: 35, + renderer: function (value, meta, record) { + + if (value != "") { + return "
" + } else { + return "---"; + } + } + }, { + dataIndex: 'HaiFangShiJian', + header: '海放', + align: 'center', + width: 35, + renderer: function (value, meta, record) { + + if (value != "") { + return "
" + } else { + return "---"; + } + } + }, { + dataIndex: 'TiHuo', + header: '提货', + align: 'center', + width: 35, + renderer: function (value, meta, record) { + + if (value == "已提货") { + return "
" + } else if (value == "部分提货") { + return "
" + } else { + return "---"; + } + } + }, { + dataIndex: 'FanKong', + header: '返空', + align: 'center', + width: 35, + renderer: function (value, meta, record) { + + + if (value == "已返空") { + return "
" + } else if (value == "部分返空") { + return "
" + } else { + return "---"; + } + } }, { sortable: true, @@ -288,13 +345,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { } } - //, { - // header: "操作", dataIndex: 'Gender', - // renderer: function (value, cellmeta) { - // var returnStr = ""; - // return returnStr; - // } - //} + ]; @@ -463,6 +514,13 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { } }); } + + if (FieldName == "TiHuo") { + _this.ShowCtnInfo(rec.data.BSNO); + } + if (FieldName == "FanKong") { + _this.ShowCtnInfo(rec.data.BSNO); + } }); //#endregion @@ -736,7 +794,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { } } }, { - fieldLabel: '到..下单时间', + fieldLabel: '到', format: 'Y-m-d', xtype: 'datefield', name: 'BSDATE_END', @@ -761,7 +819,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { } } }, { - fieldLabel: '到..ETA', + fieldLabel: '到', format: 'Y-m-d', xtype: 'datefield', name: 'ETA_END', @@ -807,15 +865,6 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { region: "north", tbar: [ { - text: "执行查询", - iconCls: "btnrefresh", - handler: function (button, event) { - this.onRefreshClick(button, event); - saveQuerySetting(this.formname, this.formSearch, true, true); - - }, - scope: this - }, '-', { text: "新建", id: "btnadd", iconCls: "btnadd", handler: function (button, event) { @@ -877,8 +926,32 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false); }, scope: this + }, '-', { + text: "刷新运踪", + iconCls: "btnrefresh", + handler: function (button, event) { + this.onRefreshYunZong(button, event); + + }, + scope: this + }, '-', + { + text: "重置条件", + iconCls: "btnreset", + handler: function (button, event) { + this.onResetClick(button, event); + }, + scope: this + }, { + text: "执行查询", + iconCls: "btnrefresh", + handler: function (button, event) { + this.onRefreshClick(button, event); + saveQuerySetting(this.formname, this.formSearch, true, true); + + }, + scope: this } - //,this.CB_EditMode ] }); @@ -1059,6 +1132,71 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { }); }, + onRefreshYunZong: function () { + //刷新运踪 + //对选中的单号执行调用接口查询 + + + var selections = this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: '提示', msg: '请先选择至少一条单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + + var GidSql = ''; + for (var i = 0; i < selections.length; i++) { + var record = selections[i]; + var GId = "" + record.get('BSNO') + ""; + if (GidSql == '') { + GidSql = GId; + } else { + GidSql = GidSql + "," + GId; + } + }; + + Ext.Msg.wait('正在查询数据...'); + Ext.Ajax.request({ + waitMsg: '正在查询数据...', + url: '/MvcShipping/OP_SERVICEBILL/RefreshYunZong', + params: { + BSNOList: GidSql + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + this.onRefreshClick(); + Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } + else { + Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { + this.onRefreshClick(); + }, + scope: this + }); //end Ext.Ajax.request + + + var feeGidSql = ''; + for (var i = 0; i < selections.length; i++) { + var record = selections[i]; + var feeGId = "'" + record.get('BSNO') + "'"; + if (feeGidSql == '') { + feeGidSql = feeGId; + } else { + feeGidSql = feeGidSql + "," + feeGId; + } + }; + }, + onResetClick: function (button, event) { + this.formSearch.getForm().reset(); + }, onRefreshClick: function (button, event) { this.PageSize = this.Pagenum.getValue(); @@ -1396,6 +1534,48 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, { } } }); + } + + , ShowCtnInfo: function (BSNO) { + + title = ""; + + model = Ext.define('OP_CTN_md', { + extend: 'Ext.data.Model', + idProperty: 'CNTRNO', + fields: [ + { name: 'CNTRNO', type: 'string' }, + { name: 'TiHuoShiJian', type: 'string' }, + { name: 'FanKongShiJian', type: 'string' } + ] + }); + + + + proxyUrl = '/MvcShipping/OP_SERVICEBILL/GetCtnList'; + + condition = BSNO; + + columns = [ + { + sortable: true, + dataIndex: 'CNTRNO', + header: '箱号', + width: 120 + }, { + sortable: true, + dataIndex: 'TiHuoShiJian', + header: '提货', + width: 120 + }, { + sortable: true, + dataIndex: 'FanKongShiJian', + header: '返空', + width: 120 + } + ]; + + ShowPublicINFO(title, model, proxyUrl, condition, columns, 380); }, }); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLModel.js index 24d37486..03fecf51 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/OP_SERVICEBILL/OP_SERVICEBILLModel.js @@ -37,7 +37,15 @@ { name: 'OT1', type: 'string' }, { name: 'OT2', type: 'string' }, { name: 'OT3', type: 'string' }, - { name: 'OT4', type: 'string' } + { name: 'OT4', type: 'string' }, + { name: 'CangDanShiJian', type: 'string' }, + { name: 'HaiFangShiJian', type: 'string' }, + { name: 'TiHuo', type: 'string' }, + { name: 'TiHuoInfo', type: 'string' }, + { name: 'FanKong', type: 'string' }, + { name: 'FanKongInfo', type: 'string' } + + ] }); diff --git a/DSWeb/DSWeb.csproj b/DSWeb/DSWeb.csproj index 2191f1cf..52bb8d1e 100644 --- a/DSWeb/DSWeb.csproj +++ b/DSWeb/DSWeb.csproj @@ -5370,6 +5370,8 @@ + + diff --git a/DSWeb/images/yuan.png b/DSWeb/images/yuan.png new file mode 100644 index 00000000..57ee7094 Binary files /dev/null and b/DSWeb/images/yuan.png differ diff --git a/DSWeb/images/yuan2.png b/DSWeb/images/yuan2.png new file mode 100644 index 00000000..befcc1dc Binary files /dev/null and b/DSWeb/images/yuan2.png differ diff --git a/JobPingTaiWork/JobPingTaiWork.csproj b/JobPingTaiWork/JobPingTaiWork.csproj index a12874a0..edd269d2 100644 --- a/JobPingTaiWork/JobPingTaiWork.csproj +++ b/JobPingTaiWork/JobPingTaiWork.csproj @@ -64,6 +64,9 @@ ..\packages\Quartz.2.6.2\lib\net40\Quartz.dll + + ..\packages\RabbitMQ.Client.3.6.9\lib\net45\RabbitMQ.Client.dll + diff --git a/JobPingTaiWork/Job_WLXX.cs b/JobPingTaiWork/Job_WLXX.cs index d39665bb..868feb3b 100644 --- a/JobPingTaiWork/Job_WLXX.cs +++ b/JobPingTaiWork/Job_WLXX.cs @@ -13,6 +13,8 @@ using System.Text; using HcUtility.Core; using HcUtility.Comm; using System.Data.Entity; +using RabbitMQ.Client; + namespace JobPingTaiWork { @@ -152,6 +154,10 @@ namespace JobPingTaiWork reqUrl = context.JobDetail.JobDataMap.GetString("ReqUrl"); reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout")); + + var mqConnStr = context.JobDetail.JobDataMap.GetString("RabbitConnectString"); + + log.Debug($"连接字符串:{connStr}"); log.Debug($"请求URL:{reqUrl}"); log.Debug($"请求超时:{reqTimeout}"); @@ -199,15 +205,17 @@ namespace JobPingTaiWork try { - //log.Debug($"请求数据:{reqObj}"); - //rtn = WebRequestHelper.DoPost(reqUrl, reqObj.ToString(Newtonsoft.Json.Formatting.None), reqTimeout * 1000); - //log.Debug($"返回数据:{rtn}"); + log.Debug($"请求数据:{reqObj}"); + rtn = WebRequestHelper.DoPost(reqUrl, reqObj.ToString(Newtonsoft.Json.Formatting.None), reqTimeout * 1000); + log.Debug($"返回数据:{rtn}"); //rtn = @"{""code"": 200, ""data"": [{""ChuKouBaoGuan"": """", ""FangXingShiJian"": """", ""FangXingZhuangTai"": ""未放行"", ""HuoWuZhuangTai"": ""进、出口货物"", ""ISFenDan"": false, ""JianShu"": ""212"", ""MBLNO"": ""HDMUTAOZ27376200"", ""ShenBaoXiangShu"": ""1"", ""YARDNAME"": ""HLW_CD"", ""YuPeiJieGuo"": ""接受申报"", ""YuPeiShiJian"": ""2023/5/10 13:29:46"", ""YunDiJieGuo"": ""未申报"", ""YunDiShiJian"": """", ""ZhongLiang"": ""17530.20"", ""ZhuangZaiJieGuo"": ""未申报"", ""ZhuangZaiShiJian"": """", ""ZuDanInfo"": ""HDMUTAOZ27376200"", ""vessel"": ""YM TRAVEL"", ""voyage"": ""009E""}], ""msg"": ""ok"", ""request"": ""POST /v1/real/query""}"; - + try { + var needPushStatus = false; + var PortResult = Newtonsoft.Json.JsonConvert.DeserializeObject(rtn); //测试数据 @@ -273,12 +281,49 @@ namespace JobPingTaiWork EdiStatusDAL.Insert(newStatusRecord); + needPushStatus = true; } } DelMinMblno(connStr); } + if (needPushStatus) + { + //回推舱单状态 + try + { + if (string.IsNullOrEmpty(mqConnStr)) + { + log.Warn($"未配置舱单回推消息队列,不会回推状态:{MFNO}"); + } + else + { + + log.Debug($"准备推送舱单状态回推到消息队列:{string.Join(",", MFNO)}"); + //推送消息 + ConnectionFactory factory = new ConnectionFactory(); + factory.Uri = mqConnStr; + var mqConn = factory.CreateConnection("JobPingTaiWork"); + + var exchangeName = "myshiping.feedback.status.cangdan"; + IModel model = mqConn.CreateModel(); + model.ExchangeDeclare(exchange: exchangeName, type: ExchangeType.Fanout); + model.BasicPublish(exchange: exchangeName, + routingKey: "", + basicProperties: null, + body: Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new { MfnoList = new string[] { MFNO } }))); + + mqConn.Close(); + log.Debug($"推送舱单状态回推消息完成"); + } + } + catch (Exception ex) + { + log.Error($"推送舱单状态回推消息失败:{ex.Message}"); + log.Error(ex.StackTrace); + } + } } else { if (PortResult.msg.Contains("单号信息不存在")) @@ -659,6 +704,8 @@ where s.group_idx = 1*/ reqUrl = context.JobDetail.JobDataMap.GetString("ReqUrl"); reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout")); + var mqConnStr = context.JobDetail.JobDataMap.GetString("RabbitConnectString"); + log.Debug($"连接字符串:{connStr}"); log.Debug($"请求URL:{reqUrl}"); log.Debug($"请求超时:{reqTimeout}"); @@ -710,6 +757,8 @@ where s.group_idx = 1*/ log.Debug($"返回数据:{rtn}"); try { + var needPushStatus = false; + var PortResult = Newtonsoft.Json.JsonConvert.DeserializeObject(rtn); if (PortResult.code == 200) @@ -745,11 +794,48 @@ where s.group_idx = 1*/ { EdiStatusDAL_D6.Update(portstatus, localrecord.GetValue("编号"), ISMAIN); } - + needPushStatus = true; } DelMinMblno(connStr); + + if (needPushStatus) + { + //回推舱单状态 + try + { + if (string.IsNullOrEmpty(mqConnStr)) + { + log.Warn($"未配置舱单回推消息队列,不会回推状态:{MFNO}"); + } + else + { + + log.Debug($"准备推送舱单状态回推到消息队列:{string.Join(",", MFNO)}"); + //推送消息 + ConnectionFactory factory = new ConnectionFactory(); + factory.Uri = mqConnStr; + var mqConn = factory.CreateConnection("JobPingTaiWork"); + + var exchangeName = "myshiping.feedback.status.cangdan"; + IModel model = mqConn.CreateModel(); + model.ExchangeDeclare(exchange: exchangeName, type: ExchangeType.Fanout); + model.BasicPublish(exchange: exchangeName, + routingKey: "", + basicProperties: null, + body: Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new { MfnoList = new string[] { MFNO } }))); + + mqConn.Close(); + log.Debug($"推送舱单状态回推消息完成"); + } + } + catch (Exception ex) + { + log.Error($"推送舱单状态回推消息失败:{ex.Message}"); + log.Error(ex.StackTrace); + } + } } else { diff --git a/JobPingTaiWork/bin/Debug/quartz_jobs.xml b/JobPingTaiWork/bin/Debug/quartz_jobs.xml index 930d3ba8..fb17258d 100644 --- a/JobPingTaiWork/bin/Debug/quartz_jobs.xml +++ b/JobPingTaiWork/bin/Debug/quartz_jobs.xml @@ -61,6 +61,7 @@ + + JobWLXXGet JobWLXXGet @@ -87,6 +89,12 @@ Data Source=djypaas.myshipping.net,5099;Initial Catalog=DsPingTai;Persist Security Info=True;User ID=sa;Password=QDdjy#2020* + + + RabbitConnectString + amqp://myshipping:myshipping2024@172.31.85.159:13866/myshipping.feedback + + ReqUrl @@ -103,6 +111,7 @@ + TriggerJobWLXXGet diff --git a/JobPingTaiWork/packages.config b/JobPingTaiWork/packages.config index d04b6cf6..6533eb64 100644 --- a/JobPingTaiWork/packages.config +++ b/JobPingTaiWork/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/JobPingTaiWork/quartz_jobs.xml b/JobPingTaiWork/quartz_jobs.xml index 930d3ba8..fb17258d 100644 --- a/JobPingTaiWork/quartz_jobs.xml +++ b/JobPingTaiWork/quartz_jobs.xml @@ -61,6 +61,7 @@ + + JobWLXXGet JobWLXXGet @@ -87,6 +89,12 @@ Data Source=djypaas.myshipping.net,5099;Initial Catalog=DsPingTai;Persist Security Info=True;User ID=sa;Password=QDdjy#2020* + + + RabbitConnectString + amqp://myshipping:myshipping2024@172.31.85.159:13866/myshipping.feedback + + ReqUrl @@ -103,6 +111,7 @@ + TriggerJobWLXXGet