InsuBusiness.cs 29 KB

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