private void DaiKaiZYPTFPCreateXml(Fpxx fp, ref XmlDocument xmlDoc) { if (fp != null) { try { System.Xml.XmlNode newChild = xmlDoc.CreateNode(XmlNodeType.Element, "INSDATA", ""); xmlDoc.AppendChild(newChild); System.Xml.XmlNode node2 = xmlDoc.CreateElement("KPCG_FPHM"); node2.InnerText = fp.fphm; newChild.AppendChild(node2); System.Xml.XmlNode node3 = xmlDoc.CreateElement("KPCG_FPDM"); node3.InnerText = fp.fpdm; newChild.AppendChild(node3); System.Xml.XmlNode node4 = xmlDoc.CreateElement("WSPZHM"); node4.InnerText = fp.xfyhzh; newChild.AppendChild(node4); System.Xml.XmlNode node5 = xmlDoc.CreateElement("FPZL"); node5.InnerText = this.PareFpType(fp.fplx).ToString(); newChild.AppendChild(node5); System.Xml.XmlNode node6 = xmlDoc.CreateElement("ZFZHBZ"); node6.InnerText = "Y"; newChild.AppendChild(node6); System.Xml.XmlNode node7 = xmlDoc.CreateElement("KPRQ"); node7.InnerText = Tool.ObjectToDateTime(fp.kprq).ToString("yyyy-MM-dd"); newChild.AppendChild(node7); System.Xml.XmlNode node8 = xmlDoc.CreateElement("HJJE"); node8.InnerText = fp.je; newChild.AppendChild(node8); System.Xml.XmlNode node9 = xmlDoc.CreateElement("SLV"); node9.InnerText = fp.sLv; newChild.AppendChild(node9); System.Xml.XmlNode node10 = xmlDoc.CreateElement("HJSE"); node10.InnerText = fp.se; newChild.AppendChild(node10); System.Xml.XmlNode node11 = xmlDoc.CreateElement("GFSH"); node11.InnerText = fp.gfsh; newChild.AppendChild(node11); System.Xml.XmlNode node12 = xmlDoc.CreateElement("GFMC"); node12.InnerText = fp.gfmc; newChild.AppendChild(node12); System.Xml.XmlNode node13 = xmlDoc.CreateElement("GFDZ_DH"); node13.InnerText = fp.gfdzdh; newChild.AppendChild(node13); System.Xml.XmlNode node14 = xmlDoc.CreateElement("GFYHMC_YHZH"); node14.InnerText = fp.gfyhzh; newChild.AppendChild(node14); System.Xml.XmlNode node15 = xmlDoc.CreateElement("XFSH"); node15.InnerText = fp.xfsh; newChild.AppendChild(node15); System.Xml.XmlNode node16 = xmlDoc.CreateElement("XFMC"); node16.InnerText = fp.xfmc; newChild.AppendChild(node16); System.Xml.XmlNode node17 = xmlDoc.CreateElement("XFYHMC_YHZH"); node17.InnerText = fp.xfdzdh; newChild.AppendChild(node17); System.Xml.XmlNode node18 = xmlDoc.CreateElement("BZ"); node18.InnerText = fp.bz; newChild.AppendChild(node18); System.Xml.XmlNode node19 = xmlDoc.CreateElement("SWJGDM"); node19.InnerText = "0"; newChild.AppendChild(node19); System.Xml.XmlNode node20 = xmlDoc.CreateElement("SWJGMC"); node20.InnerText = "0"; newChild.AppendChild(node20); System.Xml.XmlNode node21 = xmlDoc.CreateElement("SKR"); node21.InnerText = fp.skr; newChild.AppendChild(node21); System.Xml.XmlNode node22 = xmlDoc.CreateElement("FHR"); node22.InnerText = fp.fhr; newChild.AppendChild(node22); System.Xml.XmlNode node23 = xmlDoc.CreateElement("KPR"); node23.InnerText = fp.kpr; newChild.AppendChild(node23); System.Xml.XmlNode node24 = xmlDoc.CreateElement("TSNSRSBH"); node24.InnerText = "0"; newChild.AppendChild(node24); System.Xml.XmlNode node25 = xmlDoc.CreateElement("ZBNRS"); newChild.AppendChild(node25); if ((fp.Qdxx != null) && (fp.Qdxx.Count > 0)) { foreach (Dictionary <SPXX, string> dictionary in fp.Qdxx) { System.Xml.XmlNode node26 = xmlDoc.CreateElement("ZBNR"); node25.AppendChild(node26); System.Xml.XmlNode node27 = xmlDoc.CreateElement("HWMC"); node27.InnerText = dictionary[(SPXX)0]; node26.AppendChild(node27); System.Xml.XmlNode node28 = xmlDoc.CreateElement("GGXH"); node28.InnerText = dictionary[(SPXX)3]; node26.AppendChild(node28); System.Xml.XmlNode node29 = xmlDoc.CreateElement("JLDW"); node29.InnerText = dictionary[(SPXX)4]; node26.AppendChild(node29); System.Xml.XmlNode node30 = xmlDoc.CreateElement("SL"); node30.InnerText = dictionary[(SPXX)6]; node26.AppendChild(node30); System.Xml.XmlNode node31 = xmlDoc.CreateElement("BHSDJ"); node31.InnerText = dictionary[(SPXX)5]; node26.AppendChild(node31); System.Xml.XmlNode node32 = xmlDoc.CreateElement("BHSJE"); node32.InnerText = dictionary[(SPXX)7]; node26.AppendChild(node32); System.Xml.XmlNode node33 = xmlDoc.CreateElement("SLV"); node33.InnerText = dictionary[(SPXX)8]; node26.AppendChild(node33); System.Xml.XmlNode node34 = xmlDoc.CreateElement("SE"); node34.InnerText = dictionary[(SPXX)9]; node26.AppendChild(node34); } } else if ((fp.Mxxx != null) && (fp.Mxxx.Count > 0)) { foreach (Dictionary <SPXX, string> dictionary2 in fp.Mxxx) { System.Xml.XmlNode node35 = xmlDoc.CreateElement("ZBNR"); node25.AppendChild(node35); System.Xml.XmlNode node36 = xmlDoc.CreateElement("HWMC"); node36.InnerText = dictionary2[0]; node35.AppendChild(node36); System.Xml.XmlNode node37 = xmlDoc.CreateElement("GGXH"); node37.InnerText = dictionary2[(SPXX)3]; node35.AppendChild(node37); System.Xml.XmlNode node38 = xmlDoc.CreateElement("JLDW"); node38.InnerText = dictionary2[(SPXX)4]; node35.AppendChild(node38); System.Xml.XmlNode node39 = xmlDoc.CreateElement("SL"); node39.InnerText = dictionary2[(SPXX)6]; node35.AppendChild(node39); System.Xml.XmlNode node40 = xmlDoc.CreateElement("BHSDJ"); node40.InnerText = dictionary2[(SPXX)5]; node35.AppendChild(node40); System.Xml.XmlNode node41 = xmlDoc.CreateElement("BHSJE"); node41.InnerText = dictionary2[(SPXX)7]; node35.AppendChild(node41); System.Xml.XmlNode node42 = xmlDoc.CreateElement("SLV"); node42.InnerText = dictionary2[(SPXX)8]; node35.AppendChild(node42); System.Xml.XmlNode node43 = xmlDoc.CreateElement("SE"); node43.InnerText = dictionary2[(SPXX)9]; node35.AppendChild(node43); } } } catch (Exception exception) { this.loger.Error("税务代开发票构造XML异常:" + exception.ToString()); } } }
protected override object[] doService(object[] param) { object[] objArray = new object[] { 0, "存库失败" }; try { if ((param == null) || (param.Length < 2)) { this.loger.Error("单张发票修复发票参数个数不正确,参数个数为:" + param.Length); objArray[0] = 0; objArray[1] = "单张发票修复发票参数个数不正确,参数个数为:" + param.Length; return(objArray); } int length = param.Length; string str = ""; int num2 = 0; string str2 = "6666666"; string str3 = "6666666"; DateTime now = DateTime.Now; if (length >= 1) { str = param[0].ToString(); } if (length >= 2) { num2 = Tool.ObjectToInt(param[1].ToString()); } if (length >= 3) { str2 = param[2].ToString(); } if (length >= 4) { str3 = param[3].ToString(); } if (length >= 5) { now = Tool.ObjectToDateTime(param[4].ToString()); } this.loger.Debug(string.Concat(new object[] { "发票代码:", str, "发票号码:", num2, "syh:", str2, "sxh:", str3 })); InvDetail detail = this.taxCard.QueryInvInfo(str, num2, str2, str3, now); if (this.taxCard.RetCode != 0) { this.loger.Error("单张修复底层读取发票失败,错误号:" + this.taxCard.RetCode); this.loger.Debug(string.Concat(new object[] { "发票代码:", str, "发票号码:", num2, "syh:", str2, "sxh:", str3, "开票日期:", now.ToString() })); objArray[0] = 0; objArray[1] = "单张修复底层读取发票失败,错误号:" + this.taxCard.RetCode; return(objArray); } Fpxx item = null; if (this.taxCard.SoftVersion != "FWKP_V2.0_Svr_Client") { item = new Fpxx(); item.RepairInv(detail, -1); } else { item = Fpxx.DeSeriealize_Linux(ToolUtil.FromBase64String(detail.OldInvNo)); } if (item != null) { List <Fpxx> fpList = new List <Fpxx>(); item.dybz = true; item.xfbz = true; if (item.fplx == (FPLX)0x29) { item.gfdzdh = ""; item.gfyhzh = ""; item.xfdzdh = ""; item.xfyhzh = ""; item.mw = ""; item.kpr = ""; item.fhr = ""; } fpList.Add(item); this.dal.SaveXxfp(fpList); objArray[0] = 1; objArray[1] = ""; this.loger.Error("单张发票修复成功"); return(objArray); } objArray[0] = 0; objArray[1] = "单张发票修复失败"; this.loger.Error("单张发票修复失败"); return(objArray); } catch (Exception exception) { objArray[0] = 0; objArray[1] = exception.ToString(); this.loger.Error("[FPXiuFuSingleShareMethods函数异常]" + exception.ToString()); return(objArray); } }