InsuBusiness.cs 29 KB

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