DownLoad.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Helper;
  3. using PTMedicalInsurance.Variables;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Xml.Linq;
  10. namespace PTMedicalInsurance.Business.Center
  11. {
  12. /// <summary>
  13. /// 下载业务
  14. /// </summary>
  15. class DownLoad
  16. {
  17. XmlHelper xh = new XmlHelper();
  18. ///对目录下载业务的封装 91A-E, 61,GB001-003
  19. ///
  20. public JObject DownloadDirectory(string funNO, XElement inParam)
  21. {
  22. string errorMsg = "", sRtn = "";
  23. JObject joRtn = new JObject();
  24. XDocument XDoc = new XDocument();
  25. try
  26. {
  27. string jysr = xh.setInput(inParam);
  28. //rtbIn_1.Text = jysr;
  29. YinHaiCom yinhaiCom = new YinHaiCom();
  30. yinhaiCom.Init(out errorMsg);
  31. string jylsh="", jyyzm="", jysc="", appmsg="";
  32. int appcode = -1;
  33. yinhaiCom.Call(funNO, jysr, ref jylsh, ref jyyzm, ref jysc, ref appcode, ref appmsg);
  34. if (appcode > 0)
  35. {
  36. joRtn = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(xh.ToJSON(jysr)));
  37. }
  38. else
  39. {
  40. joRtn = JsonHelper.setIrisReturnValue(-1, appmsg, null);
  41. }
  42. return joRtn;
  43. }
  44. catch (Exception ex)
  45. {
  46. joRtn = JsonHelper.setExceptionJson(-100, "下载中心目录", ex.Message);
  47. return joRtn;
  48. }
  49. finally
  50. {
  51. Global.writeLog("PTMedicalInsurance.Business.Center.DownLoad.DownloadDirectory", inParam.ToString(), joRtn.ToString());
  52. }
  53. }
  54. public JObject DownloadDictionary(string funNO, XElement inParam)
  55. {
  56. string errorMsg = "", sRtn = "";
  57. JObject joRtn = new JObject();
  58. XDocument XDoc = new XDocument();
  59. try
  60. {
  61. string jysr = xh.setInput(inParam);
  62. YinHaiCom yinhaiCom = new YinHaiCom();
  63. yinhaiCom.Init(out errorMsg);
  64. string jylsh="", jyyzm="", jysc="", appmsg="";
  65. int appcode=-1;
  66. yinhaiCom.Call(funNO, jysr, ref jylsh, ref jyyzm, ref jysc, ref appcode, ref appmsg);
  67. if (appcode > 0)
  68. {
  69. joRtn = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(xh.ToJSON(jysc)));
  70. }
  71. else
  72. {
  73. joRtn = JsonHelper.setIrisReturnValue(-1, appmsg, null);
  74. }
  75. return joRtn;
  76. }
  77. catch (Exception ex)
  78. {
  79. joRtn = JsonHelper.setExceptionJson(-100, "下载中心字典", ex.Message);
  80. return joRtn;
  81. }
  82. finally
  83. {
  84. Global.writeLog("PTMedicalInsurance.Business.Center.DownLoad.DownloadDictionary", inParam.ToString(), joRtn.ToString());
  85. }
  86. }
  87. }
  88. }