InsuBusiness.cs 29 KB

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