InsuBusiness.cs 29 KB

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