protected override object[] doService(object[] param) { object[] objArray2; object[] objArray = new object[1]; XXFP xxfp = new XXFP(false); try { this.loger.Debug("###开始查询。。。。"); new Dictionary <string, object>(); if ((param == null) || (param.Length < 3)) { this.loger.Debug("[FPChanXunWenBenJieKouShareMethod函数异常]:发票查询传递参数个数有误!"); return(null); } string xSDJBH = ""; this.loger.Debug("param长度" + param.Length.ToString()); if ((param.Length > 3) && (param[3] != null)) { xSDJBH = param[3].ToString(); } if (param[0] == null) { this.loger.Debug("发票种类is null"); param[0] = ""; } if (param[1] == null) { this.loger.Debug("发票代码is null"); param[1] = ""; } if (param[2] == null) { this.loger.Debug("发票号码is null"); param[2] = ""; } if ((param.Length > 3) && (param[3] == null)) { this.loger.Debug("销售单据编号is null"); param[3] = ""; } this.loger.Debug("###查询fpzl" + param[0].ToString() + " fpdm " + param[1].ToString() + " fphm " + param[2].ToString() + " xsdjbh " + xSDJBH); Fpxx fpxx = xxfp.GetModel(param[0].ToString(), param[1].ToString(), Tool.ObjectToInt(param[2]), xSDJBH); objArray[0] = fpxx; objArray2 = objArray; } catch (Exception exception) { this.loger.Error(exception.ToString()); objArray2 = objArray; } finally { xxfp = null; } return(objArray2); }
protected override object[] doService(object[] param) { object[] objArray2; object[] objArray = new object[1]; FaPiaoChaXun xun = new FaPiaoChaXun(); try { if ((param == null) || (param.Length < 2)) { this.loger.Debug("发票传递参数个数有误!"); return(null); } List <string[]> list = param[0] as List <string[]>; bool iSQD = Tool.ObjectToBool(param[1].ToString()); List <FaPiaoChaXun.FpPrint> allFpPrintList = new List <FaPiaoChaXun.FpPrint>(); for (int i = 0; i < list.Count; i++) { FaPiaoChaXun.FpPrint item = new FaPiaoChaXun.FpPrint { fpzl = Tool.GetFPType(list[i][0]), fpdm = list[i][1], fphm = Tool.ObjectToInt(list[i][2]), index = Tool.ObjectToInt(list[i][3]), qdbz = Tool.ObjectToBool(list[i][4]) }; allFpPrintList.Add(item); } xun.WenBenSelectedFPListPrint(allFpPrintList, iSQD); objArray2 = objArray; } catch (Exception exception) { this.loger.Error(exception.Message); objArray2 = objArray; } finally { xun.Close(); xun = null; } return(objArray2); }
protected override object[] doService(object[] param) { object[] objArray = new object[] { 0 }; new XXFP(false); try { if ((param == null) || (param.Length < 2)) { this.loger.Error("发票精度参数设置错误"); return(null); } string floatNumber = param[0].ToString(); int percision = Tool.ObjectToInt(param[1]); objArray[0] = this.ComputeFloatNumber(floatNumber, percision); return(objArray); } catch (Exception exception) { this.loger.Error(exception.Message); return(objArray); } }
protected override object[] doService(object[] param) { object[] objArray2; FaPiaoZuoFei_YiKai kai = new FaPiaoZuoFei_YiKai(); object[] objArray = new object[] { false, "" }; new XXFP(false); try { new Dictionary <string, object>(); if ((param == null) || (param.Length < 3)) { this.loger.Debug("[FPYiKaiZuoFeiWenBenJieKouShareMethods函数异常]:发票作废传递参数个数有误!"); objArray[0] = false; objArray[1] = "发票作废传递参数个数有误"; return(objArray); } List <DaiKaiXml.SWDKDMHM> swdkZyList = null; List <DaiKaiXml.SWDKDMHM> swdkPtList = null; if (Tool.IsShuiWuDKSQ()) { swdkZyList = new List <DaiKaiXml.SWDKDMHM>(); swdkPtList = new List <DaiKaiXml.SWDKDMHM>(); } int type = 0; if (param.Length > 3) { type = Tool.ObjectToInt(param[3]); } string str = kai.YiKaiZuoFeiMainFunction(param[0].ToString(), param[1].ToString(), param[2].ToString(), swdkZyList, swdkPtList, type); if (str == "0000") { kai.SaveToDB(); if (Tool.IsShuiWuDKSQ()) { new DaiKaiXml().DaiKaiFpZuoFeiUpload(swdkZyList, swdkPtList); } objArray[0] = true; objArray[1] = ""; } else { objArray[0] = false; objArray[1] = str; } objArray2 = objArray; } catch (Exception exception) { this.loger.Error(exception.Message); objArray[0] = false; objArray2 = objArray; } finally { if (kai != null) { kai.Close(); kai.Dispose(); kai = null; } } return(objArray2); }
public object[] DaiKaiFpUpload_New(List <Fpxx> fpList) { if ((fpList == null) || (fpList.Count == 0)) { return(null); } List <SWDKDMHM> zyfpList = new List <SWDKDMHM>(); List <SWDKDMHM> ptfpList = new List <SWDKDMHM>(); int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; try { this.swdkUrl = PropertyUtil.GetValue("SWDK_SERVER"); if ((this.swdkUrl == null) || (this.swdkUrl == "")) { this.loger.Error("[DaiKaiFpUpload函数]:税务代开发票的回传IP地址错误"); this.swdkUrl = "http://127.0.0.1:80"; MessageManager.ShowMsgBox("FPCX-000012"); return(new object[] { num3 }); } for (int i = 0; i < fpList.Count; i++) { try { object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.UploadSWDKFP", new object[] { fpList[i] }); if (objArray == null) { MessageManager.ShowMsgBox("FPCX-000010", "提示", new string[] { fpList[i].fpdm, fpList[i].fphm }); this.loger.Error("Aisino.Fwkp.UploadSWDKFP接口错误"); continue; } XmlDocument document = objArray[0] as XmlDocument; byte[] bytes = ToolUtil.GetBytes(document.OuterXml); if ((bytes != null) && (bytes.Length > 0)) { string str = Convert.ToBase64String(bytes); string s = this.swdkClient.Post(this.swdkUrl, str, out num); num2 = 0; if ((s != null) && (s.Length > 0)) { s = ToolUtil.GetString(Convert.FromBase64String(s)); num2 = Tool.ObjectToInt(s); } if ((num == 0) && (num2 >= 1)) { if (i < fpList.Count) { this.loger.Error("回传第" + i.ToString() + "条记录成功发票代码:" + fpList[i].fpdm + "发票号码:" + fpList[i].fphm); } num3++; } else { if (i < fpList.Count) { this.loger.Error("回传第" + i.ToString() + "条记录失败:发票代码:" + fpList[i].fpdm + "发票号码:" + fpList[i].fphm + " 错误信息:" + s); } MessageManager.ShowMsgBox("FPCX-000010", "提示", new string[] { fpList[i].fpdm, fpList[i].fphm }); } } else { MessageManager.ShowMsgBox("FPCX-000010", "提示", new string[] { fpList[i].fpdm, fpList[i].fphm }); if (i < fpList.Count) { this.loger.Error("回传第" + i.ToString() + "条记录失败:发票代码:" + fpList[i].fpdm + "发票号码:" + fpList[i].fphm); } } } catch (Exception exception) { this.loger.Error(exception.ToString()); MessageManager.ShowMsgBox("FPCX-000010", "提示", new string[] { fpList[i].fpdm, fpList[i].fphm }); } try { if (fpList[i].zfbz) { SWDKDMHM item = new SWDKDMHM { fpdm = fpList[i].fpdm, fphm = fpList[i].fphm }; if (fpList[i].fplx == 0) { zyfpList.Add(item); this.DaiKaiFpZuoFeiUpload(zyfpList, null); zyfpList.Clear(); } else if (fpList[i].fplx == FPLX.PTFP) { ptfpList.Add(item); this.DaiKaiFpZuoFeiUpload(null, ptfpList); ptfpList.Clear(); } } } catch (Exception exception2) { this.loger.Error(exception2.ToString()); this.loger.Error("[DaiKaiFpUpload_New函数异常]:本张发票的作废标志已经上传或者网络原因导致上传失败"); } finally { zyfpList.Clear(); ptfpList.Clear(); } } num4 = fpList.Count - num3; if (num4 < 0) { num4 = 0; } MessageManager.ShowMsgBox("FPCX-000011", "提示", new string[] { fpList.Count.ToString(), num3.ToString(), num4.ToString() }); fpList = null; return(new object[] { num3 }); } catch (Exception exception3) { this.loger.Error("税务代开发票遍历构造XML异常:" + exception3.ToString()); return(new object[] { "1111" }); } }
public object[] DaiKaiFpZuoFeiUpload(List <SWDKDMHM> ZyfpList, List <SWDKDMHM> PtfpList) { int num = 0; int num2 = 0; try { XmlDocument document = this.DaiKaiZYFPZuofeiCreateXml(ZyfpList); this.swdkUrl = PropertyUtil.GetValue("SWDK_SERVER"); if (document != null) { if ((this.swdkUrl == null) || (this.swdkUrl == "")) { this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开专用发票的回传IP地址错误"); this.swdkUrl = "http://127.0.0.1:80"; } byte[] bytes = ToolUtil.GetBytes(document.OuterXml); if ((bytes != null) && (bytes.Length > 0)) { string str = Convert.ToBase64String(bytes); string s = this.swdkClient.Post(this.swdkUrl, str, out num); num2 = 0; if ((s != null) && (s.Length > 0)) { num2 = Tool.ObjectToInt(ToolUtil.GetString(Convert.FromBase64String(s))); } if ((num == 0) && (num2 >= 1)) { int num3 = ZyfpList.Count - num; if (num3 < 0) { num3 = 0; } this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开专用发票作废回传服务器成功" + num.ToString() + "条,失败" + num3.ToString() + "条"); } else { this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开专用发票作废回传服务器成功0条,失败:" + ZyfpList.Count.ToString() + "条"); } } } else { this.loger.Error("税务代开专票构建XML失败"); } XmlDocument document2 = this.DaiKaiPTFPZuofeiCreateXml(PtfpList); if (document2 != null) { if ((this.swdkUrl == null) || (this.swdkUrl == "")) { this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开普通发票的回传IP地址错误"); this.swdkUrl = "http://127.0.0.1:80"; } byte[] inArray = ToolUtil.GetBytes(document2.OuterXml); if ((inArray != null) && (inArray.Length > 0)) { string str3 = Convert.ToBase64String(inArray); string str4 = this.swdkClient.Post(this.swdkUrl, str3, out num); num2 = 0; if ((str4 != null) && (str4.Length > 0)) { num2 = Tool.ObjectToInt(ToolUtil.GetString(Convert.FromBase64String(str4))); } if ((num == 0) && (num2 >= 1)) { int num4 = PtfpList.Count - num; if (num4 < 0) { num4 = 0; } this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开普通发票作废回传服务器成功" + num.ToString() + "条,失败" + num4.ToString() + "条"); } else { this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开普通发票作废回传服务器成功0条,失败:" + PtfpList.Count.ToString() + "条"); } } } else { this.loger.Error("[DaiKaiFpZuoFeiUpload函数]:税务代开普通发票作废遍历构造XML异常"); return(new object[] { "1111" }); } return(new object[] { "0000" }); } catch (Exception exception) { this.loger.Error("税务代开发票作废构造XML异常:" + exception.ToString()); return(new object[] { "1111" }); } }
public object[] DaiKaiFpUpload_Old(List <Fpxx> fpList) { if ((fpList == null) || (fpList.Count == 0)) { return(null); } int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; try { List <XmlDocument> list = this.DaiKaiFpCreateXml(fpList); if ((list == null) || (list.Count <= 0)) { this.loger.Error("[DaiKaiFpUpload函数]:税务代开发票遍历构造XML异常"); return(new object[] { "2222" }); } this.swdkUrl = PropertyUtil.GetValue("SWDK_SERVER"); if ((this.swdkUrl == null) || (this.swdkUrl == "")) { this.loger.Error("[DaiKaiFpUpload函数]:税务代开发票的回传IP地址错误"); this.swdkUrl = "http://127.0.0.1:80"; MessageManager.ShowMsgBox("FPCX-000012"); return(new object[] { num3 }); } for (int i = 0; i < list.Count; i++) { byte[] bytes = ToolUtil.GetBytes(list[i].OuterXml); if ((bytes != null) && (bytes.Length > 0)) { string str = Convert.ToBase64String(bytes); string s = this.swdkClient.Post(this.swdkUrl, str, out num); num2 = 0; if ((s != null) && (s.Length > 0)) { num2 = Tool.ObjectToInt(ToolUtil.GetString(Convert.FromBase64String(s))); } if ((num == 0) && (num2 >= 1)) { if (i < fpList.Count) { this.loger.Error("回传第" + i.ToString() + "条记录成功发票代码:" + fpList[i].fpdm + "发票号码:" + fpList[i].fphm); } num3++; } else { if (i < fpList.Count) { this.loger.Error("回传第" + i.ToString() + "条记录失败:发票代码:" + fpList[i].fpdm + "发票号码:" + fpList[i].fphm); } MessageManager.ShowMsgBox("FPCX-000010", "提示", new string[] { fpList[i].fpdm, fpList[i].fphm }); } } } num4 = list.Count - num3; if (num4 < 0) { num4 = 0; } MessageManager.ShowMsgBox("FPCX-000011", "提示", new string[] { list.Count.ToString(), num3.ToString(), num4.ToString() }); fpList = null; return(new object[] { num3 }); } catch (Exception exception) { this.loger.Error("税务代开发票遍历构造XML异常:" + exception.ToString()); return(new object[] { "1111" }); } }
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); } }
protected override object[] doService(object[] param) { object[] objArray2; XXFP xxfp = new XXFP(false); object[] objArray = new object[1]; Dictionary <string, object> condition = new Dictionary <string, object>(); try { if ((param == null) || (param.Length < 2)) { this.loger.Debug("发票上传下载传递参数个数有误!"); condition = null; return(null); } int result = 1; int num2 = 100; string str = "0"; string str2 = "3"; int num3 = 0; int.TryParse(param[0].ToString(), out result); int.TryParse(param[1].ToString(), out num2); if (param.Length >= 3) { str = (param[2] == null) ? "0" : param[2].ToString(); } if (param.Length >= 4) { str2 = (param[3] == null) ? "3" : param[3].ToString(); } num3 = 0; if (param.Length >= 5) { num3 = Tool.ObjectToInt((param[4] == null) ? "0" : param[4].ToString()); } switch (num3) { case 0: { if (result <= 0) { result = 1; } if (num2 <= 0) { num2 = 100; } this.loger.Error(string.Concat(new object[] { "上传下载传入参数,传入参数:PageNo: ", result.ToString(), "PageSize: ", num2 })); string str3 = (((result - 1) * num2) + 1).ToString(); string str4 = (result * num2).ToString(); condition.Add("beginNO", str3); condition.Add("endNO", str4); condition.Add("BSZT1", str); condition.Add("BSZT2", str2); List <Fpxx> list = new XXFP(false).SelectFpxxPage(condition); this.loger.Error("上传下载传入参数,实际查询票数:" + ((list == null) ? "0" : list.Count.ToString())); objArray[0] = list; return(objArray); } case 1: { Fpxx fpxx = xxfp.GetModel(param[0].ToString(), param[1].ToString(), Tool.ObjectToInt(param[2]), ""); objArray[0] = fpxx; return(objArray); } case 2: { List <Fpxx> list2 = new XXFP(false).SelectFpxxPatch(param[5].ToString()); this.loger.Error("上传下载传入参数,实际查询票数:" + ((list2 == null) ? "0" : list2.Count.ToString())); objArray[0] = list2; return(objArray); } } objArray2 = null; } catch (Exception exception) { this.loger.Error("Excepiton:" + exception.ToString()); objArray2 = objArray; } finally { xxfp = null; condition = null; } return(objArray2); }