/// <summary> /// 收款退款单上传使用(注:金额为正的就是上传至U订货的支付单 若为负的就是上传至U订货的退款单) /// </summary> /// <param name="dh"></param> /// <returns></returns> public static string SkUpload(string dh) { var ab = new fcydata.Service(); var sqlList = new SqlList(); var selstr = sqlList.Get_Sql(dh); var data = ab.FDataSet(selstr); return(FcyUdhPosts.SKUpload(data.Tables[0].Rows[0])); }
/// <summary> /// 将K3 CLOUD的应收单上传至U订货发货单 /// </summary> /// <param name="dhstr"></param> /// <returns></returns> public static string Xsfhup(string dhstr) { var ret = ""; fcydata.Service ab = new fcydata.Service(); var data = ab.FDataSet("select dh,udh,rq,fhrq,shr,shtel,shaddr,hydh,hysj,hytel,hyrq,hyqd,hymz,hydz,hyyf,hyjs,fid,memo from fhd where dh='" + dhstr + "'"); var date = DateTime.Now; var date1 = DateTime.Now; var udhstr = data.Tables[0].Rows[0]["udh"].ToString().Trim(); Xsfhdelup(dhstr); // FcyUdhGet.xsdddmx(udhstr); var datas = ab.FDataSet("select dh,wlbh,sl,dj,je,idkey from fhdsv where dh='" + dhstr + "'"); Dictionary <string, string> param = new Dictionary <string, string>(); var delivery = @"{<M>,oDeliveryDetails:[<S>]}"; var m = @" 'cOrderNo': '<udh>','cOutSysKey':'<dh>','dCreated':'<rq>','dSendDate' :'<fhrq>','cReceiveAddress': '<shaddr>', 'cReceiver': '<shr>','cReceiveMobile': '<shtel>','oShippingMemo': {'cRemark': '<memo>'}"; try { date = (DateTime)data.Tables[0].Rows[0]["rq"]; } catch { } try { date1 = (DateTime)data.Tables[0].Rows[0]["fhrq"]; } catch { } m = m.Replace("<rq>", date.ToString("yyyy-MM-dd hh:mm:ss")); m = m.Replace("<fhrq>", date1.ToString("yyyy-MM-dd hh:mm:ss")); for (var i = 0; i < data.Tables[0].Columns.Count; i++) { m = m.Replace("<" + data.Tables[0].Columns[i].ColumnName + ">", data.Tables[0].Rows[0][i].ToString().Trim()); } // string s = @"{ //'iOrderDetailId': '<uid>', // 'iSendQuantity': <sl> // }"; var s = @"{'iOrderDetailId': '<uid>','iSendQuantity': <sl>,'fErpTransactionPrice': <dj>,'fErpSalePayMoney':<je>}"; var s1 = s; var S = ""; for (var i = 0; i < datas.Tables[0].Rows.Count; i++) { s1 = s; s1 = s1.Replace("<uid>", datas.Tables[0].Rows[i]["idkey"].ToString().Trim()); s1 = s1.Replace("<sl>", datas.Tables[0].Rows[i]["sl"].ToString().Trim()); s1 = s1.Replace("<dj>", datas.Tables[0].Rows[i]["dj"].ToString().Trim()); s1 = s1.Replace("<je>", datas.Tables[0].Rows[i]["je"].ToString().Trim()); S = S + s1 + ","; } S = S.Substring(0, S.Length - 1); delivery = delivery.Replace("<M>", m); delivery = delivery.Replace("<S>", S); param.Add("delivery", delivery); ret = FcyWeb.Post("/ws/Orders/saveDelivery", param); var fhdh = ""; XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(ret); if (fcydata.FcyXml.GetNodeVal(xmldoc.DocumentElement, "code") == "200") { fhdh = fcydata.FcyXml.GetNodeVal(xmldoc.DocumentElement, "data/models.voucher.DeliveryVoucher/cDeliveryNo"); } else { return(ret); } //hydh,hysj,hytel,hyrq,hyqd,hymz,hydz,hyyf,hyjs, param = new Dictionary <string, string>(); var json = "{deliveryNo: '" + fhdh + "',outSysNo:'<dh>',deliveryDefine:{define1:'<hyjs>',define2:'<hymz>',define3:'<hyyf>',define4:'<hydz>',define5:'<hydh>',define6:'<hysj>',define7:'<hytel>',define8:'<hyrq>'}}"; for (var i = 0; i < data.Tables[0].Columns.Count; i++) { json = json.Replace("<" + data.Tables[0].Columns[i].ColumnName + ">", data.Tables[0].Rows[0][i].ToString().Trim()); } param.Add("deliveryDefineVo", json); ret = FcyWeb.Post("/ws/Orders/saveDeliveryDefineVoApi", param); ab.sqlcmd("insert into upfhd (dh) values ('" + dhstr + "')"); return(ret); }