InvokeHelper.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. /******************************************************************************
  2. * 文件名称: InvokeHelper.cs
  3. * 文件说明: 调用助手,调用方法的封装
  4. * 当前版本: V1.0
  5. * 创建日期: 2022-04-12
  6. *
  7. * 2020-04-12: 增加 businessDLLInvoke 方法
  8. * 2020-04-12: 增加 writeLog 方法
  9. * 2020-04-14: 增加 businessDLLInvoke(重载) 方法
  10. * 2020-04-14: 增加 irisServiceInvoke 方法
  11. ******************************************************************************/
  12. using Newtonsoft.Json.Linq;
  13. using Newtonsoft.Json;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.IO;
  17. using System.Linq;
  18. using System.Net;
  19. using System.Text;
  20. using System.Threading.Tasks;
  21. using System.Windows.Forms;
  22. using PTMedicalInsurance.Helper;
  23. using PTMedicalInsurance.Common;
  24. using PTMedicalInsurance.Variables;
  25. using System.Runtime.InteropServices;
  26. using System.Reflection;
  27. namespace PTMedicalInsurance.Helper
  28. {
  29. class InvokeHelper
  30. {
  31. private string serviceURL;
  32. private string authorization;
  33. public int yh_hb_call(string infno, string input, out string output)
  34. {
  35. try
  36. {
  37. Type YinHaiComType = System.Type.GetTypeFromProgID("yinhai.yh_hb_sctr");
  38. if (YinHaiComType != null)
  39. {
  40. //创建实例,不能再次创建,否则会提示没有初始化
  41. object YinHaiComInstance = System.Activator.CreateInstance(YinHaiComType);
  42. if (YinHaiComInstance != null)
  43. {
  44. Global.writeLog("实例创建成功,准备调用yh_hb_call服务");
  45. }
  46. else
  47. {
  48. output = "实例不存在!";
  49. Global.writeLog("实例不存在");
  50. return -1;
  51. }
  52. //GlobalVariables.writeLog("入参infno:" + infno);
  53. //GlobalVariables.writeLog("入参input:" + input);
  54. //设置需要设置的参数值
  55. object[] ParamArray = new object[3];
  56. ParamArray[0] = infno;
  57. ParamArray[1] = input;
  58. ParamArray[2] = "";
  59. ParameterModifier[] ParamMods = new ParameterModifier[1];
  60. ParamMods[0] = new ParameterModifier(3); // 初始化为接口参数的个数
  61. //ParamMods[0][0] = false;
  62. //ParamMods[0][1] = false;
  63. ParamMods[0][2] = true;
  64. YinHaiComType.InvokeMember("yh_hb_call", // 接口函数名
  65. BindingFlags.Default | BindingFlags.InvokeMethod,
  66. null,
  67. YinHaiComInstance, // 调用的COM组件
  68. ParamArray, // 参数数组
  69. ParamMods, // 指定返回参数的ParameterModifier数组
  70. null,
  71. null);
  72. output = ParamArray[2].ToString();
  73. Global.writeLog("Com输出:" + output);
  74. return 0;
  75. }
  76. else
  77. {
  78. output = "COM加载失败!";
  79. Global.writeLog("COM加载失败!");
  80. return -1;
  81. }
  82. }
  83. catch (Exception ex)
  84. {
  85. output = ex.Message;
  86. Global.writeLog("COM加载失败!" + output);
  87. return -1;
  88. }
  89. }
  90. /// <summary>
  91. /// iris服务调用的封装
  92. /// </summary>
  93. /// <param name="data"></param>
  94. /// <returns></returns>
  95. public JObject invokeIrisService(string data, string serviceDesc)
  96. {
  97. string rtn = "", url = "";
  98. JObject joRtn = new JObject();
  99. try
  100. {
  101. //先根据用户请求的uri构造请求地址
  102. url = serviceURL;
  103. ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
  104. ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
  105. //创建Web访问对象
  106. HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
  107. //把用户传过来的数据转成“UTF-8”的字节流
  108. byte[] buf = System.Text.Encoding.GetEncoding("UTF-8").GetBytes(data);
  109. //添加头部信息
  110. myRequest.Method = "POST";
  111. myRequest.ContentLength = buf.Length;
  112. myRequest.ContentType = "application/json";
  113. myRequest.Headers.Add("Authorization", authorization);
  114. myRequest.MaximumAutomaticRedirections = 1;
  115. myRequest.AllowAutoRedirect = true;
  116. //发送请求
  117. Stream stream = myRequest.GetRequestStream();
  118. stream.Write(buf, 0, buf.Length);
  119. stream.Close();
  120. //获取接口返回值
  121. //通过Web访问对象获取响应内容
  122. HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
  123. //通过响应内容流创建StreamReader对象,因为StreamReader更高级更快
  124. StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
  125. //string rtn = HttpUtility.UrlDecode(reader.ReadToEnd());//如果有编码问题就用这个方法
  126. rtn = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾
  127. reader.Close();
  128. myResponse.Close();
  129. joRtn = JObject.Parse(rtn);
  130. return joRtn;
  131. }
  132. catch (Exception ex)
  133. {
  134. joRtn = JsonHelper.setExceptionJson(-1, serviceDesc, ex.Message);
  135. rtn = JsonConvert.SerializeObject(joRtn);
  136. return joRtn;
  137. }
  138. }
  139. /// <summary>
  140. /// HIS服务调用的封装
  141. /// </summary>
  142. /// <param name="data"></param>
  143. /// <returns></returns>
  144. public JObject invokeHISService(string data, string serviceDesc)
  145. {
  146. JObject joRtn = new JObject();
  147. try
  148. {
  149. //先根据用户请求的uri构造请求地址
  150. serviceURL = string.Format("{0}/{1}", Global.hisConfig.ip, Global.hisConfig.url);
  151. authorization = Global.hisConfig.authorization;
  152. joRtn = invokeIrisService(data, serviceDesc);
  153. return joRtn;
  154. }
  155. catch (Exception ex)
  156. {
  157. joRtn = JsonHelper.setExceptionJson(-1, serviceDesc, ex.Message);
  158. return joRtn;
  159. }
  160. finally
  161. {
  162. Global.writeLog_Iris(serviceDesc + "(" + serviceURL + ")" + "Authorization:" + (authorization), JsonHelper.Compress(data), JsonHelper.Compress(joRtn));
  163. }
  164. }
  165. /// <summary>
  166. /// 医保平台服务调用的封装
  167. /// </summary>
  168. /// <param name="data"></param>
  169. /// <returns></returns>
  170. public JObject invokeInsuService(string data, string serviceDesc)
  171. {
  172. string rtn = "";
  173. JObject joRtn = new JObject();
  174. try
  175. {
  176. //先根据用户请求的uri构造请求地址
  177. serviceURL = string.Format("{0}/{1}", Global.insuConfig.ip, Global.insuConfig.url);
  178. authorization = Global.insuConfig.authorization;
  179. joRtn = invokeIrisService(data, serviceDesc);
  180. rtn = JsonConvert.SerializeObject(joRtn);
  181. //if (serviceDesc == "插入签到信息")
  182. //{
  183. // MessageBox.Show("插入签到信息入参:" + data +"|返回值:"+ rtn.ToString()+"|"+ Global.insuConfig.url);
  184. //}
  185. return joRtn;
  186. }
  187. catch (Exception ex)
  188. {
  189. joRtn = JsonHelper.setExceptionJson(-1, serviceDesc, ex.Message);
  190. rtn = JsonConvert.SerializeObject(joRtn);
  191. return joRtn;
  192. }
  193. finally
  194. {
  195. Global.writeLog_Iris(serviceDesc + "(" + serviceURL + ")" + "Authorization:" + (authorization), JsonHelper.Compress(data), rtn);
  196. }
  197. }
  198. /// <summary>
  199. /// 医保中心Post服务调用封装
  200. /// </summary>
  201. /// <param name="data"></param>
  202. /// <returns></returns>
  203. private JObject invokeCenterService(string data)
  204. {
  205. string postContent = "";
  206. JObject joRtn = new JObject();
  207. try
  208. {
  209. //创建一个HTTP请求
  210. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Global.curEvt.URL);
  211. //Post请求方式
  212. request.Method = "POST";
  213. //内容类型
  214. request.ContentType = "application/json";
  215. request.Headers.Add("apikey", "fa8kQMIF6LB0D7c6UGQoZc6TCcZO2G6O");
  216. request.Accept = "text/html, application/xhtml+xml, */*";
  217. //昆明增加头部信息
  218. /*
  219. string nonce = Guid.NewGuid().ToString(); //非重复的随机字符串(十分钟内不能重复)
  220. string timestamp = TimeStamp.get13().ToString(); //当前时间戳(秒)
  221. string BusinessID = Global.inf.BusinessID; //服务商ID
  222. string InsuHosID = Global.inf.hospitalNO; //医疗机构ID
  223. string CreditID = Global.inf.CreditID; //服务商统一社会信用代码
  224. string sTemp = timestamp + BusinessID + nonce;
  225. //Sha256 加密生成的签名 signature = sha256(hsf_timestamp + infosyssign + hsf_nonce)
  226. string signature = Encrypt.SHA256EncryptStr(sTemp);
  227. request.Headers.Add("hsf_signature", signature);
  228. request.Headers.Add("hsf_timestamp", timestamp);
  229. request.Headers.Add("hsf_nonce", nonce);
  230. request.Headers.Add("fixmedins_code", InsuHosID);
  231. request.Headers.Add("infosyscode", CreditID);
  232. */
  233. //设置参数,并进行URL编码
  234. string paraUrlCoded = data;//System.Web.HttpUtility.UrlEncode(jsonParas);
  235. byte[] payload;
  236. //将Json字符串转化为字节
  237. payload = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
  238. //设置请求的ContentLength
  239. request.ContentLength = payload.Length;
  240. //发送请求,获得请求流
  241. Stream writer;
  242. writer = request.GetRequestStream();//获取用于写入请求数据的Stream对象
  243. //将请求参数写入流
  244. writer.Write(payload, 0, payload.Length);
  245. writer.Close();//关闭请求流
  246. // String strValue = "";//strValue为http响应所返回的字符流
  247. HttpWebResponse response;
  248. try
  249. {
  250. //获得响应流
  251. response = (HttpWebResponse)request.GetResponse();
  252. }
  253. catch (WebException ex)
  254. {
  255. response = ex.Response as HttpWebResponse;
  256. return JsonHelper.setExceptionJson(-99, "centerServeiceInvok中获得响应流异常", ex.Message);
  257. }
  258. Stream s = response.GetResponseStream();
  259. StreamReader sRead = new StreamReader(s);
  260. postContent = sRead.ReadToEnd();
  261. sRead.Close();
  262. joRtn = JObject.Parse(postContent);//返回Json数据
  263. return joRtn;
  264. }
  265. catch (Exception ex)
  266. {
  267. postContent = "调用中心服务异常" + ex.Message;
  268. joRtn.Add("infcode", -1);
  269. joRtn.Add("err_msg", "invokeCenterService(1):" + ex.Message);
  270. return joRtn;
  271. }
  272. }
  273. /// <summary>
  274. /// 这个是调用业务服务的invokeCenterService
  275. /// </summary>
  276. /// <param name="funNO"></param>
  277. /// <param name="data"></param>
  278. /// <returns></returns>
  279. public JObject invokeCenterServiceApi(string funNO, JObject data)
  280. {
  281. JObject joRtn = new JObject();
  282. string outPar = ""; Boolean bDownLoad = false;
  283. int iInt = 0;
  284. try
  285. {
  286. Global.curEvt.URL = Global.inf.centerURL;
  287. joRtn = invokeCenterService(data.ToString());
  288. outPar = JsonHelper.Compress(joRtn);
  289. return joRtn;
  290. }
  291. catch (Exception ex)
  292. {
  293. if (joRtn["infcode"] == null)
  294. { joRtn.Add("infcode", -1); }
  295. if (joRtn["err_msg"] == null)
  296. { joRtn.Add("err_msg", "invokeCenterService(2):" + ex.Message); }
  297. outPar = JsonHelper.Compress(joRtn);
  298. return joRtn;
  299. }
  300. finally
  301. {
  302. Global.writeLog(funNO + "(" + Global.curEvt.URL + ")", JsonHelper.Compress(data), joRtn.ToString());
  303. this.saveCenterLog(JsonHelper.Compress(data), outPar, JsonHelper.Compress(data), outPar);
  304. }
  305. }
  306. /// <summary>
  307. /// 这个是下载目录用的invokeCenterService
  308. /// </summary>
  309. /// <param name="funNO"></param>
  310. /// <param name="data"></param>
  311. /// <returns></returns>
  312. public JObject invokeCenterServiceApi(string funNO, string data)
  313. {
  314. JObject joRtn = new JObject();
  315. int iInt = 0;
  316. String outPar = ""; Boolean bDownLoad = false;
  317. try
  318. {
  319. Global.curEvt.URL = Global.inf.centerURL;
  320. joRtn = invokeCenterService(data);
  321. outPar = JsonHelper.Compress(joRtn);
  322. return joRtn;
  323. }
  324. catch (Exception ex)
  325. {
  326. if (joRtn["infcode"] == null)
  327. { joRtn.Add("infcode", -1); }
  328. if (joRtn["err_msg"] == null)
  329. { joRtn.Add("err_msg", "invokeCenterService(3):" + ex.Message); }
  330. outPar = JsonHelper.Compress(joRtn);
  331. return joRtn;
  332. }
  333. finally
  334. {
  335. Global.writeLog(funNO + "(" + Global.curEvt.URL + ")", JsonHelper.Compress(data), outPar);
  336. this.saveCenterLog(JsonHelper.Compress(data), outPar, JsonHelper.Compress(data), outPar);
  337. }
  338. }
  339. /// <summary>
  340. /// 调用银海COM组件invokeCenterService
  341. /// </summary>
  342. /// <param name="funNO"></param>
  343. /// <param name="data"></param>
  344. /// <returns></returns>
  345. public JObject invokeCenterService(string funNO, JObject data)
  346. {
  347. JObject joRtn = new JObject();
  348. string outPar = "";
  349. try
  350. {
  351. int iRes = yh_hb_call(funNO, data.ToString(), out outPar);
  352. if (iRes == 0)
  353. {
  354. joRtn = JObject.Parse(outPar);
  355. }
  356. else
  357. {
  358. joRtn.Add("infcode", -1);
  359. joRtn.Add("err_msg", outPar);
  360. outPar = JsonHelper.Compress(joRtn);
  361. }
  362. return joRtn;
  363. }
  364. catch (Exception ex)
  365. {
  366. if (joRtn["infcode"] == null)
  367. { joRtn.Add("infcode", -1); }
  368. if (joRtn["err_msg"] == null)
  369. { joRtn.Add("err_msg", "invokeCenterService(COM):" + ex.Message); }
  370. outPar = JsonHelper.Compress(joRtn);
  371. return joRtn;
  372. }
  373. finally
  374. {
  375. Global.writeLog(funNO + "(" + Global.curEvt.URL + ")", JsonHelper.Compress(data), outPar);
  376. this.saveCenterLog(JsonHelper.Compress(data), outPar, JsonHelper.Compress(data), outPar);
  377. }
  378. }
  379. /// <summary>
  380. /// 调用银海COM组件invokeCenterService
  381. /// </summary>
  382. /// <param name="funNO"></param>
  383. /// <param name="data"></param>
  384. /// <returns></returns>
  385. public JObject invokeCenterService(string funNO, string data)
  386. {
  387. JObject joRtn = new JObject();
  388. string outPar = "";
  389. try
  390. {
  391. int iRes = yh_hb_call(funNO, data, out outPar);
  392. if (funNO != "YH03")
  393. {
  394. if (iRes == 0)
  395. {
  396. joRtn = JObject.Parse(outPar);
  397. }
  398. else
  399. {
  400. joRtn.Add("infcode", -1);
  401. joRtn.Add("err_msg", outPar);
  402. outPar = JsonHelper.Compress(joRtn);
  403. }
  404. }
  405. else //打印交易不做处理
  406. {
  407. joRtn.Add("infcode", 0);
  408. joRtn.Add("err_msg", "");
  409. outPar = JsonHelper.Compress(joRtn);
  410. }
  411. return joRtn;
  412. }
  413. catch (Exception ex)
  414. {
  415. if (joRtn["infcode"] == null)
  416. { joRtn.Add("infcode", -1); }
  417. if (joRtn["err_msg"] == null)
  418. { joRtn.Add("err_msg", "invokeCenterService(COM):" + ex.Message); }
  419. outPar = JsonHelper.Compress(joRtn);
  420. return joRtn;
  421. }
  422. finally
  423. {
  424. Global.writeLog(funNO + "(" + Global.curEvt.URL + ")", JsonHelper.Compress(data), outPar);
  425. this.saveCenterLog(JsonHelper.Compress(data), outPar, JsonHelper.Compress(data), outPar);
  426. }
  427. }
  428. /// <summary>
  429. /// 医保目录txt文件下载
  430. /// </summary>
  431. /// <param name="data"></param>
  432. /// <returns></returns>
  433. public JObject DownloadCenterFile(string data)
  434. {
  435. string error = string.Empty; int errorCode = 0;
  436. string sRtn = "";
  437. try
  438. {
  439. JObject jsonInParam = JObject.Parse(data);
  440. string fileName = (string)jsonInParam["input"]["fsDownloadIn"]["filename"];
  441. string filePath = Global.curEvt.path + "\\Download\\" + fileName;
  442. //MessageBox.Show("9102下载文件入参:"+jsonInParam.ToString());
  443. //如果不存在目录,则创建目录
  444. if (!Directory.Exists(Global.curEvt.path + "\\Download"))
  445. {
  446. //创建文件夹
  447. DirectoryInfo dirInfo = Directory.CreateDirectory(Global.curEvt.path + "\\Download");
  448. }
  449. if (File.Exists(filePath))
  450. {
  451. File.Delete(filePath);
  452. }
  453. FileStream fs = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
  454. //创建一个HTTP请求
  455. //Global.curEvt.URL = Global.inf.centerURL + "/hsa-fsi-9102";
  456. Global.curEvt.URL = Global.inf.centerURL;
  457. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Global.curEvt.URL);
  458. //Post请求方式
  459. request.Method = "POST";
  460. //内容类型
  461. request.ContentType = "application/json";
  462. request.Headers.Add("apikey", "fa8kQMIF6LB0D7c6UGQoZc6TCcZO2G6O");
  463. request.Accept = "text/html, application/xhtml+xml, */*";
  464. /*
  465. //昆明增加头部信息
  466. string timestamp = TimeStamp.get13().ToString(); //当前时间戳(秒)
  467. string nonce = Guid.NewGuid().ToString(); //非重复的随机字符串(十分钟内不能重复)
  468. string InsuHosID = Global.inf.hospitalNO; //医疗机构ID
  469. string CreditID = Global.inf.CreditID; //服务商统一社会信用代码
  470. string BusinessID = Global.inf.BusinessID; //服务商ID
  471. string sTemp = timestamp + BusinessID + nonce;
  472. //Sha256 加密生成的签名 signature = sha256(hsf_timestamp + infosyssign + hsf_nonce)
  473. string signature = Encrypt.SHA256EncryptStr(sTemp);
  474. request.Headers.Add("hsf_signature", signature);
  475. request.Headers.Add("hsf_timestamp", timestamp);
  476. request.Headers.Add("hsf_nonce", nonce);
  477. request.Headers.Add("fixmedins_code", InsuHosID);
  478. request.Headers.Add("infosyscode", CreditID);
  479. */
  480. //设置参数,并进行URL编码
  481. string paraUrlCoded = data;//System.Web.HttpUtility.UrlEncode(jsonParas);
  482. byte[] payload;
  483. //将Json字符串转化为字节
  484. payload = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
  485. //设置请求的ContentLength
  486. request.ContentLength = payload.Length;
  487. Stream writer;
  488. try
  489. {
  490. writer = request.GetRequestStream();//获取用于写入请求数据的Stream对象
  491. }
  492. catch (Exception)
  493. {
  494. writer = null;
  495. errorCode = -100;
  496. error = "连接服务器失败!";
  497. }
  498. //将请求参数写入流
  499. writer.Write(payload, 0, payload.Length);
  500. writer.Close();//关闭请求流
  501. // String strValue = "";//strValue为http响应所返回的字符流
  502. //发送请求并获取相应回应数据
  503. HttpWebResponse response = request.GetResponse() as HttpWebResponse;
  504. //直到request.GetResponse()程序才开始向目标网页发送Post请求
  505. Stream responseStream = response.GetResponseStream();
  506. //创建本地文件写入流
  507. byte[] bArr = new byte[1024];
  508. int iTotalSize = 0;
  509. int size = responseStream.Read(bArr, 0, (int)bArr.Length);
  510. while (size > 0)
  511. {
  512. iTotalSize += size;
  513. fs.Write(bArr, 0, size);
  514. size = responseStream.Read(bArr, 0, (int)bArr.Length);
  515. }
  516. fs.Close();
  517. responseStream.Close();
  518. dynamic joReturn = new JObject();
  519. joReturn.errorCode = errorCode;
  520. joReturn.errorMessage = error;
  521. joReturn.filePath = filePath;
  522. sRtn = joReturn.ToString();
  523. return joReturn;
  524. }
  525. catch (Exception ex)
  526. {
  527. errorCode = -100;
  528. error = ex.Message;
  529. dynamic joReturn = new JObject();
  530. joReturn.errorCode = errorCode;
  531. joReturn.errorMessage = error;
  532. sRtn = joReturn.ToString();
  533. return joReturn;
  534. }
  535. finally
  536. {
  537. Global.writeLog("DownloadCenterFile" +"(" + Global.curEvt.URL + ")", data, sRtn);
  538. }
  539. }
  540. /// <summary>
  541. /// 保存中心交易日志到数据库
  542. /// </summary>
  543. /// <param name="inParam"></param>
  544. /// <param name="outParam"></param>
  545. /// <param name="inParamPlain"></param>
  546. /// <param name="outParamPlain"></param>
  547. private void saveCenterLog(string inParam, string outParam, string inParamPlain, string outParamPlain)
  548. {
  549. dynamic joIris = new JObject();
  550. string sRtn = "";
  551. try
  552. {
  553. //解析postContent,插入医保交易日志表
  554. JObject joIn = new JObject(JObject.Parse(inParam));
  555. JObject joOut = new JObject(JObject.Parse(outParam));
  556. JObject joInPlain = new JObject(JObject.Parse(inParamPlain));
  557. JObject joOutPlain = new JObject(JObject.Parse(outParamPlain));
  558. JArray jaParams = new JArray();
  559. JObject joParam = new JObject();
  560. joParam.Add("inParam", JObject.FromObject(joIn));
  561. joParam.Add("outParam", JObject.FromObject(joOut));
  562. joParam.Add("inParamPlain", JObject.FromObject(joInPlain));
  563. joParam.Add("outParamPlain", JObject.FromObject(joOutPlain));
  564. joParam.Add("HospitalDr", Global.inf.hospitalDr);
  565. joParam.Add("InterfaceDr", Global.inf.interfaceDr);
  566. joParam.Add("updateUserID", Global.user.ID);
  567. joParam.Add("psn_no", Global.pat.psn_no);
  568. jaParams.Add(joParam);
  569. joIris.code = "09010021";
  570. joIris.Add("params", jaParams);
  571. //InvokeHelper invoker = new InvokeHelper();
  572. sRtn = invokeInsuService(joIris.ToString(), "保存日志到数据库").ToString();
  573. }
  574. catch (Exception ex)
  575. {
  576. sRtn = JsonHelper.setExceptionJson(-100, "保存日志异常", ex.Message).ToString();
  577. Global.writeLog_Iris("保存日志异常:" + sRtn.ToString());
  578. }
  579. }
  580. }
  581. }