InsuBusiness.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  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. case "Z1"://住院读卡
  176. {
  177. string admId = JsonHelper.getDestValue(joInParam, "params[0].admID");
  178. if (!string.IsNullOrEmpty(admId)) {
  179. Global.pat.adm_Dr = int.Parse(admId);
  180. }
  181. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  182. PatientService patientService = new PatientService();
  183. patientService.readPatientInfo(out outParam);
  184. // 同时支持返回错误信息和对象
  185. rtnResult = outParam.ParseReturnObject();
  186. break;
  187. }
  188. }
  189. return rtnResult;
  190. }
  191. catch (Exception ex)
  192. {
  193. rtnResult = JsonHelper.setIrisReturnValue(-1 , "GetPatientInfo发生异常;" + ex.Message,null).ToString();
  194. return rtnResult;
  195. }
  196. finally
  197. {
  198. Global.writeLog("GetPatientInfo出参:" + JsonHelper.Compress(rtnResult));
  199. }
  200. }
  201. /// <summary>
  202. /// 登记
  203. /// </summary>
  204. /// <param name="InParam"></param>
  205. /// <returns></returns>
  206. public string Register(string InParam)
  207. {
  208. Global.writeLog("Register 入参:" + JsonHelper.Compress(InParam));
  209. //设置返回值,错误信息
  210. string errMsg, rtnResult = "", outParam;
  211. try
  212. {
  213. //解析入参
  214. if (parseInparam(InParam, out errMsg) != 0)
  215. {
  216. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  217. return rtnResult;
  218. }
  219. //BS架构调用方式问题,每次调用都需要重新初始化
  220. if (init(InParam, out outParam) != 0)
  221. {
  222. rtnResult = outParam;
  223. return rtnResult;
  224. }
  225. //获取pat
  226. hBus.GetRegPatInfo(businessType, joInParam, out Global.pat);
  227. switch (businessType)
  228. {
  229. case "M2"://门诊登记
  230. {
  231. //string patInfo = "";
  232. //errMsg = showPatientInfo(out patInfo, out outParam);
  233. //if (!errMsg.Equals("0"))
  234. //{
  235. // return errMsg;
  236. //}
  237. //Global.writeLog("获取到病人信息:" + patInfo);
  238. //JObject reg = JObject.Parse(patInfo);
  239. //this.OutpatientReg(reg,patInfo);
  240. break;
  241. }
  242. case "M2C"://门诊登记撤销
  243. {
  244. break;
  245. }
  246. case "Z0"://住院修改
  247. {
  248. break;
  249. }
  250. case "Z2"://入院登记
  251. {
  252. Global.Set.clearingWay = "1"; //住院
  253. rtnResult = new InpatientRegistionProcess().Process(joParam).Data;
  254. break;
  255. }
  256. case "Z2C"://入院登记取消
  257. {
  258. rtnResult = new InpatientRegCancelProcess().Process(joParam).Data;
  259. break;
  260. }
  261. case "Z6"://出院登记
  262. {
  263. break;
  264. }
  265. case "Z6C"://出院登记取消
  266. {
  267. rtnResult = new InpatientExitCancelProcess().Process(joParam).Data;
  268. break;
  269. }
  270. default:
  271. {
  272. rtnResult = JsonHelper.setExceptionJson(-1, "Register 交易", "传入的业务编码不对!").ToString();
  273. return rtnResult;
  274. }
  275. }
  276. }
  277. catch (Exception ex)
  278. {
  279. rtnResult = JsonHelper.setIrisReturnValue(-1, "Register 发生异常;" + ex.Message, null).ToString();
  280. return rtnResult;
  281. }
  282. finally
  283. {
  284. Global.writeLog("Register 出参:" + JsonHelper.Compress(rtnResult));
  285. }
  286. return rtnResult;
  287. }
  288. /// <summary>
  289. /// 费用上传
  290. /// </summary>
  291. /// <param name="InParam"></param>
  292. /// <returns></returns>
  293. public string FeeUpload(string InParam)
  294. {
  295. Global.writeLog("FeeUpload 入参:" + JsonHelper.Compress(InParam));
  296. //设置返回值,错误信息
  297. string errMsg, rtnResult = "", outParam;
  298. try
  299. {
  300. //解析入参
  301. if (parseInparam(InParam, out errMsg) != 0)
  302. {
  303. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  304. return rtnResult;
  305. }
  306. //BS架构调用方式问题,每次调用都需要重新初始化
  307. if (init(InParam, out outParam) != 0)
  308. {
  309. rtnResult = outParam;
  310. return rtnResult;
  311. }
  312. //获取pat
  313. hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  314. switch (businessType)
  315. {
  316. case "M3"://门诊费用上传
  317. {
  318. break;
  319. }
  320. case "M3C"://门诊费用撤销
  321. {
  322. break;
  323. }
  324. case "Z3"://入院费用上传
  325. {
  326. rtnResult = new InpatientFeeUploadProcess().Process(joParam).Data;
  327. break;
  328. }
  329. case "Z3C"://住院费用上传取消
  330. {
  331. rtnResult = new InpatientFeeUploadCancelProcess().Process(joParam).Data;
  332. break;
  333. }
  334. default:
  335. {
  336. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", "传入的业务编码不对!").ToString();
  337. return rtnResult;
  338. }
  339. }
  340. return rtnResult;
  341. }
  342. catch (Exception ex)
  343. {
  344. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", ex.Message).ToString();
  345. return rtnResult;
  346. }
  347. finally
  348. {
  349. Global.writeLog("FeeUpload 出参:" + JsonHelper.Compress(rtnResult));
  350. }
  351. }
  352. /// <summary>
  353. /// 结算
  354. /// </summary>
  355. /// <param name="InParam"></param>
  356. /// <returns></returns>
  357. public string Settlement(string InParam)
  358. {
  359. Global.writeLog("Settlement 入参:" + JsonHelper.Compress(InParam));
  360. //设置返回值,错误信息
  361. string errMsg, rtnResult = "", outParam;
  362. try
  363. {
  364. //解析入参
  365. if (parseInparam(InParam, out errMsg) != 0)
  366. {
  367. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  368. return rtnResult;
  369. }
  370. //BS架构调用方式问题,每次调用都需要重新初始化
  371. if (init(InParam, out outParam) != 0)
  372. {
  373. rtnResult = outParam;
  374. return rtnResult;
  375. }
  376. //获取pat
  377. hBus.GetSettlementHisInfo(businessType, joInParam, out Global.pat);
  378. switch (businessType)
  379. {
  380. case "M4"://门诊预结算
  381. {
  382. // 没有做任何处理?是否必须???
  383. //OutpatientRegistration frmReg = new OutpatientRegistration();
  384. //if (frmReg.ShowDialog() == DialogResult.OK)
  385. //{
  386. // rtnResult = "调用结束";
  387. //}
  388. break;
  389. }
  390. case "M4C"://门诊预结算撤销
  391. {
  392. break;
  393. }
  394. case "M5"://门诊结算
  395. {
  396. Global.Set.clearingWay = "6"; //门诊
  397. OPSettlementService opService = new OPSettlementService();
  398. rtnResult = opService.Charge(operationType, joInParam);
  399. break;
  400. }
  401. case "M5C"://门诊结算撤销
  402. {
  403. OPSettlementService opService = new OPSettlementService();
  404. rtnResult = opService.DisCharge(joParam);
  405. break;
  406. }
  407. case "M6"://门诊移动支付结算
  408. {
  409. #region 移动支付
  410. MobilePay mp = new MobilePay(InParam, out errMsg);
  411. if (errMsg != "")
  412. {
  413. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  414. return rtnResult;
  415. }
  416. if (mp.MobilePaySettlement(out outParam) != 0)
  417. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  418. else
  419. rtnResult = outParam;
  420. return rtnResult;
  421. #endregion
  422. }
  423. case "M6C"://门诊移动支付结算撤销
  424. {
  425. #region 移动支付取消
  426. string onlineYBFalg = JsonHelper.getDestValue(joInsuAdmObj, "onlineYBFalg");
  427. MobilePay mp = new MobilePay(InParam, out errMsg);
  428. if (errMsg != "")
  429. {
  430. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  431. return rtnResult;
  432. }
  433. if (String.IsNullOrEmpty(onlineYBFalg))
  434. {
  435. mp.MSettl.onlineYBFalg = "N";
  436. }
  437. else
  438. {
  439. mp.MSettl.onlineYBFalg = onlineYBFalg;
  440. }
  441. if (mp.MobilePayCancelSettlement(out outParam) != 0)
  442. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  443. else
  444. rtnResult = outParam;
  445. return rtnResult;
  446. #endregion
  447. }
  448. case "M6Confirm"://门诊移动支付确认
  449. {
  450. #region 移动支付确认
  451. MobilePay mp = new MobilePay(InParam, out errMsg);
  452. if (errMsg != "")
  453. {
  454. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  455. return rtnResult;
  456. }
  457. if (mp.MobilePayConfirmSettlement(out outParam) != 0)
  458. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  459. else
  460. rtnResult = outParam;
  461. return rtnResult;
  462. #endregion
  463. }
  464. case "M6Q":
  465. {
  466. MobilePay mp = new MobilePay(InParam, out errMsg);
  467. if (errMsg != "")
  468. {
  469. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  470. return rtnResult;
  471. }
  472. mp.MobilePayQuery(out outParam);
  473. return outParam;
  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. case "DualChannelRecord":
  627. // 双通道备案
  628. DualChannelRecordForm recordForm = new DualChannelRecordForm();
  629. recordForm.ShowDialog();
  630. break;
  631. default:
  632. {
  633. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", "传入的业务编码不对!").ToString();
  634. break;
  635. }
  636. }
  637. return rtnResult;
  638. }
  639. catch (Exception ex)
  640. {
  641. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", ex.Message).ToString();
  642. return rtnResult;
  643. }
  644. finally
  645. {
  646. Global.writeLog("AgentFun 出参:" + JsonHelper.Compress(rtnResult));
  647. }
  648. }
  649. private void printFastReport()
  650. {
  651. SettlementChecklist frmSettlList;
  652. string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  653. if (insuAdmObj == "")
  654. {
  655. frmSettlList = new SettlementChecklist();
  656. frmSettlList.ShowDialog();
  657. }
  658. else
  659. {
  660. JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  661. frmSettlList = new SettlementChecklist(joInsuAdmObj);
  662. string groupID = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "groupID");
  663. DataTable dt = (DataTable)frmSettlList.dgvSettlRecord.DataSource;
  664. frmSettlList.btnPrint_Click(null, null);
  665. }
  666. }
  667. public string PlatformDirectConnect(string InParam)
  668. {
  669. //设置返回值,错误信息
  670. string errMsg, rtnResult = "", outParam;
  671. try
  672. {
  673. Global.writeLog("PlatformDirectConnect 入参:" + JsonHelper.Compress(InParam));
  674. //解析入参
  675. if (parseInparam(InParam, out errMsg) != 0)
  676. {
  677. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  678. return rtnResult;
  679. }
  680. Global.businessType = businessType;
  681. string funNO = JsonHelper.getDestValue(joInParam, "funNO");
  682. //BS架构调用方式问题,每次调用都需要重新初始化
  683. if (init(InParam, out outParam) != 0)
  684. {
  685. rtnResult = outParam;
  686. return rtnResult;
  687. }
  688. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joInParam, "insuplc_admdvs");
  689. JObject joRtn = invoker.invokeCenterAgentService(funNO, joParam);
  690. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  691. {
  692. rtnResult = JsonHelper.setExceptionJson(-1, "平台直连错误", errMsg).ToString();
  693. return rtnResult;
  694. }
  695. else
  696. {
  697. rtnResult = JsonHelper.setIrisReturnValue(0, "", joRtn).ToString();
  698. return rtnResult;
  699. }
  700. }
  701. catch (Exception ex)
  702. {
  703. rtnResult = JsonHelper.setExceptionJson(-1, "PlatformDirectConnect 交易", ex.Message).ToString();
  704. return rtnResult;
  705. }
  706. finally
  707. {
  708. Global.writeLog("PlatformDirectConnect 出参:" + JsonHelper.Compress(rtnResult));
  709. }
  710. }
  711. }
  712. }