From dd091b440d179d4c21ccfc17fb254e5563e5bff2 Mon Sep 17 00:00:00 2001 From: dengyu Date: Fri, 14 Jul 2023 18:25:07 +0800 Subject: [PATCH] 1 --- DSWeb.DJYMQ/DS7Service.cs | 62 +++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/DSWeb.DJYMQ/DS7Service.cs b/DSWeb.DJYMQ/DS7Service.cs index f711ec16..c7bfb98d 100644 --- a/DSWeb.DJYMQ/DS7Service.cs +++ b/DSWeb.DJYMQ/DS7Service.cs @@ -158,7 +158,7 @@ namespace DSWeb.Service.Output.DS7 //测试数据 #region 测试文本 - ///* 测试时前面增加两个注释号 + /* 测试时前面增加两个注释号 var testjson = @"[{""Id"":438548467748934,""BSNO"":null,""BSSTATUS"":null,""BSSTATUSNAME"":""已收到BC"",""BSDATE"":""2023-07-13T00:00:00"",""MBLNO"":""140301248130"",""HBLNO"":"""",""BOOKINGNO"":""438548467748933"",""CONTRACTNO"":"""",""SERVICECONTRACTNO"":null,""SHIPPERID"":null,""CONSIGNEEID"":null,""NOTIFYPARTYID"":null,""SHIPPER"":""JINXIANG HONGSHENG TRADING CO.,LTD.\nCUIKOU VILLAGE,YUSHAN STREET,JINXIANG COUNTY,\nJINING CITY,SHANDONG PROVINCE CHINA"",""CONSIGNEE"":""BOBO VEGETABLES&FRUIT TRADING L.L.C\nSHOP-03, BUILDING NO.9 VEGETABLE \nAND FRUIT MARKET \nAL AWEER DUBAI U.A.E\n(TEL:+971555375678\nEMAIL:781480062@QQ.COM NO SHOW)\n\n\n"",""NOTIFYPARTY"":""BOBO VEGETABLES&FRUIT TRADING L.L.C\nSHOP-03, BUILDING NO.9 VEGETABLE \nAND FRUIT MARKET \nAL AWEER DUBAI U.A.E\n(TEL:+971555375678\nEMAIL:781480062@QQ.COM NO SHOW)\n\n"",""NOTIFYPARTY2"":"""",""YARDID"":""CHANGRONG"",""YARD"":""长荣场站"",""VESSELID"":null,""VESSEL"":""CMA CGM SYMI"",""VOYNO"":""0MD8LW"",""VOYNOINNER"":""0MD8LW1MA"",""ETD"":""2023-07-20T00:00:00"",""ATD"":null,""CLOSINGDATE"":null,""CLOSEDOCDATE"":null,""CLOSEVGMDATE"":null,""ETA"":null,""PLACERECEIPTID"":"""",""PLACERECEIPT"":"""",""PORTLOADID"":""CNTAO"",""PORTLOAD"":""QINGDAO,CHINA"",""PORTDISCHARGEID"":""AEJEA"",""PORTDISCHARGE"":""JEBEL ALI"",""PLACEDELIVERYID"":"""",""PLACEDELIVERY"":"""",""DESTINATIONID"":""AEJEA"",""DESTINATION"":""JEBEL ALI"",""NOBILL"":"""",""COPYNOBILL"":"""",""ISSUETYPE"":"""",""ISSUEDATE"":null,""ISSUEPLACEID"":"""",""ISSUEPLACE"":""QINGDAO,CHINA"",""BLFRT"":""FREIGHT PREPAID"",""PREPARDAT"":""QINGDAO,CHINA"",""PAYABLEAT"":"""",""SERVICE"":"""",""MARKS"":"""",""HSCODE"":"""",""DESCRIPTION"":""FRESH GARLIC\nTEMP:-3'C\nVENT:15CBM/H\nHS:07032000"",""PKGS"":0,""KINDPKGS"":"""",""KGS"":0.00000,""CBM"":0.0000,""TOTALNO"":"""",""CNTRTOTAL"":""40'RH*1"",""CARRIERID"":""EMC"",""CARRIER"":""长荣海运"",""CARGOID"":""R"",""DCLASS"":"""",""DUNNO"":"""",""DPAGE"":"""",""DLABEL"":"""",""LINKMAN"":"""",""TEMPID"":"""",""TEMPSET"":"""",""REEFERF"":"""",""HUMIDITY"":"""",""TEMPMIN"":"""",""TEMPMAX"":"""",""ISCONTAINERSOC"":false,""SOREMARK"":""CMA CGM SYMI 0MD8LW1MA"",""SIREMARK"":"""",""YARDREMARK"":"""",""COMPID"":null,""COMPNAME"":null,""SHIPPERNAME"":null,""SHIPPERADDR1"":null,""SHIPPERADDR2"":null,""SHIPPERADDR3"":null,""SHIPPERCITY"":null,""SHIPPERPROVINCE"":null,""SHIPPERPOSTCODE"":null,""SHIPPERCOUNTRY"":null,""SHIPPERATTN"":null,""SHIPPERTEL"":null,""CONSIGNEENAME"":null,""CONSIGNEEADDR1"":null,""CONSIGNEEADDR2"":null,""CONSIGNEEADDR3"":null,""CONSIGNEECITY"":null,""CONSIGNEEPROVINCE"":null,""CONSIGNEEPOSTCODE"":null,""CONSIGNEERCOUNTRY"":null,""CONSIGNEEATTN"":null,""CONSIGNEETEL"":null,""NOTIFYPARTYNAME"":null,""NOTIFYPARTYADDR1"":null,""NOTIFYPARTYADDR2"":null,""NOTIFYPARTYADDR3"":null,""NOTIFYPARTYCITY"":null,""NOTIFYPARTYPROVINCE"":null,""NOTIFYPARTYPOSTCODE"":null,""NOTIFYPARTYCOUNTRY"":null,""NOTIFYPARTYATTN"":null,""NOTIFYPARTYTEL"":null,""PONO"":"""",""OPID"":""356029266374725"",""DOCID"":""356029265051717"",""OP"":""王亚萍"",""DOC"":""秦璐"",""SALEID"":""386903403057221"",""SALE"":""姜中正"",""CUSTSERVICEID"":"""",""CUSTSERVICE"":"""",""CUSTOMERNAME"":""金乡泓盛"",""FORWARDER"":""青岛怡升昌"",""SHIPAGENCY"":"""",""CUSTOMSER"":"""",""TRUCKER"":"""",""AGENTID"":"""",""CUSTOMERID"":411597103960133,""FORWARDERID"":""QDYSCGYLGL"",""SHIPAGENCYID"":"""",""CUSTOMSERID"":"""",""TRUCKERID"":"""",""AGENTNAME"":"""",""WEITUO"":"""",""CONSIGNEEDOORADDR"":null,""SHIPPERDOORADDR"":null,""SCACCODE"":"""",""ITNCODE"":"""",""PREPARDATID"":""CNTAO"",""PAYABLEATID"":"""",""CUSTNO"":""0720-AMA-01"",""TRANSPORTID"":"""",""TRANSPORT"":"""",""THIRDPAYADDR"":"""",""YARDCONTRACT"":"""",""YARDCONTRACTTEL"":"""",""YARDCONTRACTEMAIL"":"""",""FEESELF"":false,""LANECODE"":"""",""LANENAME"":""AMA"",""FREIGHTPAYER"":"""",""GOODSCODE"":"""",""GOODSNAME"":"""",""PKGSTOTAL"":"""",""KGSTOTAL"":"""",""CBMTOTAL"":"""",""ROUTEID"":"""",""ROUTE"":"""",""Warehouse"":"""",""WarehouseID"":"""",""EPCode"":"""",""LineName"":""波斯湾"",""DZRemark"":"" 单20"",""CZRemark"":""1 蒜"",""TMBLNO"":null,""ShippingMethod"":null,""CtnDayNum"":null,""CreatedUserName"":""王亚萍"",""ZhanCangFlag"":""否"",""SourceCode"":null,""SourceName"":null,""YgtETD"":""2023-07-20T08:00:00"",""StartETA"":""2023-07-19T02:00:00"",""StartATA"":null,""MiddleETA"":null,""MiddleETD"":null,""MiddleATA"":null,""MiddleATD"":null,""ATA"":null,""ShenQingXiangShi"":null,""ForeignAgent"":null,""VERSION"":""21367795-1c5d-4700-b02d-53d2552fe091"",""ThirdPay"":null,""ThirdPayCode"":null,""ctnInputs"":[{""Id"":438548467802181,""BILLID"":438548467748934,""CTNCODE"":""4"",""CTNALL"":""40'RH"",""CTNNUM"":1,""TEU"":null,""CNTRNO"":""1"",""SEALNO"":""1"",""PKGS"":null,""KINDPKGS"":"""",""KGS"":null,""CBM"":null,""TAREWEIGHT"":null,""CTNSTATUS"":null,""WEIGHTYPE"":""累加"",""WEIGHKGS"":null,""WEIGHATTN"":null,""VGMCONNCOM"":null,""WEIGHTEL"":null,""WEIGHDATE"":"""",""VGMADDR"":null,""VGMEMAIL"":null,""REMARK"":null,""ctnDetailInputs"":[]},{""Id"":438548467802192,""BILLID"":438548467748934,""CTNCODE"":""4"",""CTNALL"":""40'RH"",""CTNNUM"":1,""TEU"":null,""CNTRNO"":""2"",""SEALNO"":""2"",""PKGS"":null,""KINDPKGS"":"""",""KGS"":null,""CBM"":null,""TAREWEIGHT"":null,""CTNSTATUS"":null,""WEIGHTYPE"":""累加"",""WEIGHKGS"":null,""WEIGHATTN"":null,""VGMCONNCOM"":null,""WEIGHTEL"":null,""WEIGHDATE"":"""",""VGMADDR"":null,""VGMEMAIL"":null,""REMARK"":null,""ctnDetailInputs"":[]}],""BookingEDIExt"":{""WeiTuoFang"":"""",""SendCode"":"""",""ReceiveCode"":"""",""NotifyCdoe"":"""",""SalerCode"":""CN097 | CHARLES GAO"",""MasterBolIndicator"":""3"",""EmanifestHbl"":"""",""ConsigneeEdiCode"":"""",""ShipperEdiCode"":"""",""EDIAttn"":"""",""EDIAttnTel"":"""",""EDIAttnMail"":"""",""AMSConsignee"":"""",""AMSNotifyParty"":"""",""OpEName"":"""",""OpTel"":"""",""OpEmail"":"""",""ACIHBL"":"""",""S0CC0C"":"""",""GoodsName"":"""",""MasterBolIndicatorName"":""Not Applicable/Straight bl | 无HBL"",""SalerCodeName"":"""",""CKHI"":"""",""CNCM"":"""",""WNCM"":"""",""OrderRemark"":"""",""ExRemark1"":"""",""ExRemark2"":"""",""ExRemark3"":"""",""ExRemark4"":"""",""KingTareweight"":null,""CNPTNo"":"""",""XMCYWY"":null,""EmcNameAccount"":null},""LineManage"":null,""LineManageID"":null,""childrens"":[],""GoodsStatus"":[{""StatusName"":""已订舱"",""FinishTime"":""2023-07-13T17:41:07"",""Remark"":null,""ExtData"":null},{""StatusName"":""已收到BC"",""FinishTime"":""2023-07-14T10:01:45"",""Remark"":null,""ExtData"":null}]}] "; @@ -196,7 +196,7 @@ namespace DSWeb.Service.Output.DS7 //this.Stop(hostControl); - /* 测试时删去前面两个注释号 + ///* 测试时删去前面两个注释号 #region 订舱业务和删除订舱业务 ConnectionFactory factory = new ConnectionFactory(); @@ -1531,6 +1531,7 @@ SELECT @ps_BillNo as N'billno'"; public static void Do_DingCangToDS6(string itemstr,int count=0) { + if (count >= 3) return; var head = JsonConvert.DeserializeObject(itemstr); @@ -1595,21 +1596,21 @@ SELECT @ps_BillNo as N'billno'"; #region 箱信息 var Currctnlist = DS6Data.t_op_ctn.Where(x => x.编号 == headid).ToList(); var ctn_addlist = new List(); - var ctn_updlist = new List(); + //var ctn_updlist = new List(); var ctn_dellist = new List(); var newctnList = head.GetCtnList(newhead.编号); foreach (var ctn in newctnList) { - if (Currctnlist.Exists(x => x.DJYCTNID == ctn.DJYCTNID)) - { - var currctn = Currctnlist.First(x => x.DJYCTNID == ctn.DJYCTNID); - DingCangHead.GetCtn(ref currctn, ctn); + //if (Currctnlist.Exists(x => x.DJYCTNID == ctn.DJYCTNID)) + //{ + // var currctn = Currctnlist.First(x => x.DJYCTNID == ctn.DJYCTNID); + // DingCangHead.GetCtn(ref currctn, ctn); - ctn_updlist.Add(currctn); - } - else + // ctn_updlist.Add(currctn); + //} + //else { ctn_addlist.Add(ctn); } @@ -1617,30 +1618,32 @@ SELECT @ps_BillNo as N'billno'"; foreach (var oldctn in Currctnlist) { - if (newctnList.Exists(x => x.DJYCTNID == oldctn.DJYCTNID)) - { + //if (newctnList.Exists(x => x.DJYCTNID == oldctn.DJYCTNID)) + //{ - } - else - { - ctn_dellist.Add(oldctn); - } - } - if (ctn_addlist.Count > 0) - { - DS6Data.t_op_ctn.AddRange(ctn_addlist); - } - if (ctn_updlist.Count > 0) - { - foreach (var updctn in ctn_updlist) - { - DS6Data.t_op_ctn.AddOrUpdate(updctn); - } + //} + //else + //{ + // ctn_dellist.Add(oldctn); + //} + ctn_dellist.Add(oldctn); } if (ctn_dellist.Count > 0) { DS6Data.t_op_ctn.RemoveRange(ctn_dellist); } + if (ctn_addlist.Count > 0) + { + DS6Data.t_op_ctn.AddRange(ctn_addlist); + } + //if (ctn_updlist.Count > 0) + //{ + // foreach (var updctn in ctn_updlist) + // { + // DS6Data.t_op_ctn.AddOrUpdate(updctn); + // } + //} + #endregion #region 提单信息 @@ -5013,13 +5016,14 @@ SELECT @ps_BillNo as N'billno'"; public class ThreadSaveDS6_Single { //public static bool inworking { get; set; } = false; + //public static List 处理中id列表 = new List(); - public void FuncSend(object o) { var itemstr = (string)o; + try {