InsuBusiness.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using PTMedicalInsurance.Common;
  7. using PTMedicalInsurance.Business;
  8. using System.Windows.Forms;
  9. using PTMedicalInsurance.Helper;
  10. using Newtonsoft.Json.Linq;
  11. using PTMedicalInsurance.Variables;
  12. using PTMedicalInsurance.Forms;
  13. using System.IO;
  14. using System.Reflection;
  15. using System.Data;
  16. namespace PTMedicalInsurance
  17. {
  18. public class InsuBusiness : IInsuBusiness
  19. {
  20. //定义相关的变量
  21. //private Patients patient;
  22. //private Fees fee;
  23. //private Settlements settlement;
  24. //json对象属性
  25. private JObject joInParam;
  26. private JArray jaSession ;
  27. private JArray jaParams;
  28. private JObject joParam;
  29. private JObject joInterface;
  30. //设置业务实例
  31. CenterBusiness cBus = new CenterBusiness();
  32. HisMainBusiness hBus = new HisMainBusiness();
  33. HisIrisServices hIS = new HisIrisServices();
  34. MIIrisServices mIS= new MIIrisServices();
  35. InvokeHelper invoker = new InvokeHelper();
  36. //
  37. private string businessType;
  38. private string operationType;
  39. public InsuBusiness()
  40. {
  41. Global.curEvt.path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  42. ComputerInfo comp = new ComputerInfo();
  43. Global.curEvt.mac = comp.GetMAC();
  44. Global.curEvt.ip = comp.GetIP();
  45. Global.pat.insuplc_admdvs = ""; //如果是NULL中心会报错
  46. }
  47. private int parseInparam(string inParam,out string errMsg)
  48. {
  49. errMsg = "";
  50. try
  51. {
  52. joInParam = JObject.Parse(inParam);
  53. jaSession = JArray.Parse(JsonHelper.getDestValue(joInParam, "session"));
  54. Global.curEvt.jaSession = jaSession;
  55. jaParams = JArray.Parse(JsonHelper.getDestValue(joInParam, "params"));
  56. joParam = JObject.FromObject(jaParams[0]);
  57. joInterface = JObject.Parse(JsonHelper.getDestValue(joInParam, "interfaceinfo"));
  58. businessType = JsonHelper.getDestValue(joInParam, "businessType");
  59. operationType = JsonHelper.getDestValue(joInParam, "operationType");
  60. if ((businessType == "M6") || (businessType == "M6C") || (businessType == "M6Confirm"))
  61. {
  62. Environment.CurrentDirectory = @"D:\HttpServerAPI\bin";
  63. }
  64. return 0;
  65. }
  66. catch (Exception ex)
  67. {
  68. errMsg = "parseInparam 解析入参异常:" + ex.Message;
  69. return -1;
  70. }
  71. }
  72. /// <summary>
  73. /// 签到
  74. /// </summary>
  75. /// <param name="InParam"></param>
  76. /// <returns></returns>
  77. public string Init(string InParam)
  78. {
  79. string errMsg, rtnResult ="";
  80. JObject joRtn = new JObject();
  81. try
  82. {
  83. if (hBus.initEnvironment(InParam, out errMsg) != 0)
  84. {
  85. return JsonHelper.setExceptionJson(-100, "initEnvironment 失败", errMsg).ToString();
  86. }
  87. else
  88. {
  89. if (mIS.isSigned(ref Global.curEvt.signno) != true)
  90. {
  91. if (businessType != "BasicData")//如果是打开数据对照界面不调用初始化
  92. {
  93. // 省医保不签到
  94. if (Global.inf.interfaceDr == 28)
  95. {
  96. Global.curEvt.signno = "000000";
  97. rtnResult = JsonHelper.setIrisReturnValue(0, "签到成功", joRtn).ToString();
  98. }
  99. else
  100. {
  101. CallResult callResult = new SignInProcess().Process(joRtn);
  102. rtnResult = callResult.Data;
  103. }
  104. }
  105. else
  106. {
  107. Global.curEvt.signno = "ABC123";
  108. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功(医保对照不初始化)!", null).ToString();
  109. }
  110. }
  111. else
  112. {
  113. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功!", null).ToString();
  114. }
  115. return rtnResult;
  116. }
  117. }
  118. catch (Exception ex)
  119. {
  120. rtnResult = JsonHelper.setExceptionJson(-100, "Init 异常", ex.Message).ToString();
  121. return rtnResult;
  122. }
  123. finally
  124. {
  125. Global.writeLog("初始化结果:" + rtnResult);
  126. }
  127. }
  128. /// <summary>
  129. /// 初始化
  130. /// </summary>
  131. /// <param name="inParam"></param>
  132. /// <param name="outParam"></param>
  133. /// <returns></returns>
  134. private int init(string inParam, out string outParam)
  135. {
  136. string errMsg;
  137. outParam = "";
  138. try
  139. {
  140. //BS架构调用方式问题,每次调用都需要重新初始化
  141. JObject joInitRtn = JObject.Parse(Init(inParam));
  142. if (JsonHelper.parseIrisRtnValue(joInitRtn, out errMsg) != 0)
  143. {
  144. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)", errMsg).ToString();
  145. return -1;
  146. }
  147. else
  148. {
  149. return 0;
  150. }
  151. }
  152. catch (Exception ex)
  153. {
  154. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)异常", ex.Message).ToString();
  155. return -1;
  156. }
  157. }
  158. /// <summary>
  159. /// 获取患者信息
  160. /// </summary>
  161. /// <param name="InParam"></param>
  162. /// <returns></returns>
  163. public string GetPatientInfo(string InParam)
  164. {
  165. Global.writeLog("GetPatientInfo入参:" + JsonHelper.Compress(InParam));
  166. //设置返回值,错误信息
  167. string rtnResult = "",outParam;
  168. //BS架构调用方式问题,每次调用都需要重新初始化
  169. if (init(InParam,out outParam)!= 0)
  170. {
  171. rtnResult = outParam;
  172. return rtnResult;
  173. }
  174. JObject joInParam = JObject.Parse(InParam);
  175. string businessType = JsonHelper.getDestValue(joInParam,"businessType");
  176. try
  177. {
  178. switch (businessType)
  179. {
  180. case "M1"://门诊读卡
  181. case "Z1"://住院读卡
  182. {
  183. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  184. PatientService patientService = new PatientService();
  185. patientService.readPatientInfo(out outParam);
  186. rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
  187. break;
  188. }
  189. }
  190. return rtnResult;
  191. }
  192. catch (Exception ex)
  193. {
  194. rtnResult = JsonHelper.setIrisReturnValue(-1 , "GetPatientInfo发生异常;" + ex.Message,null).ToString();
  195. return rtnResult;
  196. }
  197. finally
  198. {
  199. Global.writeLog("GetPatientInfo出参:" + JsonHelper.Compress(rtnResult));
  200. }
  201. }
  202. /// <summary>
  203. /// 登记
  204. /// </summary>
  205. /// <param name="InParam"></param>
  206. /// <returns></returns>
  207. public string Register(string InParam)
  208. {
  209. Global.writeLog("Register 入参:" + JsonHelper.Compress(InParam));
  210. //设置返回值,错误信息
  211. string errMsg, rtnResult = "", outParam;
  212. try
  213. {
  214. //解析入参
  215. if (parseInparam(InParam, out errMsg) != 0)
  216. {
  217. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  218. return rtnResult;
  219. }
  220. //BS架构调用方式问题,每次调用都需要重新初始化
  221. if (init(InParam, out outParam) != 0)
  222. {
  223. rtnResult = outParam;
  224. return rtnResult;
  225. }
  226. //获取pat
  227. hBus.GetRegPatInfo(businessType, joInParam, out Global.pat);
  228. switch (businessType)
  229. {
  230. case "M2"://门诊登记
  231. {
  232. //string patInfo = "";
  233. //errMsg = showPatientInfo(out patInfo, out outParam);
  234. //if (!errMsg.Equals("0"))
  235. //{
  236. // return errMsg;
  237. //}
  238. //Global.writeLog("获取到病人信息:" + patInfo);
  239. //JObject reg = JObject.Parse(patInfo);
  240. //this.OutpatientReg(reg,patInfo);
  241. break;
  242. }
  243. case "M2C"://门诊登记撤销
  244. {
  245. break;
  246. }
  247. case "Z0"://住院修改
  248. {
  249. break;
  250. }
  251. case "Z2"://入院登记
  252. {
  253. Global.Set.clearingWay = "1"; //住院
  254. rtnResult = new InpatientRegistionProcess().Process(joParam).Data;
  255. break;
  256. }
  257. case "Z2C"://入院登记取消
  258. {
  259. rtnResult = new InpatientRegCancelProcess().Process(joParam).Data;
  260. break;
  261. }
  262. case "Z6"://出院登记
  263. {
  264. break;
  265. }
  266. case "Z6C"://出院登记取消
  267. {
  268. rtnResult = new InpatientExitCancelProcess().Process(joParam).Data;
  269. break;
  270. }
  271. default:
  272. {
  273. rtnResult = JsonHelper.setExceptionJson(-1, "Register 交易", "传入的业务编码不对!").ToString();
  274. return rtnResult;
  275. }
  276. }
  277. }
  278. catch (Exception ex)
  279. {
  280. rtnResult = JsonHelper.setIrisReturnValue(-1, "Register 发生异常;" + ex.Message, null).ToString();
  281. return rtnResult;
  282. }
  283. finally
  284. {
  285. Global.writeLog("Register 出参:" + JsonHelper.Compress(rtnResult));
  286. }
  287. return rtnResult;
  288. }
  289. /// <summary>
  290. /// 费用上传
  291. /// </summary>
  292. /// <param name="InParam"></param>
  293. /// <returns></returns>
  294. public string FeeUpload(string InParam)
  295. {
  296. Global.writeLog("FeeUpload 入参:" + JsonHelper.Compress(InParam));
  297. //设置返回值,错误信息
  298. string errMsg, rtnResult = "", outParam;
  299. try
  300. {
  301. //解析入参
  302. if (parseInparam(InParam, out errMsg) != 0)
  303. {
  304. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  305. return rtnResult;
  306. }
  307. //BS架构调用方式问题,每次调用都需要重新初始化
  308. if (init(InParam, out outParam) != 0)
  309. {
  310. rtnResult = outParam;
  311. return rtnResult;
  312. }
  313. //获取pat
  314. hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  315. switch (businessType)
  316. {
  317. case "M3"://门诊费用上传
  318. {
  319. break;
  320. }
  321. case "M3C"://门诊费用撤销
  322. {
  323. break;
  324. }
  325. case "Z3"://入院费用上传
  326. {
  327. rtnResult = new InpatientFeeUploadProcess().Process(joParam).Data;
  328. break;
  329. }
  330. case "Z3C"://住院费用上传取消
  331. {
  332. rtnResult = new InpatientFeeUploadCancelProcess().Process(joParam).Data;
  333. break;
  334. }
  335. default:
  336. {
  337. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", "传入的业务编码不对!").ToString();
  338. return rtnResult;
  339. }
  340. }
  341. return rtnResult;
  342. }
  343. catch (Exception ex)
  344. {
  345. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", ex.Message).ToString();
  346. return rtnResult;
  347. }
  348. finally
  349. {
  350. Global.writeLog("FeeUpload 出参:" + JsonHelper.Compress(rtnResult));
  351. }
  352. }
  353. /// <summary>
  354. /// 结算
  355. /// </summary>
  356. /// <param name="InParam"></param>
  357. /// <returns></returns>
  358. public string Settlement(string InParam)
  359. {
  360. Global.writeLog("Settlement 入参:" + JsonHelper.Compress(InParam));
  361. //设置返回值,错误信息
  362. string errMsg, rtnResult = "", outParam;
  363. try
  364. {
  365. //解析入参
  366. if (parseInparam(InParam, out errMsg) != 0)
  367. {
  368. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  369. return rtnResult;
  370. }
  371. //BS架构调用方式问题,每次调用都需要重新初始化
  372. if (init(InParam, out outParam) != 0)
  373. {
  374. rtnResult = outParam;
  375. return rtnResult;
  376. }
  377. //获取pat
  378. hBus.GetSettlementHisInfo(businessType, joInParam, out Global.pat);
  379. switch (businessType)
  380. {
  381. case "M4"://门诊预结算
  382. {
  383. // 没有做任何处理?是否必须???
  384. //OutpatientRegistration frmReg = new OutpatientRegistration();
  385. //if (frmReg.ShowDialog() == DialogResult.OK)
  386. //{
  387. // rtnResult = "调用结束";
  388. //}
  389. break;
  390. }
  391. case "M4C"://门诊预结算撤销
  392. {
  393. break;
  394. }
  395. case "M5"://门诊结算
  396. {
  397. Global.Set.clearingWay = "6"; //门诊
  398. LocalOPSettleService opService = new LocalOPSettleService();
  399. rtnResult = opService.Charge(operationType, joInParam);
  400. break;
  401. }
  402. case "M5C"://门诊结算撤销
  403. {
  404. LocalOPSettleService opService = new LocalOPSettleService();
  405. rtnResult = opService.DisCharge(joParam);
  406. break;
  407. }
  408. case "M6"://门诊移动支付结算
  409. {
  410. #region 移动支付
  411. //MobilePay mp = new MobilePay(InParam, out errMsg);
  412. //if (errMsg != "")
  413. //{
  414. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  415. // return rtnResult;
  416. //}
  417. //if (mp.MobilePaySettlement(out outParam) != 0)
  418. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  419. //else
  420. // rtnResult = outParam;
  421. //return rtnResult;
  422. #endregion
  423. LocalMobilePayService mobilePayService = new LocalMobilePayService();
  424. rtnResult = mobilePayService.Charge(businessType,JObject.Parse(InParam));
  425. break;
  426. }
  427. case "M6C"://门诊移动支付结算撤销
  428. {
  429. #region 移动支付取消
  430. //MobilePay mp = new MobilePay(InParam, out errMsg);
  431. //if (errMsg != "")
  432. //{
  433. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  434. // return rtnResult;
  435. //}
  436. //if (mp.MobilePayCancelSettlement(out outParam) != 0)
  437. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  438. //else
  439. // rtnResult = outParam;
  440. //return rtnResult;
  441. #endregion
  442. break;
  443. }
  444. case "M6Confirm"://门诊移动支付确认
  445. {
  446. #region 移动支付确认
  447. //MobilePay mp = new MobilePay(InParam, out errMsg);
  448. //if (errMsg != "")
  449. //{
  450. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  451. // return rtnResult;
  452. //}
  453. //if (mp.MobilePayConfirmSettlement(out outParam) != 0)
  454. // rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  455. //else
  456. // rtnResult = outParam;
  457. //return rtnResult;
  458. #endregion
  459. break;
  460. }
  461. case "Z4"://住院预结算
  462. {
  463. #region 预结算
  464. Global.pat.RYorCY = "2";
  465. JObject joSettle = new JObject();
  466. CallResult result = new IPPreSettlementProcess().Process(joParam);
  467. if (result.Success)
  468. {
  469. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", result.Data).ToString();
  470. }
  471. else
  472. {
  473. rtnResult = JsonHelper.setIrisReturnValue(0, "预结算成功", null).ToString();
  474. }
  475. break;
  476. #endregion
  477. }
  478. case "Z4C"://住院预结算撤销
  479. {
  480. rtnResult = JsonHelper.setExceptionJson(-100, "该接口不支持预结算取消!", null).ToString();
  481. return rtnResult;
  482. }
  483. case "Z5"://住院结算
  484. {
  485. Global.Set.clearingWay = "1"; //住院
  486. LocalIPSettlementService ipService = new LocalIPSettlementService();
  487. rtnResult = ipService.Charge(operationType,joParam);
  488. break;
  489. }
  490. case "Z5C"://住院结算撤销
  491. {
  492. LocalIPSettlementService ipService = new LocalIPSettlementService();
  493. rtnResult = ipService.DisCharge(joParam);
  494. break;
  495. }
  496. default:
  497. {
  498. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "传入的业务编码不对!").ToString();
  499. return rtnResult;
  500. }
  501. }
  502. return rtnResult;
  503. }
  504. catch (Exception ex)
  505. {
  506. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", ex.Message).ToString();
  507. return rtnResult;
  508. }
  509. finally
  510. {
  511. Global.writeLog("Settlement 出参:" + JsonHelper.Compress(rtnResult));
  512. }
  513. }
  514. /// <summary>
  515. /// 辅助交易
  516. /// </summary>
  517. /// <param name="InParam"></param>
  518. /// <returns></returns>
  519. public string AgentFun(string InParam)
  520. {
  521. Global.writeLog("AgentFun 入参:" + JsonHelper.Compress(InParam));
  522. //设置返回值,错误信息
  523. string errMsg, rtnResult = "", outParam;
  524. try
  525. {
  526. //解析入参
  527. if (parseInparam(InParam, out errMsg) != 0)
  528. {
  529. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  530. return rtnResult;
  531. }
  532. //BS架构调用方式问题,每次调用都需要重新初始化
  533. if (init(InParam, out outParam) != 0)
  534. {
  535. Global.writeLog("初始化异常:"+outParam);
  536. rtnResult = outParam;
  537. // 基础数据没有初始化成功,也可以运行
  538. if (!businessType.Equals("BasicData")) {
  539. return rtnResult;
  540. }
  541. }
  542. //获取pat
  543. hBus.GetAgentFunHisInfo(businessType, joInParam, out Global.pat);
  544. switch (businessType)
  545. {
  546. case "BasicData"://基础数据维护
  547. {
  548. BasicData bd = new BasicData();
  549. bd.ShowDialog();
  550. break;
  551. }
  552. case "Exception"://异常处理
  553. {
  554. //显示异常处理界面
  555. HandleException frmEX = new HandleException();
  556. if (frmEX.ShowDialog() == DialogResult.OK)
  557. {
  558. }
  559. break;
  560. }
  561. case "CheckAndClearing"://对账清算
  562. {
  563. ClearingQuery frmEX = new ClearingQuery();
  564. if (frmEX.ShowDialog() == DialogResult.OK)
  565. {
  566. }
  567. break;
  568. }
  569. case "Print"://打印
  570. {
  571. try
  572. {
  573. rtnResult = new LocalSettleBillPrintProcess().Process(joInParam).Data;
  574. }
  575. catch (Exception ex)
  576. {
  577. MessageBox.Show(ex.Message);
  578. }
  579. break;
  580. }
  581. case "Log"://日志
  582. {
  583. MessageBox.Show(businessType);
  584. break;
  585. }
  586. case "RecordUpload"://上传记录
  587. {
  588. MessageBox.Show(businessType);
  589. break;
  590. }
  591. case "HospitalRegister"://备案
  592. {
  593. ToRecordChoose Referral = new ToRecordChoose();
  594. Referral.ShowDialog();
  595. break;
  596. }
  597. case "PreAndInProcessAnalysis"://事前分析 诊间只有住院的事前分析
  598. {
  599. Global.pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInParam, "params[0].admID"));
  600. JObject joResult = new JObject();
  601. joResult.Add("result", JObject.Parse(JsonHelper.getDestValue(joParam, "insuData")));
  602. //事前分析
  603. if (Global.curEvt.ext.isOpenAnalysis)
  604. {
  605. if (hBus.PreAnalysis("5", joResult.ToString(), out errMsg) != 0)
  606. {
  607. MessageBox.Show(errMsg);
  608. break;
  609. }
  610. }
  611. break;
  612. }
  613. default:
  614. {
  615. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", "传入的业务编码不对!").ToString();
  616. break;
  617. }
  618. }
  619. return rtnResult;
  620. }
  621. catch (Exception ex)
  622. {
  623. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", ex.Message).ToString();
  624. return rtnResult;
  625. }
  626. finally
  627. {
  628. Global.writeLog("AgentFun 出参:" + JsonHelper.Compress(rtnResult));
  629. }
  630. }
  631. public string PlatformDirectConnect(string InParam)
  632. {
  633. //设置返回值,错误信息
  634. string errMsg, rtnResult = "", outParam;
  635. try
  636. {
  637. Global.writeLog("PlatformDirectConnect 入参:" + JsonHelper.Compress(InParam));
  638. //解析入参
  639. if (parseInparam(InParam, out errMsg) != 0)
  640. {
  641. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  642. return rtnResult;
  643. }
  644. Global.businessType = businessType;
  645. string funNO = JsonHelper.getDestValue(joInParam, "funNO");
  646. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joInParam, "insuplc_admdvs");
  647. if (funNO == "4101")
  648. {
  649. //本地医保需要使用本地机构
  650. if (!Utils.isOtherCity()) {
  651. Global.curEvt.useLocalOrgCode = true;
  652. //需要单独签到
  653. Global.curEvt.mac = Global.curEvt.mac + "" + Utils.GetInsuOrgCode();
  654. }
  655. }
  656. //BS架构调用方式问题,每次调用都需要重新初始化
  657. if (init(InParam, out outParam) != 0)
  658. {
  659. rtnResult = outParam;
  660. return rtnResult;
  661. }
  662. TradeEnum trade = TradeEnum.DEFAULT.GetByCode(funNO);
  663. JObject joRtn = invoker.invokeCenterService(trade, joParam);
  664. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  665. {
  666. rtnResult = JsonHelper.setExceptionJson(-1, "平台直连错误", errMsg).ToString();
  667. return rtnResult;
  668. }
  669. else
  670. {
  671. rtnResult = JsonHelper.setIrisReturnValue(0, "", joRtn).ToString();
  672. return rtnResult;
  673. }
  674. }
  675. catch (Exception ex)
  676. {
  677. rtnResult = JsonHelper.setExceptionJson(-1, "PlatformDirectConnect 交易", ex.Message).ToString();
  678. return rtnResult;
  679. }
  680. finally
  681. {
  682. Global.writeLog("PlatformDirectConnect 出参:" + JsonHelper.Compress(rtnResult));
  683. }
  684. }
  685. }
  686. }