InsuBusiness.cs 30 KB

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